Composer php 5.3.3 - 5.3.6 autoloading

577 views
Skip to first unread message

ZPavel

unread,
Nov 23, 2012, 11:03:52 AM11/23/12
to compose...@googlegroups.com
Hi, i transfer this post from behat to here, as it's linked to composer :

hi again,

i have php 5.3.6 on my work station, in my app i put a behat fiel with :

require(__DIR__.'/../../vendor/autoload.php');

define('BEHAT_VERSION', 'DEV');

$app = new Behat\Behat\Console\BehatApplication(BEHAT_VERSION);
$app->run();

everything works. but when i put it on another server with php 5.3.3 i got :

PHP Fatal error:  Class 'Symfony\Component\Console\Application' not found

in composer namespaces, i have :

    'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/',
    'Symfony\\Component\\Translation' => $vendorDir . '/symfony/translation/',
    'Symfony\\Component\\Finder' => $vendorDir . '/symfony/finder/',
    'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/',
    'Symfony\\Component\\DependencyInjection' => $vendorDir . '/symfony/dependency-injection/',
    'Symfony\\Component\\Console' => $vendorDir . '/symfony/console/',
    'Symfony\\Component\\Config' => $vendorDir . '/symfony/config/',
    'Symfony\\Component\\ClassLoader' => $vendorDir . '/symfony/class-loader/',
    'Behat\\Gherkin' => $vendorDir . '/behat/gherkin/src/',
    'Behat\\Behat' => $vendorDir . '/behat/behat/src/',

Seems like a problem of autoloading symfony classes.

Jordi Boggiano

unread,
Nov 23, 2012, 11:21:28 AM11/23/12
to compose...@googlegroups.com
Heya,

> i have php 5.3.6 on my work station, in my app i put a behat fiel with :
>
> require(__DIR__.'/../../vendor/autoload.php');
>
> define('BEHAT_VERSION', 'DEV');
>
> $app = new Behat\Behat\Console\BehatApplication(BEHAT_VERSION);
> $app->run();
>
> everything works. but when i put it on another server with php 5.3.3 i got :

Not sure what's going on, did you check in vendor/symfony/console/ if
you actually have the files?

Composer itself uses the console component and the tests for autoloading
work fine on 5.3.3 so I guess something else is going on.

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

ZPavel

unread,
Nov 23, 2012, 12:05:24 PM11/23/12
to compose...@googlegroups.com
yes you right, the files was not present since it's a submodule and i have not executed composer.phar.
for the moment i can't execute composer to fetch vendors on some environments. so i thought to commit then.
but commit a lib with a submodule doe not commit it.

пятница, 23 ноября 2012 г., 17:21:28 UTC+1 пользователь Jordi Boggiano написал:

ZPavel

unread,
Nov 23, 2012, 12:10:39 PM11/23/12
to compose...@googlegroups.com
and i found this :


which explains how to commit vendors

пятница, 23 ноября 2012 г., 18:05:25 UTC+1 пользователь ZPavel написал:

ZPavel

unread,
Nov 23, 2012, 12:34:24 PM11/23/12
to compose...@googlegroups.com
how can i made a dependency with a submodule using a stable version of it ?

пятница, 23 ноября 2012 г., 18:10:39 UTC+1 пользователь ZPavel написал:

Jordi Boggiano

unread,
Nov 24, 2012, 7:48:17 AM11/24/12
to compose...@googlegroups.com
Heya,

On 23.11.2012 18:34, ZPavel wrote:
> how can i made a dependency with a submodule using a stable version of it ?

I am not sure I understand your question. But generally I would advise
against using submodules with composer.

ZPavel

unread,
Nov 24, 2012, 2:56:42 PM11/24/12
to compose...@googlegroups.com
That's i would like.i don't want use submodules.seems like git archive command doesn't fetch it.what is the best way turning off submodules in composer?for example, behat vendor has symfony as submodule.

Jordi Boggiano

unread,
Nov 25, 2012, 4:07:22 AM11/25/12
to compose...@googlegroups.com
On 24.11.2012 20:56, ZPavel wrote:
> That's i would like.i don't want use submodules.seems like git archive command doesn't fetch it.what is the best way turning off submodules in composer?for example, behat vendor has symfony as submodule.

Composer does not do submodules. It does not create them, and it does
not initialize them. If some of the libraries you use have submodules in
them just don't initialize them and everything should be fine.

One problem might be that composer does git clones in your vendor
directory, and that might be detected as submodules of your project by
some git GUIs that don't look too closely. To fix that you can try to
wipe the vendors and run composer install with --prefer-dist.

ZPavel

unread,
Nov 25, 2012, 8:02:01 AM11/25/12
to compose...@googlegroups.com
thanks, i'll try it tomorrow.

воскресенье, 25 ноября 2012 г., 10:07:18 UTC+1 пользователь Jordi Boggiano написал:
Reply all
Reply to author
Forward
0 new messages