这篇教程C++ zephir_array_update_string函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zephir_array_update_string函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_array_update_string函数的具体用法?C++ zephir_array_update_string怎么用?C++ zephir_array_update_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zephir_array_update_string函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHOD//.........这里部分代码省略......... ZEPHIR_OBS_VAR(fieldTypes); if (zephir_array_isset_fetch(&fieldTypes, types, field, 0 TSRMLS_CC)) { ZEPHIR_CPY_WRT(types, fieldTypes); } if (Z_TYPE_P(types) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'allowedTypes' must be an array", "phalcon/validation/validator/file.zep", 198); return; } if ((zephir_function_exists_ex(SS("finfo_open") TSRMLS_CC) == SUCCESS)) { ZEPHIR_SINIT_VAR(_47$$13); ZVAL_LONG(&_47$$13, 16); ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 250, &_47$$13); zephir_check_call_status(); zephir_array_fetch_string(&_48$$13, value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 203 TSRMLS_CC); ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 251, tmp, _48$$13); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 252, tmp); zephir_check_call_status(); } else { ZEPHIR_OBS_NVAR(mime); zephir_array_fetch_string(&mime, value, SL("type"), PH_NOISY, "phalcon/validation/validator/file.zep", 207 TSRMLS_CC); } if (!(zephir_fast_in_array(mime, types TSRMLS_CC))) { ZEPHIR_INIT_VAR(_49$$15); ZVAL_STRING(_49$$15, "FileType", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_50$$15); ZVAL_STRING(_50$$15, "messageType", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "preparemessage", NULL, 0, validation, field, _49$$15, _50$$15); zephir_check_temp_parameter(_49$$15); zephir_check_temp_parameter(_50$$15); zephir_check_call_status(); ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 2, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_49$$15); zephir_fast_join_str(_49$$15, SL(", "), types TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":types"), &_49$$15, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_49$$15); object_init_ex(_49$$15, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_51$$15, "strtr", &_11, 27, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_50$$15); ZVAL_STRING(_50$$15, "FileType", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _49$$15, "__construct", &_12, 475, _51$$15, field, _50$$15, code); zephir_check_temp_parameter(_50$$15); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _49$$15); zephir_check_call_status(); RETURN_MM_BOOL(0); } } ZEPHIR_INIT_NVAR(_28); ZVAL_STRING(_28, "minResolution", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_52, this_ptr, "hasoption", NULL, 0, _28); zephir_check_temp_parameter(_28); zephir_check_call_status(); _53 = zephir_is_true(_52); if (!(_53)) { ZEPHIR_INIT_NVAR(_28); ZVAL_STRING(_28, "maxResolution", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_54, this_ptr, "hasoption", NULL, 0, _28); zephir_check_temp_parameter(_28); zephir_check_call_status(); _53 = zephir_is_true(_54); } if (_53) {
开发者ID:adam-rocska,项目名称:cphalcon,代码行数:67,
示例2: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, validate) { zend_bool _2; int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *value = NULL, *domain = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *strict = NULL, *_0 = NULL, *_1 = NULL, *_3 = NULL, *_5 = NULL, *_4$$5, *_6$$7 = NULL, *_8$$7 = NULL, *_9$$7, *_7$$9; 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(); ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_0, this_ptr, "issetoption", NULL, 0, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); _2 = zephir_is_true(_0); if (_2) { _2 = ZEPHIR_IS_EMPTY(value); } if (_2) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(_1); ZVAL_STRING(_1, "domain", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); if (Z_TYPE_P(domain) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'domain' must be an array", "phalcon/validation/validator/inclusionin.zep", 62); return; } ZEPHIR_INIT_VAR(strict); ZVAL_BOOL(strict, 0); ZEPHIR_INIT_NVAR(_1); ZVAL_STRING(_1, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_3, this_ptr, "issetoption", NULL, 0, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); if (zephir_is_true(_3)) { if (Z_TYPE_P(strict) != IS_BOOL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'strict' must be a boolean", "phalcon/validation/validator/inclusionin.zep", 68); return; } ZEPHIR_INIT_VAR(_4$$5); ZVAL_STRING(_4$$5, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, _4$$5); zephir_check_temp_parameter(_4$$5); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 358, value, domain, strict); zephir_check_call_status(); if (!(zephir_is_true(_5))) { ZEPHIR_INIT_VAR(_6$$7); ZVAL_STRING(_6$$7, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _6$$7); zephir_check_temp_parameter(_6$$7); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_6$$7); ZVAL_STRING(_6$$7, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _6$$7); zephir_check_temp_parameter(_6$$7); zephir_check_call_status(); ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 2, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_6$$7); zephir_fast_join_str(_6$$7, SL(", "), domain TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":domain"), &_6$$7, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_VAR(_7$$9); ZVAL_STRING(_7$$9, "InclusionIn", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _7$$9); zephir_check_temp_parameter(_7$$9); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_6$$7); object_init_ex(_6$$7, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_8$$7, "strtr", NULL, 55, message, replacePairs); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:101,
示例3: PHP_METHOD/** * Phalcon/Di/FactoryDefault/CLI constructor */PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { zval *_2 = NULL, *_3 = NULL, *_4 = NULL, _5 = zval_used_for_init; zval *_1; int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL, *_6 = NULL; ZEPHIR_MM_GROW(); ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_cli_ce, this_ptr, "__construct", &_0, 144); zephir_check_call_status(); ZEPHIR_INIT_VAR(_1); zephir_create_array(_1, 10, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_VAR(_3); ZVAL_STRING(_3, "router", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "Phalcon//CLI//Router", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_VAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "dispatcher", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//CLI//Dispatcher", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_NVAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//Mvc//Model//Manager", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_NVAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//Mvc//Model//MetaData//Memory", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_NVAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//Filter", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_NVAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "escaper", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//Escaper", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_SINIT_NVAR(_5); ZVAL_BOOL(&_5, 1); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", &_6, 139, _3, _4, &_5); zephir_check_temp_parameter(_3); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_di_service_ce); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "annotations", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "Phalcon//Annotations//Adapter//Memory", ZEPHIR_TEMP_PARAM_COPY);//.........这里部分代码省略.........
开发者ID:AndrewUshchenko,项目名称:cphalcon,代码行数:101,
示例4: 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,
示例5: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_StringLength, validate) { zend_bool _1, _3; zephir_fcall_cache_entry *_8 = NULL, *_10 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *isSetMin = NULL, *isSetMax = NULL, *value = NULL, *length = NULL, *message = NULL, *minimum = NULL, *maximum = NULL, *label = NULL, *replacePairs = NULL, *_0 = NULL, *_2 = NULL, *_4$$8, *_5$$9 = NULL, *_7$$9 = NULL, *_9$$9, *_6$$10, *_11$$11, *_12$$12 = NULL, *_14$$12 = NULL, *_15$$12, *_13$$13; 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_INIT_VAR(_0); ZVAL_STRING(_0, "min", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&isSetMin, this_ptr, "issetoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "max", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&isSetMax, this_ptr, "issetoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); _1 = !zephir_is_true(isSetMin); if (_1) { _1 = !zephir_is_true(isSetMax); } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "A minimum or maximum must be set", "phalcon/validation/validator/stringlength.zep", 62); return; } ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); _3 = zephir_is_true(_2); if (_3) { _3 = ZEPHIR_IS_EMPTY(value); } if (_3) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 359, value); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(length); ZVAL_LONG(length, zephir_fast_strlen_ev(value)); } if (zephir_is_true(isSetMax)) { ZEPHIR_INIT_VAR(_4$$8); ZVAL_STRING(_4$$8, "max", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, _4$$8); zephir_check_temp_parameter(_4$$8); zephir_check_call_status(); if (ZEPHIR_GT(length, maximum)) { ZEPHIR_INIT_VAR(_5$$9); ZVAL_STRING(_5$$9, "messageMaximum", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$9); zephir_check_temp_parameter(_5$$9); zephir_check_call_status(); ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 2, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); zephir_array_update_string(&replacePairs, SL(":max"), &maximum, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_VAR(_6$$10); ZVAL_STRING(_6$$10, "TooLong", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _6$$10); zephir_check_temp_parameter(_6$$10); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_5$$9); object_init_ex(_5$$9, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_7$$9, "strtr", &_8, 55, message, replacePairs);//.........这里部分代码省略.........
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:101,
示例6: PHP_METHOD/** * Gets a value from the internal related entity or from the default value */PHP_METHOD(Phalcon_Forms_Form, getValue) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL, *entity = NULL, *method = NULL, *value = NULL, *data = NULL, *internal = NULL, *forbidden = NULL, *_1, *_0$$4; zval *name = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { zephir_get_strval(name, name_param); } else { ZEPHIR_INIT_VAR(name); ZVAL_EMPTY_STRING(name); } ZEPHIR_OBS_VAR(entity); zephir_read_property_this(&entity, this_ptr, SL("_entity"), PH_NOISY_CC); ZEPHIR_OBS_VAR(data); zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); if ((zephir_method_exists_ex(this_ptr, SS("getcustomvalue") TSRMLS_CC) == SUCCESS)) { ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcustomvalue", NULL, 0, name, entity, data); zephir_check_call_status(); RETURN_MM(); } if (Z_TYPE_P(entity) == IS_OBJECT) { ZEPHIR_INIT_VAR(_0$$4); zephir_camelize(_0$$4, name, NULL ); ZEPHIR_INIT_VAR(method); ZEPHIR_CONCAT_SV(method, "get", _0$$4); if ((zephir_method_exists(entity, method TSRMLS_CC) == SUCCESS)) { ZEPHIR_RETURN_CALL_METHOD_ZVAL(entity, method, NULL, 0); zephir_check_call_status(); RETURN_MM(); } ZEPHIR_OBS_VAR(value); if (zephir_fetch_property_zval(&value, entity, name, PH_SILENT_CC)) { RETURN_CCTOR(value); } } if (Z_TYPE_P(data) == IS_ARRAY) { ZEPHIR_OBS_NVAR(value); if (zephir_array_isset_fetch(&value, data, name, 0 TSRMLS_CC)) { RETURN_CCTOR(value); } } ZEPHIR_INIT_VAR(forbidden); zephir_create_array(forbidden, 12, 0 TSRMLS_CC); zephir_array_update_string(&forbidden, SL("validation"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("action"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("useroption"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("useroptions"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("entity"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("elements"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("messages"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("messagesfor"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("label"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("value"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("di"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); zephir_array_update_string(&forbidden, SL("eventsmanager"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(internal); zephir_fast_strtolower(internal, name); if (zephir_array_isset(forbidden, internal)) { RETURN_MM_NULL(); } ZEPHIR_INIT_VAR(_1); zephir_camelize(_1, name, NULL ); ZEPHIR_INIT_NVAR(method); ZEPHIR_CONCAT_SV(method, "get", _1); if ((zephir_method_exists(this_ptr, method TSRMLS_CC) == SUCCESS)) { ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, method, NULL, 0); zephir_check_call_status(); RETURN_MM(); } RETURN_MM_NULL();}
开发者ID:racztiborzoltan,项目名称:cphalcon,代码行数:85,
示例7: PHP_METHOD/** * Reconfigure the route adding a new pattern and a set of paths * * @param string pattern * @param array paths */PHP_METHOD(Test_Router_Route, reConfigure) { int ZEPHIR_LAST_CALL_STATUS, _0$$5; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, moduleName, controllerName, actionName, parts, routePaths, realClassName, namespaceName, pcrePattern, compiledPattern, extracted, _1$$10, _2$$19, _3$$19; ZEPHIR_INIT_THIS(); ZVAL_UNDEF(&pattern_sub); ZVAL_UNDEF(&paths_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&moduleName); ZVAL_UNDEF(&controllerName); ZVAL_UNDEF(&actionName); ZVAL_UNDEF(&parts); ZVAL_UNDEF(&routePaths); ZVAL_UNDEF(&realClassName); ZVAL_UNDEF(&namespaceName); ZVAL_UNDEF(&pcrePattern); ZVAL_UNDEF(&compiledPattern); ZVAL_UNDEF(&extracted); ZVAL_UNDEF(&_1$$10); ZVAL_UNDEF(&_2$$19); ZVAL_UNDEF(&_3$$19); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern, &paths); if (!paths) { paths = &paths_sub; paths = &__$null; } if (Z_TYPE_P(pattern) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(test_router_exception_ce, "The pattern must be string", "test/router/route.zep", 270); return; } if (Z_TYPE_P(paths) != IS_NULL) { if (Z_TYPE_P(paths) == IS_STRING) { ZEPHIR_INIT_VAR(&moduleName); ZVAL_NULL(&moduleName); ZEPHIR_INIT_VAR(&controllerName); ZVAL_NULL(&controllerName); ZEPHIR_INIT_VAR(&actionName); ZVAL_NULL(&actionName); ZEPHIR_INIT_VAR(&parts); zephir_fast_explode_str(&parts, SL("::"), paths, LONG_MAX TSRMLS_CC); do { _0$$5 = zephir_fast_count_int(&parts TSRMLS_CC); if (_0$$5 == 3) { ZEPHIR_OBS_NVAR(&moduleName); zephir_array_fetch_long(&moduleName, &parts, 0, PH_NOISY, "test/router/route.zep", 286 TSRMLS_CC); ZEPHIR_OBS_NVAR(&controllerName); zephir_array_fetch_long(&controllerName, &parts, 1, PH_NOISY, "test/router/route.zep", 287 TSRMLS_CC); ZEPHIR_OBS_NVAR(&actionName); zephir_array_fetch_long(&actionName, &parts, 2, PH_NOISY, "test/router/route.zep", 288 TSRMLS_CC); break; } if (_0$$5 == 2) { ZEPHIR_OBS_NVAR(&controllerName); zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "test/router/route.zep", 291 TSRMLS_CC); ZEPHIR_OBS_NVAR(&actionName); zephir_array_fetch_long(&actionName, &parts, 1, PH_NOISY, "test/router/route.zep", 292 TSRMLS_CC); break; } if (_0$$5 == 1) { ZEPHIR_OBS_NVAR(&controllerName); zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "test/router/route.zep", 295 TSRMLS_CC); break; } } while(0); ZEPHIR_INIT_VAR(&routePaths); array_init(&routePaths); if (Z_TYPE_P(&moduleName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&controllerName) != IS_NULL) { if (zephir_memnstr_str(&controllerName, SL("//"), "test/router/route.zep", 310)) { ZEPHIR_INIT_VAR(&realClassName); zephir_get_class_ns(&realClassName, &controllerName, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(&namespaceName); zephir_get_ns_class(&namespaceName, &controllerName, 0 TSRMLS_CC); if (zephir_is_true(&namespaceName)) { zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CPY_WRT(&realClassName, &controllerName); } ZEPHIR_INIT_VAR(&_1$$10); zephir_uncamelize(&_1$$10, &realClassName); zephir_array_update_string(&routePaths, SL("controller"), &_1$$10, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&actionName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE);//.........这里部分代码省略.........
开发者ID:crocodile2u,项目名称:zephir,代码行数:101,
示例8: PHP_METHOD/** * Phalcon/Session/Adapter/Redis constructor */PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct) { zephir_fcall_cache_entry *_13 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *options_param = NULL, *lifetime = NULL, *_2, *_3, *_5, *_7 = NULL, *_0$$3, *_1$$4; zval *options = NULL, *_4, *_6, *_8, *_9, *_10, *_11, *_12; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { ZEPHIR_INIT_VAR(options); array_init(options); } else { zephir_get_arrval(options, options_param); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0$$3); ZVAL_STRING(_0$$3, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_VAR(_1$$4); ZVAL_LONG(_1$$4, 6379); zephir_array_update_string(&options, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(lifetime); if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC)) { zephir_update_property_this(this_ptr, SL("_lifetime"), lifetime TSRMLS_CC); } ZEPHIR_INIT_VAR(_2); object_init_ex(_2, phalcon_cache_backend_redis_ce); ZEPHIR_INIT_VAR(_3); object_init_ex(_3, phalcon_cache_frontend_none_ce); if (zephir_has_constructor(_3 TSRMLS_CC)) { ZEPHIR_INIT_VAR(_4); zephir_create_array(_4, 1, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_5); zephir_read_property_this(&_5, this_ptr, SL("_lifetime"), PH_NOISY_CC); zephir_array_update_string(&_4, SL("lifetime"), &_5, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 0, _4); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 336, _3, options); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_redis"), _2 TSRMLS_CC); ZEPHIR_INIT_VAR(_6); zephir_create_array(_6, 2, 0 TSRMLS_CC); zephir_array_fast_append(_6, this_ptr); ZEPHIR_INIT_VAR(_7); ZVAL_STRING(_7, "open", 1); zephir_array_fast_append(_6, _7); ZEPHIR_INIT_VAR(_8); zephir_create_array(_8, 2, 0 TSRMLS_CC); zephir_array_fast_append(_8, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "close", 1); zephir_array_fast_append(_8, _7); ZEPHIR_INIT_VAR(_9); zephir_create_array(_9, 2, 0 TSRMLS_CC); zephir_array_fast_append(_9, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "read", 1); zephir_array_fast_append(_9, _7); ZEPHIR_INIT_VAR(_10); zephir_create_array(_10, 2, 0 TSRMLS_CC); zephir_array_fast_append(_10, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "write", 1); zephir_array_fast_append(_10, _7); ZEPHIR_INIT_VAR(_11); zephir_create_array(_11, 2, 0 TSRMLS_CC); zephir_array_fast_append(_11, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "destroy", 1); zephir_array_fast_append(_11, _7); ZEPHIR_INIT_VAR(_12); zephir_create_array(_12, 2, 0 TSRMLS_CC); zephir_array_fast_append(_12, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "gc", 1); zephir_array_fast_append(_12, _7); ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 436, _6, _8, _9, _10, _11, _12); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_redis_ce, this_ptr, "__construct", &_13, 437, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:bschantz,项目名称:cphalcon,代码行数:97,
示例9: PHP_METHODPHP_METHOD(PhalconPlus_Db_Mysql, __construct) { zval *_2, *_4; int ZEPHIR_LAST_CALL_STATUS; zval *confName = NULL; zval *di, *confName_param = NULL, *_0, *config = NULL, *dbConfig, *_1, *_3 = NULL, *_5, *_6; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &di, &confName_param); if (unlikely(Z_TYPE_P(confName_param) != IS_STRING && Z_TYPE_P(confName_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'confName' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(confName_param) == IS_STRING)) { zephir_get_strval(confName, confName_param); } else { ZEPHIR_INIT_VAR(confName); ZVAL_EMPTY_STRING(confName); } ZEPHIR_INIT_VAR(_0); array_init(_0); zephir_update_property_this(this_ptr, SL("descriptor"), _0 TSRMLS_CC); ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "config", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&config, di, "get", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(dbConfig); zephir_read_property_zval(&dbConfig, config, confName, PH_NOISY_CC); zephir_update_property_this(this_ptr, SL("di"), di TSRMLS_CC); ZEPHIR_INIT_VAR(_2); zephir_create_array(_2, 6, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_3); zephir_read_property(&_3, dbConfig, SL("host"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("host"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(_3); zephir_read_property(&_3, dbConfig, SL("port"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("port"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(_3); zephir_read_property(&_3, dbConfig, SL("username"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("username"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(_3); zephir_read_property(&_3, dbConfig, SL("password"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("password"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(_3); zephir_read_property(&_3, dbConfig, SL("dbname"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("dbname"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(_4); zephir_create_array(_4, 3, 0 TSRMLS_CC); ZEPHIR_OBS_NVAR(_3); zephir_read_property(&_3, dbConfig, SL("charset"), PH_NOISY_CC); ZEPHIR_INIT_VAR(_5); ZEPHIR_CONCAT_SV(_5, "SET NAMES ", _3); zephir_array_update_long(&_4, 1002, &_5, PH_COPY, "phalconplus/Db/Mysql.zep", 29); ZEPHIR_OBS_VAR(_6); zephir_read_property(&_6, dbConfig, SL("timeout"), PH_NOISY_CC); zephir_array_update_long(&_4, 2, &_6, PH_COPY, "phalconplus/Db/Mysql.zep", 29); add_index_long(_4, 3, 2); zephir_array_update_string(&_2, SL("options"), &_4, PH_COPY | PH_SEPARATE); zephir_update_property_this(this_ptr, SL("descriptor"), _2 TSRMLS_CC); ZEPHIR_MM_RESTORE();}
开发者ID:xuwenping,项目名称:phalconplus,代码行数:67,
示例10: PHP_METHOD/** * Phalcon/Mvc/Model/MetaData/Memcache constructor * * @param array options */PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct) { int ZEPHIR_LAST_CALL_STATUS; zval *_2; zval *options = NULL, *ttl, *_0 = NULL, *_1, *_3, *_4; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 11211); zephir_array_update_string(&options, SL("port"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 0); zephir_array_update_string(&options, SL("persistent"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("statsKey")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "_PHCM_MM", 1); zephir_array_update_string(&options, SL("statsKey"), &_0, PH_COPY | PH_SEPARATE); } if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { zephir_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC); } ZEPHIR_INIT_NVAR(_0); object_init_ex(_0, phalcon_cache_backend_memcache_ce); ZEPHIR_INIT_VAR(_1); object_init_ex(_1, phalcon_cache_frontend_data_ce); ZEPHIR_INIT_VAR(_2); zephir_create_array(_2, 1, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_3); zephir_read_property_this(&_3, this_ptr, SL("_ttl"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("lifetime"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 312, _2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 315, _1, options); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_memcache"), _0 TSRMLS_CC); ZEPHIR_INIT_VAR(_4); array_init(_4); zephir_update_property_this(this_ptr, SL("_metaData"), _4 TSRMLS_CC); ZEPHIR_MM_RESTORE();}
开发者ID:AlloVince,项目名称:cphalcon,代码行数:68,
示例11: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Identical, validate) { int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *message = NULL, *label = NULL, *replacePairs, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3 = NULL, *_4; 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(&_0, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(_2); ZVAL_STRING(_2, "accepted", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getoption", NULL, 0, _2); zephir_check_temp_parameter(_2); zephir_check_call_status(); if (!ZEPHIR_IS_EQUAL(_0, _1)) { ZEPHIR_INIT_NVAR(_2); ZVAL_STRING(_2, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _2); zephir_check_temp_parameter(_2); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_2); ZVAL_STRING(_2, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _2); zephir_check_temp_parameter(_2); zephir_check_call_status(); ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_NVAR(_2); ZVAL_STRING(_2, "Identical", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _2); zephir_check_temp_parameter(_2); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_2); object_init_ex(_2, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_3, "strtr", NULL, 53, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "Identical", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 430, _3, field, _4); zephir_check_temp_parameter(_4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _2); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:spuy767,项目名称:cphalcon,代码行数:73,
示例12: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Between, validate) { zend_bool _3; int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *value = NULL, *minimum = NULL, *maximum = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *code = NULL, *_0 = NULL, *_1$$3, *_2$$4, *_4$$5 = NULL, *_9$$5 = NULL, *_10$$5, *_5$$6, *_6$$8, *_7$$9, *_8$$10; 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(); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "minimum", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&minimum, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "maximum", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(minimum) == IS_ARRAY) { zephir_array_fetch(&_1$$3, minimum, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/between.zep", 72 TSRMLS_CC); ZEPHIR_CPY_WRT(minimum, _1$$3); } if (Z_TYPE_P(maximum) == IS_ARRAY) { zephir_array_fetch(&_2$$4, maximum, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/between.zep", 76 TSRMLS_CC); ZEPHIR_CPY_WRT(maximum, _2$$4); } _3 = ZEPHIR_LT(value, minimum); if (!(_3)) { _3 = ZEPHIR_GT(value, maximum); } if (_3) { ZEPHIR_INIT_VAR(_4$$5); ZVAL_STRING(_4$$5, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _4$$5); zephir_check_temp_parameter(_4$$5); zephir_check_call_status(); if (Z_TYPE_P(label) == IS_ARRAY) { zephir_array_fetch(&_5$$6, label, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/between.zep", 83 TSRMLS_CC); ZEPHIR_CPY_WRT(label, _5$$6); } if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_4$$5); ZVAL_STRING(_4$$5, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _4$$5); zephir_check_temp_parameter(_4$$5); zephir_check_call_status(); if (Z_TYPE_P(message) == IS_ARRAY) { zephir_array_fetch(&_6$$8, message, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/between.zep", 91 TSRMLS_CC); ZEPHIR_CPY_WRT(message, _6$$8); } ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 3, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); zephir_array_update_string(&replacePairs, SL(":min"), &minimum, PH_COPY | PH_SEPARATE); zephir_array_update_string(&replacePairs, SL(":max"), &maximum, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_VAR(_7$$9); ZVAL_STRING(_7$$9, "Between", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _7$$9); zephir_check_temp_parameter(_7$$9); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_4$$5); ZVAL_STRING(_4$$5, "code", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, _4$$5); zephir_check_temp_parameter(_4$$5); zephir_check_call_status(); if (Z_TYPE_P(code) == IS_ARRAY) { zephir_array_fetch(&_8$$10, code, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/between.zep", 100 TSRMLS_CC); ZEPHIR_CPY_WRT(code, _8$$10); } ZEPHIR_INIT_NVAR(_4$$5); object_init_ex(_4$$5, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_9$$5, "strtr", NULL, 26, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_10$$5); ZVAL_STRING(_10$$5, "Between", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _4$$5, "__construct", NULL, 462, _9$$5, field, _10$$5, code);//.........这里部分代码省略.........
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:101,
示例13: PHP_METHOD/** * Phalcon/Mvc/Model/MetaData/Redis constructor * * @param array options */PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct) { zval *_6; int ZEPHIR_LAST_CALL_STATUS; zval *options = NULL, *ttl = NULL, *_4, *_5, *_7, *_8, *_0$$4, *_1$$5, *_2$$6, *_3$$7; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(options); } if (Z_TYPE_P(options) != IS_ARRAY) { ZEPHIR_INIT_NVAR(options); array_init(options); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0$$4); ZVAL_STRING(_0$$4, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_VAR(_1$$5); ZVAL_LONG(_1$$5, 6379); zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { ZEPHIR_INIT_VAR(_2$$6); ZVAL_LONG(_2$$6, 0); zephir_array_update_string(&options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("statsKey")))) { ZEPHIR_INIT_VAR(_3$$7); ZVAL_STRING(_3$$7, "_PHCM_MM", 1); zephir_array_update_string(&options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE); } if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { zephir_update_property_this(this_ptr, SL("_ttl"), ttl TSRMLS_CC); } ZEPHIR_INIT_VAR(_4); object_init_ex(_4, phalcon_cache_backend_redis_ce); ZEPHIR_INIT_VAR(_5); object_init_ex(_5, phalcon_cache_frontend_data_ce); ZEPHIR_INIT_VAR(_6); zephir_create_array(_6, 1, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_7); zephir_read_property_this(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC); zephir_array_update_string(&_6, SL("lifetime"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 313, _6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 317, _5, options); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_redis"), _4 TSRMLS_CC); ZEPHIR_INIT_VAR(_8); array_init(_8); zephir_update_property_this(this_ptr, SL("_metaData"), _8 TSRMLS_CC); ZEPHIR_MM_RESTORE();}
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:68,
示例14: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Confirmation, validate) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *fieldWith = NULL, *value = NULL, *valueWith = NULL, *message = NULL, *label = NULL, *labelWith = NULL, *replacePairs = NULL, *code = NULL, *_0, *_2 = NULL, *_1$$3, *_3$$4 = NULL, *_5$$4 = NULL, *_6$$4, *_4$$5; 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 a 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_INIT_VAR(_0); ZVAL_STRING(_0, "with", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&fieldWith, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(fieldWith) == IS_ARRAY) { zephir_array_fetch(&_1$$3, fieldWith, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/confirmation.zep", 81 TSRMLS_CC); ZEPHIR_CPY_WRT(fieldWith, _1$$3); } ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&valueWith, validation, "getvalue", NULL, 0, fieldWith); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 481, value, valueWith); zephir_check_call_status(); if (!(zephir_is_true(_2))) { ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(_3$$4); ZVAL_STRING(_3$$4, "Confirmation", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "preparemessage", NULL, 0, validation, field, _3$$4); zephir_check_temp_parameter(_3$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&code, this_ptr, "preparecode", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_3$$4); ZVAL_STRING(_3$$4, "labelWith", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&labelWith, this_ptr, "getoption", NULL, 0, _3$$4); zephir_check_temp_parameter(_3$$4); zephir_check_call_status(); if (Z_TYPE_P(labelWith) == IS_ARRAY) { zephir_array_fetch(&_4$$5, labelWith, fieldWith, PH_NOISY | PH_READONLY, "phalcon/validation/validator/confirmation.zep", 94 TSRMLS_CC); ZEPHIR_CPY_WRT(labelWith, _4$$5); } if (ZEPHIR_IS_EMPTY(labelWith)) { ZEPHIR_CALL_METHOD(&labelWith, validation, "getlabel", NULL, 0, fieldWith); zephir_check_call_status(); } ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 2, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); zephir_array_update_string(&replacePairs, SL(":with"), &labelWith, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_3$$4); object_init_ex(_3$$4, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_5$$4, "strtr", NULL, 27, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_6$$4); ZVAL_STRING(_6$$4, "Confirmation", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _3$$4, "__construct", NULL, 478, _5$$4, field, _6$$4, code); zephir_check_temp_parameter(_6$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _3$$4); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:luomor,项目名称:cphalcon,代码行数:82,
示例15: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, validate) { int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *value = NULL, *domain = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *strict = NULL, *fieldDomain = NULL, *code = NULL, *_0 = NULL, *_1 = NULL, *_4 = NULL, *_2$$6, *_3$$7, *_5$$9 = NULL, *_10$$9 = NULL, *_11$$9, *_6$$10, *_7$$12, *_8$$13, *_9$$14; 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(); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); ZEPHIR_OBS_VAR(fieldDomain); if (zephir_array_isset_fetch(&fieldDomain, domain, field, 0 TSRMLS_CC)) { if (Z_TYPE_P(fieldDomain) == IS_ARRAY) { ZEPHIR_CPY_WRT(domain, fieldDomain); } } if (Z_TYPE_P(domain) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'domain' must be an array", "phalcon/validation/validator/inclusionin.zep", 87); return; } ZEPHIR_INIT_VAR(strict); ZVAL_BOOL(strict, 0); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "hasoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (zephir_is_true(_1)) { ZEPHIR_INIT_VAR(_2$$6); ZVAL_STRING(_2$$6, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, _2$$6); zephir_check_temp_parameter(_2$$6); zephir_check_call_status(); if (Z_TYPE_P(strict) == IS_ARRAY) { zephir_array_fetch(&_3$$7, strict, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/inclusionin.zep", 95 TSRMLS_CC); ZEPHIR_CPY_WRT(strict, _3$$7); } if (Z_TYPE_P(strict) != IS_BOOL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'strict' must be a boolean", "phalcon/validation/validator/inclusionin.zep", 99); return; } } ZEPHIR_CALL_FUNCTION(&_4, "in_array", NULL, 381, value, domain, strict); zephir_check_call_status(); if (!(zephir_is_true(_4))) { ZEPHIR_INIT_VAR(_5$$9); ZVAL_STRING(_5$$9, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _5$$9); zephir_check_temp_parameter(_5$$9); zephir_check_call_status(); if (Z_TYPE_P(label) == IS_ARRAY) { zephir_array_fetch(&_6$$10, label, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/inclusionin.zep", 110 TSRMLS_CC); ZEPHIR_CPY_WRT(label, _6$$10); } if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_5$$9); ZVAL_STRING(_5$$9, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$9); zephir_check_temp_parameter(_5$$9); zephir_check_call_status(); if (Z_TYPE_P(message) == IS_ARRAY) { zephir_array_fetch(&_7$$12, message, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/inclusionin.zep", 118 TSRMLS_CC); ZEPHIR_CPY_WRT(message, _7$$12); } ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 2, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_5$$9); zephir_fast_join_str(_5$$9, SL(", "), domain TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":domain"), &_5$$9, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_VAR(_8$$13); ZVAL_STRING(_8$$13, "InclusionIn", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _8$$13); zephir_check_temp_parameter(_8$$13); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:Studentsov,项目名称:cphalcon,代码行数:101,
示例16: PHP_METHODPHP_METHOD(Monapi_Image_ResizeOptions_Auto, getSizeByAuto) { zval *width_param = NULL, *height_param = NULL, *original_width_param = NULL, *original_height_param = NULL, *optimal_width = NULL, *optimal_height = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *sizes; int width, height, original_width, original_height, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &width_param, &height_param, &original_width_param, &original_height_param); width = zephir_get_intval(width_param); height = zephir_get_intval(height_param); original_width = zephir_get_intval(original_width_param); original_height = zephir_get_intval(original_height_param); if (original_height < original_width) { ZEPHIR_INIT_VAR(optimal_width); ZVAL_LONG(optimal_width, width); ZEPHIR_INIT_VAR(_0); ZVAL_LONG(_0, original_width); ZEPHIR_INIT_VAR(_1); ZVAL_LONG(_1, original_height); ZEPHIR_CALL_SELF(&optimal_height, "getsizebyfixedwidth", NULL, optimal_width, _0, _1); zephir_check_call_status(); if (ZEPHIR_GT_LONG(optimal_height, height)) { ZEPHIR_INIT_NVAR(optimal_height); ZVAL_LONG(optimal_height, height); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, original_width); ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, original_height); ZEPHIR_CALL_SELF(&optimal_width, "getsizebyfixedheight", NULL, optimal_height, _0, _1); zephir_check_call_status(); } } else if (original_height > original_width) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, height); ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, original_width); ZEPHIR_INIT_VAR(_2); ZVAL_LONG(_2, original_height); ZEPHIR_CALL_SELF(&optimal_width, "getsizebyfixedheight", NULL, _0, _1, _2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(optimal_height); ZVAL_LONG(optimal_height, height); if (ZEPHIR_GT_LONG(optimal_width, width)) { ZEPHIR_INIT_NVAR(optimal_width); ZVAL_LONG(optimal_width, width); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, original_width); ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, original_height); ZEPHIR_CALL_SELF(&optimal_height, "getsizebyfixedwidth", NULL, optimal_width, _0, _1); zephir_check_call_status(); } } else { if (height > width) { ZEPHIR_INIT_NVAR(optimal_width); ZVAL_LONG(optimal_width, width); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, width); ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, original_width); ZEPHIR_INIT_NVAR(_2); ZVAL_LONG(_2, original_height); ZEPHIR_CALL_SELF(&optimal_height, "getsizebyfixedwidth", NULL, _0, _1, _2); zephir_check_call_status(); } else if (height < width) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, height); ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, original_width); ZEPHIR_INIT_NVAR(_2); ZVAL_LONG(_2, original_height); ZEPHIR_CALL_SELF(&optimal_width, "getsizebyfixedheight", NULL, _0, _1, _2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(optimal_height); ZVAL_LONG(optimal_height, height); } else { ZEPHIR_INIT_NVAR(optimal_width); ZVAL_LONG(optimal_width, width); ZEPHIR_INIT_NVAR(optimal_height); ZVAL_LONG(optimal_height, height); } } ZEPHIR_INIT_VAR(sizes); array_init_size(sizes, 3); zephir_array_update_string(&sizes, SL("optimal_width"), &optimal_width, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sizes, SL("optimal_height"), &optimal_height, PH_COPY | PH_SEPARATE); RETURN_CCTOR(sizes);}
开发者ID:noikiy,项目名称:Image-Thumbnailer-PHP-Extension,代码行数:91,
示例17: PHP_METHOD/** * Returns an array of Phalcon/Db/Column objects describing a table * * <code> * print_r($connection->describeColumns("posts")); * </code> * * @param string table * @param string schema * @return Phalcon/Db/Column[] */PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) { zephir_fcall_cache_entry *_17 = NULL; zephir_nts_static zephir_fcall_cache_entry *_10 = NULL; HashTable *_5; HashPosition _4; int ZEPHIR_LAST_CALL_STATUS; zval *table_param = NULL, *schema_param = NULL, *columns, *columnType = NULL, *field = NULL, *definition = NULL, *oldColumn = NULL, *sizePattern, *matches = NULL, *matchOne = NULL, *matchTwo = NULL, *columnName, *_0 = NULL, *_1, *_2 = NULL, *_3 = NULL, **_6, *_7 = NULL, *_8 = NULL, *_9 = NULL, *_11 = NULL, *_12, *_13, *_14, *_15 = NULL, *_16; zval *table = NULL, *schema = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); zephir_get_strval(table, table_param); if (!schema_param) { ZEPHIR_INIT_VAR(schema); ZVAL_EMPTY_STRING(schema); } else { zephir_get_strval(schema, schema_param); } ZEPHIR_INIT_VAR(oldColumn); ZVAL_NULL(oldColumn); ZEPHIR_INIT_VAR(sizePattern); ZVAL_STRING(sizePattern, "#//(([0-9]+)(?:,//s*([0-9]+))*//)#", 1); ZEPHIR_INIT_VAR(columns); array_init(columns); _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&_2, _1, "describecolumns", NULL, table, schema); zephir_check_call_status(); ZEPHIR_INIT_VAR(_3); ZVAL_LONG(_3, 3); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, _2, _3); zephir_check_call_status(); zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 271); for ( ; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS ; zephir_hash_move_forward_ex(_5, &_4) ) { ZEPHIR_GET_HVALUE(field, _6); ZEPHIR_INIT_NVAR(definition); zephir_create_array(definition, 1, 0 TSRMLS_CC); add_assoc_long_ex(definition, SS("bindType"), 2); ZEPHIR_OBS_NVAR(columnType); zephir_array_fetch_long(&columnType, field, 1, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 115 TSRMLS_CC); while (1) { if (zephir_memnstr_str(columnType, SL("enum"), "phalcon/db/adapter/pdo/mysql.zep", 122)) { ZEPHIR_INIT_NVAR(_3); ZVAL_LONG(_3, 5); zephir_array_update_string(&definition, SL("type"), &_3, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/mysql.zep", 130)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 0); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, 1); zephir_array_update_string(&definition, SL("bindType"), &_8, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("varchar"), "phalcon/db/adapter/pdo/mysql.zep", 140)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 2); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("datetime"), "phalcon/db/adapter/pdo/mysql.zep", 148)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 4); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("decimal"), "phalcon/db/adapter/pdo/mysql.zep", 156)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 3); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, 32); zephir_array_update_string(&definition, SL("bindType"), &_8, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("char"), "phalcon/db/adapter/pdo/mysql.zep", 166)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 5); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE);//.........这里部分代码省略.........
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:101,
示例18: PHP_METHOD/** * Executes the validator */PHP_METHOD(Phalcon_Mvc_Model_Validator_Url, validate) { zval *_5; zend_bool _2; int ZEPHIR_LAST_CALL_STATUS; zval *record, *field = NULL, *value = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, _3, *_4 = NULL, *_6 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/url.zep", 62); return; } ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); _2 = zephir_is_true(_1); if (_2) { _2 = ZEPHIR_IS_EMPTY(value); } if (_2) { RETURN_MM_BOOL(1); } ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 273); ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 192, value, &_3); zephir_check_call_status(); if (!(zephir_is_true(_4))) { ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_NVAR(message); ZVAL_STRING(message, ":field does not have a valid url format", 1); } ZEPHIR_INIT_VAR(_5); zephir_create_array(_5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_5, SL(":field"), &field, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 54, message, _5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "Url", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _6, field, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:AlloVince,项目名称:cphalcon,代码行数:67,
示例19: PHP_METHOD/** * Executes validator */PHP_METHOD(Phalcon_Mvc_Model_Validator_Inclusionin, validate) { zval *_7; zephir_nts_static zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL; zend_bool _3; int ZEPHIR_LAST_CALL_STATUS; zval *record, *field = NULL, *domain = NULL, *value = NULL, *message = NULL, *strict = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_4 = NULL, *_5 = NULL, *_8 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/inclusionin.zep", 63); return; } ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'domain' is required for this validator", "phalcon/mvc/model/validator/inclusionin.zep", 70); return; } ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(domain) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Option 'domain' must be an array", "phalcon/mvc/model/validator/inclusionin.zep", 75); return; } ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, field); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); _3 = zephir_is_true(_2); if (_3) { _3 = ZEPHIR_IS_EMPTY(value); } if (_3) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(strict); ZVAL_BOOL(strict, 0); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_4, this_ptr, "issetoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (zephir_is_true(_4)) { if (Z_TYPE_P(strict) != IS_BOOL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Option 'strict' must be a boolean", "phalcon/mvc/model/validator/inclusionin.zep", 87); return; } ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "strict", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_5, "in_array", &_6, value, domain, strict); zephir_check_call_status(); if (!(zephir_is_true(_5))) { ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_NVAR(message); ZVAL_STRING(message, "Value of field ':field' must be part of list: :domain", 1); } ZEPHIR_INIT_VAR(_7); zephir_create_array(_7, 2, 0 TSRMLS_CC); zephir_array_update_string(&_7, SL(":field"), &field, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_0); zephir_fast_join_str(_0, SL(", "), domain TSRMLS_CC); zephir_array_update_string(&_7, SL(":domain"), &_0, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_FUNCTION(&_8, "strtr", &_9, message, _7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "Inclusion", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, _8, field, _0); zephir_check_temp_parameter(_0); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:flaver12,项目名称:cphalcon,代码行数:101,
示例20: PHP_METHOD/** * Resolves the service based on its configuration */PHP_METHOD(Phalcon_Di, get) { zend_bool _6$$6; zval *_1$$3, *_7$$12; int ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL, *parameters = NULL, *service = NULL, *eventsManager = NULL, *instance = NULL, *_0, *_2$$3, *_3$$4, *_4$$7, *_8$$12; zval *name = NULL, *_5$$7; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, ¶meters); if (unlikely(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(name_param) == IS_STRING)) { zephir_get_strval(name, name_param); } else { ZEPHIR_INIT_VAR(name); ZVAL_EMPTY_STRING(name); } if (!parameters) { parameters = ZEPHIR_GLOBAL(global_null); } ZEPHIR_INIT_VAR(instance); ZVAL_NULL(instance); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); ZEPHIR_CPY_WRT(eventsManager, _0); if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_VAR(_1$$3); zephir_create_array(_1$$3, 2, 0 TSRMLS_CC); zephir_array_update_string(&_1$$3, SL("name"), &name, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_1$$3, SL("parameters"), ¶meters, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(_2$$3); ZVAL_STRING(_2$$3, "di:beforeServiceResolve", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&instance, eventsManager, "fire", NULL, 0, _2$$3, this_ptr, _1$$3); zephir_check_temp_parameter(_2$$3); zephir_check_call_status(); } if (Z_TYPE_P(instance) != IS_OBJECT) { ZEPHIR_OBS_VAR(service); _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); if (zephir_array_isset_fetch(&service, _3$$4, name, 0 TSRMLS_CC)) { ZEPHIR_CALL_METHOD(&instance, service, "resolve", NULL, 0, parameters, this_ptr); zephir_check_call_status(); } else { if (!(zephir_class_exists(name, 1 TSRMLS_CC))) { ZEPHIR_INIT_VAR(_4$$7); object_init_ex(_4$$7, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(_5$$7); ZEPHIR_CONCAT_SVS(_5$$7, "Service '", name, "' wasn't found in the dependency injection container"); ZEPHIR_CALL_METHOD(NULL, _4$$7, "__construct", NULL, 9, _5$$7); zephir_check_call_status(); zephir_throw_exception_debug(_4$$7, "phalcon/di.zep", 236 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } _6$$6 = Z_TYPE_P(parameters) == IS_ARRAY; if (_6$$6) { _6$$6 = ((zephir_fast_count_int(parameters TSRMLS_CC)) ? 1 : 0); } if (_6$$6) { ZEPHIR_INIT_NVAR(instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, name, parameters TSRMLS_CC); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, name TSRMLS_CC); zephir_check_call_status(); } } } if (Z_TYPE_P(instance) == IS_OBJECT) { if (zephir_instance_of_ev(instance, phalcon_di_injectionawareinterface_ce TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, instance, "setdi", NULL, 0, this_ptr); zephir_check_call_status(); } } if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_VAR(_7$$12); zephir_create_array(_7$$12, 3, 0 TSRMLS_CC); zephir_array_update_string(&_7$$12, SL("name"), &name, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_7$$12, SL("parameters"), ¶meters, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_7$$12, SL("instance"), &instance, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(_8$$12); ZVAL_STRING(_8$$12, "di:afterServiceResolve", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _8$$12, this_ptr, _7$$12); zephir_check_temp_parameter(_8$$12); zephir_check_call_status(); } RETURN_CCTOR(instance);}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:98,
示例21: PHP_METHOD/** * Executes the event listeners; sorts, calls, and returns result. * * @param /Xpl/Event/Event event Event object. * @param array listeners Array of Listener objects. * @param array args Callback arguments. * @return array Array of event callback results. */PHP_METHOD(Xpl_Event_Manager, execute) { HashTable *_3; HashPosition _2; zephir_fcall_cache_entry *_7 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *listeners = NULL, *args = NULL, *_0, *_8; zval *event, *listeners_param = NULL, *args_param = NULL, *results = NULL, *listener = NULL, *value = NULL, *_1, **_4, *_9 = NULL, *_5$$4 = NULL, *_6$$3 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &event, &listeners_param, &args_param); ZEPHIR_SEPARATE_PARAM(event); listeners = listeners_param; if (!args_param) { ZEPHIR_INIT_VAR(args); array_init(args); } else { args = args_param; } ZEPHIR_INIT_VAR(results); array_init(results); ZEPHIR_INIT_VAR(_0); zephir_create_array(_0, 2, 0 TSRMLS_CC); zephir_array_fast_append(_0, this_ptr); ZEPHIR_OBS_VAR(_1); zephir_read_property_this(&_1, this_ptr, SL("sortFunction"), PH_NOISY_CC); zephir_array_fast_append(_0, _1); ZEPHIR_MAKE_REF(listeners); ZEPHIR_CALL_FUNCTION(NULL, "usort", NULL, 85, listeners, _0); ZEPHIR_UNREF(listeners); zephir_check_call_status(); ZEPHIR_MAKE_REF(args); ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 80, args, event); ZEPHIR_UNREF(args); zephir_check_call_status(); zephir_is_iterable(listeners, &_3, &_2, 0, 0, "xpl/event/manager.zep", 427); for ( ; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS ; zephir_hash_move_forward_ex(_3, &_2) ) { ZEPHIR_GET_HVALUE(listener, _4); ZEPHIR_CALL_ZVAL_FUNCTION(&value, listener, NULL, 0, args); zephir_check_call_status(); zephir_array_append(&results, value, PH_SEPARATE, "xpl/event/manager.zep", 408); if (Z_TYPE_P(value) != IS_NULL) { ZEPHIR_OBS_NVAR(_5$$4); zephir_read_property(&_5$$4, event, SL("value"), PH_NOISY_CC); if (!ZEPHIR_IS_IDENTICAL(value, _5$$4)) { zephir_update_property_zval(event, SL("value"), value TSRMLS_CC); } } ZEPHIR_INIT_NVAR(value); ZVAL_NULL(value); ZEPHIR_CALL_METHOD(&_6$$3, event, "ispropagationstopped", &_7, 105); zephir_check_call_status(); if (zephir_is_true(_6$$3)) { break; } } ZEPHIR_INIT_VAR(_8); zephir_create_array(_8, 2, 0 TSRMLS_CC); zephir_array_update_string(&_8, SL("event"), &event, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8, SL("result"), &results, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(&_9, event, "getid", NULL, 0); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("completed"), _9, _8 TSRMLS_CC); RETURN_CCTOR(results);}
开发者ID:wells5609,项目名称:xpl,代码行数:80,
示例22: PHP_METHOD//.........这里部分代码省略......... ZEPHIR_INIT_NVAR(columnMap); ZVAL_NULL(columnMap); } ZEPHIR_CALL_METHOD(&_20$$16, metaData, "getprimarykeyattributes", NULL, 0, record); zephir_check_call_status(); zephir_is_iterable(_20$$16, &_22$$16, &_21$$16, 0, 0, "phalcon/mvc/model/validator/uniqueness.zep", 197); for ( ; zephir_hash_get_current_data_ex(_22$$16, (void**) &_23$$16, &_21$$16) == SUCCESS ; zephir_hash_move_forward_ex(_22$$16, &_21$$16) ) { ZEPHIR_GET_HVALUE(primaryField, _23$$16); ZEPHIR_OBS_NVAR(bindType); if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, primaryField, 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(_24$$20); object_init_ex(_24$$20, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_25$$20); ZEPHIR_CONCAT_SVS(_25$$20, "Column '", primaryField, "' isn't part of the table columns"); ZEPHIR_CALL_METHOD(NULL, _24$$20, "__construct", &_6, 9, _25$$20); zephir_check_call_status(); zephir_throw_exception_debug(_24$$20, "phalcon/mvc/model/validator/uniqueness.zep", 174 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } if (Z_TYPE_P(columnMap) == IS_ARRAY) { ZEPHIR_OBS_NVAR(attributeField); if (!(zephir_array_isset_fetch(&attributeField, columnMap, primaryField, 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(_26$$22); object_init_ex(_26$$22, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_27$$22); ZEPHIR_CONCAT_SVS(_27$$22, "Column '", primaryField, "' isn't part of the column map"); ZEPHIR_CALL_METHOD(NULL, _26$$22, "__construct", &_6, 9, _27$$22); zephir_check_call_status(); zephir_throw_exception_debug(_26$$22, "phalcon/mvc/model/validator/uniqueness.zep", 182 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { ZEPHIR_CPY_WRT(attributeField, primaryField); } ZEPHIR_SINIT_NVAR(_28$$19); ZVAL_LONG(&_28$$19, number); ZEPHIR_INIT_LNVAR(_29$$19); ZEPHIR_CONCAT_SVSV(_29$$19, "[", attributeField, "] <> ?", &_28$$19); zephir_array_append(&conditions, _29$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 191); ZEPHIR_CALL_METHOD(&_30$$19, record, "readattribute", &_31, 0, primaryField); zephir_check_call_status(); zephir_array_append(&bindParams, _30$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 192); zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 193); number++; } } ZEPHIR_INIT_VAR(params); array_init(params); zephir_array_update_string(¶ms, SL("di"), &dependencyInjector, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_0); zephir_fast_join_str(_0, SL(" AND "), conditions TSRMLS_CC); zephir_array_update_string(¶ms, SL("conditions"), &_0, PH_COPY | PH_SEPARATE); zephir_array_update_string(¶ms, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); zephir_array_update_string(¶ms, SL("bindTypes"), &bindTypes, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(className); zephir_get_class(className, record, 0 TSRMLS_CC); _33 = zephir_fetch_class(className TSRMLS_CC); ZEPHIR_CALL_CE_STATIC(&_32, _33, "count", NULL, 0, params); zephir_check_call_status(); if (!ZEPHIR_IS_LONG(_32, 0)) { ZEPHIR_INIT_VAR(_34$$24); ZVAL_STRING(_34$$24, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _34$$24); zephir_check_temp_parameter(_34$$24); zephir_check_call_status(); ZEPHIR_INIT_VAR(replacePairs); if (Z_TYPE_P(field) == IS_ARRAY) { zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_35$$25); zephir_fast_join_str(_35$$25, SL(", "), field TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":fields"), &_35$$25, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_NVAR(message); ZVAL_STRING(message, "Value of fields: :fields are already present in another record", 1); } } else { zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &field, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_NVAR(message); ZVAL_STRING(message, "Value of field: ':field' is already present in another record", 1); } } ZEPHIR_CALL_FUNCTION(&_36$$24, "strtr", NULL, 26, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_34$$24); ZVAL_STRING(_34$$24, "Unique", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _36$$24, field, _34$$24); zephir_check_temp_parameter(_34$$24); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:Studentsov,项目名称:cphalcon,代码行数:101,
示例23: 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,
示例24: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Date, validate) { int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *value = NULL, *format = NULL, *label = NULL, *message = NULL, *replacePairs = NULL, *_0, *_2 = NULL, *_1$$3, *_3$$5 = NULL, *_7$$5 = NULL, *_8$$5, *_4$$6, *_5$$8, *_6$$9; 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(); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "format", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&format, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); if (Z_TYPE_P(format) == IS_ARRAY) { zephir_array_fetch(&_1$$3, format, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/date.zep", 77 TSRMLS_CC); ZEPHIR_CPY_WRT(format, _1$$3); } if (ZEPHIR_IS_EMPTY(format)) { ZEPHIR_INIT_NVAR(format); ZVAL_STRING(format, "Y-m-d", 1); } ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdate", NULL, 470, value, format); zephir_check_call_status(); if (!(zephir_is_true(_2))) { ZEPHIR_INIT_VAR(_3$$5); ZVAL_STRING(_3$$5, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _3$$5); zephir_check_temp_parameter(_3$$5); zephir_check_call_status(); if (Z_TYPE_P(label) == IS_ARRAY) { zephir_array_fetch(&_4$$6, label, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/date.zep", 87 TSRMLS_CC); ZEPHIR_CPY_WRT(label, _4$$6); } if (ZEPHIR_IS_EMPTY(label)) { ZEPHIR_CALL_METHOD(&label, validation, "getlabel", NULL, 0, field); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_3$$5); ZVAL_STRING(_3$$5, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _3$$5); zephir_check_temp_parameter(_3$$5); zephir_check_call_status(); if (Z_TYPE_P(message) == IS_ARRAY) { zephir_array_fetch(&_5$$8, message, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/date.zep", 95 TSRMLS_CC); ZEPHIR_CPY_WRT(message, _5$$8); } ZEPHIR_INIT_VAR(replacePairs); zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); if (ZEPHIR_IS_EMPTY(message)) { ZEPHIR_INIT_VAR(_6$$9); ZVAL_STRING(_6$$9, "Date", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _6$$9); zephir_check_temp_parameter(_6$$9); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_3$$5); object_init_ex(_3$$5, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_7$$5, "strtr", NULL, 26, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_8$$5); ZVAL_STRING(_8$$5, "Date", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", NULL, 464, _7$$5, field, _8$$5); zephir_check_temp_parameter(_8$$5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _3$$5); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:ntesic,项目名称:cphalcon,代码行数:90,
示例25: PHP_METHOD/** * Phalcon/Session/Adapter/Libmemcached constructor * * @throws /Phalcon/Session/Exception */PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct) { zephir_fcall_cache_entry *_13 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *options_param = NULL, *servers = NULL, *client = NULL, *lifetime = NULL, *prefix = NULL, *statsKey = NULL, *persistentId = NULL, *_0 = NULL, *_1 = NULL, *_2, *_4, *_7 = NULL; zval *options = NULL, *_3, *_5, *_6, *_8, *_9, *_10, *_11, *_12; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); zephir_get_arrval(options, options_param); ZEPHIR_OBS_VAR(servers); if (!(zephir_array_isset_string_fetch(&servers, options, SS("servers"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "No servers given in options", "phalcon/session/adapter/libmemcached.zep", 76); return; } ZEPHIR_OBS_VAR(client); if (!(zephir_array_isset_string_fetch(&client, options, SS("client"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(client); ZVAL_NULL(client); } ZEPHIR_OBS_VAR(lifetime); if (!(zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(lifetime); ZVAL_LONG(lifetime, 8600); } ZEPHIR_INIT_VAR(_0); ZVAL_LONG(_0, 2592000); ZEPHIR_CALL_FUNCTION(&_1, "min", NULL, 436, lifetime, _0); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_lifetime"), _1 TSRMLS_CC); ZEPHIR_OBS_VAR(prefix); if (!(zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(prefix); ZVAL_NULL(prefix); } ZEPHIR_OBS_VAR(statsKey); if (!(zephir_array_isset_string_fetch(&statsKey, options, SS("statsKey"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(statsKey); ZVAL_STRING(statsKey, "", 1); } ZEPHIR_OBS_VAR(persistentId); if (!(zephir_array_isset_string_fetch(&persistentId, options, SS("persistent_id"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(persistentId); ZVAL_STRING(persistentId, "phalcon-session", 1); } ZEPHIR_INIT_NVAR(_0); object_init_ex(_0, phalcon_cache_backend_libmemcached_ce); ZEPHIR_INIT_VAR(_2); object_init_ex(_2, phalcon_cache_frontend_data_ce); ZEPHIR_INIT_VAR(_3); zephir_create_array(_3, 1, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_4); zephir_read_property_this(&_4, this_ptr, SL("_lifetime"), PH_NOISY_CC); zephir_array_update_string(&_3, SL("lifetime"), &_4, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 334, _3); zephir_check_call_status(); ZEPHIR_INIT_VAR(_5); zephir_create_array(_5, 5, 0 TSRMLS_CC); zephir_array_update_string(&_5, SL("servers"), &servers, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5, SL("client"), &client, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5, SL("prefix"), &prefix, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5, SL("statsKey"), &statsKey, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5, SL("persistent_id"), &persistentId, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 335, _2, _5); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_libmemcached"), _0 TSRMLS_CC); ZEPHIR_INIT_VAR(_6); zephir_create_array(_6, 2, 0 TSRMLS_CC); zephir_array_fast_append(_6, this_ptr); ZEPHIR_INIT_VAR(_7); ZVAL_STRING(_7, "open", 1); zephir_array_fast_append(_6, _7); ZEPHIR_INIT_VAR(_8); zephir_create_array(_8, 2, 0 TSRMLS_CC); zephir_array_fast_append(_8, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "close", 1); zephir_array_fast_append(_8, _7); ZEPHIR_INIT_VAR(_9); zephir_create_array(_9, 2, 0 TSRMLS_CC); zephir_array_fast_append(_9, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "read", 1); zephir_array_fast_append(_9, _7); ZEPHIR_INIT_VAR(_10); zephir_create_array(_10, 2, 0 TSRMLS_CC); zephir_array_fast_append(_10, this_ptr); ZEPHIR_INIT_NVAR(_7); ZVAL_STRING(_7, "write", 1); zephir_array_fast_append(_10, _7); ZEPHIR_INIT_VAR(_11); zephir_create_array(_11, 2, 0 TSRMLS_CC);//.........这里部分代码省略.........
开发者ID:Studentsov,项目名称:cphalcon,代码行数:101,
示例26: PHP_METHOD/** * Reconfigure the route adding a new pattern and a set of paths * * @param string pattern * @param array paths */PHP_METHOD(Test_Router_Route, reConfigure) { int _0, ZEPHIR_LAST_CALL_STATUS; zval *pattern, *paths = NULL, *moduleName = NULL, *controllerName = NULL, *actionName = NULL, *parts, *routePaths = NULL, *realClassName = NULL, *namespaceName, *pcrePattern = NULL, *compiledPattern = NULL, *extracted = NULL, *_1 = NULL, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern, &paths); if (!paths) { paths = ZEPHIR_GLOBAL(global_null); } if (Z_TYPE_P(pattern) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(test_router_exception_ce, "The pattern must be string", "test/router/route.zep", 270); return; } if (Z_TYPE_P(paths) != IS_NULL) { if (Z_TYPE_P(paths) == IS_STRING) { ZEPHIR_INIT_VAR(moduleName); ZVAL_NULL(moduleName); ZEPHIR_INIT_VAR(controllerName); ZVAL_NULL(controllerName); ZEPHIR_INIT_VAR(actionName); ZVAL_NULL(actionName); ZEPHIR_INIT_VAR(parts); zephir_fast_explode_str(parts, SL("::"), paths, LONG_MAX TSRMLS_CC); do { _0 = zephir_fast_count_int(parts TSRMLS_CC); if (_0 == 3) { ZEPHIR_OBS_NVAR(moduleName); zephir_array_fetch_long(&moduleName, parts, 0, PH_NOISY, "test/router/route.zep", 286 TSRMLS_CC); ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 1, PH_NOISY, "test/router/route.zep", 287 TSRMLS_CC); ZEPHIR_OBS_NVAR(actionName); zephir_array_fetch_long(&actionName, parts, 2, PH_NOISY, "test/router/route.zep", 288 TSRMLS_CC); break; } if (_0 == 2) { ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY, "test/router/route.zep", 291 TSRMLS_CC); ZEPHIR_OBS_NVAR(actionName); zephir_array_fetch_long(&actionName, parts, 1, PH_NOISY, "test/router/route.zep", 292 TSRMLS_CC); break; } if (_0 == 1) { ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY, "test/router/route.zep", 295 TSRMLS_CC); break; } } while(0); ZEPHIR_INIT_VAR(routePaths); array_init(routePaths); if (Z_TYPE_P(moduleName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(controllerName) != IS_NULL) { if (zephir_memnstr_str(controllerName, SL("//"), "test/router/route.zep", 310)) { ZEPHIR_INIT_VAR(realClassName); zephir_get_class_ns(realClassName, controllerName, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(namespaceName); zephir_get_ns_class(namespaceName, controllerName, 0 TSRMLS_CC); if (zephir_is_true(namespaceName)) { zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CPY_WRT(realClassName, controllerName); } ZEPHIR_INIT_VAR(_1); zephir_uncamelize(_1, realClassName); zephir_array_update_string(&routePaths, SL("controller"), &_1, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(actionName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CPY_WRT(routePaths, paths); } } else { ZEPHIR_INIT_NVAR(routePaths); array_init(routePaths); } if (Z_TYPE_P(routePaths) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(test_router_exception_ce, "The route contains invalid paths", "test/router/route.zep", 342); return; } if (!(zephir_start_with_str(pattern, SL("#")))) { if (zephir_memnstr_str(pattern, SL("{"), "test/router/route.zep", 348)) { ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, pattern); zephir_check_call_status(); ZEPHIR_OBS_VAR(pcrePattern); zephir_array_fetch_long(&pcrePattern, extracted, 0, PH_NOISY, "test/router/route.zep", 351 TSRMLS_CC); ZEPHIR_INIT_NVAR(_1);//.........这里部分代码省略.........
开发者ID:Storyous,项目名称:zephir,代码行数:101,
示例27: PHP_METHOD/** * Phalcon/Session/Adapter/Memcache constructor */PHP_METHOD(Phalcon_Session_Adapter_Memcache, __construct) { zephir_fcall_cache_entry *_11 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *options_param = NULL, *lifetime, *_0 = NULL, *_1, *_3, *_5 = NULL; zval *options = NULL, *_2, *_4, *_6, *_7, *_8, *_9, *_10; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { ZEPHIR_INIT_VAR(options); array_init(options); } else { zephir_get_arrval(options, options_param); } if (!(zephir_array_isset_string(options, SS("host")))) { ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "127.0.0.1", 1); zephir_array_update_string(&options, SL("host"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("port")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 11211); zephir_array_update_string(&options, SL("port"), &_0, PH_COPY | PH_SEPARATE); } if (!(zephir_array_isset_string(options, SS("persistent")))) { ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 0); zephir_array_update_string(&options, SL("persistent"), &_0, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(lifetime); if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC)) { zephir_update_property_this(this_ptr, SL("_lifetime"), lifetime TSRMLS_CC); } ZEPHIR_INIT_NVAR(_0); object_init_ex(_0, phalcon_cache_backend_memcache_ce); ZEPHIR_INIT_VAR(_1); object_init_ex(_1, phalcon_cache_frontend_data_ce); ZEPHIR_INIT_VAR(_2); zephir_create_array(_2, 1, 0 TSRMLS_CC); ZEPHIR_OBS_VAR(_3); zephir_read_property_this(&_3, this_ptr, SL("_lifetime"), PH_NOISY_CC); zephir_array_update_string(&_2, SL("lifetime"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 318, _2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 321, _1, options); zephir_check_call_status(); zephir_update_property_this(this_ptr, SL("_memcache"), _0 TSRMLS_CC); ZEPHIR_INIT_VAR(_4); zephir_create_array(_4, 2, 0 TSRMLS_CC); zephir_array_fast_append(_4, this_ptr); ZEPHIR_INIT_VAR(_5); ZVAL_STRING(_5, "open", 1); zephir_array_fast_append(_4, _5); ZEPHIR_INIT_VAR(_6); zephir_create_array(_6, 2, 0 TSRMLS_CC); zephir_array_fast_append(_6, this_ptr); ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "close", 1); zephir_array_fast_append(_6, _5); ZEPHIR_INIT_VAR(_7); zephir_create_array(_7, 2, 0 TSRMLS_CC); zephir_array_fast_append(_7, this_ptr); ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "read", 1); zephir_array_fast_append(_7, _5); ZEPHIR_INIT_VAR(_8); zephir_create_array(_8, 2, 0 TSRMLS_CC); zephir_array_fast_append(_8, this_ptr); ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "write", 1); zephir_array_fast_append(_8, _5); ZEPHIR_INIT_VAR(_9); zephir_create_array(_9, 2, 0 TSRMLS_CC); zephir_array_fast_append(_9, this_ptr); ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "destroy", 1); zephir_array_fast_append(_9, _5); ZEPHIR_INIT_VAR(_10); zephir_create_array(_10, 2, 0 TSRMLS_CC); zephir_array_fast_append(_10, this_ptr); ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "gc", 1); zephir_array_fast_append(_10, _5); ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 410, _4, _6, _7, _8, _9, _10); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_memcache_ce, this_ptr, "__construct", &_11, 411, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:97,
示例28: PHP_METHOD/** * Reconfigure the route adding a new pattern and a set of paths * * @param string pattern * @param array paths */PHP_METHOD(Test_Router_Route, reConfigure) { int _1; zval *pattern, *paths = NULL, *moduleName = NULL, *controllerName = NULL, *actionName = NULL, *parts, *routePaths = NULL, *realClassName = NULL, *namespaceName, *pcrePattern = NULL, *compiledPattern = NULL, *extracted, _0, *_2 = NULL, *_3; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern, &paths); if (!paths) { ZEPHIR_CPY_WRT(paths, ZEPHIR_GLOBAL(global_null)); } if ((Z_TYPE_P(pattern) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The pattern must be string"); return; } if ((Z_TYPE_P(paths) != IS_NULL)) { if ((Z_TYPE_P(paths) == IS_STRING)) { ZEPHIR_INIT_VAR(moduleName); ZVAL_NULL(moduleName); ZEPHIR_INIT_VAR(controllerName); ZVAL_NULL(controllerName); ZEPHIR_INIT_VAR(actionName); ZVAL_NULL(actionName); ZEPHIR_SINIT_VAR(_0); ZVAL_STRING(&_0, "::", 0); ZEPHIR_INIT_VAR(parts); zephir_call_func_p2(parts, "explode", &_0, paths); do { _1 = zephir_fast_count_int(parts TSRMLS_CC); if ((_1 == 3)) { ZEPHIR_OBS_NVAR(moduleName); zephir_array_fetch_long(&moduleName, parts, 0, PH_NOISY TSRMLS_CC); ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 1, PH_NOISY TSRMLS_CC); ZEPHIR_OBS_NVAR(actionName); zephir_array_fetch_long(&actionName, parts, 2, PH_NOISY TSRMLS_CC); break; } if ((_1 == 2)) { ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY TSRMLS_CC); ZEPHIR_OBS_NVAR(actionName); zephir_array_fetch_long(&actionName, parts, 1, PH_NOISY TSRMLS_CC); break; } if ((_1 == 1)) { ZEPHIR_OBS_NVAR(controllerName); zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY TSRMLS_CC); break; } } while(0); ZEPHIR_INIT_VAR(routePaths); array_init(routePaths); if ((Z_TYPE_P(moduleName) != IS_NULL)) { zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE); } if ((Z_TYPE_P(controllerName) != IS_NULL)) { if (zephir_memnstr_str(controllerName, SL("//"), "test/router/route.zep", 313)) { ZEPHIR_INIT_VAR(realClassName); zephir_call_func_p1(realClassName, "get_class_ns", controllerName); ZEPHIR_INIT_VAR(namespaceName); zephir_call_func_p1(namespaceName, "get_ns_class", controllerName); if (zephir_is_true(namespaceName)) { zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CPY_WRT(realClassName, controllerName); } ZEPHIR_INIT_VAR(_2); zephir_uncamelize(_2, realClassName); zephir_array_update_string(&routePaths, SL("controller"), &_2, PH_COPY | PH_SEPARATE); } if ((Z_TYPE_P(actionName) != IS_NULL)) { zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CPY_WRT(routePaths, paths); } } else { ZEPHIR_INIT_NVAR(routePaths); array_init(routePaths); } if ((Z_TYPE_P(routePaths) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The route contains invalid paths"); return; } if (!(zephir_start_with_str(pattern, SL("#")))) { if (zephir_memnstr_str(pattern, SL("{"), "test/router/route.zep", 351)) { ZEPHIR_INIT_VAR(extracted); zephir_call_method_p1(extracted, this_ptr, "extractnamedparams", pattern); ZEPHIR_OBS_VAR(pcrePattern);//.........这里部分代码省略.........
开发者ID:hellcore,项目名称:zephir,代码行数:101,
示例29: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Identical, validate) { zend_bool valid = 0; zend_long ZEPHIR_LAST_CALL_STATUS; zval *validation, validation_sub, *field, field_sub, message, label, replacePairs, value, accepted, valueOption, code, _0, _1, _2$$3, _3$$4, _4$$5, _5$$5, _6$$6, _7$$7, _8$$8, _9$$8, _10$$8; zval *this_ptr = getThis(); ZVAL_UNDEF(&validation_sub); ZVAL_UNDEF(&field_sub); ZVAL_UNDEF(&message); ZVAL_UNDEF(&label); ZVAL_UNDEF(&replacePairs); ZVAL_UNDEF(&value); ZVAL_UNDEF(&accepted); ZVAL_UNDEF(&valueOption); ZVAL_UNDEF(&code); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$5); ZVAL_UNDEF(&_5$$5); ZVAL_UNDEF(&_6$$6); ZVAL_UNDEF(&_7$$7); ZVAL_UNDEF(&_8$$8); ZVAL_UNDEF(&_9$$8); ZVAL_UNDEF(&_10$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &validation, &field); ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "accepted"); ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasoption", NULL, 0, &_1); zephir_check_call_status(); if (zephir_is_true(&_0)) { ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "accepted"); ZEPHIR_CALL_METHOD(&accepted, this_ptr, "getoption", NULL, 0, &_2$$3); zephir_check_call_status(); if (Z_TYPE_P(&accepted) == IS_ARRAY) { zephir_array_fetch(&_3$$4, &accepted, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/identical.zep", 73 TSRMLS_CC); ZEPHIR_CPY_WRT(&accepted, &_3$$4); } valid = ZEPHIR_IS_EQUAL(&value, &accepted); } else { ZEPHIR_INIT_VAR(&_5$$5); ZVAL_STRING(&_5$$5, "value"); ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "hasoption", NULL, 0, &_5$$5); zephir_check_call_status(); if (zephir_is_true(&_4$$5)) { ZEPHIR_INIT_VAR(&_6$$6); ZVAL_STRING(&_6$$6, "value"); ZEPHIR_CALL_METHOD(&valueOption, this_ptr, "getoption", NULL, 0, &_6$$6); zephir_check_call_status(); if (Z_TYPE_P(&valueOption) == IS_ARRAY) { zephir_array_fetch(&_7$$7, &valueOption, field, PH_NOISY | PH_READONLY, "phalcon/validation/validator/identical.zep", 80 TSRMLS_CC); ZEPHIR_CPY_WRT(&valueOption, &_7$$7); } valid = ZEPHIR_IS_EQUAL(&value, &valueOption); } } if (!(valid)) { ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$8); ZVAL_STRING(&_8$$8, "Identical"); ZEPHIR_CALL_METHOD(&message, this_ptr, "preparemessage", NULL, 0, validation, field, &_8$$8); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&code, this_ptr, "preparecode", NULL, 0, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(&replacePairs); zephir_create_array(&replacePairs, 1, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &label, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8$$8); object_init_ex(&_8$$8, phalcon_messages_message_ce); ZEPHIR_CALL_FUNCTION(&_9$$8, "strtr", NULL, 50, &message, &replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_10$$8); ZVAL_STRING(&_10$$8, "Identical"); ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 299, &_9$$8, field, &_10$$8, &code); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_8$$8); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:dschissler,项目名称:cphalcon,代码行数:96,
示例30: PHP_METHOD//.........这里部分代码省略......... isRoute = 1; ZEPHIR_INIT_NVAR(methods); ZVAL_STRING(methods, "DELETE", 1); break; } if (ZEPHIR_IS_STRING(name, "Options")) { isRoute = 1; ZEPHIR_INIT_NVAR(methods); ZVAL_STRING(methods, "OPTIONS", 1); break; } } while(0); if (isRoute == 1) { ZEPHIR_INIT_VAR(_0); _1 = zephir_fetch_nproperty_this(this_ptr, SL("_actionSuffix"), PH_NOISY_CC); ZEPHIR_SINIT_VAR(_2); ZVAL_STRING(&_2, "", 0); zephir_fast_str_replace(&_0, _1, &_2, action TSRMLS_CC); ZEPHIR_INIT_VAR(actionName); zephir_fast_strtolower(actionName, _0); ZEPHIR_OBS_VAR(routePrefix); zephir_read_property_this(&routePrefix, this_ptr, SL("_routePrefix"), PH_NOISY_CC); ZEPHIR_INIT_VAR(_3); ZVAL_STRING(_3, "paths", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&paths, annotation, "getnamedargument", NULL, 0, _3); zephir_check_temp_parameter(_3); zephir_check_call_status(); if (Z_TYPE_P(paths) != IS_ARRAY) { ZEPHIR_INIT_NVAR(paths); array_init(paths); } if (!(ZEPHIR_IS_EMPTY(module))) { zephir_array_update_string(&paths, SL("module"), &module, PH_COPY | PH_SEPARATE); } if (!(ZEPHIR_IS_EMPTY(namespaceName))) { zephir_array_update_string(&paths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&paths, SL("controller"), &controller, PH_COPY | PH_SEPARATE); zephir_array_update_string(&paths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_3); ZVAL_LONG(_3, 0); ZEPHIR_CALL_METHOD(&value, annotation, "getargument", NULL, 0, _3); zephir_check_call_status(); if (Z_TYPE_P(value) != IS_NULL) { if (!ZEPHIR_IS_STRING(value, "/")) { ZEPHIR_INIT_VAR(uri); ZEPHIR_CONCAT_VV(uri, routePrefix, value); } else { if (Z_TYPE_P(routePrefix) != IS_NULL) { ZEPHIR_CPY_WRT(uri, routePrefix); } else { ZEPHIR_CPY_WRT(uri, value); } } } else { ZEPHIR_INIT_NVAR(uri); ZEPHIR_CONCAT_VV(uri, routePrefix, actionName); } ZEPHIR_CALL_METHOD(&route, this_ptr, "add", NULL, 0, uri, paths); zephir_check_call_status(); if (Z_TYPE_P(methods) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, route, "via", NULL, 0, methods); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(_3);
开发者ID:AlloVince,项目名称:cphalcon,代码行数:67,
注:本文中的zephir_array_update_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zephir_array_update_zval函数代码示例 C++ zephir_array_isset_string_fetch函数代码示例 |