[thelist] Possible PHP workaround?

McCoy, Alan amccoy at goodmanct.com
Thu Nov 15 07:33:50 CST 2001


Would this be run as a Perl shell (*.sh) script?

Alan

> -----Original Message-----
> From: jon steele [mailto:jjsteele22 at yahoo.com]
> Sent: Wednesday, November 14, 2001 6:12 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Possible PHP workaround?
> 
> 
> You could probably write your own little script... what I would do in
> your place :)
> 
> Maybe not too elegant, but it'll get the job done. Something like:
> 
> $dh=opendir('.');
> $count=1;
> while (false !== ($file = readdir($dh))) {
>   if($count<2){$count++;}else{
> 
>     //read
>     $fp=fopen($file,'r');
>     $contents=fread($fp,filesize($file));
>     fclose($fp);
> 
>     //write
>     $towrite="#!/usr/local/bin/php".chr(10).chr(13).$contents;
>     $fp=fopen($file,'w');
>     fwrite($fp,$contents);
>     fclose($fp);
>   }
> }
> closedir($dh); 
> 
> 
> 
> --- "McCoy, Alan" <amccoy at goodmanct.com> wrote:
> > One of our clients is hosted at Interland, where they run PHP as a
> > module on their server. So, in order for me to use PHP, all my
> > scripts
> > have to make a call to the module using:
> > 
> > 	#!/usr/local/bin/php
> > 
> > While I don't really have a problem with this, I need to add this
> > line
> > to the 50 or so php scripts that will be on the site. I suppose I
> > could
> > do a find/replace, but it has to go at the top of the file. Is there
> > a
> > way to specify this in a find/replace string?
> > 
> > If not, is there a known workaround for the call to the module?
> > 
> > Alan
> > 
> > ---------------------------------------
> > For unsubscribe and other options, including
> > the Tip Harvester and archive of TheList go to:
> > http://lists.evolt.org Workers of the Web, evolt ! 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
> 
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 
> 




More information about the thelist mailing list