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

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

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

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

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

示例1: PHP_METHOD

/** * Gets number of rows returned by a resultset * *<code> *	$result = $connection->query("SELECT * FROM robots ORDER BY name"); *	echo 'There are ', $result->numRows(), ' rows in the resultset'; *</code> */PHP_METHOD(Phalcon_Db_Result_Pdo, numRows) {	zend_bool _0;	int ZEPHIR_LAST_CALL_STATUS;	zval *sqlStatement, *rowCount = NULL, *connection, *type = NULL, *pdoStatement, *matches, *result = NULL, *row = NULL, *_1, _2, *_3, *_4, *_5, *_6;	ZEPHIR_MM_GROW();	ZEPHIR_OBS_VAR(rowCount);	zephir_read_property_this(&rowCount, this_ptr, SL("_rowCount"), PH_NOISY_CC);	if (ZEPHIR_IS_FALSE_IDENTICAL(rowCount)) {		ZEPHIR_OBS_VAR(connection);		zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC);		ZEPHIR_CALL_METHOD(&type, connection, "gettype", NULL, 0);		zephir_check_call_status();		_0 = ZEPHIR_IS_STRING(type, "mysql");		if (!(_0)) {			_0 = ZEPHIR_IS_STRING(type, "pgsql");		}		if (_0) {			ZEPHIR_OBS_VAR(pdoStatement);			zephir_read_property_this(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC);			ZEPHIR_CALL_METHOD(&rowCount, pdoStatement, "rowcount", NULL, 0);			zephir_check_call_status();		}		if (ZEPHIR_IS_FALSE_IDENTICAL(rowCount)) {			ZEPHIR_OBS_VAR(sqlStatement);			zephir_read_property_this(&sqlStatement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC);			if (!(zephir_start_with_str(sqlStatement, SL("SELECT COUNT(*) ")))) {				ZEPHIR_INIT_VAR(matches);				ZVAL_NULL(matches);				ZEPHIR_INIT_VAR(_1);				ZEPHIR_SINIT_VAR(_2);				ZVAL_STRING(&_2, "/^SELECT//s+(.*)/i", 0);				zephir_preg_match(_1, &_2, sqlStatement, matches, 0, 0 , 0  TSRMLS_CC);				if (zephir_is_true(_1)) {					zephir_array_fetch_long(&_3, matches, 1, PH_NOISY | PH_READONLY, "phalcon/db/result/pdo.zep", 213 TSRMLS_CC);					ZEPHIR_INIT_VAR(_4);					ZEPHIR_CONCAT_SVS(_4, "SELECT COUNT(*) /"numrows/" FROM (SELECT ", _3, ")");					_5 = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC);					_6 = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC);					ZEPHIR_CALL_METHOD(&result, connection, "query", NULL, 0, _4, _5, _6);					zephir_check_call_status();					ZEPHIR_CALL_METHOD(&row, result, "fetch", NULL, 0);					zephir_check_call_status();					ZEPHIR_OBS_NVAR(rowCount);					zephir_array_fetch_string(&rowCount, row, SL("numrows"), PH_NOISY, "phalcon/db/result/pdo.zep", 215 TSRMLS_CC);				}			} else {				ZEPHIR_INIT_NVAR(rowCount);				ZVAL_LONG(rowCount, 1);			}		}		zephir_update_property_this(this_ptr, SL("_rowCount"), rowCount TSRMLS_CC);	}	RETURN_CCTOR(rowCount);}
开发者ID:brainformatik,项目名称:cphalcon,代码行数:66,


示例2: PHP_METHOD

