您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ zephir_read_property_this函数代码示例

51自学网 2021-06-03 11:58:45
  C++
这篇教程C++ zephir_read_property_this函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中zephir_read_property_this函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_read_property_this函数的具体用法?C++ zephir_read_property_this怎么用?C++ zephir_read_property_this使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了zephir_read_property_this函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

/** * Commits the active transaction in the connection */PHP_METHOD(Phalcon_Db_Adapter_Pdo, commit) {	int transactionLevel, ZEPHIR_LAST_CALL_STATUS;	zval *nesting_param = NULL, *pdo, *eventsManager = NULL, *savepointName = NULL, *_0, *_1, *_2 = NULL, *_5 = NULL;	zend_bool nesting, _3, _4;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &nesting_param);	if (!nesting_param) {		nesting = 1;	} else {		nesting = zephir_get_boolval(nesting_param);	}	ZEPHIR_OBS_VAR(pdo);	zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC);	if (Z_TYPE_P(pdo) != IS_OBJECT) {		RETURN_MM_BOOL(0);	}	ZEPHIR_OBS_VAR(_0);	zephir_read_property_this(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC);	transactionLevel = zephir_get_intval(_0);	if (!(transactionLevel)) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/db/adapter/pdo.zep", 615);		return;	}	if (transactionLevel == 1) {		_1 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC);		ZEPHIR_CPY_WRT(eventsManager, _1);		if (Z_TYPE_P(eventsManager) == IS_OBJECT) {			ZEPHIR_INIT_VAR(_2);			ZVAL_STRING(_2, "db:commitTransaction", ZEPHIR_TEMP_PARAM_COPY);			ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2, this_ptr);			zephir_check_temp_parameter(_2);			zephir_check_call_status();		}		RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC));		ZEPHIR_RETURN_CALL_METHOD(pdo, "commit", NULL, 0);		zephir_check_call_status();		RETURN_MM();	} else {		_3 = (transactionLevel) ? 1 : 0;		if (_3) {			_3 = nesting;		}		_4 = _3;		if (_4) {			ZEPHIR_CALL_METHOD(&_5, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0);			zephir_check_call_status();			_4 = zephir_is_true(_5);		}		if (_4) {			_1 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC);			ZEPHIR_CPY_WRT(eventsManager, _1);			ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0);			zephir_check_call_status();			if (Z_TYPE_P(eventsManager) == IS_OBJECT) {				ZEPHIR_INIT_NVAR(_2);				ZVAL_STRING(_2, "db:releaseSavepoint", ZEPHIR_TEMP_PARAM_COPY);				ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2, this_ptr, savepointName);				zephir_check_temp_parameter(_2);				zephir_check_call_status();			}			RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC));			ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, 0, savepointName);			zephir_check_call_status();			RETURN_MM();		}	}	if (transactionLevel > 0) {		RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC));	}	RETURN_MM_BOOL(0);}
开发者ID:AndrewUshchenko,项目名称:cphalcon,代码行数:80,


示例2: PHP_METHOD

/** * Outputs a message formatting it with HTML * *<code> * $flash->outputMessage('error', message); *</code> * * @param string|array message * @return string|void */PHP_METHOD(Phalcon_Flash, outputMessage) {	HashTable *_3$$8;	HashPosition _2$$8;	zend_bool automaticHtml = 0, implicitFlush = 0;	zval *type_param = NULL, *message, *content = NULL, *cssClasses = NULL, *classes = NULL, *typeClasses = NULL, *eol = NULL, *msg = NULL, *htmlMessage = NULL, *_0 = NULL, *_1$$5, **_4$$8;	zval *type = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 2, 0, &type_param, &message);	zephir_get_strval(type, type_param);	ZEPHIR_OBS_VAR(_0);	zephir_read_property_this(&_0, this_ptr, SL("_automaticHtml"), PH_NOISY_CC);	automaticHtml = zephir_get_boolval(_0);	if (automaticHtml == 1) {		ZEPHIR_OBS_VAR(classes);		zephir_read_property_this(&classes, this_ptr, SL("_cssClasses"), PH_NOISY_CC);		ZEPHIR_OBS_VAR(typeClasses);		if (zephir_array_isset_fetch(&typeClasses, classes, type, 0 TSRMLS_CC)) {			ZEPHIR_INIT_VAR(cssClasses);			if (Z_TYPE_P(typeClasses) == IS_ARRAY) {				ZEPHIR_INIT_VAR(_1$$5);				zephir_fast_join_str(_1$$5, SL(" "), typeClasses TSRMLS_CC);				ZEPHIR_CONCAT_SVS(cssClasses, " class=/"", _1$$5, "/"");			} else {				ZEPHIR_CONCAT_SVS(cssClasses, " class=/"", typeClasses, "/"");			}		} else {			ZEPHIR_INIT_NVAR(cssClasses);			ZVAL_STRING(cssClasses, "", 1);		}		ZEPHIR_INIT_VAR(eol);		ZEPHIR_GET_CONSTANT(eol, "PHP_EOL");	}	ZEPHIR_OBS_NVAR(_0);	zephir_read_property_this(&_0, this_ptr, SL("_implicitFlush"), PH_NOISY_CC);	implicitFlush = zephir_get_boolval(_0);	if (Z_TYPE_P(message) == IS_ARRAY) {		if (implicitFlush == 0) {			ZEPHIR_INIT_VAR(content);			ZVAL_STRING(content, "", 1);		}		zephir_is_iterable(message, &_3$$8, &_2$$8, 0, 0, "phalcon/flash.zep", 204);		for (		  ; zephir_hash_get_current_data_ex(_3$$8, (void**) &_4$$8, &_2$$8) == SUCCESS		  ; zephir_hash_move_forward_ex(_3$$8, &_2$$8)		) {			ZEPHIR_GET_HVALUE(msg, _4$$8);			if (automaticHtml == 1) {				ZEPHIR_INIT_NVAR(htmlMessage);				ZEPHIR_CONCAT_SVSVSV(htmlMessage, "<div", cssClasses, ">", msg, "</div>", eol);			} else {				ZEPHIR_CPY_WRT(htmlMessage, msg);			}			if (implicitFlush == 1) {				zend_print_zval(htmlMessage, 0);			} else {				zephir_concat_self(&content, htmlMessage TSRMLS_CC);				zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC);			}		}		if (implicitFlush == 0) {			RETURN_CCTOR(content);		}	} else {		if (automaticHtml == 1) {			ZEPHIR_INIT_NVAR(htmlMessage);			ZEPHIR_CONCAT_SVSVSV(htmlMessage, "<div", cssClasses, ">", message, "</div>", eol);		} else {			ZEPHIR_CPY_WRT(htmlMessage, message);		}		if (implicitFlush == 1) {			zend_print_zval(htmlMessage, 0);		} else {			zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC);			RETURN_CCTOR(htmlMessage);		}	}	ZEPHIR_MM_RESTORE();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:94,


示例3: PHP_METHOD

