Reputation: 23
So, I'm trying to minimize the size of the bootstrap file (the core file), in this file I require many libraries and interfaces, I tried using the foreach(glob()) hack to lightweight it, however, my libraries' name are as follows: library.namehere.php, when I do foreach(glob()), I do it as follows:
foreach(glob('library.*.php') as $Library) { require_once($Library); }
I also tried doing:
foreach(glob('*.php') as $Library) { require_once($Library); }
And:
foreach(glob('*.*.php') as $Library) { require_once($Library); }
And preforming other changes in hopes of getting it to work, but none seem to make it work, the result is just 'Array', and that's it.
Do you have any idea as to why this happens? What could be the cause? And what could possibly be the solution?
Upvotes: 2
Views: 65
Reputation: 59681
Make sure to also include the path to the files in the glob call like this:
glob('testDIR/library.*.php')
Upvotes: 1