leofeyer/autoloader — Issue #1: My thoughts
Author: Toflar
Created: 2012-01-07 15:06:12+00:00
State: open

Didn't know where to put it, so I chose the tracker :)

Nice approach! But does it really solve the problem we have? Do I want to be able to override every Contao core class?
To be honest, I don't think so. I think it's more important to have namespaces available for the purpose they have been created.
The major drawback you mentioned is simply not bearable.

Namespaces is a feature PHP 5.3 is all about (okay, there's a lot more...) and what you're doing is taking away this feature. So we will still have the problem of two extensions having the same class names.

I think we should rather go the Symfony way (sorry for pointing to Symfony all the time but it's certainly not the most popular PHP framework for no reason!) and simply provide a directory within a module where we can override every class.
Check this out: http://symfony.com/doc/2.0/cookbook/bundles/inheritance.html

Furthermore, I don't think we should reinvent the wheel and build another autoloader class. There are PEAR defacto standards (http://pear.php.net/manual/en/standards.php) and we should be compliant to them.
Again: It's all there! Just use it and focus on CMS functionality, Leo! (http://symfony.com/doc/current/components/class_loader.html)

I think you should read those two articles :)
http://fabien.potencier.org/article/50/create-your-own-framework-on-top-of-the-symfony2-components-part-1
http://fabien.potencier.org/article/51/create-your-own-framework-on-top-of-the-symfony2-components-part-2

Again, I like the approach but personally I don't think that's the way to go...

Just my 2 cents :)