/** * Unserializing a resultset will allow to only works on the rows present in the saved state */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) {	int ZEPHIR_LAST_CALL_STATUS;	zephir_nts_static zephir_fcall_cache_entry *_1 = NULL;	zval *data_param = NULL, *resultset = NULL, *_0, *_2, *_3, *_4, *_5, *_6;	zval *data = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &data_param);	if (unlikely(Z_TYPE_P(data_param) != IS_STRING && Z_TYPE_P(data_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'data' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(data_param) == IS_STRING)) {		zephir_get_strval(data, data_param);	} else {		ZEPHIR_INIT_VAR(data);		ZVAL_EMPTY_STRING(data);	}	ZEPHIR_INIT_ZVAL_NREF(_0);	ZVAL_LONG(_0, 0);	zephir_update_property_this(this_ptr, SL("_type"), _0 TSRMLS_CC);	ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", &_1, data);	zephir_check_call_status();	if (Z_TYPE_P(resultset) != IS_ARRAY) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/mvc/model/resultset/simple.zep", 302);		return;	}	zephir_array_fetch_string(&_2, resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 305 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_model"), _2 TSRMLS_CC);	zephir_array_fetch_string(&_3, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 306 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_rows"), _3 TSRMLS_CC);	zephir_array_fetch_string(&_4, resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 307 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_cache"), _4 TSRMLS_CC);	zephir_array_fetch_string(&_5, resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 308 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_columnMap"), _5 TSRMLS_CC);	zephir_array_fetch_string(&_6, resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 309 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_hydrateMode"), _6 TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:KKrushnabate,项目名称:cphalcon,代码行数:48,


示例3: PHP_METHOD

PHP_METHOD(Test_NativeArray, testArrayAccess6) {	zval *a, b, *_0, *_1;	ZEPHIR_MM_GROW();	ZEPHIR_INIT_VAR(a);	array_init_size(a, 5);	add_assoc_long_ex(a, SS("a"), 1);	add_assoc_long_ex(a, SS("b"), 2);	add_assoc_long_ex(a, SS("c"), 3);	zephir_array_fetch_string(&_0, a, SL("a"), PH_NOISY | PH_READONLY TSRMLS_CC);	zephir_array_fetch_string(&_1, a, SL("b"), PH_NOISY | PH_READONLY TSRMLS_CC);	ZEPHIR_SINIT_VAR(b);	zephir_add_function(&b, _0, _1 TSRMLS_CC);	RETURN_LCTOR(b);}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:18,


示例4: PHP_METHOD

/** * Unserializing a resultset will allow to only works on the rows present in the saved state */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) {	int ZEPHIR_LAST_CALL_STATUS;	zval *data_param = NULL, *resultset = NULL, *_0, *_1, *_2, *_3, *_4, *_5;	zval *data = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &data_param);	if (unlikely(Z_TYPE_P(data_param) != IS_STRING && Z_TYPE_P(data_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'data' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(data_param) == IS_STRING)) {		zephir_get_strval(data, data_param);	} else {		ZEPHIR_INIT_VAR(data);		ZVAL_EMPTY_STRING(data);	}	zephir_update_property_this(this_ptr, SL("_disableHydration"), (1) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);	ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 10, data);	zephir_check_call_status();	if (Z_TYPE_P(resultset) != IS_ARRAY) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/mvc/model/resultset/complex.zep", 293);		return;	}	zephir_array_fetch_string(&_0, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 296 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_rows"), _0 TSRMLS_CC);	zephir_array_fetch_string(&_1, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 297 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_2);	ZVAL_LONG(_2, zephir_fast_count_int(_1 TSRMLS_CC));	zephir_update_property_this(this_ptr, SL("_count"), _2 TSRMLS_CC);	zephir_array_fetch_string(&_3, resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 298 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_cache"), _3 TSRMLS_CC);	zephir_array_fetch_string(&_4, resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 299 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_columnTypes"), _4 TSRMLS_CC);	zephir_array_fetch_string(&_5, resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 300 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_hydrateMode"), _5 TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:47,


示例5: PHP_METHOD

PHP_METHOD(OAuth2_GrantType_JwtBearer, getUserId) {	zval *_0, *_1;	_0 = zephir_fetch_nproperty_this(this_ptr, SL("jwt"), PH_NOISY_CC);	zephir_array_fetch_string(&_1, _0, SL("sub"), PH_NOISY | PH_READONLY, "oauth2/granttype/jwtbearer.zep", 185 TSRMLS_CC);	RETURN_CTORW(_1);}
开发者ID:noikiy,项目名称:php-oauth2-server,代码行数:10,


示例6: PHP_METHOD

/** * Phalcon/Annotations/Annotation constructor * * @param array reflectionData */PHP_METHOD(Phalcon_Annotations_Annotation, __construct) {	zephir_fcall_cache_entry *_5 = NULL;	int ZEPHIR_LAST_CALL_STATUS;	HashTable *_2;	HashPosition _1;	zval *reflectionData_param = NULL, *name, *exprArguments, *argument = NULL, *resolvedArgument = NULL, *arguments, *_0, **_3, *_4;	zval *reflectionData = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &reflectionData_param);	reflectionData = reflectionData_param;	zephir_array_fetch_string(&_0, reflectionData, SL("name"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 60 TSRMLS_CC);	zephir_update_property_this(this_ptr, SL("_name"), _0 TSRMLS_CC);	ZEPHIR_OBS_VAR(exprArguments);	if (zephir_array_isset_string_fetch(&exprArguments, reflectionData, SS("arguments"), 0 TSRMLS_CC)) {		ZEPHIR_INIT_VAR(arguments);		array_init(arguments);		zephir_is_iterable(exprArguments, &_2, &_1, 0, 0, "phalcon/annotations/annotation.zep", 75);		for (		  ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS		  ; zephir_hash_move_forward_ex(_2, &_1)		) {			ZEPHIR_GET_HVALUE(argument, _3);			zephir_array_fetch_string(&_4, argument, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 68 TSRMLS_CC);			ZEPHIR_CALL_METHOD(&resolvedArgument, this_ptr, "getexpression", &_5, _4);			zephir_check_call_status();			if (zephir_array_isset_string_fetch(&name, argument, SS("name"), 1 TSRMLS_CC)) {				zephir_array_update_zval(&arguments, name, &resolvedArgument, PH_COPY | PH_SEPARATE);			} else {				zephir_array_append(&arguments, resolvedArgument, PH_SEPARATE, "phalcon/annotations/annotation.zep", 72);			}		}		zephir_update_property_this(this_ptr, SL("_arguments"), arguments TSRMLS_CC);		zephir_update_property_this(this_ptr, SL("_exprArguments"), exprArguments TSRMLS_CC);	}	ZEPHIR_MM_RESTORE();}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:48,


示例7: PHP_METHOD

/** * @return boolean  TRUE if the grant type requires a redirect_uri, FALSE if not */PHP_METHOD(OAuth2_ResponseType_AuthorizationCode, enforceRedirect) {	zval *_0, *_1;	_0 = zephir_fetch_nproperty_this(this_ptr, SL("config"), PH_NOISY_CC);	zephir_array_fetch_string(&_1, _0, SL("enforce_redirect"), PH_NOISY | PH_READONLY, "oauth2/responsetype/authorizationcode.zep", 74 TSRMLS_CC);	RETURN_CTORW(_1);}
开发者ID:noikiy,项目名称:php-oauth2-server,代码行数:13,


示例8: PHP_METHOD

/** * Validator for constructor */PHP_METHOD(Phalcon_Translate_Adapter_Gettext, prepareOptions) {	int ZEPHIR_LAST_CALL_STATUS;	zval *options_param = NULL, *_0, *_1 = NULL, *_2, *_3, *_4, *_5, *_6;	zval *options = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &options_param);	options = options_param;	if (!(zephir_array_isset_string(options, SS("locale")))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter /"locale/" is required", "phalcon/translate/adapter/gettext.zep", 227);		return;	}	if (!(zephir_array_isset_string(options, SS("directory")))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_translate_exception_ce, "Parameter /"directory/" is required", "phalcon/translate/adapter/gettext.zep", 231);		return;	}	ZEPHIR_INIT_VAR(_0);	ZEPHIR_CALL_METHOD(&_1, this_ptr, "getoptionsdefault", NULL, 0);	zephir_check_call_status();	zephir_fast_array_merge(_0, &(_1), &(options) TSRMLS_CC);	ZEPHIR_CPY_WRT(options, _0);	zephir_array_fetch_string(&_2, options, SL("category"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/gettext.zep", 236 TSRMLS_CC);	zephir_array_fetch_string(&_3, options, SL("locale"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/gettext.zep", 236 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlocale", NULL, 0, _2, _3);	zephir_check_call_status();	zephir_array_fetch_string(&_4, options, SL("defaultDomain"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/gettext.zep", 237 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdefaultdomain", NULL, 0, _4);	zephir_check_call_status();	zephir_array_fetch_string(&_5, options, SL("directory"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/gettext.zep", 238 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdirectory", NULL, 0, _5);	zephir_check_call_status();	zephir_array_fetch_string(&_6, options, SL("defaultDomain"), PH_NOISY | PH_READONLY, "phalcon/translate/adapter/gettext.zep", 239 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdomain", NULL, 0, _6);	zephir_check_call_status();	ZEPHIR_MM_RESTORE();}
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:45,


示例9: PHP_METHOD

/** * Reads a packet from the socket. Prior to reading from the socket will * check for availability of the connection. */PHP_METHOD(Phalcon_Queue_Beanstalk, read) {	zephir_fcall_cache_entry *_1 = NULL;	zval *length_param = NULL, *connection = NULL, *data = NULL, _4, _5, _0$$5 = zval_used_for_init, *_2$$5 = NULL, *_3$$5;	int length, ZEPHIR_LAST_CALL_STATUS;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 0, 1, &length_param);	if (!length_param) {		length = 0;	} else {		length = zephir_get_intval(length_param);	}	ZEPHIR_OBS_VAR(connection);	zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC);	if (Z_TYPE_P(connection) != IS_RESOURCE) {		ZEPHIR_CALL_METHOD(&connection, this_ptr, "connect", NULL, 0);		zephir_check_call_status();		if (Z_TYPE_P(connection) != IS_RESOURCE) {			RETURN_MM_BOOL(0);		}	}	if (length) {		if (zephir_feof(connection TSRMLS_CC)) {			RETURN_MM_BOOL(0);		}		ZEPHIR_SINIT_VAR(_0$$5);		ZVAL_LONG(&_0$$5, (length + 2));		ZEPHIR_CALL_FUNCTION(&data, "stream_get_line", &_1, 386, connection, &_0$$5);		zephir_check_call_status();		ZEPHIR_CALL_FUNCTION(&_2$$5, "stream_get_meta_data", NULL, 387, connection);		zephir_check_call_status();		zephir_array_fetch_string(&_3$$5, _2$$5, SL("timed_out"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 373 TSRMLS_CC);		if (zephir_is_true(_3$$5)) {			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "Connection timed out", "phalcon/queue/beanstalk.zep", 374);			return;		}		ZEPHIR_SINIT_NVAR(_0$$5);		ZVAL_STRING(&_0$$5, "/r/n", 0);		zephir_fast_trim(return_value, data, &_0$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC);		RETURN_MM();	}	ZEPHIR_SINIT_VAR(_4);	ZVAL_LONG(&_4, 16384);	ZEPHIR_SINIT_VAR(_5);	ZVAL_STRING(&_5, "/r/n", 0);	ZEPHIR_RETURN_CALL_FUNCTION("stream_get_line", &_1, 386, connection, &_4, &_5);	zephir_check_call_status();	RETURN_MM();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:58,


示例10: PHP_METHOD

/** * Phalcon/Cache/Backend/Redis constructor * * @param	Phalcon/Cache/FrontendInterface frontend * @param	array options */PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) {	int ZEPHIR_LAST_CALL_STATUS;	zephir_fcall_cache_entry *_3 = NULL;	zend_bool _1;	zval *frontend, *options = NULL, *_0 = NULL, *_2;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &frontend, &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, 6379);		zephir_array_update_string(&options, SL("port"), &_0, PH_COPY | PH_SEPARATE);	}	if (!(zephir_array_isset_string(options, SS("index")))) {		ZEPHIR_INIT_NVAR(_0);		ZVAL_LONG(_0, 0);		zephir_array_update_string(&options, SL("index"), &_0, 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);	}	_1 = !(zephir_array_isset_string(options, SS("statsKey")));	if (!(_1)) {		zephir_array_fetch_string(&_2, options, SL("statsKey"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 90 TSRMLS_CC);		_1 = ZEPHIR_IS_EMPTY(_2);	}	if (_1) {		ZEPHIR_INIT_NVAR(_0);		ZVAL_STRING(_0, "_PHCR", 1);		zephir_array_update_string(&options, SL("statsKey"), &_0, PH_COPY | PH_SEPARATE);	}	ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_redis_ce, this_ptr, "__construct", &_3, 103, frontend, options);	zephir_check_call_status();	ZEPHIR_MM_RESTORE();}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:60,


示例11: PHP_METHOD

/** * Magic __set_state helps to recover messsages from serialization */PHP_METHOD(Phalcon_Validation_Message, __set_state) {	int ZEPHIR_LAST_CALL_STATUS;	zval *message_param = NULL, *_0, *_1, *_2;	zval *message = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &message_param);	message = message_param;	object_init_ex(return_value, phalcon_validation_message_ce);	zephir_array_fetch_string(&_0, message, SL("_message"), PH_NOISY | PH_READONLY, "phalcon/validation/message.zep", 134 TSRMLS_CC);	zephir_array_fetch_string(&_1, message, SL("_field"), PH_NOISY | PH_READONLY, "phalcon/validation/message.zep", 134 TSRMLS_CC);	zephir_array_fetch_string(&_2, message, SL("_type"), PH_NOISY | PH_READONLY, "phalcon/validation/message.zep", 134 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 435, _0, _1, _2);	zephir_check_call_status();	RETURN_MM();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:24,


示例12: PHP_METHOD

/** * Get the server variable HTTP_HOST * * @return string host http name */PHP_METHOD(Phady_Util_Tools, getHttpHost) {	zend_bool _0;	zval *server = NULL, *_SERVER, *_1;	ZEPHIR_MM_GROW();	zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);	ZEPHIR_INIT_VAR(server);	ZVAL_STRING(server, "", 1);	_0 = zephir_array_isset_string(_SERVER, SS("HTTP_HOST"));	if (_0) {		zephir_array_fetch_string(&_1, _SERVER, SL("HTTP_HOST"), PH_NOISY | PH_READONLY, "phady/util/tools.zep", 53 TSRMLS_CC);		_0 = zephir_is_true(_1);	}	if (_0) {		ZEPHIR_OBS_NVAR(server);		zephir_array_fetch_string(&server, _SERVER, SL("HTTP_HOST"), PH_NOISY, "phady/util/tools.zep", 54 TSRMLS_CC);	}	RETURN_CCTOR(server);}
开发者ID:alienfernandez,项目名称:phady,代码行数:27,


