note 75428 deleted from function.spl-autoload-register by tularis
| From: | tularis@php.net | Date: | Wed, 30 May 2007 12:13:05 +0000 |
| Subject: | note 75428 deleted from function.spl-autoload-register by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127024@lists.php.net to get a copy of this message | ||
Note Submitter: Nayana Hettiarachchi [nayanah g m a i l]
Reason: useless
----
The documentation maybe not clear, so i hard little hard time figuring this out, just incase if you
had problems registering few autoload functions using this method please not that your custom
functions should return true when it sucesfully did the autoload task and false when it did not.
The documentation says "When registering is successful the return value is true and upon
failure false is being returned." but i don't think its related.
small example
<?php
function myload($classname)
{
$file = some_logic_to_obtain_the_file_from($clasname);
if(file_exists($file) {
require_once($file);
return true;
}
return false;
}
spl_autoload_register('myload');
?>