/** * Magic method to get or set services using setters/getters */PHP_METHOD(Phalcon_Di, __call) {	int ZEPHIR_LAST_CALL_STATUS;	zephir_fcall_cache_entry *_2 = NULL, *_3 = NULL;	zval *method_param = NULL, *arguments = NULL, *instance = NULL, *possibleService = NULL, *services = NULL, *definition = NULL, *_7, _0$$3, *_1$$3, _4$$8, *_5$$8, *_6$$8 = NULL;	zval *method = NULL, *_8;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &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);	}	if (!arguments) {		arguments = ZEPHIR_GLOBAL(global_null);	}	if (zephir_start_with_str(method, SL("get"))) {		ZEPHIR_OBS_VAR(services);		zephir_read_property_this(&services, this_ptr, SL("_services"), PH_NOISY_CC);		ZEPHIR_SINIT_VAR(_0$$3);		ZVAL_LONG(&_0$$3, 3);		ZEPHIR_INIT_VAR(_1$$3);		zephir_substr(_1$$3, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH);		ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", &_2, 68, _1$$3);		zephir_check_call_status();		if (zephir_array_isset(services, possibleService)) {			if (zephir_fast_count_int(arguments TSRMLS_CC)) {				ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", &_3, 0, possibleService, arguments);				zephir_check_call_status();			} else {				ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", &_3, 0, possibleService);				zephir_check_call_status();			}			RETURN_CCTOR(instance);		}	}	if (zephir_start_with_str(method, SL("set"))) {		ZEPHIR_OBS_VAR(definition);		if (zephir_array_isset_long_fetch(&definition, arguments, 0, 0 TSRMLS_CC)) {			ZEPHIR_SINIT_VAR(_4$$8);			ZVAL_LONG(&_4$$8, 3);			ZEPHIR_INIT_VAR(_5$$8);			zephir_substr(_5$$8, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH);			ZEPHIR_CALL_FUNCTION(&_6$$8, "lcfirst", &_2, 68, _5$$8);			zephir_check_call_status();			ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, _6$$8, definition);			zephir_check_call_status();			RETURN_MM_NULL();		}	}	ZEPHIR_INIT_VAR(_7);	object_init_ex(_7, phalcon_di_exception_ce);	ZEPHIR_INIT_VAR(_8);	ZEPHIR_CONCAT_SVS(_8, "Call to undefined method or service '", method, "'");	ZEPHIR_CALL_METHOD(NULL, _7, "__construct", NULL, 9, _8);	zephir_check_call_status();	zephir_throw_exception_debug(_7, "phalcon/di.zep", 406 TSRMLS_CC);	ZEPHIR_MM_RESTORE();	return;}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:73,


示例4: PHP_METHOD

/** * Changes internal pointer to a specific position in the resultset * Set new position if required and set this->_row */PHP_METHOD(Phalcon_Mvc_Model_Resultset, seek) {	zend_bool _1, _7$$3;	zephir_fcall_cache_entry *_16 = NULL;	zval *position_param = NULL, *result = NULL, *row = NULL, *_0, *_2, *_3$$3, *_6$$3, *_8$$3, *_10$$3, *_14$$3, *_17$$3, *_4$$4, *_5$$4, *_9$$6 = NULL, *_11$$7, *_12$$7 = NULL, *_13$$7, *_15$$8 = NULL;	int position, ZEPHIR_LAST_CALL_STATUS;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &position_param);	position = zephir_get_intval(position_param);	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);	_1 = !ZEPHIR_IS_LONG(_0, position);	if (!(_1)) {		_2 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC);		_1 = Z_TYPE_P(_2) == IS_NULL;	}	if (_1) {		ZEPHIR_OBS_VAR(_3$$3);		zephir_read_property_this(&_3$$3, this_ptr, SL("_rows"), PH_NOISY_CC);		if (Z_TYPE_P(_3$$3) == IS_ARRAY) {			ZEPHIR_OBS_VAR(row);			_4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_rows"), PH_NOISY_CC);			if (zephir_array_isset_long_fetch(&row, _4$$4, position, 0 TSRMLS_CC)) {				zephir_update_property_this(this_ptr, SL("_row"), row TSRMLS_CC);			}			ZEPHIR_INIT_ZVAL_NREF(_5$$4);			ZVAL_LONG(_5$$4, position);			zephir_update_property_this(this_ptr, SL("_pointer"), _5$$4 TSRMLS_CC);			zephir_update_property_this(this_ptr, SL("_activeRow"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);			RETURN_MM_NULL();		}		ZEPHIR_OBS_VAR(result);		zephir_read_property_this(&result, this_ptr, SL("_result"), PH_NOISY_CC);		_6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC);		_7$$3 = Z_TYPE_P(_6$$3) == IS_NULL;		if (_7$$3) {			_8$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);			_7$$3 = ZEPHIR_IS_LONG_IDENTICAL(_8$$3, 0);		}		if (_7$$3) {			ZEPHIR_CALL_METHOD(&_9$$6, result, "fetch", NULL, 0);			zephir_check_call_status();			zephir_update_property_this(this_ptr, SL("_row"), _9$$6 TSRMLS_CC);		}		_10$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);		if (ZEPHIR_GT_LONG(_10$$3, position)) {			ZEPHIR_INIT_VAR(_11$$7);			ZVAL_LONG(_11$$7, position);			ZEPHIR_CALL_METHOD(NULL, result, "dataseek", NULL, 0, _11$$7);			zephir_check_call_status();			ZEPHIR_CALL_METHOD(&_12$$7, result, "fetch", NULL, 0);			zephir_check_call_status();			zephir_update_property_this(this_ptr, SL("_row"), _12$$7 TSRMLS_CC);			ZEPHIR_INIT_ZVAL_NREF(_13$$7);			ZVAL_LONG(_13$$7, position);			zephir_update_property_this(this_ptr, SL("_pointer"), _13$$7 TSRMLS_CC);		}		while (1) {			_14$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC);			if (!(ZEPHIR_LT_LONG(_14$$3, position))) {				break;			}			ZEPHIR_CALL_METHOD(&_15$$8, result, "fetch", &_16, 0);			zephir_check_call_status();			zephir_update_property_this(this_ptr, SL("_row"), _15$$8 TSRMLS_CC);			RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_pointer") TSRMLS_CC));		}		ZEPHIR_INIT_ZVAL_NREF(_17$$3);		ZVAL_LONG(_17$$3, position);		zephir_update_property_this(this_ptr, SL("_pointer"), _17$$3 TSRMLS_CC);		zephir_update_property_this(this_ptr, SL("_activeRow"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);	}	ZEPHIR_MM_RESTORE();}
开发者ID:jaskaransingh156,项目名称:cphalcon,代码行数:82,


示例5: PHP_METHOD

/** * Stores cached content into the APCu backend and stops the frontend * * @param string|int keyName * @param string content * @param int lifetime * @param boolean stopBuffer */PHP_METHOD(Phalcon_Cache_Backend_Apcu, save) {	zend_long ZEPHIR_LAST_CALL_STATUS;	zend_bool stopBuffer;	zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cachedContent = NULL, *preparedContent = NULL, *ttl = NULL, *isBuffering = NULL, *success = NULL, *_0$$4;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param);	if (!keyName) {		keyName = ZEPHIR_GLOBAL(global_null);	}	if (!content) {		content = ZEPHIR_GLOBAL(global_null);	}	if (!lifetime) {		ZEPHIR_CPY_WRT(lifetime, ZEPHIR_GLOBAL(global_null));	} else {		ZEPHIR_SEPARATE_PARAM(lifetime);	}	if (!stopBuffer_param) {		stopBuffer = 1;	} else {		stopBuffer = zephir_get_boolval(stopBuffer_param);	}	if (Z_TYPE_P(keyName) == IS_NULL) {		ZEPHIR_OBS_VAR(lastKey);		zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC);	} else {		_0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC);		ZEPHIR_INIT_NVAR(lastKey);		ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0$$4, keyName);	}	if (!(zephir_is_true(lastKey))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/apcu.zep", 95);		return;	}	ZEPHIR_OBS_VAR(frontend);	zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC);	if (Z_TYPE_P(content) == IS_NULL) {		ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(cachedContent, content);	}	if (!(zephir_is_numeric(cachedContent))) {		ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(preparedContent, cachedContent);	}	if (Z_TYPE_P(lifetime) == IS_NULL) {		ZEPHIR_OBS_NVAR(lifetime);		zephir_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC);		if (Z_TYPE_P(lifetime) == IS_NULL) {			ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0);			zephir_check_call_status();		} else {			ZEPHIR_CPY_WRT(ttl, lifetime);			zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC);		}	} else {		ZEPHIR_CPY_WRT(ttl, lifetime);	}	ZEPHIR_CALL_FUNCTION(&success, "apcu_store", NULL, 93, lastKey, preparedContent, ttl);	zephir_check_call_status();	if (!(zephir_is_true(success))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in APCu", "phalcon/cache/backend/apcu.zep", 132);		return;	}	ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0);	zephir_check_call_status();	if (stopBuffer == 1) {		ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0);		zephir_check_call_status();	}	if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) {		zend_print_zval(cachedContent, 0);	}	if (0) {		zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC);	} else {		zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC);	}	RETURN_CCTOR(success);}
开发者ID:CameronHall,项目名称:cphalcon,代码行数:97,


示例6: PHP_METHOD

/** * Phalcon/Mvc/Model/MetaData/Redis constructor * * @param array options */PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct) {	zval *_6;	int ZEPHIR_LAST_CALL_STATUS;	zval *options = NULL, *ttl = NULL, *_4, *_5, *_7, *_8, *_0$$4, *_1$$5, *_2$$6, *_3$$7;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &options);	if (!options) {		ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null));	} else {		ZEPHIR_SEPARATE_PARAM(options);	}	if (Z_TYPE_P(options) != IS_ARRAY) {		ZEPHIR_INIT_NVAR(options);		array_init(options);	}	if (!(zephir_array_isset_string(options, SS("host")))) {		ZEPHIR_INIT_VAR(_0$$4);		ZVAL_STRING(_0$$4, "127.0.0.1", 1);		zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("port")))) {		ZEPHIR_INIT_VAR(_1$$5);		ZVAL_LONG(_1$$5, 6379);		zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("persistent")))) {		ZEPHIR_INIT_VAR(_2$$6);		ZVAL_LONG(_2$$6, 0);		zephir_array_update_string(&options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("statsKey")))) {		ZEPHIR_INIT_VAR(_3$$7);		ZVAL_STRING(_3$$7, "_PHCM_MM", 1);		zephir_array_update_string(&options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE);	}	if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) {		zephir_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC);	}	ZEPHIR_INIT_VAR(_4);	object_init_ex(_4, phalcon_cache_backend_redis_ce);	ZEPHIR_INIT_VAR(_5);	object_init_ex(_5, phalcon_cache_frontend_data_ce);	ZEPHIR_INIT_VAR(_6);	zephir_create_array(_6, 1, 0 TSRMLS_CC);	ZEPHIR_OBS_VAR(_7);	zephir_read_property_this(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC);	zephir_array_update_string(&_6, SL("lifetime"), &_7, PH_COPY | PH_SEPARATE);	ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 313, _6);	zephir_check_call_status();	ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 317, _5, options);	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_redis"), _4 TSRMLS_CC);	ZEPHIR_INIT_VAR(_8);	array_init(_8);	zephir_update_property_this(this_ptr, SL("_metaData"), _8 TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:68,


示例7: PHP_METHOD

/** * Phalcon/Mvc/Model/MetaData/Memcache constructor * * @param array options */PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct) {	int ZEPHIR_LAST_CALL_STATUS;	zval *_2;	zval *options = NULL, *ttl, *_0 = NULL, *_1, *_3, *_4;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &options);	if (!options) {		ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null));	} else {		ZEPHIR_SEPARATE_PARAM(options);	}	if (Z_TYPE_P(options) != IS_ARRAY) {		ZEPHIR_INIT_NVAR(options);		array_init(options);	}	if (!(zephir_array_isset_string(options, SS("host")))) {		ZEPHIR_INIT_VAR(_0);		ZVAL_STRING(_0, "127.0.0.1", 1);		zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("port")))) {		ZEPHIR_INIT_NVAR(_0);		ZVAL_LONG(_0, 11211);		zephir_array_update_string(&options, SL("port"), &_0, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("persistent")))) {		ZEPHIR_INIT_NVAR(_0);		ZVAL_LONG(_0, 0);		zephir_array_update_string(&options, SL("persistent"), &_0, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("statsKey")))) {		ZEPHIR_INIT_NVAR(_0);		ZVAL_STRING(_0, "_PHCM_MM", 1);		zephir_array_update_string(&options, SL("statsKey"), &_0, PH_COPY | PH_SEPARATE);	}	if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) {		zephir_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC);	}	ZEPHIR_INIT_NVAR(_0);	object_init_ex(_0, phalcon_cache_backend_memcache_ce);	ZEPHIR_INIT_VAR(_1);	object_init_ex(_1, phalcon_cache_frontend_data_ce);	ZEPHIR_INIT_VAR(_2);	zephir_create_array(_2, 1, 0 TSRMLS_CC);	ZEPHIR_OBS_VAR(_3);	zephir_read_property_this(&_3, this_ptr, SL("_ttl"), PH_NOISY_CC);	zephir_array_update_string(&_2, SL("lifetime"), &_3, PH_COPY | PH_SEPARATE);	ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 312, _2);	zephir_check_call_status();	ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 315, _1, options);	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_memcache"), _0 TSRMLS_CC);	ZEPHIR_INIT_VAR(_4);	array_init(_4);	zephir_update_property_this(this_ptr, SL("_metaData"), _4 TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:AlloVince,项目名称:cphalcon,代码行数:68,