示例13: PHP_METHOD

/** * Magic __set_state helps to re-build messages variable exporting */PHP_METHOD(Phalcon_Mvc_Model_Message, __set_state) {	zend_long ZEPHIR_LAST_CALL_STATUS;	zval *message_param = NULL, *_0, *_1, *_2, *_3;	zval *message = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &message_param);	message = message_param;	object_init_ex(return_value, phalcon_mvc_model_message_ce);	zephir_array_fetch_string(&_0, message, SL("_message"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC);	zephir_array_fetch_string(&_1, message, SL("_field"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC);	zephir_array_fetch_string(&_2, message, SL("_type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC);	zephir_array_fetch_string(&_3, message, SL("_code"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, _0, _1, _2, _3);	zephir_check_call_status();	RETURN_MM();}
开发者ID:luomor,项目名称:cphalcon,代码行数:25,


示例14: PHP_METHOD

/** * Makes a connection to the Beanstalkd server */PHP_METHOD(Phalcon_Queue_Beanstalk, connect) {	zephir_nts_static zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL;	int ZEPHIR_LAST_CALL_STATUS;	zval *connection = NULL, *parameters, *_0, *_1, *_2, *_3, _5;	ZEPHIR_MM_GROW();	ZEPHIR_OBS_VAR(connection);	zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC);	if (Z_TYPE_P(connection) == IS_RESOURCE) {		ZEPHIR_CALL_METHOD(NULL, this_ptr, "disconnect", NULL);		zephir_check_call_status();	}	ZEPHIR_OBS_VAR(parameters);	zephir_read_property_this(&parameters, this_ptr, SL("_parameters"), PH_NOISY_CC);	zephir_array_fetch_string(&_0, parameters, SL("host"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 78 TSRMLS_CC);	zephir_array_fetch_string(&_1, parameters, SL("port"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 78 TSRMLS_CC);	ZEPHIR_INIT_VAR(_2);	ZVAL_NULL(_2);	ZEPHIR_INIT_VAR(_3);	ZVAL_NULL(_3);	Z_SET_ISREF_P(_2);	ZEPHIR_CALL_FUNCTION(&connection, "fsockopen", &_4, _0, _1, _2, _3);	Z_UNSET_ISREF_P(_2);	zephir_check_call_status();	if (Z_TYPE_P(connection) != IS_RESOURCE) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_exception_ce, "Can't connect to Beanstalk server", "phalcon/queue/beanstalk.zep", 80);		return;	}	ZEPHIR_SINIT_VAR(_5);	ZVAL_LONG(&_5, -1);	ZEPHIR_CALL_FUNCTION(NULL, "stream_set_timeout", &_6, connection, &_5, ZEPHIR_GLOBAL(global_null));	zephir_check_call_status();	zephir_update_property_this(this_ptr, SL("_connection"), connection TSRMLS_CC);	RETURN_CCTOR(connection);}
开发者ID:KKrushnabate,项目名称:cphalcon,代码行数:41,


示例15: PHP_METHOD

/** * Instantiates route based on passed Yaf_Config_Abstract structure * * @param array $config Configuration object */PHP_METHOD(Yaf_Route_Rewrite, getInstance) {	int ZEPHIR_LAST_CALL_STATUS;	zend_bool _0, _2;	zval *config_param = NULL, *_1, *_3, *_4, *_5;	zval *config = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &config_param);	zephir_get_arrval(config, config_param);	_0 = !(zephir_array_isset_string(config, SS("match")));	if (!(_0)) {		zephir_array_fetch_string(&_1, config, SL("match"), PH_NOISY | PH_READONLY, "yaf/Route/rewrite.zep", 21 TSRMLS_CC);		_0 = !(Z_TYPE_P(_1) == IS_STRING);	}	_2 = !(zephir_array_isset_string(config, SS("route")));	if (!(_2)) {		ZEPHIR_OBS_VAR(_3);		zephir_array_fetch_string(&_3, config, SL("route"), PH_NOISY, "yaf/Route/rewrite.zep", 23 TSRMLS_CC);		_2 = ZEPHIR_IS_EMPTY(_3);	}	if (_0) {		RETURN_MM_NULL();	} else if (_2) {		RETURN_MM_NULL();	} else {		object_init_ex(return_value, yaf_route_rewrite_ce);		zephir_array_fetch_string(&_4, config, SL("match"), PH_NOISY | PH_READONLY, "yaf/Route/rewrite.zep", 26 TSRMLS_CC);		zephir_array_fetch_string(&_5, config, SL("route"), PH_NOISY | PH_READONLY, "yaf/Route/rewrite.zep", 26 TSRMLS_CC);		ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, _4, _5);		zephir_check_call_status();		RETURN_MM();	}}
开发者ID:swordkee,项目名称:yaftoz,代码行数:43,


示例16: PHP_METHOD

PHP_METHOD(Test_NativeArray, testArrayAccess6) {	zval a, b, _0, _1;	zval *this_ptr = getThis();	ZVAL_UNDEF(&a);	ZVAL_UNDEF(&b);	ZVAL_UNDEF(&_0);	ZVAL_UNDEF(&_1);	ZEPHIR_MM_GROW();	ZEPHIR_INIT_VAR(&a);	zephir_create_array(&a, 3, 0 TSRMLS_CC);	add_assoc_long_ex(&a, SL("a"), 1);	add_assoc_long_ex(&a, SL("b"), 2);	add_assoc_long_ex(&a, SL("c"), 3);	zephir_array_fetch_string(&_0, &a, SL("a"), PH_NOISY | PH_READONLY, "test/nativearray.zep", 300 TSRMLS_CC);	zephir_array_fetch_string(&_1, &a, SL("b"), PH_NOISY | PH_READONLY, "test/nativearray.zep", 300 TSRMLS_CC);	ZEPHIR_INIT_VAR(&b);	zephir_add_function(&b, &_0, &_1);	RETURN_CCTOR(&b);}
开发者ID:phalcon,项目名称:zephir,代码行数:24,


示例17: PHP_METHOD

/** * Sets the bound parameters in the criteria * This method replaces all previously set bound parameters */PHP_METHOD(Phalcon_Mvc_Model_Criteria, bind) {	zend_bool merge;	zval *bindParams_param = NULL, *merge_param = NULL, *bind = NULL, *_0$$3, *_1$$4, *_2$$6, *_3$$6, *_4$$7, *_5$$8;	zval *bindParams = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 1, &bindParams_param, &merge_param);	bindParams = bindParams_param;	if (!merge_param) {		merge = 0;	} else {		merge = zephir_get_boolval(merge_param);	}	if (merge) {		_0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC);		if (zephir_array_isset_string(_0$$3, SS("bind"))) {			_1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC);			ZEPHIR_OBS_VAR(bind);			zephir_array_fetch_string(&bind, _1$$4, SL("bind"), PH_NOISY, "phalcon/mvc/model/criteria.zep", 106 TSRMLS_CC);		} else {			ZEPHIR_INIT_NVAR(bind);			ZVAL_NULL(bind);		}		if (Z_TYPE_P(bind) == IS_ARRAY) {			ZEPHIR_INIT_VAR(_2$$6);			zephir_add_function(_2$$6, bind, bindParams);			ZEPHIR_INIT_VAR(_3$$6);			ZVAL_STRING(_3$$6, "bind", 1);			zephir_update_property_array(this_ptr, SL("_params"), _3$$6, _2$$6 TSRMLS_CC);		} else {			ZEPHIR_INIT_VAR(_4$$7);			ZVAL_STRING(_4$$7, "bind", 1);			zephir_update_property_array(this_ptr, SL("_params"), _4$$7, bindParams TSRMLS_CC);		}	} else {		ZEPHIR_INIT_VAR(_5$$8);		ZVAL_STRING(_5$$8, "bind", 1);		zephir_update_property_array(this_ptr, SL("_params"), _5$$8, bindParams TSRMLS_CC);	}	RETURN_THIS();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:50,


