Hacker News new | ask | show | jobs
by alanstorm 5547 days ago
I can't comment specifically on the Fuel framework, but it's probably going to take years (if ever) for "the right" way to use namespaces to emerge among the PHP communities. There's been a decade plus of ingrained name-spacing by convention that PHP developers will need to shed
2 comments

There is already a standard.

http://groups.google.com/group/php-standards/web/psr-0-final...

Voted on back in 2009 by members of Solar, Cake, Doctrine, Zend, Symfony, Typo3, PHP Core, Yahoo! and others.

We actually keep pretty close to that, but have two implementational differences: 1. Namespaces are linked to a specific directory instead of just translated to a path 2. Our paths are fully lowercase

And I stand by those. The first allows for more flexibility when it comes to code organization and the second makes mistakes in classloading a lot less common. You can disagree with these but we have documented them clearly. Also it's quite easy to add another autoloader, ours won't even do a filesystem check when trying to load from an unknown namespace so it should add hardly any overhead to attach a Zend (or anything) compatible loader.

Doctrine2 and Lithium took the lead and went 100% namespaces. Other projects such as Symfony2 and Solar2 have followed suit.