mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-20 17:31:51 +00:00
Remove conditional compilation for PHP_VERSION_ID < 7.0.0
This commit is contained in:
parent
cef7b0beba
commit
45f7e18624
@ -196,13 +196,7 @@ static zend_object_value v8js_new(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
|||||||
zend_object_std_init(&c->std, ce TSRMLS_CC);
|
zend_object_std_init(&c->std, ce TSRMLS_CC);
|
||||||
TSRMLS_SET_CTX(c->zts_ctx);
|
TSRMLS_SET_CTX(c->zts_ctx);
|
||||||
|
|
||||||
#if PHP_VERSION_ID >= 50400
|
|
||||||
object_properties_init(&c->std, ce);
|
object_properties_init(&c->std, ce);
|
||||||
#else
|
|
||||||
zval *tmp;
|
|
||||||
zend_hash_copy(c->std.properties, &ce->default_properties,
|
|
||||||
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
new(&c->object_name) v8::Persistent<v8::String>();
|
new(&c->object_name) v8::Persistent<v8::String>();
|
||||||
new(&c->context) v8::Persistent<v8::Context>();
|
new(&c->context) v8::Persistent<v8::Context>();
|
||||||
@ -406,11 +400,7 @@ static PHP_METHOD(V8Js, __construct)
|
|||||||
v8::Local<v8::FunctionTemplate> php_obj_t = v8::FunctionTemplate::New(isolate, 0);
|
v8::Local<v8::FunctionTemplate> php_obj_t = v8::FunctionTemplate::New(isolate, 0);
|
||||||
|
|
||||||
/* Set class name for PHP object */
|
/* Set class name for PHP object */
|
||||||
#if PHP_VERSION_ID >= 50400
|
|
||||||
free = !zend_get_object_classname(getThis(), const_cast<const char**>(&class_name), &class_name_len TSRMLS_CC);
|
free = !zend_get_object_classname(getThis(), const_cast<const char**>(&class_name), &class_name_len TSRMLS_CC);
|
||||||
#else
|
|
||||||
free = !zend_get_object_classname(getThis(), &class_name, &class_name_len TSRMLS_CC);
|
|
||||||
#endif
|
|
||||||
php_obj_t->SetClassName(V8JS_SYML(class_name, class_name_len));
|
php_obj_t->SetClassName(V8JS_SYML(class_name, class_name_len));
|
||||||
|
|
||||||
if (free) {
|
if (free) {
|
||||||
|
@ -211,20 +211,6 @@ int v8js_to_zval(v8::Handle<v8::Value> jsValue, zval *return_value, int flags, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
zend_class_entry *ce = php_date_get_date_ce();
|
zend_class_entry *ce = php_date_get_date_ce();
|
||||||
#if PHP_VERSION_ID < 50304
|
|
||||||
zval *param;
|
|
||||||
|
|
||||||
MAKE_STD_ZVAL(param);
|
|
||||||
ZVAL_STRING(param, date_str, 0);
|
|
||||||
|
|
||||||
object_init_ex(return_value, ce TSRMLS_CC);
|
|
||||||
zend_call_method_with_1_params(&return_value, ce, &ce->constructor, "__construct", NULL, param);
|
|
||||||
zval_ptr_dtor(¶m);
|
|
||||||
|
|
||||||
if (EG(exception)) {
|
|
||||||
return FAILURE;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
php_date_instantiate(ce, return_value TSRMLS_CC);
|
php_date_instantiate(ce, return_value TSRMLS_CC);
|
||||||
if (!php_date_initialize((php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC), date_str, strlen(date_str), NULL, NULL, 0 TSRMLS_CC)) {
|
if (!php_date_initialize((php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC), date_str, strlen(date_str), NULL, NULL, 0 TSRMLS_CC)) {
|
||||||
efree(date_str);
|
efree(date_str);
|
||||||
@ -232,7 +218,6 @@ int v8js_to_zval(v8::Handle<v8::Value> jsValue, zval *return_value, int flags, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
efree(date_str);
|
efree(date_str);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (jsValue->IsObject())
|
else if (jsValue->IsObject())
|
||||||
{
|
{
|
||||||
|
@ -303,11 +303,7 @@ static zend_function *v8js_v8object_get_method(zval **object_ptr, char *method,
|
|||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
#if PHP_VERSION_ID >= 50400
|
|
||||||
static int v8js_v8object_call_method(const char *method, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
|
static int v8js_v8object_call_method(const char *method, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
|
||||||
#else
|
|
||||||
static int v8js_v8object_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
zval *object = this_ptr, ***argv = NULL;
|
zval *object = this_ptr, ***argv = NULL;
|
||||||
int argc = ZEND_NUM_ARGS();
|
int argc = ZEND_NUM_ARGS();
|
||||||
|
Loading…
Reference in New Issue
Block a user