示例18: PHP_METHOD

/** * Magic __set_state helps to re-build messages variable when exporting * * @param array group * @return /Phalcon/Validation/Message/Group */PHP_METHOD(Phalcon_Validation_Message_Group, __set_state) {	int ZEPHIR_LAST_CALL_STATUS;	zval *group, *_0;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &group);	object_init_ex(return_value, phalcon_validation_message_group_ce);	zephir_array_fetch_string(&_0, group, SL("_messages"), PH_NOISY | PH_READONLY, "phalcon/validation/message/group.zep", 274 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 3, _0);	zephir_check_call_status();	RETURN_MM();}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:23,


示例19: PHP_METHOD

/** * Check on empty */PHP_METHOD(Phalcon_Validation_Validator_File, isAllowEmpty) {	zend_bool _0, _1;	zend_long ZEPHIR_LAST_CALL_STATUS;	zval field;	zval *validation, validation_sub, *field_param = NULL, value, _2;	zval *this_ptr = getThis();	ZVAL_UNDEF(&validation_sub);	ZVAL_UNDEF(&value);	ZVAL_UNDEF(&_2);	ZVAL_UNDEF(&field);	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 2, 0, &validation, &field_param);	if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) {		zephir_get_strval(&field, field_param);	} else {		ZEPHIR_INIT_VAR(&field);		ZVAL_EMPTY_STRING(&field);	}	ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, &field);	zephir_check_call_status();	_0 = ZEPHIR_IS_EMPTY(&value);	if (!(_0)) {		_1 = zephir_array_isset_string(&value, SL("error"));		if (_1) {			zephir_array_fetch_string(&_2, &value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 299 TSRMLS_CC);			_1 = ZEPHIR_IS_LONG_IDENTICAL(&_2, 4);		}		_0 = _1;	}	RETURN_MM_BOOL(_0);}
开发者ID:joeyhub,项目名称:cphalcon,代码行数:45,


