Req #64201 [Opn->Nab]: Resource Identification in Autoload Callback
| From: | johannes@php.net | Date: | Wed, 13 Feb 2013 14:33:27 +0000 |
| Subject: | Req #64201 [Opn->Nab]: Resource Identification in Autoload Callback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176602@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
Updated by: johannes@php.net
Reported by: savinger at sc dot rr dot com
Summary: Resource Identification in Autoload Callback
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: OSX
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
No this is not possible, especially as there are situations where we can't see the difference.
(Especially if you also think about interfaces) You have to use a custom naming scheme or such.
Previous Comments:
------------------------------------------------------------------------
[2013-02-13 06:08:30] savinger at sc dot rr dot com
wrong package
------------------------------------------------------------------------
[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