Re: PHP CLI vs WebServed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    Replying this back on the list, unchanged and without any
additions from me.... yet.

On Sat, Apr 25, 2009 at 14:09, Simon <turner25@xxxxxxxxx> 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@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux