Пример #1
0
PHP_METHOD(Test_Oo_OoDynamicA, getNew) {

	zend_class_entry *_1;
	zval className, fullClassName, _0;
	int ZEPHIR_LAST_CALL_STATUS;
	ZEPHIR_INIT_THIS();

	ZVAL_UNDEF(&className);
	ZVAL_UNDEF(&fullClassName);
	ZVAL_UNDEF(&_0);

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(&className);
	zephir_get_called_class(&className TSRMLS_CC);
	ZEPHIR_INIT_VAR(&fullClassName);
	ZEPHIR_CONCAT_SV(&fullClassName, "\\", &className);
	zephir_fetch_safe_class(_0, fullClassName);
	_1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO);
	object_init_ex(return_value, _1);
	if (zephir_has_constructor(return_value TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0);
		zephir_check_call_status();
	}
	RETURN_MM();

}
PHP_METHOD(Configman_BaseServiceConfig, getService) {

	int ZEPHIR_LAST_CALL_STATUS;
	zend_class_entry *_1;
	zval *service_param = NULL, *service_class_name, *upcase_service, *_0 = NULL;
	zval *service = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &service_param);

	zephir_get_strval(service, service_param);


	ZEPHIR_INIT_VAR(upcase_service);
	zephir_ucfirst(upcase_service, service);
	ZEPHIR_INIT_VAR(service_class_name);
	ZEPHIR_CONCAT_SVSVS(service_class_name, "\\Configman\\Service\\", upcase_service, "\\", upcase_service, "Config");
	zephir_fetch_safe_class(_0, service_class_name);
	_1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	object_init_ex(return_value, _1);
	if (zephir_has_constructor(return_value TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, service);
		zephir_check_call_status();
	}
	RETURN_MM();

}
Пример #3
0
/**
 * Initializes the internal handler, calling functions on it
 *
 * @param  string method
 * @param  array arguments
 * @return mixed
 */
PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call) {

	zend_class_entry *_1$$3;
	zval *_3;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *method_param = NULL, *arguments = NULL, *handler = NULL, *definition = NULL, *modelBinder = NULL, *bindCacheKey = NULL, *_0$$3 = NULL, *_2$$4 = NULL;
	zval *method = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &method_param, &arguments);

	if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) {
		zephir_get_strval(method, method_param);
	} else {
		ZEPHIR_INIT_VAR(method);
		ZVAL_EMPTY_STRING(method);
	}
	ZEPHIR_SEPARATE_PARAM(arguments);


	ZEPHIR_OBS_VAR(handler);
	zephir_read_property_this(&handler, this_ptr, SL("_handler"), PH_NOISY_CC);
	ZEPHIR_OBS_VAR(definition);
	zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC);
	if (Z_TYPE_P(handler) != IS_OBJECT) {
		ZEPHIR_INIT_NVAR(handler);
		zephir_fetch_safe_class(_0$$3, definition);
			_1$$3 = zend_fetch_class(Z_STRVAL_P(_0$$3), Z_STRLEN_P(_0$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(handler, _1$$3);
		if (zephir_has_constructor(handler TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, handler, "__construct", NULL, 0);
			zephir_check_call_status();
		}
		zephir_update_property_this(this_ptr, SL("_handler"), handler TSRMLS_CC);
	}
	ZEPHIR_OBS_VAR(modelBinder);
	zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC);
	if (Z_TYPE_P(modelBinder) != IS_NULL) {
		ZEPHIR_INIT_VAR(bindCacheKey);
		ZEPHIR_CONCAT_SVSV(bindCacheKey, "_PHMB_", definition, "_", method);
		ZEPHIR_CALL_METHOD(&_2$$4, modelBinder, "bindtohandler", NULL, 0, handler, arguments, bindCacheKey, method);
		zephir_check_call_status();
		ZEPHIR_CPY_WRT(arguments, _2$$4);
	}
	ZEPHIR_INIT_VAR(_3);
	zephir_create_array(_3, 2, 0 TSRMLS_CC);
	zephir_array_fast_append(_3, handler);
	zephir_array_fast_append(_3, method);
	ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _3, arguments);
	zephir_check_call_status();
	RETURN_MM();

}
Пример #4
0
/**
 * Detects and returns the first available cache driver.
 *
 * @return \Xpl\Cache\DriverInterface
 */