示例8: PHP_METHOD

/** * Loads registered template engines, if none is registered it will use Phalcon/Mvc/View/Engine/Php * * @return array */PHP_METHOD(Phalcon_Mvc_View_Simple, _loadTemplateEngines) {	zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL;	HashTable *_2;	HashPosition _1;	int ZEPHIR_LAST_CALL_STATUS;	zval *engines = NULL, *dependencyInjector, *registeredEngines, *arguments, *extension = NULL, *engineService = NULL, *engineObject = NULL, *_0 = NULL, **_3, *_5 = NULL;	ZEPHIR_MM_GROW();	ZEPHIR_OBS_VAR(engines);	zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC);	if (ZEPHIR_IS_FALSE_IDENTICAL(engines)) {		ZEPHIR_OBS_VAR(dependencyInjector);		zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);		ZEPHIR_INIT_NVAR(engines);		array_init(engines);		ZEPHIR_OBS_VAR(registeredEngines);		zephir_read_property_this(&registeredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC);		if (Z_TYPE_P(registeredEngines) != IS_ARRAY) {			ZEPHIR_INIT_VAR(_0);			object_init_ex(_0, phalcon_mvc_view_engine_php_ce);			ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 370, this_ptr, dependencyInjector);			zephir_check_call_status();			zephir_array_update_string(&engines, SL(".phtml"), &_0, PH_COPY | PH_SEPARATE);		} else {			if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {				ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view/simple.zep", 139);				return;			}			ZEPHIR_INIT_VAR(arguments);			zephir_create_array(arguments, 2, 0 TSRMLS_CC);			zephir_array_fast_append(arguments, this_ptr);			zephir_array_fast_append(arguments, dependencyInjector);			zephir_is_iterable(registeredEngines, &_2, &_1, 0, 0, "phalcon/mvc/view/simple.zep", 171);			for (			  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS			  ; zephir_hash_move_forward_ex(_2, &_1)			) {				ZEPHIR_GET_HMKEY(extension, _2, _1);				ZEPHIR_GET_HVALUE(engineService, _3);				if (Z_TYPE_P(engineService) == IS_OBJECT) {					if (zephir_instance_of_ev(engineService, zend_ce_closure TSRMLS_CC)) {						ZEPHIR_INIT_NVAR(engineObject);						ZEPHIR_CALL_USER_FUNC_ARRAY(engineObject, engineService, arguments);						zephir_check_call_status();					} else {						ZEPHIR_CPY_WRT(engineObject, engineService);					}				} else {					if (Z_TYPE_P(engineService) == IS_STRING) {						ZEPHIR_CALL_METHOD(&engineObject, dependencyInjector, "getshared", &_4, 0, engineService, arguments);						zephir_check_call_status();					} else {						ZEPHIR_INIT_NVAR(_0);						object_init_ex(_0, phalcon_mvc_view_exception_ce);						ZEPHIR_INIT_LNVAR(_5);						ZEPHIR_CONCAT_SV(_5, "Invalid template engine registration for extension: ", extension);						ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_6, 9, _5);						zephir_check_call_status();						zephir_throw_exception_debug(_0, "phalcon/mvc/view/simple.zep", 165 TSRMLS_CC);						ZEPHIR_MM_RESTORE();						return;					}				}				zephir_array_update_zval(&engines, extension, &engineObject, PH_COPY | PH_SEPARATE);			}		}		zephir_update_property_this(this_ptr, SL("_engines"), engines TSRMLS_CC);	} else {		ZEPHIR_OBS_NVAR(engines);		zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC);	}	RETURN_CCTOR(engines);}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:81,


示例9: PHP_METHOD

/** * Returns a complete resultset as an array, if the resultset has a big number of rows * it could consume more memory than currently it does. Export the resultset to an array * couldn't be faster with a large number of records */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) {	HashTable *_2$$7, *_5$$8;	HashPosition _1$$7, _4$$8;	zephir_fcall_cache_entry *_9 = NULL;	int ZEPHIR_LAST_CALL_STATUS;	zval *renameColumns_param = NULL, *result = NULL, *records = NULL, *record = NULL, *renamed = NULL, *renamedKey = NULL, *key = NULL, *value = NULL, *renamedRecords = NULL, *columnMap = NULL, *_0$$3, **_3$$7, **_6$$8, *_7$$10 = NULL, *_8$$10 = NULL, *_10$$12 = NULL, *_11$$12 = NULL;	zend_bool renameColumns;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &renameColumns_param);	if (!renameColumns_param) {		renameColumns = 1;	} else {		renameColumns = zephir_get_boolval(renameColumns_param);	}	ZEPHIR_OBS_VAR(records);	zephir_read_property_this(&records, this_ptr, SL("_rows"), PH_NOISY_CC);	if (Z_TYPE_P(records) != IS_ARRAY) {		ZEPHIR_OBS_VAR(result);		zephir_read_property_this(&result, this_ptr, SL("_result"), PH_NOISY_CC);		_0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC);		if (Z_TYPE_P(_0$$3) != IS_NULL) {			ZEPHIR_CALL_METHOD(NULL, result, "execute", NULL, 0);			zephir_check_call_status();		}		ZEPHIR_CALL_METHOD(&records, result, "fetchall", NULL, 0);		zephir_check_call_status();		zephir_update_property_this(this_ptr, SL("_row"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);		zephir_update_property_this(this_ptr, SL("_rows"), records TSRMLS_CC);	}	if (renameColumns) {		ZEPHIR_OBS_VAR(columnMap);		zephir_read_property_this(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC);		if (Z_TYPE_P(columnMap) != IS_ARRAY) {			RETURN_CCTOR(records);		}		ZEPHIR_INIT_VAR(renamedRecords);		array_init(renamedRecords);		if (Z_TYPE_P(records) == IS_ARRAY) {			zephir_is_iterable(records, &_2$$7, &_1$$7, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 218);			for (			  ; zephir_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS			  ; zephir_hash_move_forward_ex(_2$$7, &_1$$7)			) {				ZEPHIR_GET_HVALUE(record, _3$$7);				ZEPHIR_INIT_NVAR(renamed);				array_init(renamed);				zephir_is_iterable(record, &_5$$8, &_4$$8, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 216);				for (				  ; zephir_hash_get_current_data_ex(_5$$8, (void**) &_6$$8, &_4$$8) == SUCCESS				  ; zephir_hash_move_forward_ex(_5$$8, &_4$$8)				) {					ZEPHIR_GET_HMKEY(key, _5$$8, _4$$8);					ZEPHIR_GET_HVALUE(value, _6$$8);					ZEPHIR_OBS_NVAR(renamedKey);					if (!(zephir_array_isset_fetch(&renamedKey, columnMap, key, 0 TSRMLS_CC))) {						ZEPHIR_INIT_NVAR(_7$$10);						object_init_ex(_7$$10, phalcon_mvc_model_exception_ce);						ZEPHIR_INIT_LNVAR(_8$$10);						ZEPHIR_CONCAT_SVS(_8$$10, "Column '", key, "' is not part of the column map");						ZEPHIR_CALL_METHOD(NULL, _7$$10, "__construct", &_9, 9, _8$$10);						zephir_check_call_status();						zephir_throw_exception_debug(_7$$10, "phalcon/mvc/model/resultset/simple.zep", 200 TSRMLS_CC);						ZEPHIR_MM_RESTORE();						return;					}					if (Z_TYPE_P(renamedKey) == IS_ARRAY) {						ZEPHIR_OBS_NVAR(renamedKey);						if (!(zephir_array_isset_long_fetch(&renamedKey, renamedKey, 0, 0 TSRMLS_CC))) {							ZEPHIR_INIT_NVAR(_10$$12);							object_init_ex(_10$$12, phalcon_mvc_model_exception_ce);							ZEPHIR_INIT_LNVAR(_11$$12);							ZEPHIR_CONCAT_SVS(_11$$12, "Column '", key, "' is not part of the column map");							ZEPHIR_CALL_METHOD(NULL, _10$$12, "__construct", &_9, 9, _11$$12);							zephir_check_call_status();							zephir_throw_exception_debug(_10$$12, "phalcon/mvc/model/resultset/simple.zep", 206 TSRMLS_CC);							ZEPHIR_MM_RESTORE();							return;						}					}					zephir_array_update_zval(&renamed, renamedKey, &value, PH_COPY | PH_SEPARATE);				}				zephir_array_append(&renamedRecords, renamed, PH_SEPARATE, "phalcon/mvc/model/resultset/simple.zep", 216);			}		}		RETURN_CCTOR(renamedRecords);	}	RETURN_CCTOR(records);}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:99,


示例10: PHP_METHOD

