As silly as I thought it sounded, I wanted this same effect in PHP as well.
After pointing the php.ini to the static Application.php and
OnRequestEnd.php files, I wanted this to act kind of like the CF version:
If there is an App/OnReq in the current directory, use it, if not, forget
it. But at the same time - don't let it be viewable directly... These are
what I came up with as a quick fix:
[static] Application.php
<?php
!strpos($SCRIPT_NAME, "Application.php") or die("You can't do that!");
if (is_file("./Application.php"))
include("./Application.php");
?>
[static] OnRequestEnd.php
<?php
!strpos($SCRIPT_NAME, "OnRequestEnd.php") or die("You can't do that!");
if (is_file("./OnRequestEnd.php"))
include("./OnRequestEnd.php");
?>
So these never get changed, and if I need to, I put an App/OnReq wherever I
need to...
geo
-----Original Message-----
From: David Huyck [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 04, 2001 2:31 PM
To: Fusebox
Subject: Re: Switching to PHP (Was: Decrypting tags)
| I don't know if PHP has the equivalent of application.cfm (like I said,
I'm
| new at it), but since FB people include the app_local/globals file anyway,
a
| PHP FB app is structured pretty much the same way as a CF FB app. Of
course,
| with XFB that might not hold true, but structuring things a little
| differently would be a small price to pay for the added value that I get
in
| PHP.
You can do an auto-prepend and and auto-append in PHP. Those would act like
Application.cfm and OnRequestEnd.cfm, and you could probably just name the
files the same (Application.php and OnRequestEnd.php). Assuming you are
using Apache and PHP4, use these lines in your .htaccess file (also settable
in the php.ini file, since you have a dedicated server)
php_value auto_prepend_file /path/to/Application.php
php_value auto_append_file /path/to/OnRequestEnd.php
Have fun!
David Huyck
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists