`require_once` searching subdirectories of entire include_path?

时间:2016-02-12 19:33:46

标签: php-5.3 windows-server-2012 iis-8 include-path php-include

Is there a way to make require_once (and all of its cousins) not only search in the directories specified in include_path, but also all the subdirectories of those directories?

The reason I ask is I'm wanting to use this: https://code.google.com/archive/p/php-sql-parser/

I've dropped the php-sql-parser main folder in my general c:\PHP\includes directory, which is included in the include_path. But because the actual .php file is in a sub-sub-subdirectory, it isn't found.

I can work around this by giving a full path to the main .php file, but it'd be nice just to not be that explicit.

So my questions are:

  1. Is it possible to make require_once search subdirectories of include_path directories?

  2. Is it for any reason a bad idea to do this?

0 个答案:

没有答案