faqts : Computers : Programming : Languages : PHP : Installation and Setup

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 13 people (85%) answered Yes
Recently 6 of 7 people (86%) answered Yes

Entry

Most of my page execution time is being spent loading and parsing php require/include files. Can I load all of these once files from a config file?

Jan 11th, 2001 04:28
Vincent E, Neil Mayle,


You could create a new script that will include() all the other scripts,
but that would not gain anything because the amount of parsed code
doesn't change.

If the amount of time spent loading and parsing the code is becoming a
problem (seriously slowing you down) then you might want to reconsider
which files you need to include, and at which point in your program.
The lovely thing about include() is that it is only done at the point in
the program where the include() statement is.

So, if you put a condition around that code, like this:

if ($command=='logon')
{
  include('logon_library.php');
}

the code would only be loaded when it is needed.