Re: Get filename in php command line

From: Date: Tue, 17 Jul 2001 19:38:17 +0000
Subject: Re: Get filename in php command line
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58320@lists.php.net to get a copy of this message
On Tuesday 17 July 2001 11:14 am, Boget, Chris wrote: > in "my_api.inc", have the following code: > > echo "Currently Running file is: "; > echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__; > > in test.php > > <? > $CurrentRunningFile = __FILE__; > > include( "my_api.inc" ); > echo "This is test.php3<br>\n"; > ?> > > Define "$CurrentRunningFile" on line one of all your files. Or > something along those lines... > > Chris Well, I thought about that too. The thing is, this is part of the bigger project to make our apps can be run from command line, and we already have tons of apps that currently running from web. Doing that for every single apps would be a pain. But apparently since there is no other way, at least at this point, it will have do for some apps. Thanks. Reuben D. Budiardja

« previous php.general (#58320) next »