|
Posted by -Lost on 05/12/07 19:49
Schraalhans Keukenmeester wrote:
> I think I've read somewhere exit() only has implications for
> auto_APpend_file, not for its prepend counterpart. But undoubtedly you
> know more about it. Glad to hear!
Oh no, you are exactly right. Well, kind of.
Using exit() in the append file results in the append file never being
appended.
But think about a prepend file. If you use die or exit anywhere, the
rest of the script is killed. That means whatever you prepended a file
into.
>
> I also read -as you stated- it handles the file as an include, which may
> lead to problems if the file is specifically included later, or a
> function definition is repeated later on.
>
> One advantage is I can prepend stuff completely outside the docroot AND
> include_path, so no script could ever re-include it. The php include_path
> doesn't limit this feature, at least not in my setup. It takes an absolute
> or relative filepath (relative to the php.ini dir).
Exactly. Not to mention your coding guidelines and or application
structure should dictate how all includes are handled.
One example is testing for a given variable. For example, I prepend a
file called reset.php to certain session applications. To make sure
that is available in an easy sense, I simply throw "$reset = true;" at
the end of it.
Then I can just if ($reset) { // don't reinclude } or something similar.
> Then there are quite a few reported bugs, but I haven't seen chance yet to
> inspect all these reports, some of which from the google synopsis alone
> can be filed under 'User Error'.
Current bugs? Most of the ones I knew about were solved in the later
versions of PHP 4 and surely now by 5.
> I'll test it first, see how well it works, if there are many hickups or
> unexplained/unexpected behaviours involved.
Please do. Make sure to post them as well.
> Thanks for your comments!
If they helped, you are quite welcome!
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
[Back to original message]
|