Composer: Undefined Method Related To Global Install

Posted by Unknown on Friday, January 31, 2014

I just updated the Aura v2 libraries to use PSR-4 via Composer instead of their custom autoload.php files, but when I started my integration tests for the Aura.Project_Kernel, I got this error:



PHP Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /Users/pmjones/Code/auraphp/develop-2-projects/Aura.Project_Kernel/cli-project/vendor/composer/autoload_real.php on line 38


Even after a composer self-update the problem remained.


It turns out the problem was related to having issued composer global require phpunit/phpunit=3.7.*. The various Composer global vendor files were overriding the local ones in the project. I discovered this only by calling var_dump(get_included_files()) in the project-specific autoload_real.php file.


I ended up deleting ~/.composer (the global Composer location) and re-installing PHPUnit, but looking back on it, perhaps a composer global update would have solved the problem as well.




more

{ 0 comments... » Composer: Undefined Method Related To Global Install read them below or add one }

Post a Comment

Popular Posts