note 46691 deleted from language.oop5.autoload by sean
| From: | sean@php.net | Date: | Wed, 20 Oct 2004 15:34:22 +0000 |
| Subject: | note 46691 deleted from language.oop5.autoload by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78835@lists.php.net to get a copy of this message | ||
Note Submitter: JaskaS
----
I was storing some PEAR classes on sessions and wanted to load those BIG classes only when needed.
So I made very simple autoload function for PEAR(or any classes which uses same naming standards).
//Autoload PEAR classes
function __autoload($class_name){
$class_name = str_replace('_','/',$class_name);
require_once($class_name.'.php');
}
This is not anything fancy, but it surely made my life easier.
----
Reason: useless example