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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jrags at jasrags dot net
New email:
PHP Version: OS:

 

 [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 03 01:01:33 2024 UTC