FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How expensive is glob'ing a dir and including all the files?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How expensive is glob'ing a dir and including all the files? [message #179148 is a reply to message #179147] Sat, 15 September 2012 13:14 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 9/15/2012 2:08 AM, Anders Wegge Keller wrote:
> "J. Frank Parnell" <juglesh(at)gmail(dot)com> writes:
>
>> So, my question is, am I saving a significant amount of ram/cpu/time
>> by keeping this cache of filenames or should I just glob the dir and
>> include what's in there everytime?
>
> You may want to consider autoloading classes as needed. See
> http://php.net/manual/en/language.oop5.autoload.php
>
> This approach is of course dependent on using PHP5 *and* having an
> OO design.
>

Additionally, you're never sure which module you got. All kinds of
hard-to-diagnose things can happen when someone uploads a module of the
same name but earlier in the search path. You'll be trying to debug one
module while the system is using an entirely different module.

Plus the extra overhead of searching for the module, of course.

This is not a feature I recommend. It can cause many problems, and good
programming techniques render it pretty much unnecessary.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php and PDO Error HTTP 500
Next Topic: PHP Update
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 09:30:20 GMT 2024

Total time taken to generate the page: 0.03830 seconds