<div dir="ltr"><div><div><div>That pkg-php-tools is almost exactly another project I started working towards :)  ..... on the side and no public code available yet though because to be honest I'd have to find it as it has been a little while since I touched it.<br><br></div>I think we could come up with a "self" autoload generator but the dependencies are where it would get tricky -- if everything was PSR-0 it would be easy, but PSR-4 makes it tricky.  Let's say Symfony version 2 is installed at `{BASE_DIR}/symfony/` and Symfony version 3 is installed at `{BASE_DIR}/symfony3/` then the autoload generator would need to need to know exactly which base directory to use.  There are also some dependencies that do not provide `{BASE_DIR}/autoload.php` autoload files and instead need to use `{BASE_DIR}/autoload-{SOME_DESC}.php`.<br><br></div><div>I did start some kind of rudimentary autoload-generator for packaging for Symfony 3: <a href="https://github.com/siwinski/rpms/blob/master/php-symfony3/php-symfony3-generate-autoloaders.php">https://github.com/siwinski/rpms/blob/master/php-symfony3/php-symfony3-generate-autoloaders.php</a> .  Each sub-pkg gets its' own stand-alone autoload.php file.  We've also redone the logic for required/optional dependencies that I did not port over to that generator as well.<br></div><div><br></div>I'm also thinking that because of the differences in distro rules and pkg formats we'd have to create custom layers on top of this autoloader lib.  Would you picture your idea as an all-inclusive pkg/lib or something build on top of this autoloader lib?<br><br></div>Also, if we'd like to share stuff perhaps we could come up with another namespace or is the `Fedora` namespace fine?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 22, 2016 at 2:49 PM, Mathieu Parent (Debian) <span dir="ltr"><<a href="mailto:sathieu@debian.org" target="_blank">sathieu@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2016-06-22 15:44 GMT+02:00 David Prévot <<a href="mailto:taffit@debian.org">taffit@debian.org</a>>:<br>
> [Forwarding a message from Fedora people with their consent, keeping<br>
> them CC since they’re not subscribed.]<br>
><br>
> Le 21/06/2016 à 04:37, Ondřej Surý a écrit :<br>
>> On Tue, Jun 21, 2016, at 06:42, Remi Collet wrote:<br>
>>> > Hi Ondrej,<br>
>>> ><br>
>>> > Having look at some Debian packages, I think maintainers are using a<br>
>>> > solution close to our, to manage autoloader [1]<br>
>>> ><br>
>>> > Our documentation:<br>
>>> > <a href="https://fedoraproject.org/wiki/SIGs/PHP/PackagingTips#Autoloader" rel="noreferrer" target="_blank">https://fedoraproject.org/wiki/SIGs/PHP/PackagingTips#Autoloader</a><br>
>>> ><br>
>>> > For now we are using classmap, Zend or Symfony autoloaders which are<br>
>>> > mostly un-maintained as nearly everybody use composer outside of distro.<br>
>>> ><br>
>>> > Using them could also become a nightmare when we'll have 2 versions of<br>
>>> > the same framework (e.g. symfony 2 and 3)<br>
>>> ><br>
>>> > So we are thinking to create a Fedora Autoloader, without any<br>
>>> > dependencies, used in our packages.<br>
>>> > <a href="https://github.com/siwinski/php-fedora-autoloader" rel="noreferrer" target="_blank">https://github.com/siwinski/php-fedora-autoloader</a><br>
>>> ><br>
>>> > This is a work in progress, really in "devel" state.<br>
>>> ><br>
<br>
</span>Thanks for this, and thanks for sharing.<br>
<br>
We really need cross-distro cooperation on this topic (and others, ...).<br>
<br>
The code is great, but couldn't we go a little bit further, and<br>
directly parse composer.json and construct the autoload file from it?<br>
<br>
In Debian, we use pkg-php-tools which is able to map PEAR or Composer<br>
metadata and dependencies to there deb equivalent. Merging autoloader<br>
code in pkg-php-tools would benefit both Fedora and Debian. The code<br>
is at:<br>
<br>
<a href="http://anonscm.debian.org/cgit/pkg-php/pkg-php-tools.git/tree/" rel="noreferrer" target="_blank">http://anonscm.debian.org/cgit/pkg-php/pkg-php-tools.git/tree/</a><br>
<br>
[...]<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mathieu Parent<br>
</font></span></blockquote></div><br></div>