|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-10 12:19 UTC] helly@php.net
[2005-03-10 12:45 UTC] jtaal at eljakim dot nl
[2005-03-10 12:56 UTC] johannes@php.net
[2005-03-10 13:01 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
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); } }