#32262 [Opn->WFx]: make require accept wildcards

From: Date: Thu, 10 Mar 2005 11:19:59 +0000
Subject: #32262 [Opn->WFx]: make require accept wildcards
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-75200@lists.php.net to get a copy of this message
ID: 32262 Updated by: helly@php.net Reported By: jtaal at eljakim dot nl -Status: Open +Status: Wont fix Bug Type: Feature/Change Request -Operating System: Linux +Operating System: * -PHP Version: 4.3.10 +PHP Version: 4.3.* New Comment: Sorry no new features in the 4.3 branch. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#75200) next »