PHP_METHOD(Xpl_Cache_Cache, getDetectedDriver) {

	zend_class_entry *_7$$4;
	HashTable *_2;
	HashPosition _1;
	zval *driverClasses = NULL, *classname = NULL, *_0 = NULL, **_3, *_4$$3 = NULL, *_5$$3 = NULL, *_6$$4 = NULL;
	zephir_fcall_cache_entry *_8 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(driverClasses);
	zephir_create_array(driverClasses, 3, 0 TSRMLS_CC);
	ZEPHIR_INIT_VAR(_0);
	ZVAL_STRING(_0, "Xpl\\Cache\\Driver\\ApcuDriver", 1);
	zephir_array_fast_append(driverClasses, _0);
	ZEPHIR_INIT_NVAR(_0);
	ZVAL_STRING(_0, "Xpl\\Cache\\Driver\\ApcDriver", 1);
	zephir_array_fast_append(driverClasses, _0);
	ZEPHIR_INIT_NVAR(_0);
	ZVAL_STRING(_0, "Xpl\\Cache\\Driver\\XCacheDriver", 1);
	zephir_array_fast_append(driverClasses, _0);
	zephir_is_iterable(driverClasses, &_2, &_1, 0, 0, "xpl/cache/cache.zep", 215);
	for (
	  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
	  ; zephir_hash_move_forward_ex(_2, &_1)
	) {
		ZEPHIR_GET_HVALUE(classname, _3);
		ZEPHIR_INIT_NVAR(_4$$3);
		ZEPHIR_INIT_LNVAR(_5$$3);
		ZEPHIR_CONCAT_VS(_5$$3, classname, "::isAvailable");
		ZEPHIR_CALL_USER_FUNC(_4$$3, _5$$3);
		zephir_check_call_status();
		if (ZEPHIR_IS_TRUE_IDENTICAL(_4$$3)) {
			zephir_fetch_safe_class(_6$$4, classname);
				_7$$4 = zend_fetch_class(Z_STRVAL_P(_6$$4), Z_STRLEN_P(_6$$4), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _7$$4);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", &_8, 0);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
	}
	object_init_ex(return_value, xpl_cache_driver_memorydriver_ce);
	if (zephir_has_constructor(return_value TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0);
		zephir_check_call_status();
	}
	RETURN_MM();

}
Пример #5
0
/**
 * Initializes the internal handler, calling functions on it
 *
 * @param  string method
 * @param  array arguments
 * @return mixed
 */
PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call) {

	zval *_2;
	int ZEPHIR_LAST_CALL_STATUS;
	zend_class_entry *_1;
	zval *method_param = NULL, *arguments, *handler = NULL, *definition, *_0 = NULL;
	zval *method = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &method_param, &arguments);

	if (unlikely(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	if (likely(Z_TYPE_P(method_param) == IS_STRING)) {
		zephir_get_strval(method, method_param);
	} else {
		ZEPHIR_INIT_VAR(method);
		ZVAL_EMPTY_STRING(method);
	}


	ZEPHIR_OBS_VAR(handler);
	zephir_read_property_this(&handler, this_ptr, SL("_handler"), PH_NOISY_CC);
	if (Z_TYPE_P(handler) != IS_OBJECT) {
		ZEPHIR_OBS_VAR(definition);
		zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC);
		ZEPHIR_INIT_NVAR(handler);
		zephir_fetch_safe_class(_0, definition);
		_1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(handler, _1);
		if (zephir_has_constructor(handler TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, handler, "__construct", NULL);
			zephir_check_call_status();
		}
		zephir_update_property_this(this_ptr, SL("_handler"), handler TSRMLS_CC);
	}
	ZEPHIR_INIT_VAR(_2);
	zephir_create_array(_2, 2, 0 TSRMLS_CC);
	zephir_array_fast_append(_2, handler);
	zephir_array_fast_append(_2, method);
	ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _2, arguments);
	zephir_check_call_status();
	RETURN_MM();

}
Пример #6
0
PHP_METHOD(Owl_Log_AbstractWriter, setFormatter) {

	zend_class_entry *_5;
	int ZEPHIR_LAST_CALL_STATUS;
	zend_bool _0;
	zval *formatter, _1, *_2 = NULL, *_3, *_4 = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &formatter);



	_0 = Z_TYPE_P(formatter) == IS_OBJECT;
	if (_0) {
		ZEPHIR_SINIT_VAR(_1);
		ZVAL_STRING(&_1, "\\Owl\\Log\\FormatterInterface", 0);
		ZEPHIR_CALL_FUNCTION(&_2, "is_subclass_of", NULL, 2, formatter, &_1);
		zephir_check_call_status();
		_0 = zephir_is_true(_2);
	}
	if (_0) {
		zephir_update_property_this(this_ptr, SL("formatter"), formatter TSRMLS_CC);
	} else if (Z_TYPE_P(formatter) == IS_STRING) {
		if (!(zephir_class_exists(formatter, 1 TSRMLS_CC))) {
			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(owl_log_exception_invalidformatterexception_ce, "Formatter class is not exits", "owl/Log/AbstractWriter.zep", 94);
			return;
		}
		ZEPHIR_INIT_VAR(_3);
		zephir_fetch_safe_class(_4, formatter);
		_5 = zend_fetch_class(Z_STRVAL_P(_4), Z_STRLEN_P(_4), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(_3, _5);
		if (zephir_has_constructor(_3 TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 0);
			zephir_check_call_status();
		}
		zephir_update_property_this(this_ptr, SL("formatter"), _3 TSRMLS_CC);
	} else {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(owl_log_exception_invalidformatterexception_ce, "Formatter set error", "owl/Log/AbstractWriter.zep", 99);
		return;
	}
	ZEPHIR_MM_RESTORE();

}
Пример #7
0
PHP_METHOD(PhalconPlus_Base_ModuleDef, impl) {

	zend_class_entry *_7;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *di, *_0, *_1, *className = NULL, *_5, *_6 = NULL, *_2$$3, *_3$$3, *_4$$3;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &di);



	_0 = zephir_fetch_nproperty_this(this_ptr, SL("classPath"), PH_NOISY_CC);
	if (zephir_require_zval(_0 TSRMLS_CC) == FAILURE) {
		RETURN_MM_NULL();
	}
	_1 = zephir_fetch_nproperty_this(this_ptr, SL("className"), PH_NOISY_CC);
	if (!(zephir_class_exists(_1, 1 TSRMLS_CC))) {
		ZEPHIR_INIT_VAR(_2$$3);
		object_init_ex(_2$$3, zend_exception_get_default(TSRMLS_C));
		_3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("className"), PH_NOISY_CC);
		ZEPHIR_INIT_VAR(_4$$3);
		ZEPHIR_CONCAT_SV(_4$$3, "Module class not exists: ", _3$$3);
		ZEPHIR_CALL_METHOD(NULL, _2$$3, "__construct", NULL, 7, _4$$3);
		zephir_check_call_status();
		zephir_throw_exception_debug(_2$$3, "phalconplus/Base/ModuleDef.zep", 71 TSRMLS_CC);
		ZEPHIR_MM_RESTORE();
		return;
	}
	_5 = zephir_fetch_nproperty_this(this_ptr, SL("className"), PH_NOISY_CC);
	ZEPHIR_CPY_WRT(className, _5);
	zephir_fetch_safe_class(_6, className);
		_7 = zend_fetch_class(Z_STRVAL_P(_6), Z_STRLEN_P(_6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	object_init_ex(return_value, _7);
	if (zephir_has_constructor(return_value TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, di, this_ptr);
		zephir_check_call_status();
	}
	RETURN_MM();

}
Пример #8
0
PHP_METHOD(Yb_Std, newInstanceOf) {

	zend_class_entry *_1$$3, *_4$$5, *_7$$6, *_11$$7, *_16$$8, *_22$$9;
	long c = 0;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *args = NULL;
	zval *className_param = NULL, *args_param = NULL, *a = NULL, *_28, *_0$$3 = NULL, *_2$$4, *_3$$5 = NULL, *_5$$5, *_6$$6 = NULL, *_8$$6, *_9$$6, *_10$$7 = NULL, *_12$$7, *_13$$7, *_14$$7, *_15$$8 = NULL, *_17$$8, *_18$$8, *_19$$8, *_20$$8, *_21$$9 = NULL, *_23$$9, *_24$$9, *_25$$9, *_26$$9, *_27$$9;
	zval *className = NULL, *_29;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 1, &className_param, &args_param);

	zephir_get_strval(className, className_param);
	if (!args_param) {
		ZEPHIR_INIT_VAR(args);
		array_init(args);
	} else {
		zephir_get_arrval(args, args_param);
	}


	c = zephir_fast_count_int(args TSRMLS_CC);
	if (c < 1) {
		zephir_fetch_safe_class(_0$$3, className);
			_1$$3 = zend_fetch_class(Z_STRVAL_P(_0$$3), Z_STRLEN_P(_0$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(return_value, _1$$3);
		if (zephir_has_constructor(return_value TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0);
			zephir_check_call_status();
		}
		RETURN_MM();
	}
	if (c > 5) {
		ZEPHIR_INIT_VAR(_2$$4);
		object_init_ex(_2$$4, zephir_get_internal_ce(SS("reflectionclass") TSRMLS_CC));
		ZEPHIR_CALL_METHOD(NULL, _2$$4, "__construct", NULL, 16, className);
		zephir_check_call_status();
		ZEPHIR_RETURN_CALL_METHOD(_2$$4, "newinstanceargs", NULL, 18, args);
		zephir_check_call_status();
		RETURN_MM();
	}
	ZEPHIR_CALL_FUNCTION(&a, "array_values", NULL, 22, args);
	zephir_check_call_status();
	do {
		if (c == 1) {
			zephir_fetch_safe_class(_3$$5, className);
				_4$$5 = zend_fetch_class(Z_STRVAL_P(_3$$5), Z_STRLEN_P(_3$$5), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _4$$5);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_array_fetch_long(&_5$$5, a, 0, PH_NOISY | PH_READONLY, "yb/std.zep", 396 TSRMLS_CC);
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _5$$5);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
		if (c == 2) {
			zephir_fetch_safe_class(_6$$6, className);
				_7$$6 = zend_fetch_class(Z_STRVAL_P(_6$$6), Z_STRLEN_P(_6$$6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _7$$6);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_array_fetch_long(&_8$$6, a, 0, PH_NOISY | PH_READONLY, "yb/std.zep", 398 TSRMLS_CC);
				zephir_array_fetch_long(&_9$$6, a, 1, PH_NOISY | PH_READONLY, "yb/std.zep", 398 TSRMLS_CC);
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _8$$6, _9$$6);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
		if (c == 3) {
			zephir_fetch_safe_class(_10$$7, className);
				_11$$7 = zend_fetch_class(Z_STRVAL_P(_10$$7), Z_STRLEN_P(_10$$7), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _11$$7);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_array_fetch_long(&_12$$7, a, 0, PH_NOISY | PH_READONLY, "yb/std.zep", 400 TSRMLS_CC);
				zephir_array_fetch_long(&_13$$7, a, 1, PH_NOISY | PH_READONLY, "yb/std.zep", 400 TSRMLS_CC);
				zephir_array_fetch_long(&_14$$7, a, 2, PH_NOISY | PH_READONLY, "yb/std.zep", 400 TSRMLS_CC);
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _12$$7, _13$$7, _14$$7);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
		if (c == 4) {
			zephir_fetch_safe_class(_15$$8, className);
				_16$$8 = zend_fetch_class(Z_STRVAL_P(_15$$8), Z_STRLEN_P(_15$$8), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _16$$8);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_array_fetch_long(&_17$$8, a, 0, PH_NOISY | PH_READONLY, "yb/std.zep", 402 TSRMLS_CC);
				zephir_array_fetch_long(&_18$$8, a, 1, PH_NOISY | PH_READONLY, "yb/std.zep", 402 TSRMLS_CC);
				zephir_array_fetch_long(&_19$$8, a, 2, PH_NOISY | PH_READONLY, "yb/std.zep", 402 TSRMLS_CC);
				zephir_array_fetch_long(&_20$$8, a, 3, PH_NOISY | PH_READONLY, "yb/std.zep", 402 TSRMLS_CC);
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _17$$8, _18$$8, _19$$8, _20$$8);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
		if (c == 5) {
			zephir_fetch_safe_class(_21$$9, className);
				_22$$9 = zend_fetch_class(Z_STRVAL_P(_21$$9), Z_STRLEN_P(_21$$9), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(return_value, _22$$9);
			if (zephir_has_constructor(return_value TSRMLS_CC)) {
				zephir_array_fetch_long(&_23$$9, a, 0, PH_NOISY | PH_READONLY, "yb/std.zep", 404 TSRMLS_CC);
				zephir_array_fetch_long(&_24$$9, a, 1, PH_NOISY | PH_READONLY, "yb/std.zep", 404 TSRMLS_CC);
				zephir_array_fetch_long(&_25$$9, a, 2, PH_NOISY | PH_READONLY, "yb/std.zep", 404 TSRMLS_CC);
				zephir_array_fetch_long(&_26$$9, a, 3, PH_NOISY | PH_READONLY, "yb/std.zep", 404 TSRMLS_CC);
				zephir_array_fetch_long(&_27$$9, a, 4, PH_NOISY | PH_READONLY, "yb/std.zep", 404 TSRMLS_CC);
				ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _23$$9, _24$$9, _25$$9, _26$$9, _27$$9);
				zephir_check_call_status();
			}
			RETURN_MM();
		}
	} while(0);

	ZEPHIR_INIT_VAR(_28);
	object_init_ex(_28, yb_exception_ce);
	ZEPHIR_INIT_VAR(_29);
	ZEPHIR_CONCAT_SV(_29, "Fail to fetch a new instance of class: ", className);
	ZEPHIR_CALL_METHOD(NULL, _28, "__construct", NULL, 2, _29);
	zephir_check_call_status();
	zephir_throw_exception_debug(_28, "yb/std.zep", 407 TSRMLS_CC);
	ZEPHIR_MM_RESTORE();
	return;

}
Пример #9
0
PHP_METHOD(PhalconPlus_RPC_Client_Adapter_Local, callByParams) {

	zephir_nts_static zephir_fcall_cache_entry *_7 = NULL;
	zval *_5, *_11, *_12;
	int ZEPHIR_LAST_CALL_STATUS;
	zend_class_entry *_3;
	zval *service_param = NULL, *method_param = NULL, *request, *serviceClass, *serviceObj, *response, *_0 = NULL, *_1, *_2 = NULL, *_4, *_6, *_9, *_10;
	zval *service = NULL, *method = NULL, *_8;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 3, 0, &service_param, &method_param, &request);

	if (unlikely(Z_TYPE_P(service_param) != IS_STRING && Z_TYPE_P(service_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'service' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	if (likely(Z_TYPE_P(service_param) == IS_STRING)) {
		zephir_get_strval(service, service_param);
	} else {
		ZEPHIR_INIT_VAR(service);
		ZVAL_EMPTY_STRING(service);
	}
	if (unlikely(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	if (likely(Z_TYPE_P(method_param) == IS_STRING)) {
		zephir_get_strval(method, method_param);
	} else {
		ZEPHIR_INIT_VAR(method);
		ZVAL_EMPTY_STRING(method);
	}


	ZEPHIR_INIT_VAR(_1);
	zephir_ucfirst(_1, service);
	ZEPHIR_INIT_VAR(serviceClass);
	ZEPHIR_CONCAT_VS(serviceClass, _1, "Service");
	ZEPHIR_INIT_VAR(serviceObj);
	zephir_fetch_safe_class(_2, serviceClass);
	_3 = zend_fetch_class(Z_STRVAL_P(_2), Z_STRLEN_P(_2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	object_init_ex(serviceObj, _3);
	if (zephir_has_constructor(serviceObj TSRMLS_CC)) {
		_4 = zephir_fetch_nproperty_this(this_ptr, SL("di"), PH_NOISY_CC);
		ZEPHIR_CALL_METHOD(NULL, serviceObj, "__construct", NULL, _4);
		zephir_check_call_status();
	}
	ZEPHIR_INIT_VAR(_5);
	zephir_create_array(_5, 2, 0 TSRMLS_CC);
	zephir_array_fast_append(_5, serviceObj);
	zephir_array_fast_append(_5, method);
	if (zephir_is_callable(_5 TSRMLS_CC)) {
		ZEPHIR_INIT_VAR(_6);
		ZEPHIR_CONCAT_SV(_6, "ServerClass: ", serviceClass);
		ZEPHIR_CALL_FUNCTION(NULL, "error_log", &_7, _6);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(_8);
		ZEPHIR_CONCAT_SV(_8, "InvokeMethod: ", method);
		ZEPHIR_CALL_FUNCTION(NULL, "error_log", &_7, _8);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(_9);
		zephir_var_export_ex(_9, &(request) TSRMLS_CC);
		ZEPHIR_INIT_VAR(_10);
		ZEPHIR_CONCAT_SV(_10, "InputParma: ", _9);
		ZEPHIR_CALL_FUNCTION(NULL, "error_log", &_7, _10);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(response);
		ZEPHIR_INIT_VAR(_11);
		zephir_create_array(_11, 2, 0 TSRMLS_CC);
		zephir_array_fast_append(_11, serviceObj);
		zephir_array_fast_append(_11, method);
		ZEPHIR_INIT_VAR(_12);
		zephir_create_array(_12, 1, 0 TSRMLS_CC);
		zephir_array_fast_append(_12, request);
		ZEPHIR_CALL_USER_FUNC_ARRAY(response, _11, _12);
		zephir_check_call_status();
		RETURN_CCTOR(response);
	} else {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "No service is found", "phalconplus/RPC/Client/Adapter/Local.zep", 29);
		return;
	}

}
Пример #10
0
PHP_METHOD(Xs_FieldMeta, getCustomTokenizer) {

	zend_class_entry *_15, *_17;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *name = NULL, *arg = NULL, *_7 = NULL, *_9 = NULL, *_11 = NULL;
	zval *tokenizer = NULL, *m = NULL, *_0, *_1, *_2, *_3, _4, *_5 = NULL, *_6, *_8 = NULL, *_10, *_12 = NULL, *_13 = NULL, *_14 = NULL, *_16 = NULL;

	ZEPHIR_MM_GROW();
	ZEPHIR_INIT_VAR(m);
	ZVAL_NULL(m);

	ZEPHIR_OBS_VAR(tokenizer);
	_0 = zephir_fetch_static_property_ce(xs_fieldmeta_ce, SL("tokenizers") TSRMLS_CC);
	_1 = zephir_fetch_nproperty_this(this_ptr, SL("tokenizer"), PH_NOISY_CC);
	if (zephir_array_isset_fetch(&tokenizer, _0, _1, 0 TSRMLS_CC)) {
		RETURN_CCTOR(tokenizer);
	}
	ZEPHIR_INIT_VAR(_2);
	_3 = zephir_fetch_nproperty_this(this_ptr, SL("tokenizer"), PH_NOISY_CC);
	ZEPHIR_SINIT_VAR(_4);
	ZVAL_STRING(&_4, "/^([^\\(]+)\\((.*)\\)$/", 0);
	zephir_preg_match(_2, &_4, _3, m, 0, 0 , 0  TSRMLS_CC);
	if (zephir_is_true(_2)) {
		ZEPHIR_INIT_VAR(_5);
		zephir_array_fetch_long(&_6, m, 1, PH_NOISY | PH_READONLY, "xs/fieldmeta.zep", 125 TSRMLS_CC);
		zephir_ucfirst(_5, _6);
		zephir_get_strval(_7, _5);
		ZEPHIR_INIT_VAR(name);
		ZEPHIR_CONCAT_SSV(name, "Xs", "\\Tokenizer", _7);
		ZEPHIR_OBS_VAR(_8);
		zephir_array_fetch_long(&_8, m, 2, PH_NOISY, "xs/fieldmeta.zep", 126 TSRMLS_CC);
		zephir_get_strval(_9, _8);
		ZEPHIR_CPY_WRT(arg, _9);
	} else {
		ZEPHIR_INIT_NVAR(_5);
		_10 = zephir_fetch_nproperty_this(this_ptr, SL("tokenizer"), PH_NOISY_CC);
		zephir_ucfirst(_5, _10);
		zephir_get_strval(_11, _5);
		ZEPHIR_INIT_NVAR(name);
		ZEPHIR_CONCAT_SSV(name, "Xs", "\\Tokenizer", _11);
		ZEPHIR_INIT_NVAR(arg);
		ZVAL_EMPTY_STRING(arg);
	}
	if (unlikely(!(zephir_class_exists(name, zephir_is_true(ZEPHIR_GLOBAL(global_true))  TSRMLS_CC)))) {
		ZEPHIR_INIT_NVAR(_5);
		object_init_ex(_5, xs_exception_ce);
		_10 = zephir_fetch_nproperty_this(this_ptr, SL("name"), PH_NOISY_CC);
		ZEPHIR_INIT_VAR(_12);
		ZEPHIR_CONCAT_SVSVS(_12, "Undefined custom tokenizer ", name, " for field `", _10, "`");
		ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 4, _12);
		zephir_check_call_status();
		zephir_throw_exception_debug(_5, "xs/fieldmeta.zep", 133 TSRMLS_CC);
		ZEPHIR_MM_RESTORE();
		return;
	}
	ZEPHIR_INIT_NVAR(tokenizer);
	if (zephir_fast_strlen_ev(arg) > 0) {
		zephir_fetch_safe_class(_14, name);
		_15 = zend_fetch_class(Z_STRVAL_P(_14), Z_STRLEN_P(_14), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(tokenizer, _15);
		if (zephir_has_constructor(tokenizer TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, tokenizer, "__construct", NULL, 0, arg);
			zephir_check_call_status();
		}
	} else {
		zephir_fetch_safe_class(_16, name);
		_17 = zend_fetch_class(Z_STRVAL_P(_16), Z_STRLEN_P(_16), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(tokenizer, _17);
		if (zephir_has_constructor(tokenizer TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, tokenizer, "__construct", NULL, 0);
			zephir_check_call_status();
		}
	}
	if (unlikely(!((zephir_instance_of_ev(tokenizer, xs_tokenizer_ce TSRMLS_CC))))) {
		ZEPHIR_INIT_NVAR(_5);
		object_init_ex(_5, xs_exception_ce);
		_10 = zephir_fetch_nproperty_this(this_ptr, SL("name"), PH_NOISY_CC);
		ZEPHIR_INIT_LNVAR(_12);
		ZEPHIR_CONCAT_VSVS(_12, name, " for field `", _10, "` does not implement Tokenizer interface");
		ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 4, _12);
		zephir_check_call_status();
		zephir_throw_exception_debug(_5, "xs/fieldmeta.zep", 143 TSRMLS_CC);
		ZEPHIR_MM_RESTORE();
		return;
	}
	ZEPHIR_OBS_NVAR(_8);
	zephir_read_property_this(&_8, this_ptr, SL("tokenizer"), PH_NOISY_CC);
	zephir_update_static_property_array_multi_ce(xs_fieldmeta_ce, SL("tokenizers"), &tokenizer TSRMLS_CC, SL("z"), 1, _8);
	RETURN_CCTOR(tokenizer);

}
Пример #11
0
/**
 * Builds a Phalcon\Mvc\Model\Criteria based on an input array like _POST
 */
PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput) {

	zend_bool _6$$4, _7$$7;
	HashTable *_4$$3;
	HashPosition _3$$3;
	zend_class_entry *_2$$3;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *data = NULL;
	zval *modelName = NULL, *operator = NULL, *_12$$10;
	zval *dependencyInjector, *modelName_param = NULL, *data_param = NULL, *operator_param = NULL, *attribute = NULL, *conditions = NULL, *field = NULL, *value = NULL, *type = NULL, *metaData = NULL, *model = NULL, *dataTypes = NULL, *bind = NULL, *criteria = NULL, *columnMap = NULL, *_0$$3, *_1$$3 = NULL, **_5$$3, *_8$$9 = NULL, *_9$$9 = NULL, *_10$$8 = NULL, *_11$$10;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 3, 1, &dependencyInjector, &modelName_param, &data_param, &operator_param);

	if (unlikely(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (likely(Z_TYPE_P(modelName_param) == IS_STRING)) {
		zephir_get_strval(modelName, modelName_param);
	} else {
		ZEPHIR_INIT_VAR(modelName);
		ZVAL_EMPTY_STRING(modelName);
	}
	data = data_param;
	if (!operator_param) {
		ZEPHIR_INIT_VAR(operator);
		ZVAL_STRING(operator, "AND", 1);
	} else {
	if (unlikely(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (likely(Z_TYPE_P(operator_param) == IS_STRING)) {
		zephir_get_strval(operator, operator_param);
	} else {
		ZEPHIR_INIT_VAR(operator);
		ZVAL_EMPTY_STRING(operator);
	}
	}


	ZEPHIR_INIT_VAR(conditions);
	array_init(conditions);
	if (zephir_fast_count_int(data TSRMLS_CC)) {
		ZEPHIR_INIT_VAR(_0$$3);
		ZVAL_STRING(_0$$3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _0$$3);
		zephir_check_temp_parameter(_0$$3);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(model);
		zephir_fetch_safe_class(_1$$3, modelName);
			_2$$3 = zend_fetch_class(Z_STRVAL_P(_1$$3), Z_STRLEN_P(_1$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
		object_init_ex(model, _2$$3);
		if (zephir_has_constructor(model TSRMLS_CC)) {
			ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0);
			zephir_check_call_status();
		}
		ZEPHIR_CALL_METHOD(&dataTypes, metaData, "getdatatypes", NULL, 0, model);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, model);
		zephir_check_call_status();
		ZEPHIR_INIT_VAR(bind);
		array_init(bind);
		zephir_is_iterable(data, &_4$$3, &_3$$3, 0, 0, "phalcon/mvc/model/criteria.zep", 747);
		for (
		  ; zephir_hash_get_current_data_ex(_4$$3, (void**) &_5$$3, &_3$$3) == SUCCESS
		  ; zephir_hash_move_forward_ex(_4$$3, &_3$$3)
		) {
			ZEPHIR_GET_HMKEY(field, _4$$3, _3$$3);
			ZEPHIR_GET_HVALUE(value, _5$$3);
			_6$$4 = Z_TYPE_P(columnMap) == IS_ARRAY;
			if (_6$$4) {
				_6$$4 = (zephir_fast_count_int(columnMap TSRMLS_CC)) ? 1 : 0;
			}
			if (_6$$4) {
				ZEPHIR_OBS_NVAR(attribute);
				zephir_array_fetch(&attribute, columnMap, field, PH_NOISY, "phalcon/mvc/model/criteria.zep", 724 TSRMLS_CC);
			} else {
				ZEPHIR_CPY_WRT(attribute, field);
			}
			ZEPHIR_OBS_NVAR(type);
			if (zephir_array_isset_fetch(&type, dataTypes, attribute, 0 TSRMLS_CC)) {
				_7$$7 = Z_TYPE_P(value) != IS_NULL;
				if (_7$$7) {
					_7$$7 = !ZEPHIR_IS_STRING_IDENTICAL(value, "");
				}
				if (_7$$7) {
					if (ZEPHIR_IS_LONG(type, 2)) {
						ZEPHIR_INIT_LNVAR(_8$$9);
						ZEPHIR_CONCAT_SVSVS(_8$$9, "[", field, "] LIKE :", field, ":");
						zephir_array_append(&conditions, _8$$9, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 736);
						ZEPHIR_INIT_LNVAR(_9$$9);
						ZEPHIR_CONCAT_SVS(_9$$9, "%", value, "%");
						zephir_array_update_zval(&bind, field, &_9$$9, PH_COPY | PH_SEPARATE);
						continue;
					}
					ZEPHIR_INIT_LNVAR(_10$$8);
					ZEPHIR_CONCAT_SVSVS(_10$$8, "[", field, "] = :", field, ":");
					zephir_array_append(&conditions, _10$$8, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 743);
					zephir_array_update_zval(&bind, field, &value, PH_COPY | PH_SEPARATE);
				}
			}
		}
	}
	ZEPHIR_INIT_VAR(criteria);
	object_init_ex(criteria, phalcon_mvc_model_criteria_ce);
	if (zephir_has_constructor(criteria TSRMLS_CC)) {
		ZEPHIR_CALL_METHOD(NULL, criteria, "__construct", NULL, 0);
		zephir_check_call_status();
	}
	if (zephir_fast_count_int(conditions TSRMLS_CC)) {
		ZEPHIR_INIT_VAR(_11$$10);
		ZEPHIR_INIT_VAR(_12$$10);
		ZEPHIR_CONCAT_SVS(_12$$10, " ", operator, " ");
		zephir_fast_join(_11$$10, _12$$10, conditions TSRMLS_CC);
		ZEPHIR_CALL_METHOD(NULL, criteria, "where", NULL, 306, _11$$10);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(NULL, criteria, "bind", NULL, 307, bind);
		zephir_check_call_status();
	}
	ZEPHIR_CALL_METHOD(NULL, criteria, "setmodelname", NULL, 300, modelName);
	zephir_check_call_status();
	RETURN_CCTOR(criteria);

}
Пример #12
0
PHP_METHOD(PhalconPlus_RPC_Server_AbstractServer, callByParams) {

	zend_class_entry *_10, *_17;
	zephir_nts_static zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_13 = NULL;
	int ZEPHIR_LAST_CALL_STATUS;
	zval *_3 = NULL, *_18, *_19;
	zend_bool _2;
	zval *service_param = NULL, *method_param = NULL, *request = NULL, *rawData, *serviceClass = NULL, *_0 = NULL, *_1, *tmp = NULL, *param, *paramClass = NULL, *_4 = NULL, *_6 = NULL, *_8 = NULL, *_9 = NULL, *_11 = NULL, *_12 = NULL, *_14, *_15, *serviceObj, *response = NULL, *e = NULL, *_16 = NULL, *_20;
	zval *service = NULL, *method = NULL, *_21;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 4, 0, &service_param, &method_param, &request, &rawData);

	if (unlikely(Z_TYPE_P(service_param) != IS_STRING && Z_TYPE_P(service_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'service' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	if (likely(Z_TYPE_P(service_param) == IS_STRING)) {
		zephir_get_strval(service, service_param);
	} else {
		ZEPHIR_INIT_VAR(service);
		ZVAL_EMPTY_STRING(service);
	}
	if (unlikely(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}

	if (likely(Z_TYPE_P(method_param) == IS_STRING)) {
		zephir_get_strval(method, method_param);
	} else {
		ZEPHIR_INIT_VAR(method);
		ZVAL_EMPTY_STRING(method);
	}
	ZEPHIR_INIT_VAR(serviceClass);
	ZVAL_STRING(serviceClass, "", 1);
	ZEPHIR_INIT_VAR(tmp);
	array_init(tmp);


	ZEPHIR_INIT_VAR(_1);
	zephir_ucfirst(_1, service);
	ZEPHIR_INIT_NVAR(serviceClass);
	ZEPHIR_CONCAT_VS(serviceClass, _1, "Service");
	_2 = Z_TYPE_P(request) == IS_OBJECT;
	if (_2) {
		_2 = zephir_instance_of_ev(request, phalconplus_base_protobuffer_ce TSRMLS_CC);
	}
	if (_2) {
		zephir_update_property_this(this_ptr, SL("phpOnly"), (1) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
	} else if (Z_TYPE_P(request) == IS_ARRAY) {
		ZEPHIR_CPY_WRT(tmp, request);
		ZEPHIR_INIT_VAR(param);
		object_init_ex(param, zephir_get_internal_ce(SS("reflectionparameter") TSRMLS_CC));
		ZEPHIR_INIT_VAR(_3);
		zephir_create_array(_3, 2, 0 TSRMLS_CC);
		zephir_array_fast_append(_3, serviceClass);
		zephir_array_fast_append(_3, method);
		ZEPHIR_INIT_VAR(_4);
		ZVAL_LONG(_4, 0);
		ZEPHIR_CALL_METHOD(NULL, param, "__construct", &_5, _3, _4);
		zephir_check_call_status();
		ZEPHIR_CALL_METHOD(&_6, param, "getclass", &_7);
		zephir_check_call_status();
		if (zephir_is_true(_6)) {
			ZEPHIR_CALL_METHOD(&_8, param, "getclass", &_7);
			zephir_check_call_status();
			ZEPHIR_CALL_METHOD(&paramClass, _8, "getname", NULL);
			zephir_check_call_status();
			ZEPHIR_INIT_NVAR(request);
			zephir_fetch_safe_class(_9, paramClass);
			_10 = zend_fetch_class(Z_STRVAL_P(_9), Z_STRLEN_P(_9), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
			object_init_ex(request, _10);
			if (zephir_has_constructor(request TSRMLS_CC)) {
				ZEPHIR_CALL_METHOD(NULL, request, "__construct", NULL);
				zephir_check_call_status();
			}
			ZEPHIR_CALL_METHOD(NULL, request, "softclone", NULL, tmp);
			zephir_check_call_status();
		} else {
			ZEPHIR_INIT_NVAR(_4);
			object_init_ex(_4, zend_exception_get_default(TSRMLS_C));
			ZEPHIR_INIT_VAR(_11);
			zephir_json_encode(_11, &(_11), request, 0  TSRMLS_CC);
			ZEPHIR_INIT_VAR(_12);
			ZEPHIR_CONCAT_SVSVSV(_12, "Service class:method definition is invalid. Detail: ", service, " : ", method, ". Request: ", _11);
			ZEPHIR_CALL_METHOD(NULL, _4, "__construct", &_13, _12);
			zephir_check_call_status();
			zephir_throw_exception_debug(_4, "phalconplus/RPC/Server/AbstractServer.zep", 36 TSRMLS_CC);
			ZEPHIR_MM_RESTORE();
			return;
		}
	} else {
		ZEPHIR_INIT_NVAR(_4);
		object_init_ex(_4, zend_exception_get_default(TSRMLS_C));
		ZEPHIR_INIT_NVAR(_11);
		zephir_json_encode(_11, &(_11), request, 0  TSRMLS_CC);
		ZEPHIR_INIT_LNVAR(_12);
		ZEPHIR_CONCAT_SV(_12, "Your input is not allowed. Request: ", _11);
		ZEPHIR_CALL_METHOD(NULL, _4, "__construct", &_13, _12);
		zephir_check_call_status();
		zephir_throw_exception_debug(_4, "phalconplus/RPC/Server/AbstractServer.zep", 39 TSRMLS_CC);
		ZEPHIR_MM_RESTORE();
		return;
	}
	_14 = zephir_fetch_nproperty_this(this_ptr, SL("di"), PH_NOISY_CC);
	ZEPHIR_INIT_NVAR(_4);
	ZVAL_STRING(_4, "requestCheck", ZEPHIR_TEMP_PARAM_COPY);
	ZEPHIR_CALL_METHOD(&_6, _14, "has", NULL, _4);
	zephir_check_temp_parameter(_4);
	zephir_check_call_status();
	if (zephir_is_true(_6)) {
		_15 = zephir_fetch_nproperty_this(this_ptr, SL("di"), PH_NOISY_CC);
		ZEPHIR_INIT_NVAR(_3);
		zephir_create_array(_3, 3, 0 TSRMLS_CC);
		zephir_array_fast_append(_3, serviceClass);
		zephir_array_fast_append(_3, method);
		zephir_array_fast_append(_3, rawData);
		ZEPHIR_INIT_NVAR(_4);
		ZVAL_STRING(_4, "requestCheck", ZEPHIR_TEMP_PARAM_COPY);
		ZEPHIR_CALL_METHOD(NULL, _15, "get", NULL, _4, _3);
		zephir_check_temp_parameter(_4);
		zephir_check_call_status();
	} else {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "requestcheck", NULL, serviceClass, method, request);
		zephir_check_call_status();
	}
	ZEPHIR_INIT_VAR(serviceObj);
	zephir_fetch_safe_class(_16, serviceClass);
	_17 = zend_fetch_class(Z_STRVAL_P(_16), Z_STRLEN_P(_16), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
	object_init_ex(serviceObj, _17);
	if (zephir_has_constructor(serviceObj TSRMLS_CC)) {
		_15 = zephir_fetch_nproperty_this(this_ptr, SL("di"), PH_NOISY_CC);
		ZEPHIR_CALL_METHOD(NULL, serviceObj, "__construct", NULL, _15);
		zephir_check_call_status();
	}
	ZEPHIR_INIT_NVAR(_3);
	zephir_create_array(_3, 2, 0 TSRMLS_CC);
	zephir_array_fast_append(_3, serviceObj);
	zephir_array_fast_append(_3, method);
	if (zephir_is_callable(_3 TSRMLS_CC)) {

		/* try_start_1: */

			ZEPHIR_INIT_NVAR(_4);
			ZEPHIR_INIT_VAR(_18);
			zephir_create_array(_18, 2, 0 TSRMLS_CC);
			zephir_array_fast_append(_18, serviceObj);
			zephir_array_fast_append(_18, method);
			ZEPHIR_INIT_VAR(_19);
			zephir_create_array(_19, 1, 0 TSRMLS_CC);
			zephir_array_fast_append(_19, request);
			ZEPHIR_CALL_USER_FUNC_ARRAY(_4, _18, _19);
			zephir_check_call_status_or_jump(try_end_1);
			ZEPHIR_CPY_WRT(response, _4);

		try_end_1:

		if (EG(exception)) {
			ZEPHIR_CPY_WRT(e, EG(exception));
			if (zephir_instance_of_ev(e, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) {
				zend_clear_exception(TSRMLS_C);
				zephir_throw_exception_debug(e, "phalconplus/RPC/Server/AbstractServer.zep", 55 TSRMLS_CC);
				ZEPHIR_MM_RESTORE();
				return;
			}
		}
		ZEPHIR_INIT_NVAR(_4);
		_20 = zephir_fetch_nproperty_this(this_ptr, SL("phpOnly"), PH_NOISY_CC);
		if (ZEPHIR_IS_TRUE(_20)) {
			ZEPHIR_CPY_WRT(_4, response);
		} else {
			ZEPHIR_CALL_METHOD(&_4, response, "toarray", NULL);
			zephir_check_call_status();
		}
		RETURN_CCTOR(_4);
	} else {
		object_init_ex(_4, zend_exception_get_default(TSRMLS_C));
		ZEPHIR_INIT_VAR(_21);
		ZEPHIR_CONCAT_SVSV(_21, "Service:method not found. Detail: ", service, " : ", method);
		ZEPHIR_CALL_METHOD(NULL, _4, "__construct", &_13, _21);
		zephir_check_call_status();
		zephir_throw_exception_debug(_4, "phalconplus/RPC/Server/AbstractServer.zep", 59 TSRMLS_CC);
		ZEPHIR_MM_RESTORE();
		return;
	}

}