Edit report at https://bugs.php.net/bug.php?id=64201&edit=1
ID: 64201
User updated by: savinger at sc dot rr dot com
Reported by: savinger at sc dot rr dot com
Summary: Resource Identification in Autoload Callback
Status: Open
Type: Feature/Change Request
-Package: Dynamic loading
+Package: *General Issues
Operating System: OSX
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
wrong package
Previous Comments:
------------------------------------------------------------------------
[2013-02-13 06:05:15] savinger at sc dot rr dot com
Description:
------------
Is there any way for me to differentiate between traits and classes in my
autoload
function? Say I have a folder of classes and a folder of traits; it would be
nice
to be able to do something like...
Test script:
---------------
spl_autoload_register(function($resource) {
if ( /* $resource is class */ ) {
include 'classes/'.$resource.'.php';
}
if ( /* $resource is trait */ ) {
include 'traits/'.$resource.'.php';
}
});
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64201&edit=1