How do you register a namespace with Silex autoloader
In recent versions of Silex the autoloader is deprecated and you should register all your namespaces through the composer.json
file which imo is a nicer solution because you are centralizing your autoloading definitions.
Example:
{ "require": { "silex/silex": "1.0.*@dev" }, "autoload": { "psr-0": { "MyNameSpace": "src/" } }}
In fact when you try to access the autoloader in any recent version of Silex the following RuntimeException is thrown:
You tried to access the autoloader service. The autoloader has been removed from Silex. It is recommended that you use Composer to manage your dependencies and handle your autoloading. See http://getcomposer.org for more information.