I am using this class in php for autoloading. http://pastebin.com/m75f95c3b
But when I have somewhere
class Bar extends Foo
And I have a file called foo.class.php it won’t find the class. But when i chagne the filename to Foo.class.php it will find the class.
I am trying to add some functionallity to my class to always find the file if its there no matter wether the filename starts with a capital or not. But so far I haven’t scuceeded.
Anyone?
Gumbo’s solution is the best one and that’s what almost everyone uses. I do not understand why you do not like. Of course you can first check whether a file with the class name capitalized exists or not, and if not then check whether lowercased version exists or not. That’s definitely not better than Gumbo’s solution. After all ‘your’ programmers have to follow some conventions/rules.