这篇教程C++ zephir_array_update_zval函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zephir_array_update_zval函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_array_update_zval函数的具体用法?C++ zephir_array_update_zval怎么用?C++ zephir_array_update_zval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zephir_array_update_zval函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHOD/** * Converts recursively the object to an array * *<code> * print_r($config->toArray()); *</code> */PHP_METHOD(Phalcon_Config, toArray) { HashTable *_2; HashPosition _1; int ZEPHIR_LAST_CALL_STATUS; zval *key = NULL, *value = NULL, *arrayConfig, *_0 = NULL, **_3, *_4 = NULL; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(arrayConfig); array_init(arrayConfig); ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 23, this_ptr); zephir_check_call_status(); zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/config.zep", 180); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(key, _2, _1); ZEPHIR_GET_HVALUE(value, _3); if (Z_TYPE_P(value) == IS_OBJECT) { if ((zephir_method_exists_ex(value, SS("toarray") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&_4, value, "toarray", NULL, 0); zephir_check_call_status(); zephir_array_update_zval(&arrayConfig, key, &_4, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&arrayConfig, key, &value, PH_COPY | PH_SEPARATE); } } else { zephir_array_update_zval(&arrayConfig, key, &value, PH_COPY | PH_SEPARATE); } } RETURN_CCTOR(arrayConfig);}
开发者ID:spuy767,项目名称:cphalcon,代码行数:42,
示例2: PHP_METHOD/** * Sets a session variable in an application context * *<code> * $session->set('auth', 'yes'); *</code> */PHP_METHOD(Phalcon_Session_Adapter, set) { int _2, _1$$3; zval *index_param = NULL, *value, *_SESSION, *uniqueId = NULL, *_0$$3; zval *index = NULL; ZEPHIR_MM_GROW(); zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); zephir_fetch_params(1, 2, 0, &index_param, &value); zephir_get_strval(index, index_param); uniqueId = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueId"), PH_NOISY_CC); if (!(ZEPHIR_IS_EMPTY(uniqueId))) { ZEPHIR_INIT_VAR(_0$$3); ZEPHIR_CONCAT_VSV(_0$$3, uniqueId, "#", index); _1$$3 = zephir_maybe_separate_zval(&_SESSION); zephir_array_update_zval(&_SESSION, _0$$3, &value, PH_COPY | PH_SEPARATE); if (_1$$3) { ZEND_SET_SYMBOL(&EG(symbol_table), "_SESSION", _SESSION); } RETURN_MM_NULL(); } _2 = zephir_maybe_separate_zval(&_SESSION); zephir_array_update_zval(&_SESSION, index, &value, PH_COPY | PH_SEPARATE); if (_2) { ZEND_SET_SYMBOL(&EG(symbol_table), "_SESSION", _SESSION); } ZEPHIR_MM_RESTORE();}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:39,
示例3: PHP_METHOD/** * Build multidimensional array from string * * <code> * $this->_parseIniString('path.hello.world', 'value for last key'); * * // result * [ * 'path' => [ * 'hello' => [ * 'world' => 'value for last key', * ], * ], * ]; * </code> */PHP_METHOD(Phalcon_Config_Adapter_Ini, _parseIniString) { int ZEPHIR_LAST_CALL_STATUS; zval *path_param = NULL, *value = NULL, *pos = NULL, *key = NULL, *_0 = NULL, _1, _2, _3, *_4; zval *path = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &path_param, &value); if (unlikely(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(path_param) == IS_STRING)) { zephir_get_strval(path, path_param); } else { ZEPHIR_INIT_VAR(path); ZVAL_EMPTY_STRING(path); } ZEPHIR_SEPARATE_PARAM(value); ZEPHIR_CALL_METHOD(&_0, this_ptr, "_cast", NULL, 135, value); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, _0); ZEPHIR_SINIT_VAR(_1); ZVAL_STRING(&_1, ".", 0); ZEPHIR_INIT_VAR(pos); zephir_fast_strpos(pos, path, &_1, 0 ); if (ZEPHIR_IS_FALSE_IDENTICAL(pos)) { zephir_create_array(return_value, 1, 0 TSRMLS_CC); zephir_array_update_zval(&return_value, path, &value, PH_COPY); RETURN_MM(); } ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, 0); ZEPHIR_INIT_VAR(key); zephir_substr(key, path, 0 , zephir_get_intval(pos), 0); ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, (zephir_get_numberval(pos) + 1)); ZEPHIR_INIT_VAR(_4); zephir_substr(_4, path, zephir_get_intval(&_3), 0, ZEPHIR_SUBSTR_NO_LENGTH); zephir_get_strval(path, _4); zephir_create_array(return_value, 1, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_0, this_ptr, "_parseinistring", NULL, 136, path, value); zephir_check_call_status(); zephir_array_update_zval(&return_value, key, &_0, PH_COPY); RETURN_MM();}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:66,
示例4: PHP_METHODPHP_METHOD(Cake_Core_Configure, write) { int ZEPHIR_LAST_CALL_STATUS, debug; zephir_fcall_cache_entry *_4 = NULL; HashTable *_1; HashPosition _0; zval *config = NULL, *value = NULL, *name = NULL, **_2, *_3 = NULL, *_5, *_6, *_7, _8, _9; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &config, &value); ZEPHIR_SEPARATE_PARAM(config); if (!value) { ZEPHIR_CPY_WRT(value, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(value); } if (!(Z_TYPE_P(config) == IS_ARRAY)) { ZEPHIR_INIT_NVAR(config); zephir_create_array(config, 1, 0 TSRMLS_CC); zephir_array_update_zval(&config, config, &value, PH_COPY); } zephir_is_iterable(config, &_1, &_0, 0, 0, "cake/Core/Configure.zep", 28); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(name, _1, _0); ZEPHIR_GET_HVALUE(value, _2); _5 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_values") TSRMLS_CC); ZEPHIR_CALL_CE_STATIC(&_3, cake_utility_hash_ce, "insert", &_4, 0, _5, name, value); zephir_check_call_status(); zephir_update_static_property_ce(cake_core_configure_ce, SL("_values"), &_3 TSRMLS_CC); } if (zephir_array_isset_string(config, SS("debug"))) { _5 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_hasIniSet") TSRMLS_CC); if (Z_TYPE_P(_5) == IS_NULL) { zephir_update_static_property_ce(cake_core_configure_ce, SL("_hasIniSet"), ((zephir_function_exists_ex(SS("ini_set") TSRMLS_CC) == SUCCESS)) ? &(ZEPHIR_GLOBAL(global_true)) : &(ZEPHIR_GLOBAL(global_false)) TSRMLS_CC); } _6 = zephir_fetch_static_property_ce(cake_core_configure_ce, SL("_hasIniSet") TSRMLS_CC); if (zephir_is_true(_6)) { zephir_array_fetch_string(&_7, config, SL("debug"), PH_NOISY | PH_READONLY, "cake/Core/Configure.zep", 36 TSRMLS_CC); if (zephir_is_true(_7)) { debug = 1; } else { debug = 0; } ZEPHIR_SINIT_VAR(_8); ZVAL_STRING(&_8, "display_errors", 0); ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, debug); ZEPHIR_CALL_FUNCTION(NULL, "ini_set", NULL, 4, &_8, &_9); zephir_check_call_status(); } } RETURN_MM_BOOL(1);}
开发者ID:ivyhjk,项目名称:zephir-cake,代码行数:60,
示例5: PHP_METHOD/** * Adds a message to the session flasher */PHP_METHOD(Phalcon_Flash_Session, message) { int ZEPHIR_LAST_CALL_STATUS; zval *type_param = NULL, *message_param = NULL, *messages = NULL, *_0, *_1$$4; zval *type = NULL, *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &message_param); zephir_get_strval(type, type_param); zephir_get_strval(message, message_param); ZEPHIR_INIT_VAR(_0); ZVAL_BOOL(_0, 0); ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, _0); zephir_check_call_status(); if (Z_TYPE_P(messages) != IS_ARRAY) { ZEPHIR_INIT_NVAR(messages); array_init(messages); } if (!(zephir_array_isset(messages, type))) { ZEPHIR_INIT_VAR(_1$$4); array_init(_1$$4); zephir_array_update_zval(&messages, type, &_1$$4, PH_COPY | PH_SEPARATE); } zephir_array_update_multi(&messages, &message TSRMLS_CC, SL("za"), 2, type); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_setsessionmessages", NULL, 0, messages); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:35,
示例6: PHP_METHOD/** * Returns the paths using positions as keys and names as values * * @return array */PHP_METHOD(Test_Router_Route, getReversedPaths) { zend_string *_3; zend_ulong _2; zval reversed, path, position, _0, *_1; ZEPHIR_INIT_THIS(); ZVAL_UNDEF(&reversed); ZVAL_UNDEF(&path); ZVAL_UNDEF(&position); ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&reversed); array_init(&reversed); zephir_read_property(&_0, this_ptr, SL("_paths"), PH_NOISY_CC | PH_READONLY); zephir_is_iterable(&_0, 0, "test/router/route.zep", 478); ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) { ZEPHIR_INIT_NVAR(&path); if (_3 != NULL) { ZVAL_STR_COPY(&path, _3); } else { ZVAL_LONG(&path, _2); } ZEPHIR_INIT_NVAR(&position); ZVAL_COPY(&position, _1); zephir_array_update_zval(&reversed, &position, &path, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END();
开发者ID:crocodile2u,项目名称:zephir,代码行数:35,
示例7: PHP_METHOD/** * Allow setting of a session variable. * Throw an exception if the name is not string. * * @param string $name * @param mixed $value * @throws Yaf_Exception * @return void */PHP_METHOD(Yaf_Session, __set) { int _0; zval *name_param = NULL, *value, *_SESSION; zval *name = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &value); zephir_get_strval(name, name_param); if (Z_TYPE_P(name) == IS_STRING) { zephir_update_property_array(this_ptr, SL("session"), name, value TSRMLS_CC); zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); _0 = zephir_maybe_separate_zval(&_SESSION); zephir_array_update_zval(&_SESSION, name, &value, PH_COPY | PH_SEPARATE); if (_0) { ZEND_SET_SYMBOL(&EG(symbol_table), "_SESSION", _SESSION); } } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(yaf_exception_ce, "Expect a string key name", "yaf/session.zep", 219); return; } ZEPHIR_MM_RESTORE();}
开发者ID:swordkee,项目名称:yaftoz,代码行数:36,
示例8: PHP_METHODPHP_METHOD(Test_Flow, testFor17) { zend_bool _1; int _0, _2, _3; zval *a = NULL, *b = NULL, *c; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(c); array_init(c); _3 = 10; _2 = _3; _0 = 0; _1 = 0; if ((_2 >= 1)) { while (1) { if (_1) { _0++; _2--; if (!((_2 >= 1))) { break; } } else { _1 = 1; } ZEPHIR_INIT_NVAR(a); ZVAL_LONG(a, _0); ZEPHIR_INIT_NVAR(b); ZVAL_LONG(b, _2); zephir_array_update_zval(&c, a, &b, PH_COPY | PH_SEPARATE); } } RETURN_CCTOR(c);}
开发者ID:azrulharis,项目名称:zephir,代码行数:35,
示例9: zephir_array_update_zval_string/** * @brief Updates value in @a arr at position @a index with boolean @a value * @param[in,out] arr Array * @param index Index * @param value Value * @param value_length Length of value (usually <tt>strlen(value)</tt>) * @param flags Flags * @return Whether the operation succeeded * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type * @retval @c SUCCESS Success * @throw @c E_WARNING if @a arr is not an array * @see zephir_array_update_zval() * * Equivalent to <tt>$arr[$index] = $value</tt> in PHP, where @c $value is a string. * Flags may be a bitwise OR of the following values: * @arg @c PH_CTOR: create a copy of @a value and work with that copy * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version * @arg @c PH_COPY: increment the reference count on the internally constructed value * * Only @c PH_SEPARATE is meaningful with this function */int zephir_array_update_zval_string(zval **arr, zval *index, char *value, uint value_length, int flags) { zval *zvalue; ALLOC_INIT_ZVAL(zvalue); ZVAL_STRINGL(zvalue, value, value_length, 1); return zephir_array_update_zval(arr, index, &zvalue, flags);}
开发者ID:golovanov,项目名称:php-ext-zendxml,代码行数:30,
示例10: zephir_array_update_zval_bool/** * @brief Updates value in @a arr at position @a index with boolean @a value * @param[in,out] arr Array * @param index Index * @param value Value * @param flags Flags * @return Whether the operation succeeded * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type * @retval @c SUCCESS Success * @throw @c E_WARNING if @a arr is not an array * @see zephir_array_update_zval() * * Equivalent to <tt>$arr[$index] = $value</tt> in PHP, where @c $value is a boolean. * Flags may be a bitwise OR of the following values: * @arg @c PH_CTOR: create a copy of @a value and work with that copy * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version * @arg @c PH_COPY: increment the reference count on the internally constructed value * * Only @c PH_SEPARATE is meaningful with this function */int zephir_array_update_zval_bool(zval **arr, zval *index, int value, int flags) { zval *zvalue; ALLOC_INIT_ZVAL(zvalue); ZVAL_BOOL(zvalue, value); return zephir_array_update_zval(arr, index, &zvalue, flags);}
开发者ID:golovanov,项目名称:php-ext-zendxml,代码行数:29,
示例11: zephir_array_update_zval_long/** * @brief Updates value in @a arr at position @a index with long integer @a value * @param[in,out] arr Array * @param index Index * @param value Value * @param flags Flags * @return Whether the operation succeeded * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type * @retval @c SUCCESS Success * @throw @c E_WARNING if @a arr is not an array * @see zephir_array_update_zval() * * Equivalent to <tt>$arr[$index] = $value</tt> in PHP, where @c $value is an integer. * Flags may be a bitwise OR of the following values: * @arg @c PH_CTOR: create a copy of @a value and work with that copy * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version * @arg @c PH_COPY: increment the reference count on the internally constructed value * * Only @c PH_SEPARATE is meaningful with this function. */int zephir_array_update_zval_long(zval **arr, zval *index, long value, int flags) { zval *zvalue; ALLOC_INIT_ZVAL(zvalue); ZVAL_LONG(zvalue, value); return zephir_array_update_zval(arr, index, &zvalue, flags);}
开发者ID:golovanov,项目名称:php-ext-zendxml,代码行数:29,
示例12: PHP_METHOD/** * Appends a NOT BETWEEN condition to the current conditions * *<code> * $criteria->notBetweenWhere('price', 100.25, 200.50); *</code> */PHP_METHOD(Phalcon_Mvc_Model_Criteria, notBetweenWhere) { zval *_1; int ZEPHIR_LAST_CALL_STATUS; zval *expr_param = NULL, *minimum, *maximum, *hiddenParam = NULL, *nextHiddenParam = NULL, *minimumKey = NULL, *maximumKey = NULL, *_0; zval *expr = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &expr_param, &minimum, &maximum); if (unlikely(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(expr_param) == IS_STRING)) { zephir_get_strval(expr, expr_param); } else { ZEPHIR_INIT_VAR(expr); ZVAL_EMPTY_STRING(expr); } ZEPHIR_OBS_VAR(hiddenParam); zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); ZEPHIR_INIT_VAR(nextHiddenParam); ZVAL_LONG(nextHiddenParam, (zephir_get_numberval(hiddenParam) + 1)); ZEPHIR_INIT_VAR(minimumKey); ZEPHIR_CONCAT_SV(minimumKey, "ACP", hiddenParam); ZEPHIR_INIT_VAR(maximumKey); ZEPHIR_CONCAT_SV(maximumKey, "ACP", nextHiddenParam); ZEPHIR_INIT_VAR(_0); ZEPHIR_CONCAT_VSVSVS(_0, expr, " NOT BETWEEN :", minimumKey, ": AND :", maximumKey, ":"); ZEPHIR_INIT_VAR(_1); zephir_create_array(_1, 2, 0 TSRMLS_CC); zephir_array_update_zval(&_1, minimumKey, &minimum, PH_COPY); zephir_array_update_zval(&_1, maximumKey, &maximum, PH_COPY); ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _0, _1); zephir_check_call_status(); ZEPHIR_SEPARATE(nextHiddenParam); zephir_increment(nextHiddenParam); zephir_update_property_this(this_ptr, SL("_hiddenParamNumber"), nextHiddenParam TSRMLS_CC); RETURN_THIS();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:51,
示例13: PHP_METHODPHP_METHOD(Yb_Std, uniqueValues) { HashTable *_1; HashPosition _0; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *uniqueKey = NULL; zval *data_param = NULL, *uniqueKey_param = NULL, *k = NULL, *v = NULL, *arr = NULL, *uniqueValue = NULL, **_2, *_3$$4 = NULL, *_4$$4 = NULL, *_6$$5 = NULL, *_7$$5 = NULL; zval *data = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &data_param, &uniqueKey_param); zephir_get_arrval(data, data_param); zephir_get_strval(uniqueKey, uniqueKey_param); ZEPHIR_INIT_VAR(arr); array_init(arr); zephir_is_iterable(data, &_1, &_0, 0, 0, "yb/std.zep", 377); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(k, _1, _0); ZEPHIR_GET_HVALUE(v, _2); if (unlikely(Z_TYPE_P(v) != IS_ARRAY)) { ZEPHIR_INIT_NVAR(_3$$4); object_init_ex(_3$$4, yb_exception_ce); ZEPHIR_INIT_LNVAR(_4$$4); ZEPHIR_CONCAT_SV(_4$$4, "Invalid item type, array required at: ", k); ZEPHIR_CALL_METHOD(NULL, _3$$4, "__construct", &_5, 2, _4$$4); zephir_check_call_status(); zephir_throw_exception_debug(_3$$4, "yb/std.zep", 368 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(uniqueValue); if (unlikely(!(zephir_array_isset_fetch(&uniqueValue, v, uniqueKey, 0 TSRMLS_CC)))) { ZEPHIR_INIT_NVAR(_6$$5); object_init_ex(_6$$5, yb_exception_ce); ZEPHIR_INIT_LNVAR(_7$$5); ZEPHIR_CONCAT_SV(_7$$5, "Cannot find value of unique at: ", k); ZEPHIR_CALL_METHOD(NULL, _6$$5, "__construct", &_5, 2, _7$$5); zephir_check_call_status(); zephir_throw_exception_debug(_6$$5, "yb/std.zep", 371 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } zephir_array_update_zval(&arr, uniqueValue, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); } zephir_array_keys(return_value, arr TSRMLS_CC); RETURN_MM();}
开发者ID:VergilTang,项目名称:yb,代码行数:55,
示例14: PHP_METHOD/** * Sets a single attribute. * * @param string name * @param mixed value * @param boolean overwrite [Optional] Default = true * @return /Xpl/HtmlElement */PHP_METHOD(Xpl_HtmlElement, setAttribute) { zend_bool overwrite, _0; zval *name_param = NULL, *value, *overwrite_param = NULL, *attrs = NULL, *arrVal = NULL, *_1$$6, *_2$$6; zval *name = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &name_param, &value, &overwrite_param); zephir_get_strval(name, name_param); if (!overwrite_param) { overwrite = 1; } else { overwrite = zephir_get_boolval(overwrite_param); } ZEPHIR_OBS_VAR(attrs); zephir_read_property_this(&attrs, this_ptr, SL("_attributes"), PH_NOISY_CC); if (Z_TYPE_P(value) == IS_ARRAY) { ZEPHIR_CPY_WRT(arrVal, value); } else { ZEPHIR_INIT_NVAR(arrVal); zephir_create_array(arrVal, 1, 0 TSRMLS_CC); zephir_array_fast_append(arrVal, value); } _0 = !(zephir_array_isset(attrs, name)); if (!(_0)) { _0 = overwrite; } if (_0) { zephir_array_update_zval(&attrs, name, &arrVal, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_VAR(_1$$6); zephir_array_fetch(&_2$$6, attrs, name, PH_NOISY | PH_READONLY, "xpl/htmlelement.zep", 84 TSRMLS_CC); zephir_fast_array_merge(_1$$6, &(_2$$6), &(arrVal) TSRMLS_CC); zephir_array_update_zval(&attrs, name, &_1$$6, PH_COPY | PH_SEPARATE); } zephir_update_property_this(this_ptr, SL("_attributes"), attrs TSRMLS_CC); RETURN_THIS();}
开发者ID:wells5609,项目名称:xpl,代码行数:50,
示例15: PHP_METHOD/** * {@inheritDoc} */PHP_METHOD(Lynx_Stdlib_Hydrator_ClassMethods, extract) { HashTable *_2; HashPosition _1; int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_0 = NULL, *_6 = NULL, *_9 = NULL, *_11 = NULL; zval *currentObject, *methods = NULL, *method = NULL, *attribute = NULL, *attributes, **_3, *_4 = NULL, *_5 = NULL, _7 = zval_used_for_init, *_8 = NULL, *_10 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¤tObject); if (unlikely(Z_TYPE_P(currentObject) != IS_OBJECT)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'currentObject' must be an object") TSRMLS_CC); RETURN_MM_NULL(); } ZEPHIR_CALL_FUNCTION(&methods, "get_class_methods", &_0, currentObject); zephir_check_call_status(); ZEPHIR_INIT_VAR(attributes); array_init(attributes); zephir_is_iterable(methods, &_2, &_1, 0, 0, "lynx/Stdlib/Hydrator/ClassMethods.zep", 48); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(method, _3); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "/^get/", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_FUNCTION(&_5, "preg_match", &_6, _4, method); zephir_check_temp_parameter(_4); zephir_check_call_status(); if (zephir_is_true(_5)) { ZEPHIR_SINIT_NVAR(_7); ZVAL_LONG(&_7, 3); ZEPHIR_INIT_NVAR(attribute); zephir_substr(attribute, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); ZEPHIR_CALL_FUNCTION(&_8, "property_exists", &_9, currentObject, attribute); zephir_check_call_status(); if (!zephir_is_true(_8)) { ZEPHIR_CALL_FUNCTION(&_10, "lcfirst", &_11, attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(attribute, _10); ZEPHIR_CALL_METHOD(&_10, currentObject, "attributes", NULL); zephir_check_call_status(); zephir_array_update_zval(&attributes, attribute, &_10, PH_COPY | PH_SEPARATE); } } } RETURN_CCTOR(attributes);}
开发者ID:Green-Cat,项目名称:lynx,代码行数:56,
示例16: PHP_METHODPHP_METHOD(Test_Assign, testArrayVarAssign1) { zval *index, *value, *a; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &index, &value); ZEPHIR_INIT_VAR(a); array_init(a); zephir_array_update_zval(&a, index, &value, PH_COPY | PH_SEPARATE); RETURN_CCTOR(a);}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:15,
示例17: PHP_METHODPHP_METHOD(Test_NativeArray, testArrayWrongUpdate1) { zval *x, *y, *_0; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(x); array_init(x); ZEPHIR_INIT_VAR(y); ZVAL_STRING(y, "hello", 1); ZEPHIR_INIT_VAR(_0); object_init(_0); zephir_array_update_zval(&x, y, &_0, PH_COPY | PH_SEPARATE); ZEPHIR_MM_RESTORE();}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:16,
示例18: PHP_METHOD/** * Returns the annotations found in the properties' docblocks */PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) { HashTable *_2$$5; HashPosition _1$$5; zval *annotations = NULL, *reflectionProperties = NULL, *collections = NULL, *property = NULL, *reflectionProperty = NULL, *_0$$3, **_3$$5, *_4$$6 = NULL; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); ZEPHIR_OBS_VAR(annotations); zephir_read_property_this(&annotations, this_ptr, SL("_propertyAnnotations"), PH_NOISY_CC); if (Z_TYPE_P(annotations) != IS_OBJECT) { ZEPHIR_OBS_VAR(reflectionProperties); _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_reflectionData"), PH_NOISY_CC); if (zephir_array_isset_string_fetch(&reflectionProperties, _0$$3, SS("properties"), 0 TSRMLS_CC)) { if (zephir_fast_count_int(reflectionProperties TSRMLS_CC)) { ZEPHIR_INIT_VAR(collections); array_init(collections); zephir_is_iterable(reflectionProperties, &_2$$5, &_1$$5, 0, 0, "phalcon/annotations/reflection.zep", 131); for ( ; zephir_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS ; zephir_hash_move_forward_ex(_2$$5, &_1$$5) ) { ZEPHIR_GET_HMKEY(property, _2$$5, _1$$5); ZEPHIR_GET_HVALUE(reflectionProperty, _3$$5); ZEPHIR_INIT_NVAR(_4$$6); object_init_ex(_4$$6, phalcon_annotations_collection_ce); ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", &_5, 17, reflectionProperty); zephir_check_call_status(); zephir_array_update_zval(&collections, property, &_4$$6, PH_COPY | PH_SEPARATE); } zephir_update_property_this(this_ptr, SL("_propertyAnnotations"), collections TSRMLS_CC); RETURN_CCTOR(collections); } } if (0) { zephir_update_property_this(this_ptr, SL("_propertyAnnotations"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); } else { zephir_update_property_this(this_ptr, SL("_propertyAnnotations"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); } RETURN_MM_BOOL(0); } RETURN_CCTOR(annotations);}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:49,
示例19: PHP_METHOD/** * Interpolates context values into the message placeholders * * @see http://www.php-fig.org/psr/psr-3/ Section 1.2 Message * @param string $message * @param array $context */PHP_METHOD(Phalcon_Logger_Formatter, interpolate) { int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_5 = NULL; HashTable *_2; HashPosition _1; zend_bool _0; zval *message_param = NULL, *context = NULL, *replace, *key = NULL, *value = NULL, **_3, *_4 = NULL; zval *message = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context); zephir_get_strval(message, message_param); if (!context) { context = ZEPHIR_GLOBAL(global_null); } _0 = Z_TYPE_P(context) == IS_ARRAY; if (_0) { _0 = zephir_fast_count_int(context TSRMLS_CC) > 0; } if (_0) { ZEPHIR_INIT_VAR(replace); array_init(replace); zephir_is_iterable(context, &_2, &_1, 0, 0, "phalcon/logger/formatter.zep", 92); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(key, _2, _1); ZEPHIR_GET_HVALUE(value, _3); ZEPHIR_INIT_LNVAR(_4); ZEPHIR_CONCAT_SVS(_4, "{", key, "}"); zephir_array_update_zval(&replace, _4, &value, PH_COPY | PH_SEPARATE); } ZEPHIR_RETURN_CALL_FUNCTION("strtr", &_5, message, replace); zephir_check_call_status(); RETURN_MM(); } RETURN_CTOR(message);}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:51,
示例20: 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,
示例21: PHP_METHOD/** * Read the model's column map, this can't be inferred */PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getColumnMaps) { HashTable *_1$$3; HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; zval *model, *dependencyInjector, *orderedColumnMap = NULL, *userColumnMap = NULL, *reversedColumnMap = NULL, *name = NULL, *userName = NULL, **_2$$3; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dependencyInjector); ZEPHIR_INIT_VAR(orderedColumnMap); ZVAL_NULL(orderedColumnMap); ZEPHIR_INIT_VAR(reversedColumnMap); ZVAL_NULL(reversedColumnMap); if ((zephir_method_exists_ex(model, SS("columnmap") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&userColumnMap, model, "columnmap", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(userColumnMap) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "columnMap() not returned an array", "phalcon/mvc/model/metadata/strategy/introspection.zep", 198); return; } ZEPHIR_INIT_NVAR(reversedColumnMap); array_init(reversedColumnMap); ZEPHIR_CPY_WRT(orderedColumnMap, userColumnMap); zephir_is_iterable(userColumnMap, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/metadata/strategy/introspection.zep", 205); for ( ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS ; zend_hash_move_forward_ex(_1$$3, &_0$$3) ) { ZEPHIR_GET_HMKEY(name, _1$$3, _0$$3); ZEPHIR_GET_HVALUE(userName, _2$$3); zephir_array_update_zval(&reversedColumnMap, userName, &name, PH_COPY | PH_SEPARATE); } } zephir_create_array(return_value, 2, 0 TSRMLS_CC); zephir_array_fast_append(return_value, orderedColumnMap); zephir_array_fast_append(return_value, reversedColumnMap); RETURN_MM();}
开发者ID:CameronHall,项目名称:cphalcon,代码行数:45,
示例22: PHP_METHOD/** * Returns the annotations found in the methods' docblocks */PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) { zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; HashTable *_2; HashPosition _1; zval *annotations, *reflectionMethods, *collections, *methodName = NULL, *reflectionMethod = NULL, *_0, **_3, *_4 = NULL; ZEPHIR_MM_GROW(); ZEPHIR_OBS_VAR(annotations); zephir_read_property_this(&annotations, this_ptr, SL("_methodAnnotations"), PH_NOISY_CC); if (Z_TYPE_P(annotations) != IS_OBJECT) { ZEPHIR_OBS_VAR(reflectionMethods); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_reflectionData"), PH_NOISY_CC); if (zephir_array_isset_string_fetch(&reflectionMethods, _0, SS("methods"), 0 TSRMLS_CC)) { if (zephir_fast_count_int(reflectionMethods TSRMLS_CC)) { ZEPHIR_INIT_VAR(collections); array_init(collections); zephir_is_iterable(reflectionMethods, &_2, &_1, 0, 0, "phalcon/annotations/reflection.zep", 104); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(methodName, _2, _1); ZEPHIR_GET_HVALUE(reflectionMethod, _3); ZEPHIR_INIT_NVAR(_4); object_init_ex(_4, phalcon_annotations_collection_ce); ZEPHIR_CALL_METHOD(NULL, _4, "__construct", &_5, 19, reflectionMethod); zephir_check_call_status(); zephir_array_update_zval(&collections, methodName, &_4, PH_COPY | PH_SEPARATE); } zephir_update_property_this(this_ptr, SL("_methodAnnotations"), collections TSRMLS_CC); RETURN_CCTOR(collections); } } zephir_update_property_this(this_ptr, SL("_methodAnnotations"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); RETURN_MM_BOOL(0); } RETURN_CCTOR(annotations);}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:45,
示例23: PHP_METHOD/** * Returns the paths using positions as keys and names as values * * @return array */PHP_METHOD(Test_Router_Route, getReversedPaths) { HashTable *_2; HashPosition _1; zval *reversed, *path = NULL, *position = NULL, *_0, **_3; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(reversed); array_init(reversed); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_paths"), PH_NOISY_CC); zephir_is_iterable(_0, &_2, &_1, 0, 0); for ( ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zend_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(path, _2, _1); ZEPHIR_GET_HVALUE(position, _3); zephir_array_update_zval(&reversed, position, &path, PH_COPY | PH_SEPARATE); } RETURN_CCTOR(reversed);}
开发者ID:hellcore,项目名称:zephir,代码行数:28,
示例24: PHP_METHOD//.........这里部分代码省略......... 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/libmemcached.zep", 192); 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 (!(zephir_is_true(content))) { 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(); } 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, 0); 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, memcache, "set", NULL, 0, lastKey, cachedContent, tt1); zephir_check_call_status(); } else { ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, preparedContent, tt1); zephir_check_call_status(); } if (!(zephir_is_true(success))) { ZEPHIR_INIT_VAR(_1$$16); object_init_ex(_1$$16, phalcon_cache_exception_ce); ZEPHIR_CALL_METHOD(&_2$$16, memcache, "getresultcode", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(_3$$16); ZEPHIR_CONCAT_SV(_3$$16, "Failed storing data in memcached, error code: ", _2$$16); ZEPHIR_CALL_METHOD(NULL, _1$$16, "__construct", NULL, 9, _3$$16); zephir_check_call_status(); zephir_throw_exception_debug(_1$$16, "phalcon/cache/backend/libmemcached.zep", 238 TSRMLS_CC); ZEPHIR_MM_RESTORE(); 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/libmemcached.zep", 244); return; } if (!ZEPHIR_IS_STRING(specialKey, "")) { ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); zephir_check_call_status(); if (Z_TYPE_P(keys) != IS_ARRAY) { ZEPHIR_INIT_NVAR(keys); array_init(keys); } if (!(zephir_array_isset(keys, lastKey))) { zephir_array_update_zval(&keys, lastKey, &tt1, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, memcache, "set", NULL, 0, specialKey, keys); zephir_check_call_status(); } } 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(this_ptr, SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); } else { zephir_update_property_this(this_ptr, SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); } ZEPHIR_MM_RESTORE();}
开发者ID:jaskaransingh156,项目名称:cphalcon,代码行数:101,
示例25: PHP_METHODPHP_METHOD(Phalcon_Validation_Validator_Uniqueness, isUniqueness) { zval *_32$$16 = NULL, *_44$$20 = NULL, *_58$$25 = NULL; zend_bool _11$$7, _18$$12; zend_class_entry *_78; HashTable *_2, *_8, *_24$$13, *_29$$15, *_41$$19, *_50$$22, *_55$$24, *_68$$27; HashPosition _1, _7, _23$$13, _28$$15, _40$$19, _49$$22, _54$$24, _67$$27; zephir_fcall_cache_entry *_5 = NULL, *_12 = NULL, *_14 = NULL; int ZEPHIR_LAST_CALL_STATUS, index = 0; zval *validation, *field = NULL, *value = NULL, *values = NULL, *convert = NULL, *record = NULL, *attribute = NULL, *except = NULL, *params = NULL, *metaData = NULL, *primaryField = NULL, *className = NULL, *singleField = NULL, *fieldExcept = NULL, *singleExcept = NULL, *notInValues = NULL, *exceptConditions = NULL, *_0 = NULL, **_3, **_9, *_63 = NULL, *_76, *_77 = NULL, *_4$$4 = NULL, *_6$$5 = NULL, *_10$$7 = NULL, *_13$$7 = NULL, _15$$10 = zval_used_for_init, *_16$$10 = NULL, *_17$$11 = NULL, *_19$$12, _20$$12, _21$$12, *_22$$12 = NULL, **_25$$13, *_26$$14 = NULL, *_27$$14 = NULL, **_30$$15, *_33$$15 = NULL, *_34$$15 = NULL, _31$$16 = zval_used_for_init, _35$$17 = zval_used_for_init, *_36$$17 = NULL, *_37$$18 = NULL, *_38$$18, *_39$$18, **_42$$19, *_45$$19, *_46$$19, _43$$20 = zval_used_for_init, _47$$21, *_48$$21, **_51$$22, *_52$$23 = NULL, *_53$$23 = NULL, **_56$$24, *_59$$24 = NULL, *_60$$24 = NULL, _57$$25 = zval_used_for_init, _61$$26 = zval_used_for_init, *_62$$26 = NULL, *_64$$27 = NULL, *_65$$27, *_66$$27 = NULL, **_69$$27, *_70$$28 = NULL, _71$$28 = zval_used_for_init, *_72$$28 = NULL, *_73$$28 = NULL, *_74$$29, *_75$$29; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &validation, &field); ZEPHIR_SEPARATE_PARAM(field); ZEPHIR_INIT_VAR(exceptConditions); array_init(exceptConditions); index = 0; ZEPHIR_INIT_VAR(params); zephir_create_array(params, 2, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_0); array_init(_0); zephir_array_update_string(¶ms, SL("conditions"), &_0, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_0); array_init(_0); zephir_array_update_string(¶ms, SL("bind"), &_0, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(field) != IS_ARRAY) { ZEPHIR_CPY_WRT(singleField, field); ZEPHIR_INIT_NVAR(field); array_init(field); zephir_array_append(&field, singleField, PH_SEPARATE, "phalcon/validation/validator/uniqueness.zep", 156); } ZEPHIR_INIT_VAR(values); array_init(values); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "convert", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&convert, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); zephir_is_iterable(field, &_2, &_1, 0, 0, "phalcon/validation/validator/uniqueness.zep", 166); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(singleField, _3); ZEPHIR_CALL_METHOD(&_4$$4, validation, "getvalue", &_5, 0, singleField); zephir_check_call_status(); zephir_array_update_zval(&values, singleField, &_4$$4, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(convert) != IS_NULL) { ZEPHIR_CALL_ZVAL_FUNCTION(&_6$$5, convert, NULL, 0, values); zephir_check_call_status(); ZEPHIR_CPY_WRT(values, _6$$5); if (!(Z_TYPE_P(values) == IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Value conversion must return an array", "phalcon/validation/validator/uniqueness.zep", 170); return; } } zephir_is_iterable(field, &_8, &_7, 0, 0, "phalcon/validation/validator/uniqueness.zep", 200); for ( ; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS ; zephir_hash_move_forward_ex(_8, &_7) ) { ZEPHIR_GET_HVALUE(singleField, _9); ZEPHIR_INIT_NVAR(fieldExcept); ZVAL_NULL(fieldExcept); ZEPHIR_INIT_NVAR(notInValues); array_init(notInValues); ZEPHIR_INIT_NVAR(_10$$7); ZVAL_STRING(_10$$7, "model", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&record, this_ptr, "getoption", NULL, 0, _10$$7); zephir_check_temp_parameter(_10$$7); zephir_check_call_status(); ZEPHIR_OBS_NVAR(value); zephir_array_fetch(&value, values, singleField, PH_NOISY, "phalcon/validation/validator/uniqueness.zep", 178 TSRMLS_CC); _11$$7 = ZEPHIR_IS_EMPTY(record); if (!(_11$$7)) { _11$$7 = Z_TYPE_P(record) != IS_OBJECT; } if (_11$$7) { ZEPHIR_CALL_METHOD(&record, validation, "getentity", &_12, 0); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(record)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Model of record must be set to property /"model/"", "phalcon/validation/validator/uniqueness.zep", 184); return; } } ZEPHIR_INIT_NVAR(_10$$7); ZVAL_STRING(_10$$7, "attribute", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_13$$7, this_ptr, "getoption", NULL, 0, _10$$7, singleField); zephir_check_temp_parameter(_10$$7); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&attribute, this_ptr, "getcolumnnamereal", &_14, 0, record, _13$$7); zephir_check_call_status(); if (Z_TYPE_P(value) != IS_NULL) { ZEPHIR_SINIT_NVAR(_15$$10); ZVAL_LONG(&_15$$10, index); ZEPHIR_INIT_LNVAR(_16$$10);//.........这里部分代码省略.........
开发者ID:coolsnow77,项目名称:cphalcon,代码行数:101,
示例26: 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, ×tamp_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_update_zval函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zephir_check_call_status函数代码示例 C++ zephir_array_update_string函数代码示例 |