/** * Creates a password hash using bcrypt with a pseudo random salt */PHP_METHOD(Phalcon_Security, hash) {	zephir_fcall_cache_entry *_3 = NULL, *_6 = NULL;	int workFactor, ZEPHIR_LAST_CALL_STATUS, hash = 0;	zval *password_param = NULL, *workFactor_param = NULL, *saltBytes = NULL, *_1, *_0$$3, *_2$$9, *_4$$11, *_5$$11, *_7$$13, _8$$13, _9$$13, *_10$$13 = NULL, *_11$$13;	zval *password = NULL, *variant = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &password_param, &workFactor_param);	zephir_get_strval(password, password_param);	if (!workFactor_param) {		workFactor = 0;	} else {		workFactor = zephir_get_intval(workFactor_param);	}	if (!(workFactor)) {		ZEPHIR_OBS_VAR(_0$$3);		zephir_read_property_this(&_0$$3, this_ptr, SL("_workFactor"), PH_NOISY_CC);		workFactor = zephir_get_intval(_0$$3);	}	ZEPHIR_OBS_VAR(_1);	zephir_read_property_this(&_1, this_ptr, SL("_defaultHash"), PH_NOISY_CC);	hash = zephir_get_intval(_1);	do {		if (hash == 5) {			ZEPHIR_INIT_VAR(variant);			ZVAL_STRING(variant, "x", 1);			break;		}		if (hash == 6) {			ZEPHIR_INIT_NVAR(variant);			ZVAL_STRING(variant, "y", 1);			break;		}		if (hash == 7) {			ZEPHIR_INIT_NVAR(variant);			ZVAL_STRING(variant, "5", 1);			break;		}		if (hash == 8) {			ZEPHIR_INIT_NVAR(variant);			ZVAL_STRING(variant, "6", 1);			break;		}		ZEPHIR_INIT_NVAR(variant);		ZVAL_STRING(variant, "a", 1);		break;	} while(0);	do {		if (hash == 1) {			ZEPHIR_INIT_VAR(_2$$9);			ZVAL_LONG(_2$$9, 2);			ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", &_3, 0, _2$$9);			zephir_check_call_status();			if (Z_TYPE_P(saltBytes) != IS_STRING) {				ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 195);				return;			}			break;		}		if (hash == 8) {			ZEPHIR_INIT_VAR(_4$$11);			ZVAL_LONG(_4$$11, 8);			ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", &_3, 0, _4$$11);			zephir_check_call_status();			if (Z_TYPE_P(saltBytes) != IS_STRING) {				ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 203);				return;			}			ZEPHIR_INIT_VAR(_5$$11);			ZEPHIR_CONCAT_SVSV(_5$$11, "$", variant, "$", saltBytes);			ZEPHIR_RETURN_CALL_FUNCTION("crypt", &_6, 396, password, _5$$11);			zephir_check_call_status();			RETURN_MM();		}		ZEPHIR_INIT_VAR(_7$$13);		ZVAL_LONG(_7$$13, 22);		ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", &_3, 0, _7$$13);		zephir_check_call_status();		if (Z_TYPE_P(saltBytes) != IS_STRING) {			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 225);			return;		}		if (workFactor < 4) {			workFactor = 4;		} else {			if (workFactor > 31) {				workFactor = 31;			}		}		ZEPHIR_SINIT_VAR(_8$$13);		ZVAL_STRING(&_8$$13, "%02s", 0);		ZEPHIR_SINIT_VAR(_9$$13);//.........这里部分代码省略.........
开发者ID:Dmitry-Kucher,项目名称:cphalcon,代码行数:101,


示例11: PHP_METHOD

