Opened 2 years ago

Last modified 2 years ago

#289 assigned defect

class loading fails using stream_wrapper_register for the file:// protocol with xcache enabled

Reported by: ferengee Owned by: moo
Priority: minor Milestone: undecided
Component: cacher Version: 2.0.1
Keywords: Cc:
Application: PHP Version: PHP 5.3.5-0.dotdeb.1 with Suhosin-Patch (cli) (built: Jan 18 2011 13:18:29)
Other Exts: SAPI: Irrelevant
Probability: Always Blocked By:
Blocking:

Description

I am using a proxy filestream wrapper which takes notes of modifying file operations. For each operation it unregisters it self and executes the operation using the respective php function, and than registers it self again as the wrapper for the file:// protocol.

As soon as xcache is enabled, and the proxy wrapper is used, php fails to load the file wrapper class in stream_wrapper_register('file', CLASS)

I concluded that xcache should use the &php_plain_files_wrapper and not a class which can't get loaded because the stream wrapper is unregistered just before that.

I wrote a small patch for the 2.0.1 version which enables the &php_plain_files_wrapper for xcache and restores the original as soon as xcache is done compiling of the php code

gcc version: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
php version: PHP 5.3.5-0.dotdeb.1 with Suhosin-Patch (built: Jan 18 2011 13:18:29)

Attachments (2)

xc_swap_file_wrapper.patch (3.0 KB) - added by ferengee 2 years ago.
file wrapper patch to 2.0.1 version
xcache_test.zip (3.1 KB) - added by ferengee 2 years ago.
small testcase consisting of 4 php files and a readme, run test_xcache.php to execute

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by ferengee

file wrapper patch to 2.0.1 version

comment:1 Changed 2 years ago by moo

I don't get it. any short test case?

Changed 2 years ago by ferengee

small testcase consisting of 4 php files and a readme, run test_xcache.php to execute

comment:2 Changed 2 years ago by ferengee

The problem might also be solved if I could flag classes (or files or folders which contain the classes) so they wont be cached.

comment:3 Changed 2 years ago by moo

  • Status changed from new to assigned

the problem is caused by XCache sandbox. when in sandbox XCache hides all user defined function/class until sandbox destroyed. i'll have to consider it carefully (as i did for every single design in XCache)

Note: See TracTickets for help on using tickets.