dompdf/dompdf — pull request #2 by adrianmacneil (2012-11-15 11:57:06+00:00)
Title: Add php-font-lib as a composer dependency

Ok this is my proposed solution for loading php-font-lib via composer, while still retaining complete backwards compatibility.

I have removed the git submodule for php-font-lib. If you want to install dompdf without composer then you must copy the files to lib/php-font-lib manually. This isn't a big deal because if people use the github "zip download" button they won't get the submodule anyway. Also if they include dompdf as a git submodule rather than using composer, it won't automatically pull down the submodule-inside-a-submodule. So I don't think there's any great loss here.

If composer is already running, dompdf won't load its own autoloader. If composer is installed locally (for example during your development if you run `composer update` in the package directory), it will include that automatically. Otherwise it will fall back to the regular dompdf autoloader.

Also I have removed the hard coded references to require_once php-font-lib. I use class_exists to check whether it is already being autoloaded, and if not simply include the file in `dompdf_config.inc.php` (it's only one file, and seems to be required by everything dompdf does anyway).

Let me know what you think. Also I haven't tested this on PHP 5.2 but I don't think there will be any issues.