/** * Gets the a value to validate in the array/object data source * * @param string field * @return mixed */PHP_METHOD(Phalcon_Validation, getValue) {	zephir_fcall_cache_entry *_2 = NULL;	zend_bool _1;	int ZEPHIR_LAST_CALL_STATUS;	zval *field_param = NULL, *entity, *method = NULL, *value = NULL, *data, *values, *filters, *fieldFilters, *dependencyInjector = NULL, *filterService = NULL, *_3;	zval *field = NULL, *_0;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &field_param);	zephir_get_strval(field, field_param);	ZEPHIR_OBS_VAR(entity);	zephir_read_property_this(&entity, this_ptr, SL("_entity"), PH_NOISY_CC);	if (Z_TYPE_P(entity) == IS_OBJECT) {		ZEPHIR_INIT_VAR(_0);		ZEPHIR_CONCAT_SV(_0, "get", field);		ZEPHIR_CPY_WRT(method, _0);		if ((zephir_method_exists(entity, method TSRMLS_CC)  == SUCCESS)) {			ZEPHIR_CALL_METHOD_ZVAL(&value, entity, method,  NULL, 0);			zephir_check_call_status();		} else {			if ((zephir_method_exists_ex(entity, SS("readattribute") TSRMLS_CC) == SUCCESS)) {				ZEPHIR_CALL_METHOD(&value, entity, "readattribute", NULL, 0, field);				zephir_check_call_status();			} else {				ZEPHIR_INIT_NVAR(value);				if (zephir_isset_property_zval(entity, field TSRMLS_CC)) {					zephir_read_property_zval(&value, entity, field, PH_NOISY_CC);				} else {					ZVAL_NULL(value);				}			}		}		RETURN_CCTOR(value);	}	ZEPHIR_OBS_VAR(data);	zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC);	_1 = Z_TYPE_P(data) != IS_ARRAY;	if (_1) {		_1 = Z_TYPE_P(data) != IS_OBJECT;	}	if (_1) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "There is no data to validate", "phalcon/validation.zep", 386);		return;	}	ZEPHIR_OBS_VAR(values);	zephir_read_property_this(&values, this_ptr, SL("_values"), PH_NOISY_CC);	ZEPHIR_OBS_NVAR(value);	if (zephir_array_isset_fetch(&value, values, field, 0 TSRMLS_CC)) {		RETURN_CCTOR(value);	}	ZEPHIR_INIT_NVAR(value);	ZVAL_NULL(value);	if (Z_TYPE_P(data) == IS_ARRAY) {		if (zephir_array_isset(data, field)) {			ZEPHIR_OBS_NVAR(value);			zephir_array_fetch(&value, data, field, PH_NOISY, "phalcon/validation.zep", 400 TSRMLS_CC);		}	} else if (Z_TYPE_P(data) == IS_OBJECT) {		if (zephir_isset_property_zval(data, field TSRMLS_CC)) {			ZEPHIR_OBS_NVAR(value);			zephir_read_property_zval(&value, data, field, PH_NOISY_CC);		}	}	if (Z_TYPE_P(value) == IS_NULL) {		RETURN_MM_NULL();	}	ZEPHIR_OBS_VAR(filters);	zephir_read_property_this(&filters, this_ptr, SL("_filters"), PH_NOISY_CC);	if (Z_TYPE_P(filters) == IS_ARRAY) {		ZEPHIR_OBS_VAR(fieldFilters);		if (zephir_array_isset_fetch(&fieldFilters, filters, field, 0 TSRMLS_CC)) {			if (zephir_is_true(fieldFilters)) {				ZEPHIR_CALL_METHOD(&dependencyInjector, this_ptr, "getdi", NULL, 0);				zephir_check_call_status();				if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {					ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_2, 147);					zephir_check_call_status();					if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {						ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "A dependency injector is required to obtain the 'filter' service", "phalcon/validation.zep", 423);						return;					}				}				ZEPHIR_INIT_VAR(_3);				ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY);				ZEPHIR_CALL_METHOD(&filterService, dependencyInjector, "getshared", NULL, 0, _3);				zephir_check_temp_parameter(_3);				zephir_check_call_status();				if (Z_TYPE_P(filterService) != IS_OBJECT) {					ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Returned 'filter' service is invalid", "phalcon/validation.zep", 429);					return;//.........这里部分代码省略.........
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:101,


示例12: PHP_METHOD

/** * Produce the routing parameters from the rewrite information */PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) {	zephir_fcall_cache_entry *_9 = NULL, *_17 = NULL, *_18 = NULL;	HashTable *_2, *_7, *_11, *_15;	HashPosition _1, _6, _10, _14;	int ZEPHIR_LAST_CALL_STATUS;	zval *uri_param = NULL, *realUri = NULL, *annotationsService = NULL, *handlers, *controllerSuffix, *scope = NULL, *prefix = NULL, *dependencyInjector = NULL, *handler = NULL, *controllerName = NULL, *lowerControllerName = NULL, *namespaceName = NULL, *moduleName = NULL, *sufixed = NULL, *handlerAnnotations = NULL, *classAnnotations = NULL, *annotations = NULL, *annotation = NULL, *methodAnnotations = NULL, *lowercased = NULL, *method = NULL, *collection = NULL, *_0, **_3, *_4, *_5 = NULL, **_8, **_12, *_13 = NULL, **_16;	zval *uri = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &uri_param);	if (!uri_param) {		ZEPHIR_INIT_VAR(uri);		ZVAL_EMPTY_STRING(uri);	} else {	if (unlikely(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(uri_param) == IS_STRING)) {		zephir_get_strval(uri, uri_param);	} else {		ZEPHIR_INIT_VAR(uri);		ZVAL_EMPTY_STRING(uri);	}	}	if (!(!(!uri) && Z_STRLEN_P(uri))) {		ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri", NULL, 0);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(realUri, uri);	}	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_processed"), PH_NOISY_CC);	if (!(zephir_is_true(_0))) {		ZEPHIR_INIT_VAR(annotationsService);		ZVAL_NULL(annotationsService);		ZEPHIR_OBS_VAR(handlers);		zephir_read_property_this(&handlers, this_ptr, SL("_handlers"), PH_NOISY_CC);		if (Z_TYPE_P(handlers) == IS_ARRAY) {			ZEPHIR_OBS_VAR(controllerSuffix);			zephir_read_property_this(&controllerSuffix, this_ptr, SL("_controllerSuffix"), PH_NOISY_CC);			zephir_is_iterable(handlers, &_2, &_1, 0, 0, "phalcon/mvc/router/annotations.zep", 208);			for (			  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS			  ; zephir_hash_move_forward_ex(_2, &_1)			) {				ZEPHIR_GET_HVALUE(scope, _3);				if (Z_TYPE_P(scope) == IS_ARRAY) {					ZEPHIR_OBS_NVAR(prefix);					zephir_array_fetch_long(&prefix, scope, 0, PH_NOISY, "phalcon/mvc/router/annotations.zep", 117 TSRMLS_CC);					if (!(ZEPHIR_IS_EMPTY(prefix))) {						if (!(zephir_start_with(realUri, prefix, NULL))) {							continue;						}					}					if (Z_TYPE_P(annotationsService) != IS_OBJECT) {						_4 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);						ZEPHIR_CPY_WRT(dependencyInjector, _4);						if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {							ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "A dependency injection container is required to access the 'annotations' service", "phalcon/mvc/router/annotations.zep", 129);							return;						}						ZEPHIR_INIT_NVAR(_5);						ZVAL_STRING(_5, "annotations", ZEPHIR_TEMP_PARAM_COPY);						ZEPHIR_CALL_METHOD(&annotationsService, dependencyInjector, "getshared", NULL, 0, _5);						zephir_check_temp_parameter(_5);						zephir_check_call_status();					}					ZEPHIR_OBS_NVAR(handler);					zephir_array_fetch_long(&handler, scope, 1, PH_NOISY, "phalcon/mvc/router/annotations.zep", 138 TSRMLS_CC);					if (zephir_memnstr_str(handler, SL("//"), "phalcon/mvc/router/annotations.zep", 140)) {						ZEPHIR_INIT_NVAR(controllerName);						zephir_get_class_ns(controllerName, handler, 0 TSRMLS_CC);						ZEPHIR_INIT_NVAR(lowerControllerName);						zephir_uncamelize(lowerControllerName, controllerName);						ZEPHIR_INIT_NVAR(namespaceName);						zephir_get_ns_class(namespaceName, handler, 0 TSRMLS_CC);					} else {						ZEPHIR_CPY_WRT(controllerName, handler);						ZEPHIR_INIT_NVAR(lowerControllerName);						zephir_uncamelize(lowerControllerName, controllerName);						ZEPHIR_INIT_NVAR(namespaceName);						ZVAL_NULL(namespaceName);					}					zephir_update_property_this(this_ptr, SL("_routePrefix"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);					ZEPHIR_OBS_NVAR(moduleName);					zephir_array_isset_long_fetch(&moduleName, scope, 2, 0 TSRMLS_CC);					ZEPHIR_INIT_NVAR(sufixed);					ZEPHIR_CONCAT_VV(sufixed, handler, controllerSuffix);					ZEPHIR_CALL_METHOD(&handlerAnnotations, annotationsService, "get", NULL, 0, sufixed);					zephir_check_call_status();					if (Z_TYPE_P(handlerAnnotations) == IS_OBJECT) {						ZEPHIR_CALL_METHOD(&classAnnotations, handlerAnnotations, "getclassannotations", NULL, 0);						zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:AlloVince,项目名称:cphalcon,代码行数:101,


示例13: PHP_METHOD

//.........这里部分代码省略.........	zephir_concat_self(&html, _16 TSRMLS_CC);	ZEPHIR_OBS_VAR(traceArgs);	if (zephir_array_isset_string_fetch(&traceArgs, trace, SS("args"), 0 TSRMLS_CC)) {		ZEPHIR_INIT_VAR(arguments);		array_init(arguments);		zephir_is_iterable(traceArgs, &_18$$14, &_17$$14, 0, 0, "phalcon/debug.zep", 441);		for (		  ; zend_hash_get_current_data_ex(_18$$14, (void**) &_19$$14, &_17$$14) == SUCCESS		  ; zend_hash_move_forward_ex(_18$$14, &_17$$14)		) {			ZEPHIR_GET_HVALUE(argument, _19$$14);			ZEPHIR_CALL_METHOD(&_20$$15, this_ptr, "_getvardump", &_21, 0, argument);			zephir_check_call_status();			ZEPHIR_INIT_LNVAR(_22$$15);			ZEPHIR_CONCAT_SVS(_22$$15, "<span class=/"error-parameter/">", _20$$15, "</span>");			zephir_array_append(&arguments, _22$$15, PH_SEPARATE, "phalcon/debug.zep", 435);		}		ZEPHIR_INIT_VAR(_23$$14);		zephir_fast_join_str(_23$$14, SL(", "), arguments TSRMLS_CC);		ZEPHIR_INIT_VAR(_24$$14);		ZEPHIR_CONCAT_SVS(_24$$14, "(", _23$$14, ")");		zephir_concat_self(&html, _24$$14 TSRMLS_CC);	}	ZEPHIR_OBS_VAR(filez);	if (zephir_array_isset_string_fetch(&filez, trace, SS("file"), 0 TSRMLS_CC)) {		ZEPHIR_OBS_VAR(_25$$16);		zephir_array_fetch_string(&_25$$16, trace, SL("line"), PH_NOISY, "phalcon/debug.zep", 449 TSRMLS_CC);		zephir_get_strval(_26$$16, _25$$16);		ZEPHIR_CPY_WRT(line, _26$$16);		ZEPHIR_INIT_VAR(_27$$16);		ZEPHIR_CONCAT_SVSVS(_27$$16, "<br/><div class=/"error-file/">", filez, " (", line, ")</div>");		zephir_concat_self(&html, _27$$16 TSRMLS_CC);		ZEPHIR_OBS_VAR(showFiles);		zephir_read_property_this(&showFiles, this_ptr, SL("_showFiles"), PH_NOISY_CC);		if (zephir_is_true(showFiles)) {			ZEPHIR_CALL_FUNCTION(&lines, "file", NULL, 165, filez);			zephir_check_call_status();			ZEPHIR_INIT_VAR(numberLines);			ZVAL_LONG(numberLines, zephir_fast_count_int(lines TSRMLS_CC));			ZEPHIR_OBS_VAR(showFileFragment);			zephir_read_property_this(&showFileFragment, this_ptr, SL("_showFileFragment"), PH_NOISY_CC);			if (zephir_is_true(showFileFragment)) {				ZEPHIR_INIT_VAR(beforeLine);				ZVAL_LONG(beforeLine, (zephir_get_numberval(line) - 7));				if (ZEPHIR_LT_LONG(beforeLine, 1)) {					firstLine = 1;				} else {					firstLine = zephir_get_numberval(beforeLine);				}				ZEPHIR_INIT_VAR(afterLine);				ZVAL_LONG(afterLine, (zephir_get_numberval(line) + 5));				if (ZEPHIR_GT(afterLine, numberLines)) {					ZEPHIR_CPY_WRT(lastLine, numberLines);				} else {					ZEPHIR_CPY_WRT(lastLine, afterLine);				}				ZEPHIR_SINIT_VAR(_28$$18);				ZVAL_LONG(&_28$$18, firstLine);				ZEPHIR_SINIT_VAR(_29$$18);				ZVAL_LONG(&_29$$18, firstLine);				ZEPHIR_INIT_VAR(_30$$18);				ZEPHIR_CONCAT_SVSVSVS(_30$$18, "<pre class=/"prettyprint highlight:", &_28$$18, ":", line, " linenums:", &_29$$18, "/">");				zephir_concat_self(&html, _30$$18 TSRMLS_CC);			} else {				firstLine = 1;				ZEPHIR_CPY_WRT(lastLine, numberLines);
开发者ID:bschantz,项目名称:cphalcon,代码行数:67,


示例14: PHP_METHOD

//.........这里部分代码省略.........								if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) {									ZEPHIR_INIT_NVAR(_9);									ZEPHIR_INIT_NVAR(_10);									zephir_create_array(_10, 1, 0 TSRMLS_CC);									zephir_array_fast_append(_10, position);									ZEPHIR_CALL_USER_FUNC_ARRAY(_9, converter, _10);									zephir_check_call_status();									zephir_array_update_zval(&parts, part, &_9, PH_COPY | PH_SEPARATE);								}							}						}					}					zephir_update_property_this(this_ptr, SL("_matches"), matches TSRMLS_CC);				}				zephir_update_property_this(this_ptr, SL("_matchedRoute"), route TSRMLS_CC);				break;			}		}		if (zephir_is_true(routeFound)) {			zephir_update_property_this(this_ptr, SL("_wasMatched"), (1) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);		} else {			zephir_update_property_this(this_ptr, SL("_wasMatched"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);			_11 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultModule"), PH_NOISY_CC);			zephir_update_property_this(this_ptr, SL("_module"), _11 TSRMLS_CC);			_12 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultTask"), PH_NOISY_CC);			zephir_update_property_this(this_ptr, SL("_task"), _12 TSRMLS_CC);			_13 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAction"), PH_NOISY_CC);			zephir_update_property_this(this_ptr, SL("_action"), _13 TSRMLS_CC);			_14 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC);			zephir_update_property_this(this_ptr, SL("_params"), _14 TSRMLS_CC);			RETURN_THIS();		}	} else {		ZEPHIR_CPY_WRT(parts, arguments);	}	ZEPHIR_INIT_VAR(moduleName);	ZVAL_NULL(moduleName);	ZEPHIR_INIT_VAR(taskName);	ZVAL_NULL(taskName);	ZEPHIR_INIT_VAR(actionName);	ZVAL_NULL(actionName);	ZEPHIR_OBS_NVAR(moduleName);	if (zephir_array_isset_string_fetch(&moduleName, parts, SS("module"), 0 TSRMLS_CC)) {		zephir_array_unset_string(&parts, SS("module"), PH_SEPARATE);	} else {		ZEPHIR_OBS_NVAR(moduleName);		zephir_read_property_this(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC);	}	ZEPHIR_OBS_NVAR(taskName);	if (zephir_array_isset_string_fetch(&taskName, parts, SS("task"), 0 TSRMLS_CC)) {		zephir_array_unset_string(&parts, SS("task"), PH_SEPARATE);	} else {		ZEPHIR_OBS_NVAR(taskName);		zephir_read_property_this(&taskName, this_ptr, SL("_defaultTask"), PH_NOISY_CC);	}	ZEPHIR_OBS_NVAR(actionName);	if (zephir_array_isset_string_fetch(&actionName, parts, SS("action"), 0 TSRMLS_CC)) {		zephir_array_unset_string(&parts, SS("action"), PH_SEPARATE);	} else {		ZEPHIR_OBS_NVAR(actionName);		zephir_read_property_this(&actionName, this_ptr, SL("_defaultAction"), PH_NOISY_CC);	}	if (zephir_is_true(routeFound)) {		ZEPHIR_OBS_NVAR(params);		if (zephir_array_isset_string_fetch(&params, parts, SS("params"), 0 TSRMLS_CC)) {			if (Z_TYPE_P(params) != IS_ARRAY) {				zephir_get_strval(_15, params);				ZEPHIR_SINIT_VAR(_16);				ZVAL_LONG(&_16, 1);				ZEPHIR_INIT_VAR(strParams);				zephir_substr(strParams, _15, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH);				if (zephir_is_true(strParams)) {					ZEPHIR_CALL_CE_STATIC(&_17, phalcon_cli_router_route_ce, "getdelimiter", &_18, 121);					zephir_check_call_status();					ZEPHIR_INIT_NVAR(params);					zephir_fast_explode(params, _17, strParams, LONG_MAX TSRMLS_CC);				} else {					ZEPHIR_INIT_NVAR(params);					array_init(params);				}			}			zephir_array_unset_string(&parts, SS("params"), PH_SEPARATE);		}		if (zephir_fast_count_int(params TSRMLS_CC)) {			ZEPHIR_INIT_NVAR(_9);			zephir_fast_array_merge(_9, &(params), &(parts) TSRMLS_CC);			ZEPHIR_CPY_WRT(params, _9);		} else {			ZEPHIR_CPY_WRT(params, parts);		}	} else {		ZEPHIR_CPY_WRT(params, parts);	}	zephir_update_property_this(this_ptr, SL("_module"), moduleName TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_task"), taskName TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_action"), actionName TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_params"), params TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:spuy767,项目名称:cphalcon,代码行数:101,


示例15: PHP_METHOD

/** * Create/Returns a new transaction or an existing one */PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) {	HashTable *_2$$5;	HashPosition _1$$5;	int ZEPHIR_LAST_CALL_STATUS;	zval *autoBegin_param = NULL, *dependencyInjector = NULL, *transaction = NULL, *transactions = NULL, *_0, *_5, *_6, **_3$$5, *_4$$7 = NULL;	zend_bool autoBegin;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &autoBegin_param);	if (!autoBegin_param) {		autoBegin = 1;	} else {		autoBegin = zephir_get_boolval(autoBegin_param);	}	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);	ZEPHIR_CPY_WRT(dependencyInjector, _0);	if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_transaction_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model/transaction/manager.zep", 188);		return;	}	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_number"), PH_NOISY_CC);	if (zephir_is_true(_0)) {		ZEPHIR_OBS_VAR(transactions);		zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC);		if (Z_TYPE_P(transactions) == IS_ARRAY) {			zephir_is_iterable(transactions, &_2$$5, &_1$$5, 0, 1, "phalcon/mvc/model/transaction/manager.zep", 200);			for (			  ; zephir_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS			  ; zephir_hash_move_backwards_ex(_2$$5, &_1$$5)			) {				ZEPHIR_GET_HVALUE(transaction, _3$$5);				if (Z_TYPE_P(transaction) == IS_OBJECT) {					ZEPHIR_INIT_NVAR(_4$$7);					ZVAL_BOOL(_4$$7, 0);					ZEPHIR_CALL_METHOD(NULL, transaction, "setisnewtransaction", NULL, 0, _4$$7);					zephir_check_call_status();					RETURN_CCTOR(transaction);				}			}		}	}	ZEPHIR_INIT_NVAR(transaction);	object_init_ex(transaction, phalcon_mvc_model_transaction_ce);	_5 = zephir_fetch_nproperty_this(this_ptr, SL("_service"), PH_NOISY_CC);	ZEPHIR_INIT_VAR(_6);	if (autoBegin) {		ZVAL_BOOL(_6, 1);	} else {		ZVAL_BOOL(_6, 0);	}	ZEPHIR_CALL_METHOD(NULL, transaction, "__construct", NULL, 352, dependencyInjector, _6, _5);	zephir_check_call_status();	ZEPHIR_CALL_METHOD(NULL, transaction, "settransactionmanager", NULL, 353, this_ptr);	zephir_check_call_status();	zephir_update_property_array_append(this_ptr, SL("_transactions"), transaction TSRMLS_CC);	RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_number") TSRMLS_CC));	RETURN_CCTOR(transaction);}
开发者ID:Dmitry-Kucher,项目名称:cphalcon,代码行数:66,


