Using custom namespaces with (C/S)ilex and Composer

Aside from installing dependencies and creating an autoloader for those dependencies, Composer can also be the autoloader for your own custom code. Obviously, it's a matter of reading the F***** documentation, and as soon as Jordi told me Composer could actually do this, I quickly had stuff set up. All I needed to do was add an autoload entry to my composer.json file:

"autoload": {
    "psr-0": {"Foo": "lib"}
}

After that, you need to run composer.phar install to generate the new autoloader, and I'm all set. I can now load all libraries as long as they adhere to the PSR-0 naming standard (because I specified psr-0). If you don't use PSR-0, you could actually also use a classmap, as discussed in the documentation.