Re: PHP CLI vs WebServed

From: Date: Sat, 25 Apr 2009 19:38:45 +0000
Subject: Re: PHP CLI vs WebServed
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-291977@lists.php.net to get a copy of this message
Replying this back on the list, unchanged and without any additions from me.... yet. On Sat, Apr 25, 2009 at 14:09, Simon <turner25@gmail.com> wrote: >>    Perhaps you may want to consider hacking PHP itself.  From memory, >> one place you may want to start looking is the >> php_filter_get_storage() function, then trace back from there.  If >> memory continues to serve correctly, it should be in the >> ext/filter/filter.c file. > > Hacking php is probably the most efficient solution, but until i can > accomplish that, i think i got a good idea... > > what if i opened a socket to php with C function popen(), this enables > to read/write to the stdin/out of the called program (php).  I would > execute php to read the code from stdin, and the first few lines would > be created by my 'webserver' and would just set all the correct > superglobals ($_GET, $_POST, $_SERVER, etc) overwritting whatever is > in there with the correct information.  Then i would add one last line > with something like: > require('theRealPHPfile.php'); > this one would be executed with the proper superglobals set. > > the result would give something similar to: > <?PHP > $_GET['somevar'] = 'somevalue'; > // [...] more superglobals set here... > require('index.php'); > ?> > ----(end of example)---- > This is what my program would do when someone tries to browse to: > website.com/index.php?somevar=somevalue > > I see a loss of performance for creating the header, but other than > this, i think it should be almost as efficient as hacking php...  and > being easier... > > What do you guys think? > > Thanks! > -- </Daniel P. Brown> daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

« previous php.general (#291977) next »