I use Symfony and I need to add couple bundles in my autoload.php file, which is in .../app/
folder.
So, I basically wrote this:
<?php
// [snip]
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader->registerNamespaces(array(
'Behat\BehatBundle' => '/var/www/testsuite.behat/vendor',
'Behat\Behat' => '/var/www/testsuite.behat/vendor/Behat/Behat/src',
'Behat\Gherkin' => '/var/www/testsuite.behat/vendor/Behat/Gherkin/src',
'Behat\Mink' => '/var/www/testsuite.behat/vendor/Behat/Mink/src',
'Behat\MinkBundle' => '/var/www/testsuite.behat/vendor',
'Goutte' => '/var/www/testsuite.behat/vendor/Goutte/src',
'Zend' => '/var/www/testsuite.behat/vendor/Zend/library',
'Behat\SahiClient' => '/var/www/testsuite.behat/vendor/Behat/SahiClient/src',
'Buzz' => '/var/www/testsuite.behat/vendor/Buzz/lib'
));
$loader->register();
And when I run php app/console
it shows me the error:
PHP Notice: Undefined variable: loader in /var/www/~/app/autoload.php on line 6
PHP Fatal error: Call to a member function registerNamespaces() on a non-object in /var/www/~/app/autoload.php on line 6
where "~" is my project's name.
Please, help me with this problem.