瀏覽代碼

zend_fetch_class_by_name is not available in PHP 5.3

Stefan Siegl 10 年之前
父節點
當前提交
3947d8690c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      v8js_convert.cc

+ 3 - 2
v8js_convert.cc

@@ -504,10 +504,11 @@ static void php_v8js_invoke_callback(const v8::FunctionCallbackInfo<v8::Value>&
 		v8::String::Utf8Value str(self->GetConstructorName()->ToString());
 		const char *constructor_name = ToCString(str);
 
-		zend_class_entry *ce = zend_fetch_class_by_name(constructor_name, str.length(), NULL, 0);
+		zend_class_entry **pce;
+		zend_lookup_class(constructor_name, str.length(), &pce);
 		v8::Local<v8::FunctionTemplate> new_tpl;
 		new_tpl = v8::Local<v8::FunctionTemplate>::New
-			(isolate, ctx->template_cache.at(ce->name));
+			(isolate, ctx->template_cache.at((*pce)->name));
 
 		result = new_tpl->GetFunction()->NewInstance(argc, argv);
 	} else {