php - How to implement composer in yii 1? -
hello have old project written in php framework yii 1.1. dependencies added manually uploading extensions in extension folder.
i want make project use composer track third-party code vendor directory. "extensions" directory not exist.
existing extensions not namespaced , used manually in controllers: yii::import('application.models.black_lists.domains');
so possible achieve , how? thanks
you have require composer autoloader before vendor used in code. so, have unregister yii autoloader before require composer one
spl_autoload_unregister(array('yiibase','autoload')); require yii::getpathofalias('application.vendor').directory_separator.'autoload.php'; spl_autoload_register(array('yiibase','autoload'));
after this, should able call class in vendor folder, composer way.
new \owner\module();
wiki
Comments
Post a Comment