[pkg-php-pear] [Symfony (and more)] class loader in Composer packages

Mathieu Parent math.parent at gmail.com
Thu Apr 2 11:46:17 UTC 2015

2015-04-01 23:50 GMT+02:00 "David Prévot" <david at tilapin.org>:
> Hi Daniel and all,

hello David,

> I’ve recently been providing autoload.php files in the PHP (Composer)
> packages I’m currently maintaining (following Prach lead IIRC).
> It mostly workarounds the lack of proper autoloader from Composer, and
> allows one to load (statically) dependency classes without the need to use
> something like the ClassLoader Element from Symfony (and thus fixed bugs
> like #777380).
> Static loaders should also be a performance improvement compared to
> dynamic ones.
> In order to do so, a simple phpab call is enough if no dependencies are
> involved:
> https://anonscm.debian.org/cgit/pkg-owncloud/php-sabre-vobject.git/tree/debian/rules#n8
> If some dependencies are involved, I also used a template to load them on
> top of the actual class loader:
> https://anonscm.debian.org/cgit/pkg-owncloud/php-sabredav.git/plain/debian/autoload.php.tpl
> https://anonscm.debian.org/cgit/pkg-owncloud/php-sabredav.git/tree/debian/rules#n8

Thanks for this info. I will welcome a patch to pkg-php-tools to
handle this automaticaly (i.e create the proper autoload.php). Even if
I'm not sure to understand all the implication of this.

PS: I'm a bit behind currently and my TODO list is growing, feel free
propose and commit to git.



More information about the pkg-php-pear mailing list