php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57123 apc.filters don't work on included files
Submitted: 2006-07-02 13:35 UTC Modified: 2008-07-17 12:54 UTC
From: gabriel at oxeva dot fr Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 4.4.1 OS: Linux
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: gabriel at oxeva dot fr
New email:
PHP Version: OS:

 

 [2006-07-02 13:35 UTC] gabriel at oxeva dot fr
Description:
------------
apc.filters allow defining if a file must be cached or not. But filters don't work on included files in PHP code with include(_once) and require(_once) methods.

Reproduce code:
---------------
Just write a PHP script with include ('file.php'); within.

For example : the file /home/test/test.php :
<?php
include('file.php');
?>

then set apc.filters = '/home/test/'

APC must not cache both test.php and file.php. Instead, test.php is well filtered, but not file.php

Expected result:
----------------
APC don't cache anything in this case.

Actual result:
--------------
In the file apc_main.c, function zend_op_array,
zend_file_handle h contains an opened_path and a filename string.

While these 2 strings are filled with the filename of the main script called, included file have a different behaviour : opened_path is unset and h->filename is set to the name of included file (if include('file.php'), then h->filename is "file.php" and if include('/home/test/file.php'), h->filename is "/home/test/file.php")

if we wan't apc.filters work right with included file, we must have the full path+filename in h->filename  instead of the filename given as argument to include().

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-18 10:01 UTC] gopalv82 at yahoo dot com
Providing a full filename for a relative path is a costly operation.

But the problem you mention is real and needs more thought.
 [2008-01-07 09:28 UTC] gabriel at oxeva dot fr
What about this bug? Has this problem been given thought? :-)
 [2008-07-17 12:54 UTC] gopalv82 at yahoo dot com
Fixed in CVS HEAD, please re-test (on php-5.x)
 [2012-11-20 21:16 UTC] yuri at theredpin dot com
It still doesn't work in the apc version 3.1.9, php ver. 5.3.3
What about this bug?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 18:01:31 2024 UTC