ClassLoader
Introduction
A PHP5 class that simplifies (hopefully) the dynamic loading of class definition files and adds a memetic namespace of dubious value.
Installation
Both versions are the same and require PHP5.
Usage
Treat this like the import directive in Java. So, to import a file:
-
ClassLoader::import('packageName.className')
Or to import a folder of files:
-
ClassLoader::import('packageName.*')
Your class files should be named according to the following convention: ClassName.php, ClassName.class.php, ClassName.interface.php or similar, and be in folders. Edit the variable ClassLoader::$className to reflect your setup. Enjoy!
Changelog
Version 0.1
Initial release. Probably quite badly broken.
Popularity: 2% [?]
January 3rd, 2007 - 12:48
Hi, I really like this class. I have one little update for line 144- 146. Why don’t you take them together in one line? Like:
exit (’
ClassLoader Error
’);I changed the string a little.
January 3rd, 2007 - 15:40
and some more stuff.
1) The last example you give here does not work because you always prepend (line 154) $_SERVER['DOCUMENT_ROOT']. Your example would become: /var/www/html/usr/local/share/php5/myclasses/