Req #64201 [Opn]: Resource Identification in Autoload Callback

From: Date: Wed, 13 Feb 2013 06:08:30 +0000
Subject: Req #64201 [Opn]: Resource Identification in Autoload Callback
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-176592@lists.php.net to get a copy of this message
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

« previous php.bugs (#176592) next »