ID: 32262
Updated by: [EMAIL PROTECTED]
Reported By: jtaal at eljakim dot nl
Status: Wont fix
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 4.3.*
New Comment:
No.
Previous Comments:
------------------------------------------------------------------------
[2005-03-10 12:45:31] jtaal at eljakim dot nl
will there be a 4.4 branch?
------------------------------------------------------------------------
[2005-03-10 12:19:58] [EMAIL PROTECTED]
Sorry no new features in the 4.3 branch.
------------------------------------------------------------------------
[2005-03-10 12:13:31] jtaal at eljakim dot nl
Description:
------------
I have a series of classes in PHP 4.3, there is no autoload feature
there so I named all my files "class.$className.inc.php".
I created the class.inc.php file which require_onces all
class.*.inc.php files.
This works fine for files which are inside the same directory as
class.*.inc.php
BUT, when I include class.inc.php from another directory the `ls
$wildcard` comes up empty, thus nothing is included.
Wouldn't it be a good feature to have a require_once_wildcard which
includes files.
A problem that may rise is the includeSearchPath (in which directory
should the wildcard be executed?). A solution is to execute only in the
directory where the file resides which calls require_once_wildcard.
My source for require_once_wildcard is in the Reproduce code field.
Reproduce code:
---------------
function require_once_wildcard($wildcard) {
$ls = `ls $wildcard`;
$ls = explode("\n", $ls);
array_pop($ls); // strip last empty line
print_r($ls);
foreach ($ls as $inc) {
require_once($inc);
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32262&edit=1