示例20: PHP_METHOD

/** * Construct connection */PHP_METHOD(Lynx_DBAL_Connection, __construct) {    int ZEPHIR_LAST_CALL_STATUS;    zval *parameters, *eventsManager = NULL, *_0, *_1, *_2 = NULL;    ZEPHIR_MM_GROW();    zephir_fetch_params(1, 1, 1, &parameters, &eventsManager);    if (!eventsManager) {        ZEPHIR_CPY_WRT(eventsManager, ZEPHIR_GLOBAL(global_null));    } else {        ZEPHIR_SEPARATE_PARAM(eventsManager);    }    if (Z_TYPE_P(eventsManager) == IS_NULL) {        ZEPHIR_INIT_NVAR(eventsManager);        object_init_ex(eventsManager, lynx_stdlib_events_manager_ce);        if (zephir_has_constructor(eventsManager TSRMLS_CC)) {            ZEPHIR_CALL_METHOD(NULL, eventsManager, "__construct", NULL);            zephir_check_call_status();        }    }    if (zephir_array_isset_string(parameters, SS("driver"))) {        zephir_array_fetch_string(&_0, parameters, SL("driver"), PH_NOISY | PH_READONLY, "lynx/DBAL/Connection.zep", 34 TSRMLS_CC);        zephir_update_property_this(this_ptr, SL("driver"), _0 TSRMLS_CC);        _1 = zephir_fetch_nproperty_this(this_ptr, SL("driver"), PH_NOISY_CC);        ZEPHIR_CALL_METHOD(&_2, _1, "getnewplatform", NULL);        zephir_check_call_status();        zephir_update_property_this(this_ptr, SL("platform"), _2 TSRMLS_CC);    } else {        ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "Driver didn`t find in $parameters", "lynx/DBAL/Connection.zep", 41);        return;    }    _1 = zephir_fetch_nproperty_this(this_ptr, SL("driver"), PH_NOISY_CC);    ZEPHIR_CALL_METHOD(NULL, _1, "seteventsmanager", NULL, eventsManager);    zephir_check_call_status();    ZEPHIR_MM_RESTORE();}
开发者ID:noikiy,项目名称:lynx,代码行数:43,


示例21: PHP_METHOD

