Opened 8 months ago
Last modified 8 months 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: | ||
| Blocked By: | PHP Version: | PHP 5.3.5-0.dotdeb.1 with Suhosin-Patch (cli) (built: Jan 18 2011 13:18:29) | |
| Application: | Need User Feedback: | no | |
| Other Exts: | SAPI: | Irrelevant | |
| Probability: | Always | 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)
Change History (5)
Changed 8 months ago by ferengee
comment:1 Changed 8 months ago by moo
I don't get it. any short test case?
Changed 8 months ago by ferengee
small testcase consisting of 4 php files and a readme, run test_xcache.php to execute
comment:2 Changed 8 months 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 8 months 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)


file wrapper patch to 2.0.1 version