Added the cache creating/fetching method in the code.

This commit is contained in:
Derick Rethans
2011-06-29 12:46:46 +01:00
parent 7367cf942b
commit 8bc1f0268b
+7
View File
@@ -470,8 +470,15 @@ PHP_FUNCTION(twig_template_get_attributes)
*/ */
char *class_name; char *class_name;
zend_uint class_name_len; zend_uint class_name_len;
zval *tmp_self_cache;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
tmp_self_cache = TWIG_GET_STATIC_PROPERTY(template, "cache");
if (!TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name)) {
twig_add_class_to_cache(tmp_self_cache, object, class_name);
}
/* /*
// object property // object property
if (Twig_TemplateInterface::METHOD_CALL !== $type) { if (Twig_TemplateInterface::METHOD_CALL !== $type) {