Using composer with symfony 1.4

228 Views Asked by At

I am trying to autoload composer-installed libraries with a Symfony 1.4 application but have some name conflict.

I have a legacy Symfony 1.4 application (in fact I am using a FriendsOfSymfony1/symfony1 1.5 clone that supports php 7.2). I need to use AWS SDK PHP library. In order to use it I need to install it with composer

I have added required components to composer.json, run composer update and modified my ProjectConfiguration:


require_once dirname(__FILE__) . '/../lib/vendor/autoload.php';
require_once dirname(__FILE__) . '/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();


class ProjectConfiguration extends sfProjectConfiguration {

Symfony's autoload stopped working. I get a warning that actually is a critical error:

( ! ) Warning: constant(): Couldn't find constant Project::PEER in ***/lib/vendor/propel/propel1/runtime/lib/query/ModelCriteria.php on line 79

When I remove the line

require_once dirname(__FILE__) . '/../lib/vendor/autoload.php';

everything works fine (but, of course, I cannot see the composer installed packages).

0

There are 0 best solutions below