Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Executed only once and used across all pages
October 16, 2006, 1:55 am
rate this thread
Given my web application has some codes that only need to be executed
once(eg.configuration used over the whole site), but every php script
which needs that config seems to execute that once to get configuration
when a request comes.
Is there any mechanism that can make a script processed only once and
all other pages can use its output?
(Maybe this is impossible,but I just want to get a definite answer.)
Thx in advance!
Re: Executed only once and used across all pages
it is normal practise to have one config file that is included in
whatever other scripts need it, thats the method i would recommend, if
the scripts were large and performance was on your mind, then you could
just write the outputs to a flat file and include that into your php
scripts, less work for php but more work for the coder.