﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	appname	phpversion	exts	sapi	probability	blockedby	blocking
198	xcache with streams on ZEND_ENGINE_2	lang@…	moo	"Hi xcache developers,
this patch permits to process streams from xcache on ZEND_ENGINE_2. It is very helpfully when a php module use streams.

{{{
#!diff
diff -u -r -N xcache-1.2.2/xcache.c xcache-1.2.2-patch/xcache.c
--- xcache-1.2.2/xcache.c       2007-12-28 17:00:00.000000000 +0100
+++ xcache-1.2.2-patch/xcache.c 2008-10-02 12:38:06.000000000 +0200
@@ -727,6 +727,21 @@
        php = xce->data.php;

        if (XG(stat)) {
+
+#ifdef ZEND_ENGINE_2
+               php_stream_statbuf ssb;
+               php_stream_wrapper *wrapper = NULL;
+               char *path_for_open = NULL;
+
+               wrapper = php_stream_locate_url_wrapper(filename, &path_for_open, 0 TSRMLS_CC);
+               if ((wrapper) && (wrapper->wops) && (wrapper->wops->url_stat) &&
+                   (wrapper != &php_plain_files_wrapper) &&
+                   (SUCCESS == wrapper->wops->url_stat(wrapper, path_for_open, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL TSRMLS_CC))) {
+                       pbuf = &ssb.sb;
+                       goto stat_done;
+               }
+#endif
+
                if (strcmp(SG(request_info).path_translated, filename) == 0) {
                        /* sapi has already done this stat() for us */
                        pbuf = sapi_get_stat(TSRMLS_C);
}}}"	enhancement	closed	major	3.0.0	cacher	1.3.0	fixed						Irrelevant			
