[pkg-php-pear] Are Symfony apps bound to composer, and not really compatible to Debian packages philosophy

Daniel Beyer dabe at deb.ymc.ch
Fri Dec 4 16:24:55 UTC 2015


Hi

On Fri, 2015-12-04 at 15:57 +0100, Mathieu Parent wrote:
> 2015-12-04 14:35 GMT+01:00 Olivier Berger <olivier.berger at telecom-sudparis.eu>:
> > Hi.
> >
> > I hope someone is reading here, beyond notifications about packages and
> > bugs.
> >
> > I'm thinking about the deployment of applications built with Symfony on
> > to Debian systems, as Symfony seems to be packaged.
> >

Having a custom application using the Debian packaging of Symfony would
be great, especially since I'm not aware of anyone doing this so far.

Which version of Debian are you planning to use?

> > But I'm wondering if this is really a viable option, since Symfony apps
> > seem to be very much tied to composer.
> >
> > Is it possible to get rid of the vendors/ dir and still have autoloader
> > mechanisms working, provided all dependencies would be installed as
> > Debian packages ?
> > Maybe I need to RTFM more on composer...
> >

Yes, this is possible. The following autoload code should work with the
packaging in jessie, as well as the one in stretch and up:
<?php
require_once 'Symfony/Component/ClassLoader/ClassLoader.php';
use Symfony\Component\ClassLoader\ClassLoader;
$loader = new ClassLoader();
$loader->setUseIncludePath(true);
$loader->register();
?>

This code assumes you did not modify Debian's default php include_path,
which has '/usr/share/php' in. In case you modified or overridden it,
you need to add something like this in front of the above code:
<?php
// In Debian php libs are installed in '/usr/share/php', update the
// include_path to be aware of them.
set_include_path('/usr/share/php' . PATH_SEPARATOR . get_include_path());

//(... autoloding code from above ...)
?>


> > I've reported a wishlist for some documentations along those lines in
> > #806903, FWIW.
> >
> > Or maybe the symfony packaging is misleading, and it's just a matter of
> > PHP libs under the symfony umbrella, and symfony apps won't be supported
> > per se ?
> 

I saw this report, thanks for it. I'll respond to this later. As of
today Symfony in Debian is solely used by other Debian packages like
owncloud or phpunit to satisfy dependencies of those. But it is okay if
you like to use it for your own Symfony apps. As mentioned above, I
would welcome this and will try to offer you some help in doing so.


> pkg-php-tools is currently able to convert COmposer pkgs to debs.
> 
> But it doesn't handle autoload, and I'm not going to make it as I
> don't understand autoload in Composer.
> 

On DebConf15 I mentioned to taffit, that I'm not very happy with the
current way we deal with autoloading in respect of composer. I have this
loose idea of making composer aware of Debian packages, so we could use
it to handle the autoloading for us. We could either work together with
usptream on this (e.g. providing pull requests) or add support ourselfs
in composer shipped with Debian (it is in stretch and up).


Greetings
Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-pear/attachments/20151204/272a836e/attachment-0001.sig>


More information about the pkg-php-pear mailing list