示例16: PHP_METHOD

/** * Throws an internal exception */PHP_METHOD(Phalcon_Mvc_Dispatcher, _throwDispatchException) {	int exceptionCode, ZEPHIR_LAST_CALL_STATUS;	zval *message_param = NULL, *exceptionCode_param = NULL, *dependencyInjector, *response = NULL, *exception, *_0 = NULL, *_1 = NULL, *_2, *_3 = NULL;	zval *message = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &message_param, &exceptionCode_param);	if (unlikely(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(message_param) == IS_STRING)) {		zephir_get_strval(message, message_param);	} else {		ZEPHIR_INIT_VAR(message);		ZVAL_EMPTY_STRING(message);	}	if (!exceptionCode_param) {		exceptionCode = 0;	} else {		exceptionCode = zephir_get_intval(exceptionCode_param);	}	ZEPHIR_OBS_VAR(dependencyInjector);	zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);	if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {		ZEPHIR_INIT_VAR(_0);		object_init_ex(_0, phalcon_mvc_dispatcher_exception_ce);		ZEPHIR_INIT_VAR(_1);		ZVAL_STRING(_1, "A dependency injection container is required to access the 'response' service", ZEPHIR_TEMP_PARAM_COPY);		ZEPHIR_INIT_VAR(_2);		ZVAL_LONG(_2, 0);		ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 9, _1, _2);		zephir_check_temp_parameter(_1);		zephir_check_call_status();		zephir_throw_exception_debug(_0, "phalcon/mvc/dispatcher.zep", 120 TSRMLS_CC);		ZEPHIR_MM_RESTORE();		return;	}	ZEPHIR_INIT_NVAR(_0);	ZVAL_STRING(_0, "response", ZEPHIR_TEMP_PARAM_COPY);	ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _0);	zephir_check_temp_parameter(_0);	zephir_check_call_status();	ZEPHIR_CPY_WRT(response, _3);	ZEPHIR_INIT_NVAR(_0);	ZVAL_LONG(_0, 404);	ZEPHIR_INIT_NVAR(_1);	ZVAL_STRING(_1, "Not Found", ZEPHIR_TEMP_PARAM_COPY);	ZEPHIR_CALL_METHOD(NULL, response, "setstatuscode", NULL, 0, _0, _1);	zephir_check_temp_parameter(_1);	zephir_check_call_status();	ZEPHIR_INIT_VAR(exception);	object_init_ex(exception, phalcon_mvc_dispatcher_exception_ce);	ZEPHIR_INIT_NVAR(_0);	ZVAL_LONG(_0, exceptionCode);	ZEPHIR_CALL_METHOD(NULL, exception, "__construct", NULL, 9, message, _0);	zephir_check_call_status();	ZEPHIR_CALL_METHOD(&_3, this_ptr, "_handleexception", NULL, 0, exception);	zephir_check_call_status();	if (ZEPHIR_IS_FALSE_IDENTICAL(_3)) {		RETURN_MM_BOOL(0);	}	zephir_throw_exception_debug(exception, "phalcon/mvc/dispatcher.zep", 142 TSRMLS_CC);	ZEPHIR_MM_RESTORE();	return;}
开发者ID:brainformatik,项目名称:cphalcon,代码行数:75,


示例17: PHP_METHOD

/** * Phalcon/Session/Adapter/Redis constructor */PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct) {	zephir_fcall_cache_entry *_13 = NULL;	int ZEPHIR_LAST_CALL_STATUS;	zval *options_param = NULL, *lifetime = NULL, *_2, *_3, *_5, *_7 = NULL, *_0$$3, *_1$$4;	zval *options = NULL, *_4, *_6, *_8, *_9, *_10, *_11, *_12;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &options_param);	if (!options_param) {		ZEPHIR_INIT_VAR(options);		array_init(options);	} else {		zephir_get_arrval(options, options_param);	}	if (!(zephir_array_isset_string(options, SS("host")))) {		ZEPHIR_INIT_VAR(_0$$3);		ZVAL_STRING(_0$$3, "127.0.0.1", 1);		zephir_array_update_string(&options, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("port")))) {		ZEPHIR_INIT_VAR(_1$$4);		ZVAL_LONG(_1$$4, 6379);		zephir_array_update_string(&options, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("persistent")))) {		zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE);	}	ZEPHIR_OBS_VAR(lifetime);	if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC)) {		zephir_update_property_this(this_ptr, SL("_lifetime"), lifetime TSRMLS_CC);	}	ZEPHIR_INIT_VAR(_2);	object_init_ex(_2, phalcon_cache_backend_redis_ce);	ZEPHIR_INIT_VAR(_3);	object_init_ex(_3, phalcon_cache_frontend_none_ce);	if (zephir_has_constructor(_3 TSRMLS_CC)) {		ZEPHIR_INIT_VAR(_4);		zephir_create_array(_4, 1, 0 TSRMLS_CC);		ZEPHIR_OBS_VAR(_5);		zephir_read_property_this(&_5, this_ptr, SL("_lifetime"), PH_NOISY_CC);		zephir_array_update_string(&_4, SL("lifetime"), &_5, PH_COPY | PH_SEPARATE);		ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 0, _4);		zephir_check_call_status();	}	ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 336, _3, options);	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_redis"), _2 TSRMLS_CC);	ZEPHIR_INIT_VAR(_6);	zephir_create_array(_6, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_6, this_ptr);	ZEPHIR_INIT_VAR(_7);	ZVAL_STRING(_7, "open", 1);	zephir_array_fast_append(_6, _7);	ZEPHIR_INIT_VAR(_8);	zephir_create_array(_8, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_8, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "close", 1);	zephir_array_fast_append(_8, _7);	ZEPHIR_INIT_VAR(_9);	zephir_create_array(_9, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_9, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "read", 1);	zephir_array_fast_append(_9, _7);	ZEPHIR_INIT_VAR(_10);	zephir_create_array(_10, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_10, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "write", 1);	zephir_array_fast_append(_10, _7);	ZEPHIR_INIT_VAR(_11);	zephir_create_array(_11, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_11, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "destroy", 1);	zephir_array_fast_append(_11, _7);	ZEPHIR_INIT_VAR(_12);	zephir_create_array(_12, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_12, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "gc", 1);	zephir_array_fast_append(_12, _7);	ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 436, _6, _8, _9, _10, _11, _12);	zephir_check_call_status();	ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_redis_ce, this_ptr, "__construct", &_13, 437, options);	zephir_check_call_status();	ZEPHIR_MM_RESTORE();}
开发者ID:bschantz,项目名称:cphalcon,代码行数:97,


示例18: PHP_METHOD

