Re: svn: /php/php-src/ branches/PHP_5_2/Zend/zend_object_handlers.c branches/PHP_5_3/NEWS branches/PHP_5_3/main/fopen_wrappers.c
branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/fopen_wrappers.c trunk/sapi/cgi/cgi_main.c
| From: | jvlad | Date: | Thu, 10 Sep 2009 10:55:07 +0000 |
| Subject: | Re: svn: /php/php-src/ branches/PHP_5_2/Zend/zend_object_handlers.c branches/PHP_5_3/NEWS branches/PHP_5_3/main/fopen_wrappers.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/fopen_wrappers.c trunk/sapi/cgi/cgi_main.c |
||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45549@lists.php.net to get a copy of this message | ||
>>> I'm wondered why the shebang line support was removed from scanner.
>>
>> Because it didn't make any sense for other SAPIs. You could ask Ilia more
>> about it:
>>
>> -------------------------------------------------------------------------
>> r273178 | iliaa | 2009-01-09 19:21:12 +0200 (Fri, 09 Jan 2009) | 4 lines
>>
>> MFH: Corrected fix for bug #46844 to only trigger on the 1st line of CLI
>> opened files.
>> ------------------------------------------------------------------------
>
> I think it's better to be consistent between different SAPI. I would
> prefer all of them always skip shebang line instead of checking it only in
> CGI and CLI. Anyway it doesn't cost the performance degradation we got.
+1
>>> Note that going back to this solution requires extra open() and fstat()
>>> syscalls in case the requested file already stored in opcode cache. It
>>> might be a visible slowdown for FastCGI sapi.
>>
>> Any ideas how to avoid it without adding this thing into the scanner?
>
> SAPI knows nothing about opcode caches, so it's not possible to do in
> general way.
I believe as soon as php is parsed and its shebang is skipped, it does not
matter
how the results (opcodes) are cached -- the output will be the same because
shebang has not been converted into echo.
In other words, no extra open() or fstat() are needed at all.
-j