ZF-14: Remove Zend_Pdf_Const
Description
Zend_Pdf_Const was initially conceived as the single home for all PDF-related constants. This worked well enough when the number of constants was small, but recent work (ZF-6 and Zend_Pdf_Image subclasses) has more than tripled the constant count, making a master class like this difficult to maintain.
None of the other components in the framework share this model; they all define constants in the base classes that use them. For consistency with the other components in the framework, and to improve maintainability going forward, move the constants currently defined in Zend_Pdf_Const to the base classes in which they are used.
Comments
Posted by Willie Alberty (willie) on 2006-06-16T23:43:16.000+0000
This issue necessitates a change to the public API. Specific details to follow...
Posted by Willie Alberty (willie) on 2006-06-17T14:33:53.000+0000
Done. This issue caused a backwards-incompatible API change. To repair your code, you will need to perform the following global search-and-replace operations:
In addition, font object creation has been revamped. Font objects are now instantiated via a factory methods. You will also need to perform the following global search-and-replace operation:
Finally, the old static arrays {{$pageSizeAliases}} and {{$standardFonts}} have been completely removed. There are no replacements.
Posted by Willie Alberty (willie) on 2006-06-17T17:26:10.000+0000
On Jun 17, 2006, at 4:04 PM, andi@zend.com wrote:
I have one piece of feedback though. The constants (not sure if you are responsible for naming them or not) don't use underscores to separate words. I think it'd be much nicer to do so. I know we have it in the PHP coding standards, but not sure if we wrote it in the ZFW coding standards (if not we should).
Posted by Willie Alberty (willie) on 2006-06-17T19:11:10.000+0000
Implemented Andi's request. All constants in Zend_Pdf now have underscores between words.
{panel:title=NOTE: Due to this change, ignore the instructions above and use these instead.|titleBGColor=#F7D6C1|bgColor=#FFFFCE} To repair your code, you will need to perform the following global search-and-replace operations:
In addition, font object creation has been revamped. Font objects are now instantiated via a factory methods. You will also need to perform the following global search-and-replace operations:
Finally, the old static arrays $pageSizeAliases and $standardFonts have been completely removed. There are no replacements. {panel}
Posted by Willie Alberty (willie) on 2006-06-17T19:23:14.000+0000
Updated the coding standards document as well: http://framework.zend.com/wiki/display/…
Posted by Matthew Ratzloff (mratzloff) on 2008-05-24T21:05:10.000+0000
This change was made eons ago (in Zend Framework time) but the file Zend/Pdf/Const.php still exists. At this point it is safe to remove it entirely.
Posted by Thomas Weidner (thomas) on 2008-10-30T04:05:37.000+0000
Fixed with 12192
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:22.000+0000
Changing issues in preparation for the 1.7.0 release.