/** * Stores cached content into the file backend and stops the frontend * * @param int|string keyName * @param string content * @param long lifetime * @param boolean stopBuffer */PHP_METHOD(Phalcon_Cache_Backend_Memcache, save) {    int ZEPHIR_LAST_CALL_STATUS;    zend_bool stopBuffer;    zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *memcache = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp = NULL, *ttl = NULL, *success = NULL, *options = NULL, *specialKey = NULL, *keys = NULL, *isBuffering = NULL, *_0$$4, *_1$$13, *_2$$14;    ZEPHIR_MM_GROW();    zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param);    if (!keyName) {        keyName = ZEPHIR_GLOBAL(global_null);    }    if (!content) {        content = ZEPHIR_GLOBAL(global_null);    }    if (!lifetime) {        lifetime = ZEPHIR_GLOBAL(global_null);    }    if (!stopBuffer_param) {        stopBuffer = 1;    } else {        stopBuffer = zephir_get_boolval(stopBuffer_param);    }    if (Z_TYPE_P(keyName) == IS_NULL) {        ZEPHIR_OBS_VAR(lastKey);        zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC);    } else {        _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC);        ZEPHIR_INIT_NVAR(lastKey);        ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName);    }    if (!(zephir_is_true(lastKey))) {        ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/memcache.zep", 189);        return;    }    ZEPHIR_OBS_VAR(frontend);    zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC);    ZEPHIR_OBS_VAR(memcache);    zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC);    if (Z_TYPE_P(memcache) != IS_OBJECT) {        ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0);        zephir_check_call_status();        ZEPHIR_OBS_NVAR(memcache);        zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC);    }    if (Z_TYPE_P(content) == IS_NULL) {        ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0);        zephir_check_call_status();    } else {        ZEPHIR_CPY_WRT(cachedContent, content);    }    ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent);    zephir_check_call_status();    if (Z_TYPE_P(lifetime) == IS_NULL) {        ZEPHIR_OBS_VAR(tmp);        zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC);        if (!(zephir_is_true(tmp))) {            ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0);            zephir_check_call_status();        } else {            ZEPHIR_CPY_WRT(ttl, tmp);        }    } else {        ZEPHIR_CPY_WRT(ttl, lifetime);    }    if (zephir_is_numeric(cachedContent)) {        ZEPHIR_INIT_VAR(_1$$13);        ZVAL_LONG(_1$$13, 0);        ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, cachedContent, _1$$13, ttl);        zephir_check_call_status();    } else {        ZEPHIR_INIT_VAR(_2$$14);        ZVAL_LONG(_2$$14, 0);        ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, preparedContent, _2$$14, ttl);        zephir_check_call_status();    }    if (!(zephir_is_true(success))) {        ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in memcached", "phalcon/cache/backend/memcache.zep", 236);        return;    }    ZEPHIR_OBS_VAR(options);    zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);    ZEPHIR_OBS_VAR(specialKey);    if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) {        ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 242);        return;    }    if (!ZEPHIR_IS_STRING(specialKey, "")) {        ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey);        zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:michanismus,项目名称:cphalcon,代码行数:101,


示例19: PHP_METHOD

/** * Phalcon/Session/Adapter/Libmemcached constructor * * @throws /Phalcon/Session/Exception */PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct) {	zephir_fcall_cache_entry *_13 = NULL;	int ZEPHIR_LAST_CALL_STATUS;	zval *options_param = NULL, *servers = NULL, *client = NULL, *lifetime = NULL, *prefix = NULL, *statsKey = NULL, *_0 = NULL, *_1 = NULL, *_2, *_4, *_7 = NULL;	zval *options = NULL, *_3, *_5, *_6, *_8, *_9, *_10, *_11, *_12;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &options_param);	zephir_get_arrval(options, options_param);	ZEPHIR_OBS_VAR(servers);	if (!(zephir_array_isset_string_fetch(&servers, options, SS("servers"), 0 TSRMLS_CC))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "No servers given in options", "phalcon/session/adapter/libmemcached.zep", 71);		return;	}	ZEPHIR_OBS_VAR(client);	if (!(zephir_array_isset_string_fetch(&client, options, SS("client"), 0 TSRMLS_CC))) {		ZEPHIR_INIT_NVAR(client);		ZVAL_NULL(client);	}	ZEPHIR_OBS_VAR(lifetime);	if (!(zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC))) {		ZEPHIR_INIT_NVAR(lifetime);		ZVAL_LONG(lifetime, 8600);	}	ZEPHIR_INIT_VAR(_0);	ZVAL_LONG(_0, 2592000);	ZEPHIR_CALL_FUNCTION(&_1, "min", NULL, 405, lifetime, _0);	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_lifetime"), _1 TSRMLS_CC);	ZEPHIR_OBS_VAR(prefix);	if (!(zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC))) {		ZEPHIR_INIT_NVAR(prefix);		ZVAL_NULL(prefix);	}	ZEPHIR_OBS_VAR(statsKey);	if (!(zephir_array_isset_string_fetch(&statsKey, options, SS("statsKey"), 0 TSRMLS_CC))) {		ZEPHIR_INIT_NVAR(statsKey);		ZVAL_NULL(statsKey);	}	ZEPHIR_INIT_NVAR(_0);	object_init_ex(_0, phalcon_cache_backend_libmemcached_ce);	ZEPHIR_INIT_VAR(_2);	object_init_ex(_2, phalcon_cache_frontend_data_ce);	ZEPHIR_INIT_VAR(_3);	zephir_create_array(_3, 1, 0 TSRMLS_CC);	ZEPHIR_OBS_VAR(_4);	zephir_read_property_this(&_4, this_ptr, SL("_lifetime"), PH_NOISY_CC);	zephir_array_update_string(&_3, SL("lifetime"), &_4, PH_COPY | PH_SEPARATE);	ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 309, _3);	zephir_check_call_status();	ZEPHIR_INIT_VAR(_5);	zephir_create_array(_5, 4, 0 TSRMLS_CC);	zephir_array_update_string(&_5, SL("servers"), &servers, PH_COPY | PH_SEPARATE);	zephir_array_update_string(&_5, SL("client"), &client, PH_COPY | PH_SEPARATE);	zephir_array_update_string(&_5, SL("prefix"), &prefix, PH_COPY | PH_SEPARATE);	zephir_array_update_string(&_5, SL("statsKey"), &statsKey, PH_COPY | PH_SEPARATE);	ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 310, _2, _5);	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_libmemcached"), _0 TSRMLS_CC);	ZEPHIR_INIT_VAR(_6);	zephir_create_array(_6, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_6, this_ptr);	ZEPHIR_INIT_VAR(_7);	ZVAL_STRING(_7, "open", 1);	zephir_array_fast_append(_6, _7);	ZEPHIR_INIT_VAR(_8);	zephir_create_array(_8, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_8, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "close", 1);	zephir_array_fast_append(_8, _7);	ZEPHIR_INIT_VAR(_9);	zephir_create_array(_9, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_9, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "read", 1);	zephir_array_fast_append(_9, _7);	ZEPHIR_INIT_VAR(_10);	zephir_create_array(_10, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_10, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "write", 1);	zephir_array_fast_append(_10, _7);	ZEPHIR_INIT_VAR(_11);	zephir_create_array(_11, 2, 0 TSRMLS_CC);	zephir_array_fast_append(_11, this_ptr);	ZEPHIR_INIT_NVAR(_7);	ZVAL_STRING(_7, "destroy", 1);	zephir_array_fast_append(_11, _7);	ZEPHIR_INIT_VAR(_12);	zephir_create_array(_12, 2, 0 TSRMLS_CC);//.........这里部分代码省略.........
开发者ID:Dmitry-Kucher,项目名称:cphalcon,代码行数:101,


示例20: PHP_METHOD