/** * Unserializing a resultset will allow to only works on the rows present in the saved state */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) {	zend_long ZEPHIR_LAST_CALL_STATUS;	zval *data_param = NULL, *resultset = NULL, *keepSnapshots = NULL, *_0, *_1, *_2, *_3, *_4, *_5, *_6;	zval *data = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &data_param);	if (UNEXPECTED(Z_TYPE_P(data_param) != IS_STRING && Z_TYPE_P(data_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'data' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (EXPECTED(Z_TYPE_P(data_param) == IS_STRING)) {		zephir_get_strval(data, data_param);	} else {		ZEPHIR_INIT_VAR(data);		ZVAL_EMPTY_STRING(data);	}	ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 67, data);	zephir_check_call_status();	if (Z_TYPE_P(resultset) != IS_ARRAY) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/mvc/model/resultset/simple.zep", 252);		return;	}	zephir_array_fetch_string(&_0, resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 255 TSRMLS_CC);	zephir_update_property_this(getThis(), SL("_model"), _0 TSRMLS_CC);	zephir_array_fetch_string(&_1, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 256 TSRMLS_CC);	zephir_update_property_this(getThis(), SL("_rows"), _1 TSRMLS_CC);	zephir_array_fetch_string(&_2, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 257 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_3);	ZVAL_LONG(_3, zephir_fast_count_int(_2 TSRMLS_CC));	zephir_update_property_this(getThis(), SL("_count"), _3 TSRMLS_CC);	zephir_array_fetch_string(&_4, resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 258 TSRMLS_CC);	zephir_update_property_this(getThis(), SL("_cache"), _4 TSRMLS_CC);	zephir_array_fetch_string(&_5, resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 259 TSRMLS_CC);	zephir_update_property_this(getThis(), SL("_columnMap"), _5 TSRMLS_CC);	zephir_array_fetch_string(&_6, resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 260 TSRMLS_CC);	zephir_update_property_this(getThis(), SL("_hydrateMode"), _6 TSRMLS_CC);	if (zephir_array_isset_string_fetch(&keepSnapshots, resultset, SS("keepSnapshots"), 1 TSRMLS_CC)) {		zephir_update_property_this(getThis(), SL("_keepSnapshots"), keepSnapshots TSRMLS_CC);	}	ZEPHIR_MM_RESTORE();}
开发者ID:adam-rocska,项目名称:cphalcon,代码行数:50,


示例22: PHP_METHOD

/** * Returns the array that was returned from a completed event trigger. * * This allows you to access previously returned values (obviously). * * @param string eventId The event's ID * @return array Values returned from the event's listeners, else null. */PHP_METHOD(Xpl_Event_Manager, result) {	zval *eventId_param = NULL, *_0, *_1, *_2, *_3;	zval *eventId = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 1, 0, &eventId_param);	zephir_get_strval(eventId, eventId_param);	ZEPHIR_INIT_VAR(_0);	_1 = zephir_fetch_nproperty_this(this_ptr, SL("completed"), PH_NOISY_CC);	if (zephir_array_isset(_1, eventId)) {		_2 = zephir_fetch_nproperty_this(this_ptr, SL("completed"), PH_NOISY_CC);		zephir_array_fetch(&_3, _2, eventId, PH_NOISY | PH_READONLY, "xpl/event/manager.zep", 301 TSRMLS_CC);		zephir_array_fetch_string(&_0, _3, SL("result"), PH_NOISY, "xpl/event/manager.zep", 301 TSRMLS_CC);	} else {		ZVAL_NULL(_0);	}	RETURN_CCTOR(_0);}
开发者ID:wells5609,项目名称:xpl,代码行数:31,


示例23: PHP_METHOD

/** * Check on empty */PHP_METHOD(Phalcon_Validation_Validator_File, isAllowEmpty) {	zend_bool _0, _1;	int ZEPHIR_LAST_CALL_STATUS;	zval *field = NULL;	zval *validation, *field_param = NULL, *value = NULL, *_2;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 2, 0, &validation, &field_param);	if (unlikely(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be a string") TSRMLS_CC);		RETURN_MM_NULL();	}	if (likely(Z_TYPE_P(field_param) == IS_STRING)) {		zephir_get_strval(field, field_param);	} else {		ZEPHIR_INIT_VAR(field);		ZVAL_EMPTY_STRING(field);	}	ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field);	zephir_check_call_status();	_0 = ZEPHIR_IS_EMPTY(value);	if (!(_0)) {		_1 = zephir_array_isset_string(value, SS("error"));		if (_1) {			zephir_array_fetch_string(&_2, value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 319 TSRMLS_CC);			_1 = ZEPHIR_IS_LONG_IDENTICAL(_2, 4);		}		_0 = _1;	}	RETURN_MM_BOOL(_0);}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:39,


示例24: PHP_METHOD

//.........这里部分代码省略.........		keyName = ZEPHIR_GLOBAL(global_null);	}	if (!content) {		content = ZEPHIR_GLOBAL(global_null);	}	if (!lifetime) {		lifetime = ZEPHIR_GLOBAL(global_null);	}	if (!stopBuffer) {		stopBuffer = ZEPHIR_GLOBAL(global_true);	}	if (!(zephir_is_true(keyName))) {		ZEPHIR_OBS_VAR(lastKey);		zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC);		ZEPHIR_SINIT_VAR(_0);		ZVAL_LONG(&_0, 5);		ZEPHIR_INIT_VAR(prefixedKey);		zephir_substr(prefixedKey, lastKey, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH);	} else {		ZEPHIR_OBS_VAR(prefix);		zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC);		ZEPHIR_INIT_NVAR(prefixedKey);		ZEPHIR_CONCAT_VV(prefixedKey, prefix, keyName);		ZEPHIR_INIT_NVAR(lastKey);		ZEPHIR_CONCAT_SV(lastKey, "_PHCR", prefixedKey);	}	if (!(zephir_is_true(lastKey))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/redis.zep", 185);		return;	}	ZEPHIR_OBS_VAR(frontend);	zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC);	ZEPHIR_OBS_VAR(redis);	zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC);	if (Z_TYPE_P(redis) != IS_OBJECT) {		ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL);		zephir_check_call_status();		ZEPHIR_OBS_NVAR(redis);		zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC);	}	if (!(zephir_is_true(content))) {		ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL);		zephir_check_call_status();	} else {		ZEPHIR_CPY_WRT(cachedContent, content);	}	if (!(zephir_is_numeric(cachedContent))) {		ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, cachedContent);		zephir_check_call_status();	}	if (!(zephir_is_true(lifetime))) {		ZEPHIR_OBS_VAR(tmp);		zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC);		if (!(zephir_is_true(tmp))) {			ZEPHIR_CALL_METHOD(&tt1, frontend, "getlifetime", NULL);			zephir_check_call_status();		} else {			ZEPHIR_CPY_WRT(tt1, tmp);		}	} else {		ZEPHIR_CPY_WRT(tt1, lifetime);	}	if (zephir_is_numeric(cachedContent)) {		ZEPHIR_CALL_METHOD(&success, redis, "set", NULL, lastKey, cachedContent);		zephir_check_call_status();	} else {		ZEPHIR_CALL_METHOD(&success, redis, "set", NULL, lastKey, preparedContent);		zephir_check_call_status();	}	if (!(zephir_is_true(success))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in redis", "phalcon/cache/backend/redis.zep", 231);		return;	}	ZEPHIR_CALL_METHOD(NULL, redis, "settimeout", NULL, lastKey, tt1);	zephir_check_call_status();	ZEPHIR_OBS_VAR(options);	zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);	if (!(zephir_array_isset_string(options, SS("statsKey")))) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 239);		return;	}	ZEPHIR_OBS_VAR(specialKey);	zephir_array_fetch_string(&specialKey, options, SL("statsKey"), PH_NOISY, "phalcon/cache/backend/redis.zep", 242 TSRMLS_CC);	ZEPHIR_CALL_METHOD(NULL, redis, "sadd", NULL, specialKey, prefixedKey);	zephir_check_call_status();	ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL);	zephir_check_call_status();	if (ZEPHIR_IS_TRUE_IDENTICAL(stopBuffer)) {		ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL);		zephir_check_call_status();	}	if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) {		zend_print_zval(cachedContent, 0);	}	zephir_update_property_this(this_ptr, SL("_started"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC);	ZEPHIR_MM_RESTORE();}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:101,


示例25: PHP_METHOD

/** * Returns a slice of the resultset to show in the pagination */PHP_METHOD(Phalcon_Paginator_Adapter_Model, getPaginate) {	zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL;	int pageNumber, show, n, start, lastShowPage, i, next, totalPages, before, ZEPHIR_LAST_CALL_STATUS;	zval *config, *items, *pageItems, *page, *_0, *_1, *_2 = NULL, *_3 = NULL, *_4 = NULL, *_7;	ZEPHIR_MM_GROW();	ZEPHIR_OBS_VAR(_0);	zephir_read_property_this(&_0, this_ptr, SL("_limitRows"), PH_NOISY_CC);	show = zephir_get_intval(_0);	ZEPHIR_OBS_VAR(config);	zephir_read_property_this(&config, this_ptr, SL("_config"), PH_NOISY_CC);	ZEPHIR_OBS_VAR(items);	zephir_array_fetch_string(&items, config, SL("data"), PH_NOISY, "phalcon/paginator/adapter/model.zep", 80 TSRMLS_CC);	ZEPHIR_OBS_VAR(_1);	zephir_read_property_this(&_1, this_ptr, SL("_page"), PH_NOISY_CC);	pageNumber = zephir_get_intval(_1);	if (Z_TYPE_P(items) != IS_OBJECT) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Invalid data for paginator", "phalcon/paginator/adapter/model.zep", 84);		return;	}	if (pageNumber <= 0) {		pageNumber = 1;	}	if (show <= 0) {		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "The start page number is zero or less", "phalcon/paginator/adapter/model.zep", 94);		return;	}	n = zephir_fast_count_int(items TSRMLS_CC);	lastShowPage = (pageNumber - 1);	start = (show * lastShowPage);	ZEPHIR_INIT_VAR(pageItems);	array_init(pageItems);	if (zephir_safe_mod_long_long(n, show TSRMLS_CC) != 0) {		totalPages = (int) ((zephir_safe_div_long_long(n, show TSRMLS_CC) + (double) (1)));	} else {		totalPages = (int) (zephir_safe_div_long_long(n, show TSRMLS_CC));	}	if (n > 0) {		if (start <= n) {			ZEPHIR_INIT_VAR(_2);			ZVAL_LONG(_2, start);			ZEPHIR_CALL_METHOD(NULL, items, "seek", NULL, _2);			zephir_check_call_status();		} else {			ZEPHIR_INIT_NVAR(_2);			ZVAL_LONG(_2, 0);			ZEPHIR_CALL_METHOD(NULL, items, "seek", NULL, _2);			zephir_check_call_status();			pageNumber = 1;		}		i = 1;		while (1) {			ZEPHIR_CALL_METHOD(&_3, items, "valid", NULL);			zephir_check_call_status();			if (!(zephir_is_true(_3))) {				break;			}			ZEPHIR_CALL_METHOD(&_4, items, "current", &_5);			zephir_check_call_status();			zephir_array_append(&pageItems, _4, PH_SEPARATE, "phalcon/paginator/adapter/model.zep", 121);			if (i >= show) {				break;			}			i++;			ZEPHIR_CALL_METHOD(NULL, items, "next", &_6);			zephir_check_call_status();		}	}	next = (pageNumber + 1);	if (next > totalPages) {		next = totalPages;	}	if (pageNumber > 1) {		before = (pageNumber - 1);	} else {		before = 1;	}	ZEPHIR_INIT_VAR(page);	object_init(page);	zephir_update_property_zval(page, SL("items"), pageItems TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_7);	ZVAL_LONG(_7, 1);	zephir_update_property_zval(page, SL("first"), _7 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_7);	ZVAL_LONG(_7, before);	zephir_update_property_zval(page, SL("before"), _7 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_7);	ZVAL_LONG(_7, pageNumber);	zephir_update_property_zval(page, SL("current"), _7 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_7);	ZVAL_LONG(_7, totalPages);	zephir_update_property_zval(page, SL("last"), _7 TSRMLS_CC);	ZEPHIR_INIT_ZVAL_NREF(_7);	ZVAL_LONG(_7, next);	zephir_update_property_zval(page, SL("next"), _7 TSRMLS_CC);//.........这里部分代码省略.........
开发者ID:KKrushnabate,项目名称:cphalcon,代码行数:101,


示例26: PHP_METHOD

//.........这里部分代码省略.........				zephir_array_update_multi(&params, &_48$$21 TSRMLS_CC, SL("sa"), 3, SL("conditions"));				zephir_array_update_multi(&params, &except TSRMLS_CC, SL("sa"), 3, SL("bind"));				index++;			}		} else if (zephir_fast_count_int(field TSRMLS_CC) > 1) {			zephir_is_iterable(field, &_50$$22, &_49$$22, 0, 0, "phalcon/validation/validator/uniqueness.zep", 249);			for (			  ; zephir_hash_get_current_data_ex(_50$$22, (void**) &_51$$22, &_49$$22) == SUCCESS			  ; zephir_hash_move_forward_ex(_50$$22, &_49$$22)			) {				ZEPHIR_GET_HVALUE(singleField, _51$$22);				ZEPHIR_INIT_NVAR(_53$$23);				ZVAL_STRING(_53$$23, "attribute", ZEPHIR_TEMP_PARAM_COPY);				ZEPHIR_CALL_METHOD(&_52$$23, this_ptr, "getoption", NULL, 0, _53$$23, singleField);				zephir_check_temp_parameter(_53$$23);				zephir_check_call_status();				ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _52$$23);				zephir_check_call_status();				if (Z_TYPE_P(except) == IS_ARRAY) {					zephir_is_iterable(except, &_55$$24, &_54$$24, 0, 0, "phalcon/validation/validator/uniqueness.zep", 242);					for (					  ; zephir_hash_get_current_data_ex(_55$$24, (void**) &_56$$24, &_54$$24) == SUCCESS					  ; zephir_hash_move_forward_ex(_55$$24, &_54$$24)					) {						ZEPHIR_GET_HVALUE(singleExcept, _56$$24);						ZEPHIR_SINIT_NVAR(_57$$25);						ZVAL_LONG(&_57$$25, index);						ZEPHIR_INIT_LNVAR(_58$$25);						ZEPHIR_CONCAT_SV(_58$$25, "?", &_57$$25);						zephir_array_append(&notInValues, _58$$25, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 238);						zephir_array_update_multi(&params, &singleExcept TSRMLS_CC, SL("sa"), 3, SL("bind"));						index++;					}					ZEPHIR_INIT_NVAR(_59$$24);					zephir_fast_join_str(_59$$24, SL(","), notInValues TSRMLS_CC);					ZEPHIR_INIT_LNVAR(_60$$24);					ZEPHIR_CONCAT_VSVS(_60$$24, attribute, " NOT IN (", _59$$24, ")");					zephir_array_append(&exceptConditions, _60$$24, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 242);				} else {					ZEPHIR_SINIT_NVAR(_61$$26);					ZVAL_LONG(&_61$$26, index);					ZEPHIR_INIT_LNVAR(_62$$26);					ZEPHIR_CONCAT_VSV(_62$$26, attribute, " <> ?", &_61$$26);					zephir_array_update_multi(&params, &_62$$26 TSRMLS_CC, SL("sa"), 3, SL("conditions"));					zephir_array_update_multi(&params, &except TSRMLS_CC, SL("sa"), 3, SL("bind"));					index++;				}			}		}	}	ZEPHIR_CALL_METHOD(&_63, record, "getdirtystate", NULL, 0);	zephir_check_call_status();	if (ZEPHIR_IS_LONG(_63, 0)) {		ZEPHIR_CALL_METHOD(&_64$$27, record, "getdi", NULL, 0);		zephir_check_call_status();		ZEPHIR_INIT_VAR(_65$$27);		ZVAL_STRING(_65$$27, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY);		ZEPHIR_CALL_METHOD(&metaData, _64$$27, "getshared", NULL, 0, _65$$27);		zephir_check_temp_parameter(_65$$27);		zephir_check_call_status();		ZEPHIR_CALL_METHOD(&_66$$27, metaData, "getprimarykeyattributes", NULL, 0, record);		zephir_check_call_status();		zephir_is_iterable(_66$$27, &_68$$27, &_67$$27, 0, 0, "phalcon/validation/validator/uniqueness.zep", 263);		for (		  ; zephir_hash_get_current_data_ex(_68$$27, (void**) &_69$$27, &_67$$27) == SUCCESS		  ; zephir_hash_move_forward_ex(_68$$27, &_67$$27)		) {			ZEPHIR_GET_HVALUE(primaryField, _69$$27);			ZEPHIR_CALL_METHOD(&_70$$28, this_ptr, "getcolumnnamereal", &_14, 0, record, primaryField);			zephir_check_call_status();			ZEPHIR_SINIT_NVAR(_71$$28);			ZVAL_LONG(&_71$$28, index);			ZEPHIR_INIT_LNVAR(_72$$28);			ZEPHIR_CONCAT_VSV(_72$$28, _70$$28, " <> ?", &_71$$28);			zephir_array_update_multi(&params, &_72$$28 TSRMLS_CC, SL("sa"), 3, SL("conditions"));			ZEPHIR_CALL_METHOD(&_73$$28, record, "readattribute", NULL, 0, primaryField);			zephir_check_call_status();			zephir_array_update_multi(&params, &_73$$28 TSRMLS_CC, SL("sa"), 3, SL("bind"));			index++;		}	}	ZEPHIR_INIT_VAR(className);	zephir_get_class(className, record, 0 TSRMLS_CC);	if (!(ZEPHIR_IS_EMPTY(exceptConditions))) {		ZEPHIR_INIT_VAR(_74$$29);		zephir_fast_join_str(_74$$29, SL(" OR "), exceptConditions TSRMLS_CC);		ZEPHIR_INIT_VAR(_75$$29);		ZEPHIR_CONCAT_SVS(_75$$29, "(", _74$$29, ")");		zephir_array_update_multi(&params, &_75$$29 TSRMLS_CC, SL("sa"), 3, SL("conditions"));	}	ZEPHIR_INIT_NVAR(_0);	zephir_array_fetch_string(&_76, params, SL("conditions"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/uniqueness.zep", 269 TSRMLS_CC);	zephir_fast_join_str(_0, SL(" AND "), _76 TSRMLS_CC);	zephir_array_update_string(&params, SL("conditions"), &_0, PH_COPY | PH_SEPARATE);	_78 = zephir_fetch_class(className TSRMLS_CC);	ZEPHIR_CALL_CE_STATIC(&_77, _78, "count", NULL, 0, params);	zephir_check_call_status();	RETURN_MM_BOOL(ZEPHIR_IS_LONG(_77, 0));}
开发者ID:coolsnow77,项目名称:cphalcon,代码行数:101,


示例27: PHP_METHOD

/** * Applies a format to a message before sending it to the log * * @param string $message * @param int $type * @param int $timestamp * @param array $context * * @return string */PHP_METHOD(Phalcon_Logger_Formatter_Firephp, format) {	zval *_18;	HashTable *_7;	HashPosition _6;	zend_bool param, _11, _14;	int type, timestamp, ZEPHIR_LAST_CALL_STATUS;	zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *meta, *body = NULL, *backtrace = NULL, *encoded, *len, *lastTrace = NULL, *_0 = NULL, *_1 = NULL, *_2, *backtraceItem = NULL, *key = NULL, _3, _4, *_5, **_8, *_9, *_10, *_12, *_13, *_15, *_16, *_17;	zval *message = NULL;	ZEPHIR_MM_GROW();	zephir_fetch_params(1, 3, 1, &message_param, &type_param, &timestamp_param, &context);	zephir_get_strval(message, message_param);	type = zephir_get_intval(type_param);	timestamp = zephir_get_intval(timestamp_param);	if (!context) {		context = ZEPHIR_GLOBAL(global_null);	}	if (Z_TYPE_P(context) == IS_ARRAY) {		ZEPHIR_CALL_METHOD(&_0, this_ptr, "interpolate", NULL, 0, message, context);		zephir_check_call_status();		zephir_get_strval(message, _0);	}	ZEPHIR_INIT_VAR(meta);	zephir_create_array(meta, 1, 0 TSRMLS_CC);	ZEPHIR_INIT_VAR(_1);	ZVAL_LONG(_1, type);	ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettypestring", NULL, 0, _1);	zephir_check_call_status();	zephir_array_update_string(&meta, SL("Type"), &_0, PH_COPY | PH_SEPARATE);	_2 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);	if (zephir_is_true(_2)) {		param = 0;		ZEPHIR_INIT_NVAR(_1);		ZEPHIR_GET_CONSTANT(_1, "PHP_VERSION");		ZEPHIR_SINIT_VAR(_3);		ZVAL_STRING(&_3, "5.3.6", 0);		ZEPHIR_SINIT_VAR(_4);		ZVAL_STRING(&_4, "<", 0);		ZEPHIR_CALL_FUNCTION(&_0, "version_compare", NULL, 248, _1, &_3, &_4);		zephir_check_call_status();		if (!(zephir_is_true(_0))) {			param = (2) ? 1 : 0;		}		ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", NULL, 150, (param ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false)));		zephir_check_call_status();		Z_SET_ISREF_P(backtrace);		ZEPHIR_CALL_FUNCTION(&lastTrace, "end", NULL, 170, backtrace);		Z_UNSET_ISREF_P(backtrace);		zephir_check_call_status();		if (zephir_array_isset_string(lastTrace, SS("file"))) {			zephir_array_fetch_string(&_5, lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 133 TSRMLS_CC);			zephir_array_update_string(&meta, SL("File"), &_5, PH_COPY | PH_SEPARATE);		}		if (zephir_array_isset_string(lastTrace, SS("line"))) {			zephir_array_fetch_string(&_5, lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 137 TSRMLS_CC);			zephir_array_update_string(&meta, SL("Line"), &_5, PH_COPY | PH_SEPARATE);		}		zephir_is_iterable(backtrace, &_7, &_6, 1, 0, "phalcon/logger/formatter/firephp.zep", 146);		for (		  ; zephir_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS		  ; zephir_hash_move_forward_ex(_7, &_6)		) {			ZEPHIR_GET_HMKEY(key, _7, _6);			ZEPHIR_GET_HVALUE(backtraceItem, _8);			zephir_array_unset_string(&backtraceItem, SS("object"), PH_SEPARATE);			zephir_array_unset_string(&backtraceItem, SS("args"), PH_SEPARATE);			zephir_array_update_zval(&backtrace, key, &backtraceItem, PH_COPY | PH_SEPARATE);		}	}	_9 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);	if (zephir_is_true(_9)) {		zephir_array_update_string(&meta, SL("Label"), &message, PH_COPY | PH_SEPARATE);	}	_10 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);	_11 = !zephir_is_true(_10);	if (_11) {		_12 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);		_11 = !zephir_is_true(_12);	}	_13 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC);	_14 = zephir_is_true(_13);	if (_14) {		_15 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);		_14 = !zephir_is_true(_15);	}	if (_11) {//.........这里部分代码省略.........
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:101,



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


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