php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57211 Need a php.ini option to skip the include_once rewrite
Submitted: 2006-08-31 22:45 UTC Modified: 2006-09-01 20:09 UTC
From: jrags at jasrags dot net Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.1.4 OS: Fedora Core 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
14 - 9 = ?
Subscribe to this entry?

 
 [2006-08-31 22:45 UTC] jrags at jasrags dot net
Description:
------------
APC 3.0.11

I understand the reason behind adding the include_once to include rewriting but it causes problems for me, i added a php.ini feature to skip this, but i would love to see it included in the next release. see below for my code

Reproduce code:
---------------
APC 3.0.11

I understand the reason behind adding the include_once to include rewriting but it causes problems for me, i added a php.ini feature to skip this, but i would love to see it included in the next release. see below for my code

apc_globals.h:
-->    zend_bool enable_include_rewrite;
ZEND_END_MODULE_GLOBALS(apc)

apc_zend.c:
#include "apc_zend.h"
-->#include "apc_globals.h"

/* Cheat our way through the file inclusion by temporarily changing the op to a plain require/include
     * Then calling into the original opcode handler, and finally restoring the opline's original meaning
     */
-->    if(APCG(enable_include_rewrite)) {
    Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE_ONCE) ? ZEND_INCLUDE : ZEND_REQUIRE;
-->    }
    ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
-->    if(APCG(enable_include_rewrite)) {
    Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE) ? ZEND_INCLUDE_ONCE : ZEND_REQUIRE_ONCE;
-->    }

php_apc.c:
-->STD_PHP_INI_BOOLEAN("apc.enable_include_rewrite", "0",  PHP_INI_SYSTEM, OnUpdateBool,         enable_include_rewrite, zend_apc_globals, apc_globals)
PHP_INI_END()

php.ini: 
apc.enable_include_rewrite=0


Expected result:
----------------
This disables the codeblock mentioned

Actual result:
--------------
Works as expected

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-01 18:01 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Applied, though slightly differently than the patch you provided and under a slightly different name.
 [2006-09-01 18:47 UTC] jrags at jasrags dot net
Great, thank you for the quick response, I will continue using my patch until the next version of APC.
 [2006-09-01 20:09 UTC] pierre dot php at gmail dot com
> APC
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 22:01:31 2024 UTC