Re: performance improvement using include(), possible to cache included code?
| From: | waldschrott | Date: | Thu, 15 Jun 2000 06:31:42 +0000 |
| Subject: | Re: performance improvement using include(), possible to cache included code? | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-21394@lists.php.net to get a copy of this message | ||
nah, the "user" should be protected almost entirely from "global", "function", "user_init()" and all these nasty words a "user" (user= pseudo-programmer, which doesn´t know coding, uses "LEGO" pieces of php objects which allow him to build dynamic sites, without programming) has never heard of before ;)
so minimal hurt would occur if there was only
--- user_code_file.php
$application<<<'EnterCodeBetween'
....
'EnterCodeBetween';
but here docs are unfortunately not yet enabled to do this :(
regards
Flavien LEBARBE wrote:
What about putting the code inside functions ? It would be read once, compiled once, but interpreted multiple times. Something like : ---user_init_file.php <?php function user_init() { global $blah=3; print "Initializing variables"; } ?> ---user_code_file.php function user_code() { global $blah; $blah++; print $blah; } ?> ---app.php <?php include ('user_init_file.php'); user_init(); include ('user_code_file'); for(...) user_code(); ?> --- If the user_code contains functions, just put the global scope into the user_code() function... and that's it ! :-) Hope this helps, Flavien.-- o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° · 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . · | psychedelic experience | gott@kiffen.de | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·