/** * Encrypts a text * *<code> *	$encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password"); *</code> */PHP_METHOD(Phalcon_Crypt, encrypt) {	zend_bool _4, _5;	zephir_nts_static zephir_fcall_cache_entry *_2 = NULL, *_6 = NULL;	int ZEPHIR_LAST_CALL_STATUS, _3;	zval *text_param = NULL, *key_param = NULL, *encryptKey = NULL, *ivSize = NULL, *iv = NULL, *cipher, *mode, *blockSize = NULL, *paddingType, *padded = NULL, _0, *_1 = NULL;	zval *text = NULL, *key = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &text_param, &key_param);	if (unlikely(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(text_param) == IS_STRING)) {		zephir_get_strval(text, text_param);	} else {		ZEPHIR_INIT_VAR(text);		ZVAL_EMPTY_STRING(text);	}	if (!key_param) {		ZEPHIR_INIT_VAR(key);		ZVAL_EMPTY_STRING(key);	} else {	if (unlikely(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(key_param) == IS_STRING)) {		zephir_get_strval(key, key_param);	} else {		ZEPHIR_INIT_VAR(key);		ZVAL_EMPTY_STRING(key);	}	}	if (!((zephir_function_exists_ex(SS("mcrypt_get_iv_size") TSRMLS_CC) == SUCCESS))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "mcrypt extension is required", "phalcon/crypt.zep", 306);		return;	}	if (ZEPHIR_IS_STRING_IDENTICAL(key, "")) {		ZEPHIR_OBS_VAR(encryptKey);		zephir_read_property_this(&encryptKey, this_ptr, SL("_key"), PH_NOISY_CC);	} else {		ZEPHIR_CPY_WRT(encryptKey, key);	}	if (ZEPHIR_IS_EMPTY(encryptKey)) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Encryption key cannot be empty", "phalcon/crypt.zep", 316);		return;	}	ZEPHIR_OBS_VAR(cipher);	zephir_read_property_this(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC);	ZEPHIR_OBS_VAR(mode);	zephir_read_property_this(&mode, this_ptr, SL("_mode"), PH_NOISY_CC);	ZEPHIR_CALL_FUNCTION(&ivSize, "mcrypt_get_iv_size", NULL, cipher, mode);	zephir_check_call_status();	if (ZEPHIR_LT_LONG(ivSize, zephir_fast_strlen_ev(encryptKey))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Size of key is too large for this algorithm", "phalcon/crypt.zep", 324);		return;	}	ZEPHIR_SINIT_VAR(_0);	ZVAL_LONG(&_0, 2);	ZEPHIR_CALL_FUNCTION(&iv, "mcrypt_create_iv", NULL, ivSize, &_0);	zephir_check_call_status();	if (Z_TYPE_P(iv) != IS_STRING) {		ZEPHIR_CALL_FUNCTION(&_1, "strval", &_2, iv);		zephir_check_call_status();		ZEPHIR_CPY_WRT(iv, _1);	}	ZEPHIR_CALL_FUNCTION(&blockSize, "mcrypt_get_block_size", NULL, cipher, mode);	zephir_check_call_status();	if (Z_TYPE_P(blockSize) != IS_LONG) {		_3 = zephir_get_intval(blockSize);		ZEPHIR_INIT_NVAR(blockSize);		ZVAL_LONG(blockSize, _3);	}	ZEPHIR_OBS_VAR(paddingType);	zephir_read_property_this(&paddingType, this_ptr, SL("_padding"), PH_NOISY_CC);	_4 = !ZEPHIR_IS_LONG(paddingType, 0);	if (_4) {		_5 = ZEPHIR_IS_STRING(mode, "cbc");		if (!(_5)) {			_5 = ZEPHIR_IS_STRING(mode, "ecb");		}		_4 = _5;	}	if (_4) {		ZEPHIR_CALL_METHOD(&padded, this_ptr, "_cryptpadtext", &_6, text, mode, blockSize, paddingType);		zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:101,


示例21: PHP_METHOD

/** * Returns current row in the resultset */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) {	zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL;	HashTable *_2, *_5;	HashPosition _1, _4;	int dirtyState, ZEPHIR_LAST_CALL_STATUS;	zval *row, *hydrateMode, *alias = NULL, *activeRow = NULL, *type = NULL, *columnTypes, *column = NULL, *columnValue = NULL, *value = NULL, *attribute = NULL, *source = NULL, *attributes = NULL, *columnMap = NULL, *rowModel = NULL, *keepSnapshots = NULL, *sqlAlias = NULL, *_0, **_3, **_6, *_7 = NULL, *_9, *_10 = NULL, _12 = zval_used_for_init, _13 = zval_used_for_init;	ZEPHIR_MM_GROW();	ZEPHIR_OBS_VAR(activeRow);	zephir_read_property_this(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC);	if (Z_TYPE_P(activeRow) != IS_NULL) {		RETURN_CCTOR(activeRow);	}	ZEPHIR_OBS_VAR(row);	zephir_read_property_this(&row, this_ptr, SL("_row"), PH_NOISY_CC);	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_disableHydration"), PH_NOISY_CC);	if (zephir_is_true(_0)) {		zephir_update_property_this(this_ptr, SL("_activeRow"), row TSRMLS_CC);		RETURN_CCTOR(row);	}	if (Z_TYPE_P(row) != IS_ARRAY) {		zephir_update_property_this(this_ptr, SL("_activeRow"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);		RETURN_MM_BOOL(0);	}	ZEPHIR_OBS_VAR(hydrateMode);	zephir_read_property_this(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC);	do {		if (ZEPHIR_IS_LONG(hydrateMode, 0)) {			ZEPHIR_INIT_NVAR(activeRow);			object_init_ex(activeRow, phalcon_mvc_model_row_ce);			if (zephir_has_constructor(activeRow TSRMLS_CC)) {				ZEPHIR_CALL_METHOD(NULL, activeRow, "__construct", NULL, 0);				zephir_check_call_status();			}			break;		}		if (ZEPHIR_IS_LONG(hydrateMode, 1)) {			ZEPHIR_INIT_NVAR(activeRow);			array_init(activeRow);			break;		}		ZEPHIR_INIT_NVAR(activeRow);		object_init(activeRow);		break;	} while(0);	ZEPHIR_OBS_VAR(columnTypes);	zephir_read_property_this(&columnTypes, this_ptr, SL("_columnTypes"), PH_NOISY_CC);	dirtyState = 0;	zephir_is_iterable(columnTypes, &_2, &_1, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 235);	for (	  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS	  ; zephir_hash_move_forward_ex(_2, &_1)	) {		ZEPHIR_GET_HMKEY(alias, _2, _1);		ZEPHIR_GET_HVALUE(column, _3);		if (Z_TYPE_P(column) != IS_ARRAY) {			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/mvc/model/resultset/complex.zep", 136);			return;		}		ZEPHIR_OBS_NVAR(type);		zephir_array_fetch_string(&type, column, SL("type"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 139 TSRMLS_CC);		if (ZEPHIR_IS_STRING(type, "object")) {			ZEPHIR_OBS_NVAR(source);			zephir_array_fetch_string(&source, column, SL("column"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 145 TSRMLS_CC);			ZEPHIR_OBS_NVAR(attributes);			zephir_array_fetch_string(&attributes, column, SL("attributes"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 146 TSRMLS_CC);			ZEPHIR_OBS_NVAR(columnMap);			zephir_array_fetch_string(&columnMap, column, SL("columnMap"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 147 TSRMLS_CC);			ZEPHIR_INIT_NVAR(rowModel);			array_init(rowModel);			zephir_is_iterable(attributes, &_5, &_4, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 165);			for (			  ; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS			  ; zephir_hash_move_forward_ex(_5, &_4)			) {				ZEPHIR_GET_HVALUE(attribute, _6);				ZEPHIR_OBS_NVAR(columnValue);				ZEPHIR_INIT_LNVAR(_7);				ZEPHIR_CONCAT_SVSV(_7, "_", source, "_", attribute);				zephir_array_fetch(&columnValue, row, _7, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 158 TSRMLS_CC);				zephir_array_update_zval(&rowModel, attribute, &columnValue, PH_COPY | PH_SEPARATE);			}			do {				if (ZEPHIR_IS_LONG(hydrateMode, 0)) {					ZEPHIR_OBS_NVAR(keepSnapshots);					if (!(zephir_array_isset_string_fetch(&keepSnapshots, column, SS("keepSnapshots"), 0 TSRMLS_CC))) {						ZEPHIR_INIT_NVAR(keepSnapshots);						ZVAL_BOOL(keepSnapshots, 0);					}					zephir_array_fetch_string(&_9, column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 180 TSRMLS_CC);					ZEPHIR_INIT_NVAR(_10);					ZVAL_LONG(_10, dirtyState);					ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_8, 0, _9, rowModel, columnMap, _10, keepSnapshots);					zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:101,


示例22: PHP_METHOD

/** * Handles routing information received from the rewrite engine * *<code> * //Read the info from the rewrite engine * $router->handle(); * * //Manually passing an URL * $router->handle('/posts/edit/1'); *</code> * * @param string uri */PHP_METHOD(Test_Router, handle) {	zephir_nts_static zephir_fcall_cache_entry *_12 = NULL;	HashTable *_2, *_9;	HashPosition _1, _8;	int ZEPHIR_LAST_CALL_STATUS;	zval *uri = NULL, *realUri = NULL, *request = NULL, *currentHostName = NULL, *routeFound = NULL, *parts = NULL, *params, *matches, *notFoundPaths, *vnamespace, *module, *controller, *action, *paramsStr, *strParams = NULL, *paramsMerge = NULL, *route = NULL, *methods = NULL, *dependencyInjector = NULL, *hostname = NULL, *regexHostName = NULL, *matched = NULL, *pattern = NULL, *handledUri = NULL, *beforeMatch = NULL, *paths = NULL, *converters = NULL, *part = NULL, *position = NULL, *matchPosition = NULL, *_0, **_3, *_4, *_5 = NULL, *_6 = NULL, *_7 = NULL, **_10, _11, *_13, *_14, *_15, *_16;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &uri);	if (!uri) {		uri = ZEPHIR_GLOBAL(global_null);	}	if (!(zephir_is_true(uri))) {		ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri",  NULL);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(realUri, uri);	}	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_removeExtraSlashes"), PH_NOISY_CC);	if (zephir_is_true(_0)) {		ZEPHIR_CALL_METHOD(&handledUri, this_ptr, "doremoveextraslashes", NULL, realUri);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(handledUri, realUri);	}	ZEPHIR_INIT_VAR(request);	ZVAL_NULL(request);	ZEPHIR_INIT_VAR(currentHostName);	ZVAL_NULL(currentHostName);	ZEPHIR_INIT_VAR(routeFound);	ZVAL_BOOL(routeFound, 0);	ZEPHIR_INIT_VAR(parts);	array_init(parts);	ZEPHIR_INIT_VAR(params);	array_init(params);	ZEPHIR_INIT_VAR(matches);	ZVAL_NULL(matches);	zephir_update_property_this(this_ptr, SL("_wasMatched"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_matchedRoute"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC);	_0 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC);	zephir_is_iterable(_0, &_2, &_1, 0, 1);	for (	  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS	  ; zephir_hash_move_backwards_ex(_2, &_1)	) {		ZEPHIR_GET_HVALUE(route, _3);		ZEPHIR_CALL_METHOD(&methods, route, "gethttpmethods",  NULL);		zephir_check_call_status();		if (Z_TYPE_P(methods) != IS_NULL) {			if (Z_TYPE_P(request) == IS_NULL) {				_4 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);				ZEPHIR_CPY_WRT(dependencyInjector, _4);				if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {					ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "A dependency injection container is required to access the 'request' service");					return;				}				ZEPHIR_INIT_NVAR(_5);				ZVAL_STRING(_5, "request", 0);				ZEPHIR_CALL_METHOD(&request, dependencyInjector, "getshared", NULL, _5);				zephir_check_temp_parameter(_5);				zephir_check_call_status();			}			ZEPHIR_CALL_METHOD(&_6, request, "ismethod", NULL, methods);			zephir_check_call_status();			if (ZEPHIR_IS_FALSE(_6)) {				continue;			}		}		ZEPHIR_CALL_METHOD(&hostname, route, "gethostname",  NULL);		zephir_check_call_status();		if (Z_TYPE_P(hostname) != IS_NULL) {			if (Z_TYPE_P(request) == IS_NULL) {				ZEPHIR_OBS_NVAR(dependencyInjector);				zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);				if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) {					ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "A dependency injection container is required to access the 'request' service");					return;				}				ZEPHIR_INIT_NVAR(_5);				ZVAL_STRING(_5, "request", 0);				ZEPHIR_CALL_METHOD(&request, dependencyInjector, "getshared", NULL, _5);				zephir_check_temp_parameter(_5);				zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:101,



注:本文中的zephir_read_property_this函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ zephir_throw_exception_debug函数代码示例
C++ zephir_read_property函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。