summaryrefslogtreecommitdiff
path: root/xcache
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-10 09:07:27 +0000
committerXuefer <xuefer@gmail.com>2014-11-10 09:07:27 +0000
commit6c397c70ecd8a7a4e67dd347614ee4571c2830fd (patch)
tree4c7f236e4fbd38e9a1bd24897b53022de558c43b /xcache
parentcaa8966009576da40eebb8b511344ec838411067 (diff)
downloadxcache-6c397c70ecd8a7a4e67dd347614ee4571c2830fd.tar.gz
xcache-6c397c70ecd8a7a4e67dd347614ee4571c2830fd.zip
support for autoload in xcache_get
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1560 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'xcache')
-rw-r--r--xcache/xc_utils.c15
-rw-r--r--xcache/xc_utils.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/xcache/xc_utils.c b/xcache/xc_utils.c
index 461901a..b757b3c 100644
--- a/xcache/xc_utils.c
+++ b/xcache/xc_utils.c
@@ -638,3 +638,18 @@ void xc_copy_internal_zend_constants(HashTable *target, HashTable *source) /* {{
}
/* }}} */
#endif
+zend_class_entry *xc_lookup_class(const char *class_name, int class_name_len, zend_bool autoload TSRMLS_DC) /* {{{ */
+{
+ xc_cest_t *cest;
+#ifdef ZEND_ENGINE_2
+ if (zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &cest TSRMLS_CC) != SUCCESS) {
+ return NULL;
+ }
+#else
+ if (zend_hash_find(EG(class_table), class_name, class_name_len, (void **) &cest) != SUCCESS) {
+ return NULL;
+ }
+#endif
+ return CestToCePtr(*cest);
+}
+/* }}} */
diff --git a/xcache/xc_utils.h b/xcache/xc_utils.h
index eae8826..86350e6 100644
--- a/xcache/xc_utils.h
+++ b/xcache/xc_utils.h
@@ -56,3 +56,5 @@ void xc_copy_internal_zend_constants(HashTable *target, HashTable *source);
#ifndef ZEND_COMPILE_DELAYED_BINDING
int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC);
#endif
+
+zend_class_entry *xc_lookup_class(const char *class_name, int class_name_len, zend_bool autoload TSRMLS_DC);