Undefined method registerNamespaces() symfony2

fosuserbundle, symfony, symfony-2.1

Solution

for symfony 2.* replace this

$loader->add('FOS' => __DIR__.'/../vendor/bundles');

with

$loader->add('FOS', __DIR__.'/../vendor/bundles');

Problem

I'm following this FOSTwitterBundle documentation: https://github.com/FriendsOfSymfony/FOSTwitterBundle I did it all step by step, but when I access my site, i get this error: ``` Fatal error: Call to undefined method Composer\Autoload\ClassLoader::registerNamespaces() in C:\xampp\htdocs\Symfony\app\autoload.php on line 16 ``` My autoload.php is like this: ``` <?php use Doctrine\Common\Annotations\AnnotationRegistry; $loader = require __DIR__.'/../vendor/autoload.php'; // intl if (!function_exists('intl_get_error_code')) { require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'; $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs'); } AnnotationRegistry::registerLoader(array($loader, 'loadClass')); $loader->registerNamespaces(array( // ... 'FOS' => __DIR__.'/../vendor/bundles', // ... )); return $loader; ``` What should I do?

Original source