News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stefan Koopmanschap's Blog:
Using custom namespaces with (C/S)ilex and Composer
April 12, 2012 @ 12:22:47

Stefan Koopmanschap has a quick new post to his blog with a handy tip for Composer and Cilex/Silex users when dealing with custom namespaces.

For a new proof of concept application I'm building, I need both a simple web interface as well as some commandline tools. I decided to use Silex for the web interface and Cilex for the CLI tools, and opted for using Composer for installing these dependencies into my project. I ran into some issues with the custom project libraries I was building for this application however. Registering my custom namespace into Silex and Cilex didn't result in the classes being loaded for some reason. Composer helped me out though.

His solution involves letting Composer be the default autoloader for the application via an "autoloader" configuration option in the "composer.json" (that can also take a classmap option if you're not PSR-0 compliant, see here).

0 comments voice your opinion now!
custom namespace cilex silex composer psr0 autoloader


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Migrating OOP Libraries and Frameworks to PHP 5.3

David Coallier's Blog: Namespaces has PHP 5.3 (Or the other way around)

James Morris: A WebSockets, Ratchet, Silex and Redis PubSub Implementation

Stephan Hochdörfer: Defining Phing Tasks in PSR-0 style

David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)


Community Events

Don't see your event here?
Let us know!


version unittest framework php7 video language example introduction series voicesoftheelephpant laravel5 security api community opinion laravel podcast interview release library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework