这篇教程C++ zephir_is_true函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zephir_is_true函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_is_true函数的具体用法?C++ zephir_is_true怎么用?C++ zephir_is_true使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zephir_is_true函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHOD/** * Handle the whole command-line tasks */PHP_METHOD(Phalcon_Cli_Console, handle) { zend_bool _5; int ZEPHIR_LAST_CALL_STATUS; zval *arguments_param = NULL, *dependencyInjector = NULL, *router = NULL, *eventsManager = NULL, *moduleName = NULL, *modules = NULL, *module = NULL, *path = NULL, *className = NULL, *moduleObject = NULL, *dispatcher = NULL, *task = NULL, *_0, *_3 = NULL, *_4 = NULL, *_15 = NULL, *_16 = NULL, *_17, *_1$$4 = NULL, *_2$$4, *_6$$6, *_7$$10 = NULL, *_8$$10, *_9$$12, *_10$$12, *_11$$15, *_12$$15, *_13$$17 = NULL, *_14$$17, *_18$$19 = NULL, *_19$$19, *_20$$21; zval *arguments = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &arguments_param); if (!arguments_param) { ZEPHIR_INIT_VAR(arguments); array_init(arguments); } else { zephir_get_arrval(arguments, arguments_param); } ZEPHIR_OBS_VAR(dependencyInjector); zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_console_exception_ce, "A dependency injection object is required to access internal services", "phalcon/cli/console.zep", 69); return; } _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(_2$$4); ZVAL_STRING(_2$$4, "console:boot", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_1$$4, eventsManager, "fire", NULL, 0, _2$$4, this_ptr); zephir_check_temp_parameter(_2$$4); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$4)) { RETURN_MM_BOOL(0); } } ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "router", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); zephir_check_temp_parameter(_4); zephir_check_call_status(); ZEPHIR_CPY_WRT(router, _3); _5 = !(zephir_fast_count_int(arguments TSRMLS_CC)); if (_5) { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); _5 = zephir_is_true(_0); } if (_5) { _6$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, _6$$6); zephir_check_call_status(); } else { ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, arguments); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&moduleName, router, "getmodulename", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(moduleName))) { ZEPHIR_OBS_NVAR(moduleName); zephir_read_property_this(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); } if (zephir_is_true(moduleName)) { if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_VAR(_8$$10); ZVAL_STRING(_8$$10, "console:beforeStartModule", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_7$$10, eventsManager, "fire", NULL, 0, _8$$10, this_ptr, moduleName); zephir_check_temp_parameter(_8$$10); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_7$$10)) { RETURN_MM_BOOL(0); } } ZEPHIR_OBS_VAR(modules); zephir_read_property_this(&modules, this_ptr, SL("_modules"), PH_NOISY_CC); if (!(zephir_array_isset(modules, moduleName))) { ZEPHIR_INIT_VAR(_9$$12); object_init_ex(_9$$12, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(_10$$12); ZEPHIR_CONCAT_SVS(_10$$12, "Module '", moduleName, "' isn't registered in the console container"); ZEPHIR_CALL_METHOD(NULL, _9$$12, "__construct", NULL, 9, _10$$12); zephir_check_call_status(); zephir_throw_exception_debug(_9$$12, "phalcon/cli/console.zep", 109 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_VAR(module); zephir_array_fetch(&module, modules, moduleName, PH_NOISY, "phalcon/cli/console.zep", 112 TSRMLS_CC); if (Z_TYPE_P(module) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_console_exception_ce, "Invalid module definition path", "phalcon/cli/console.zep", 114); return; } ZEPHIR_OBS_VAR(path); if (zephir_array_isset_string_fetch(&path, module, SS("path"), 0 TSRMLS_CC)) { if (!((zephir_file_exists(path TSRMLS_CC) == SUCCESS))) { ZEPHIR_INIT_VAR(_11$$15); object_init_ex(_11$$15, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(_12$$15);//.........这里部分代码省略.........
开发者ID:SDpower,项目名称:cphalcon,代码行数:101,
示例2: PHP_METHOD/** * Connect: Establish connection to a database * @param string hostname Hostname[:port] overriding datasource specs [optional] * @param string username Username overriding datasource specs [optional] * @param string passname Password overriding datasource specs [optional] * @param string database Database name overriding datasource specsString [optional] * @return boolean */PHP_METHOD(ADOdb_Connection, connect) { zend_function *_6 = NULL; HashTable *_4; HashPosition _3; zval *hostname_param = NULL, *username_param = NULL, *password_param = NULL, *database_param = NULL, *options = NULL, *_0, *_1, *_2, *option = NULL, *value = NULL, **_5; zval *hostname = NULL, *username = NULL, *password = NULL, *database = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 5, &hostname_param, &username_param, &password_param, &database_param, &options); if (!hostname_param) { ZEPHIR_INIT_VAR(hostname); ZVAL_EMPTY_STRING(hostname); } else { zephir_get_strval(hostname, hostname_param); } if (!username_param) { ZEPHIR_INIT_VAR(username); ZVAL_EMPTY_STRING(username); } else { zephir_get_strval(username, username_param); } if (!password_param) { ZEPHIR_INIT_VAR(password); ZVAL_EMPTY_STRING(password); } else { zephir_get_strval(password, password_param); } if (!database_param) { ZEPHIR_INIT_VAR(database); ZVAL_EMPTY_STRING(database); } else { zephir_get_strval(database, database_param); } if (!options) { ZEPHIR_INIT_VAR(options); array_init(options); } _0 = zephir_fetch_nproperty_this(this_ptr, SL("connection"), PH_NOISY_CC); if (zephir_is_true(_0)) { RETURN_MM_BOOL(0); } if (hostname && Z_STRLEN_P(hostname)) { _1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC); zephir_call_method_p1_noret(_1, "sethostname", hostname); } if (username && Z_STRLEN_P(username)) { _1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC); zephir_call_method_p1_noret(_1, "setusername", username); } if (password && Z_STRLEN_P(password)) { _1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC); zephir_call_method_p1_noret(_1, "setpassword", password); } if (database && Z_STRLEN_P(database)) { _1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC); zephir_call_method_p1_noret(_1, "setdatabase", database); } ZEPHIR_INIT_VAR(_2); _1 = zephir_fetch_nproperty_this(this_ptr, SL("dso"), PH_NOISY_CC); zephir_call_static_p1(_2, "ADOdb//Driver//DriverManager", "create", _1); zephir_update_property_this(this_ptr, SL("connection"), _2 TSRMLS_CC); zephir_is_iterable(options, &_4, &_3, 0, 0); for ( ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS ; zephir_hash_move_forward_ex(_4, &_3) ) { ZEPHIR_GET_HMKEY(option, _4, _3); ZEPHIR_GET_HVALUE(value, _5); zephir_call_method_p2_cache_noret(this_ptr, "setattribute", &_6, option, value); } RETURN_MM_BOOL(1);}
开发者ID:dario1985,项目名称:adodb,代码行数:85,
示例3: PHP_METHOD/** * We have to cast values manually because parse_ini_file() has a poor implementation. * * @param mixed ini The array casted by `parse_ini_file` */PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { zend_bool _5$$5, _6$$5, _8$$5, _9$$5; HashTable *_1$$3; HashPosition _0$$3; zephir_fcall_cache_entry *_4 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *ini, *key = NULL, *val = NULL, **_2$$3, *_3$$4 = NULL, *_7$$5, *_10$$5, *_11$$9, *_12$$9, _13$$9; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &ini); ZEPHIR_SEPARATE_PARAM(ini); if (Z_TYPE_P(ini) == IS_ARRAY) { zephir_is_iterable(ini, &_1$$3, &_0$$3, 1, 0, "phalcon/config/adapter/ini.zep", 148); for ( ; zephir_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS ; zephir_hash_move_forward_ex(_1$$3, &_0$$3) ) { ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); ZEPHIR_GET_HVALUE(val, _2$$3); ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_cast", &_4, 137, val); zephir_check_call_status(); zephir_array_update_zval(&ini, key, &_3$$4, PH_COPY | PH_SEPARATE); } zend_hash_destroy(_1$$3); FREE_HASHTABLE(_1$$3); } if (Z_TYPE_P(ini) == IS_STRING) { _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "true"); if (!(_5$$5)) { _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "yes"); } _6$$5 = _5$$5; if (!(_6$$5)) { ZEPHIR_INIT_VAR(_7$$5); zephir_fast_strtolower(_7$$5, ini); _6$$5 = ZEPHIR_IS_STRING_IDENTICAL(_7$$5, "on"); } if (_6$$5) { RETURN_MM_BOOL(1); } _8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "false"); if (!(_8$$5)) { _8$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "no"); } _9$$5 = _8$$5; if (!(_9$$5)) { ZEPHIR_INIT_VAR(_10$$5); zephir_fast_strtolower(_10$$5, ini); _9$$5 = ZEPHIR_IS_STRING_IDENTICAL(_10$$5, "off"); } if (_9$$5) { RETURN_MM_BOOL(0); } if (ZEPHIR_IS_STRING_IDENTICAL(ini, "null")) { RETURN_MM_NULL(); } if (zephir_is_numeric(ini)) { ZEPHIR_INIT_VAR(_11$$9); ZEPHIR_INIT_VAR(_12$$9); ZEPHIR_SINIT_VAR(_13$$9); ZVAL_STRING(&_13$$9, "/[.]+/", 0); zephir_preg_match(_12$$9, &_13$$9, ini, _11$$9, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(_12$$9)) { RETURN_MM_DOUBLE(zephir_get_doubleval(ini)); } else { RETURN_MM_LONG(zephir_get_intval(ini)); } } } RETVAL_ZVAL(ini, 1, 0); RETURN_MM();}
开发者ID:SDpower,项目名称:cphalcon,代码行数:82,
示例4: PHP_METHOD/** * getOctet allow to gets the value of a configuration option in octet * * @return int the value of a configuration option in octet */PHP_METHOD(Phady_Util_Tools, getOctets) { int size, ZEPHIR_LAST_CALL_STATUS; zval *option, *_0, *_1, _2, *_3, *_4, _5, *_6, *_7, _8, *_9 = NULL, *_10 = NULL, *_11 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &option); ZEPHIR_INIT_VAR(_0); ZEPHIR_INIT_VAR(_1); ZEPHIR_SINIT_VAR(_2); ZVAL_STRING(&_2, "/[0-9]+k/i", 0); zephir_preg_match(_1, &_2, option, _0, 0, 0 , 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_3); ZEPHIR_INIT_VAR(_4); ZEPHIR_SINIT_VAR(_5); ZVAL_STRING(&_5, "/[0-9]+m/i", 0); zephir_preg_match(_4, &_5, option, _3, 0, 0 , 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_6); ZEPHIR_INIT_VAR(_7); ZEPHIR_SINIT_VAR(_8); ZVAL_STRING(&_8, "/[0-9]+g/i", 0); zephir_preg_match(_7, &_8, option, _6, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(_1)) { ZEPHIR_INIT_VAR(_9); ZVAL_STRING(_9, "/m/i", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_10); ZVAL_STRING(_10, "", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_FUNCTION(&_11, "preg_replace", NULL, 142, _9, _10, option); zephir_check_temp_parameter(_9); zephir_check_temp_parameter(_10); zephir_check_call_status(); size = (zephir_get_intval(_11) * 1024); } else if (zephir_is_true(_4)) { ZEPHIR_INIT_NVAR(_9); ZVAL_STRING(_9, "/m/i", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_FUNCTION(&_11, "preg_replace", NULL, 142, _9, _10, option); zephir_check_temp_parameter(_9); zephir_check_temp_parameter(_10); zephir_check_call_status(); size = (1048576 * zephir_get_intval(_11)); } else if (zephir_is_true(_7)) { ZEPHIR_INIT_NVAR(_9); ZVAL_STRING(_9, "/g/i", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_FUNCTION(&_11, "preg_replace", NULL, 142, _9, _10, option); zephir_check_temp_parameter(_9); zephir_check_temp_parameter(_10); zephir_check_call_status(); size = ((1048576 * 1024) * zephir_get_intval(_11)); } else { size = zephir_get_numberval(option); } RETURN_MM_LONG(size);}
开发者ID:alienfernandez,项目名称:phady,代码行数:66,
示例5: PHP_METHOD//.........这里部分代码省略......... break; } if (zephir_memnstr_str(columnType, SL("bit"), "phalcon/db/adapter/pdo/mysql.zep", 216)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 8); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, 5); zephir_array_update_string(&definition, SL("bindType"), &_8, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("tinyblob"), "phalcon/db/adapter/pdo/mysql.zep", 225)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 10); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_8); ZVAL_LONG(_8, 5); zephir_array_update_string(&definition, SL("bindType"), &_8, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("mediumblob"), "phalcon/db/adapter/pdo/mysql.zep", 234)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 12); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("longblob"), "phalcon/db/adapter/pdo/mysql.zep", 242)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 13); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); break; } if (zephir_memnstr_str(columnType, SL("blob"), "phalcon/db/adapter/pdo/mysql.zep", 250)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 11); zephir_array_update_string(&definition, SL("type"), &_7, PH_COPY | PH_SEPARATE); break; } 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("("), "phalcon/db/adapter/pdo/mysql.zep", 265)) { ZEPHIR_INIT_NVAR(matches); ZVAL_NULL(matches); ZEPHIR_INIT_NVAR(_8); zephir_preg_match(_8, sizePattern, columnType, matches, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(_8)) { ZEPHIR_OBS_NVAR(matchOne); if (zephir_array_isset_long_fetch(&matchOne, matches, 1, 0 TSRMLS_CC)) { ZEPHIR_INIT_NVAR(_9); ZVAL_LONG(_9, zephir_get_intval(matchOne)); zephir_array_update_string(&definition, SL("size"), &_9, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_NVAR(matchTwo); if (zephir_array_isset_long_fetch(&matchTwo, matches, 2, 0 TSRMLS_CC)) { ZEPHIR_INIT_NVAR(_9); ZVAL_LONG(_9, zephir_get_intval(matchTwo)); zephir_array_update_string(&definition, SL("scale"), &_9, PH_COPY | PH_SEPARATE); } } } if (zephir_memnstr_str(columnType, SL("unsigned"), "phalcon/db/adapter/pdo/mysql.zep", 280)) { zephir_array_update_string(&definition, SL("unsigned"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(oldColumn) == IS_NULL) { zephir_array_update_string(&definition, SL("first"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } zephir_array_fetch_long(&_10, field, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 296 TSRMLS_CC); if (ZEPHIR_IS_STRING(_10, "PRI")) { zephir_array_update_string(&definition, SL("primary"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } zephir_array_fetch_long(&_11, field, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 303 TSRMLS_CC); if (ZEPHIR_IS_STRING(_11, "NO")) { zephir_array_update_string(&definition, SL("notNull"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } zephir_array_fetch_long(&_12, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 310 TSRMLS_CC); if (ZEPHIR_IS_STRING(_12, "auto_increment")) { zephir_array_update_string(&definition, SL("autoIncrement"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_NVAR(_13); zephir_array_fetch_long(&_13, field, 4, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 317 TSRMLS_CC); if (Z_TYPE_P(_13) != IS_NULL) { zephir_array_fetch_long(&_14, field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 318 TSRMLS_CC); zephir_array_update_string(&definition, SL("default"), &_14, PH_COPY | PH_SEPARATE); } zephir_array_fetch_long(&columnName, field, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 324 TSRMLS_CC); ZEPHIR_INIT_NVAR(_7); object_init_ex(_7, phalcon_db_column_ce); ZEPHIR_CALL_METHOD(NULL, _7, "__construct", &_15, 140, columnName, definition); zephir_check_call_status(); zephir_array_append(&columns, _7, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 325); ZEPHIR_CPY_WRT(oldColumn, columnName); } RETURN_CCTOR(columns);}
开发者ID:brainformatik,项目名称:cphalcon,代码行数:101,
示例6: PHP_METHOD/** * Sets the HTTP response code * *<code> * $response->setStatusCode(404, "Not Found"); *</code> */PHP_METHOD(Phalcon_Http_Response, setStatusCode) { zval *_10; zephir_fcall_cache_entry *_7 = NULL, *_8 = NULL; zend_bool _4; HashTable *_2; HashPosition _1; zval *message = NULL, *_13, *_15; zval *code_param = NULL, *message_param = NULL, *headers = NULL, *currentHeadersRaw = NULL, *key = NULL, *defaultMessage, *_0 = NULL, **_3, _5 = zval_used_for_init, *_6 = NULL, *_9, *_11, *_12, _14; int code, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &code_param, &message_param); code = zephir_get_intval(code_param); if (!message_param) { ZEPHIR_INIT_VAR(message); ZVAL_EMPTY_STRING(message); } else { zephir_get_strval(message, message_param); } ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(¤tHeadersRaw, headers, "toarray", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(currentHeadersRaw) == IS_ARRAY) { ZEPHIR_INIT_VAR(_0); zephir_is_iterable(currentHeadersRaw, &_2, &_1, 0, 0, "phalcon/http/response.zep", 130); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(key, _2, _1); ZEPHIR_GET_HVALUE(_0, _3); _4 = Z_TYPE_P(key) == IS_STRING; if (_4) { ZEPHIR_SINIT_NVAR(_5); ZVAL_STRING(&_5, "HTTP/", 0); ZEPHIR_CALL_FUNCTION(&_6, "strstr", &_7, 235, key, &_5); zephir_check_call_status(); _4 = zephir_is_true(_6); } if (_4) { ZEPHIR_CALL_METHOD(NULL, headers, "remove", &_8, 0, key); zephir_check_call_status(); } } } if (ZEPHIR_IS_STRING_IDENTICAL(message, "")) { ZEPHIR_OBS_VAR(_9); zephir_read_property_this(&_9, this_ptr, SL("_statusCodes"), PH_NOISY_CC); if (Z_TYPE_P(_9) != IS_ARRAY) { ZEPHIR_INIT_VAR(_10); zephir_create_array(_10, 59, 0 TSRMLS_CC); add_index_stringl(_10, 100, SL("Continue"), 1); add_index_stringl(_10, 101, SL("Switching Protocols"), 1); add_index_stringl(_10, 102, SL("Processing"), 1); add_index_stringl(_10, 200, SL("OK"), 1); add_index_stringl(_10, 201, SL("Created"), 1); add_index_stringl(_10, 202, SL("Accepted"), 1); add_index_stringl(_10, 203, SL("Non-Authoritative Information"), 1); add_index_stringl(_10, 204, SL("No Content"), 1); add_index_stringl(_10, 205, SL("Reset Content"), 1); add_index_stringl(_10, 206, SL("Partial Content"), 1); add_index_stringl(_10, 207, SL("Multi-status"), 1); add_index_stringl(_10, 208, SL("Already Reported"), 1); add_index_stringl(_10, 300, SL("Multiple Choices"), 1); add_index_stringl(_10, 301, SL("Moved Permanently"), 1); add_index_stringl(_10, 302, SL("Found"), 1); add_index_stringl(_10, 303, SL("See Other"), 1); add_index_stringl(_10, 304, SL("Not Modified"), 1); add_index_stringl(_10, 305, SL("Use Proxy"), 1); add_index_stringl(_10, 306, SL("Switch Proxy"), 1); add_index_stringl(_10, 307, SL("Temporary Redirect"), 1); add_index_stringl(_10, 400, SL("Bad Request"), 1); add_index_stringl(_10, 401, SL("Unauthorized"), 1); add_index_stringl(_10, 402, SL("Payment Required"), 1); add_index_stringl(_10, 403, SL("Forbidden"), 1); add_index_stringl(_10, 404, SL("Not Found"), 1); add_index_stringl(_10, 405, SL("Method Not Allowed"), 1); add_index_stringl(_10, 406, SL("Not Acceptable"), 1); add_index_stringl(_10, 407, SL("Proxy Authentication Required"), 1); add_index_stringl(_10, 408, SL("Request Time-out"), 1); add_index_stringl(_10, 409, SL("Conflict"), 1); add_index_stringl(_10, 410, SL("Gone"), 1); add_index_stringl(_10, 411, SL("Length Required"), 1); add_index_stringl(_10, 412, SL("Precondition Failed"), 1); add_index_stringl(_10, 413, SL("Request Entity Too Large"), 1); add_index_stringl(_10, 414, SL("Request-URI Too Large"), 1); add_index_stringl(_10, 415, SL("Unsupported Media Type"), 1); add_index_stringl(_10, 416, SL("Requested range not satisfiable"), 1);//.........这里部分代码省略.........
开发者ID:AlloVince,项目名称:cphalcon,代码行数:101,
示例7: PHP_METHOD//.........这里部分代码省略......... args = &args_sub; args = &__$null; } if (!local_param) { local = 0; } else { local = zephir_get_boolval(local_param); } if (!baseUri) { baseUri = &baseUri_sub; ZEPHIR_CPY_WRT(baseUri, &__$null); } else { ZEPHIR_SEPARATE_PARAM(baseUri); } if (local == 0) { _0$$3 = Z_TYPE_P(uri) == IS_STRING; if (_0$$3) { _1$$3 = zephir_memnstr_str(uri, SL("//"), "phalcon/mvc/url.zep", 103); if (!(_1$$3)) { _1$$3 = zephir_memnstr_str(uri, SL(":"), "phalcon/mvc/url.zep", 103); } _0$$3 = _1$$3; } if (_0$$3) { ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_INIT_VAR(&_3$$4); ZVAL_STRING(&_3$$4, "#^((//)|([a-z0-9]+://)|([a-z0-9]+:))#i"); ZEPHIR_INIT_VAR(&_4$$4); ZEPHIR_INIT_VAR(&_5$$4); ZVAL_STRING(&_5$$4, "#^((//)|([a-z0-9]+://)|([a-z0-9]+:))#i"); zephir_preg_match(&_4$$4, &_5$$4, uri, &_2$$4, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(&_4$$4)) { local = 0; } else { local = 1; } } else { local = 1; } } if (Z_TYPE_P(baseUri) != IS_STRING) { ZEPHIR_CALL_METHOD(baseUri, this_ptr, "getbaseuri", NULL, 0); zephir_check_call_status(); } if (Z_TYPE_P(uri) == IS_ARRAY) { ZEPHIR_OBS_VAR(&routeName); if (!(zephir_array_isset_string_fetch(&routeName, uri, SL("for"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_url_exception_ce, "It's necessary to define the route name with the parameter 'for'", "phalcon/mvc/url.zep", 121); return; } zephir_read_property(&_6$$9, this_ptr, SL("router"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&router, &_6$$9); if (Z_TYPE_P(&router) != IS_OBJECT) { zephir_read_property(&_7$$11, this_ptr, SL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&dependencyInjector, &_7$$11); if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_url_exception_ce, "A dependency injector container is required to obtain the 'router' service", "phalcon/mvc/url.zep", 133); return; } ZEPHIR_INIT_VAR(&_9$$11); ZVAL_STRING(&_9$$11, "router"); ZEPHIR_CALL_METHOD(&_8$$11, &dependencyInjector, "getshared", NULL, 0, &_9$$11); zephir_check_call_status(); ZEPHIR_CPY_WRT(&router, &_8$$11);
开发者ID:joeyhub,项目名称:cphalcon,代码行数:67,
示例8: PHP_METHOD/** * Detach the listener from the events manager * * @param string eventType * @param object handler */PHP_METHOD(Phalcon_Events_Manager, detach) { zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL, *_8 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *eventType_param = NULL, *handler, *priorityQueue = NULL, *newPriorityQueue = NULL, *key = NULL, *data = NULL, *_0, *_1$$5 = NULL, *_2$$5 = NULL, *_5$$6, *_6$$7, *_7$$7; zval *eventType = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &eventType_param, &handler); if (unlikely(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(eventType_param) == IS_STRING)) { zephir_get_strval(eventType, eventType_param); } else { ZEPHIR_INIT_VAR(eventType); ZVAL_EMPTY_STRING(eventType); } if (Z_TYPE_P(handler) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object", "phalcon/events/manager.zep", 99); return; } ZEPHIR_OBS_VAR(priorityQueue); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); if (zephir_array_isset_fetch(&priorityQueue, _0, eventType, 0 TSRMLS_CC)) { if (Z_TYPE_P(priorityQueue) == IS_OBJECT) { ZEPHIR_INIT_VAR(newPriorityQueue); object_init_ex(newPriorityQueue, spl_ce_SplPriorityQueue); if (zephir_has_constructor(newPriorityQueue TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "__construct", NULL, 0); zephir_check_call_status(); } ZEPHIR_INIT_VAR(_1$$5); ZVAL_LONG(_1$$5, 1); ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "setextractflags", NULL, 190, _1$$5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_1$$5); ZVAL_LONG(_1$$5, 3); ZEPHIR_CALL_METHOD(NULL, priorityQueue, "setextractflags", NULL, 0, _1$$5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, priorityQueue, "top", NULL, 0); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_2$$5, priorityQueue, "valid", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(_2$$5))) { break; } ZEPHIR_CALL_METHOD(&data, priorityQueue, "current", &_3, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, priorityQueue, "next", &_4, 0); zephir_check_call_status(); zephir_array_fetch_string(&_5$$6, data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 116 TSRMLS_CC); if (!ZEPHIR_IS_IDENTICAL(_5$$6, handler)) { zephir_array_fetch_string(&_6$$7, data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); zephir_array_fetch_string(&_7$$7, data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "insert", &_8, 191, _6$$7, _7$$7); zephir_check_call_status(); } } zephir_update_property_array(this_ptr, SL("_events"), eventType, newPriorityQueue TSRMLS_CC); } else { ZEPHIR_CALL_FUNCTION(&key, "array_search", NULL, 192, handler, priorityQueue, ZEPHIR_GLOBAL(global_true)); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(key)) { zephir_array_unset(&priorityQueue, key, PH_SEPARATE); } zephir_update_property_array(this_ptr, SL("_events"), eventType, priorityQueue TSRMLS_CC); } } ZEPHIR_MM_RESTORE();}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:83,
示例9: PHP_METHOD/** * @return array */PHP_METHOD(Lynx_Annotation_RegexDocParser, parseAnnotations) { zval *_14 = NULL; HashTable *_3, *_8; HashPosition _2, _7; int ZEPHIR_LAST_CALL_STATUS; zephir_nts_static zephir_fcall_cache_entry *_1 = NULL, *_11 = NULL; zval *docComment, *hasAnnotations = NULL, *matches, *anno = NULL, *annoName = NULL, *val = NULL, *hasParams = NULL, *params, *param = NULL, *rex, *_0 = NULL, *annotations, **_4, *_5, *regex1, *_6, **_9, *_10 = NULL, *_12, *_13 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &docComment); ZEPHIR_INIT_VAR(matches); array_init(matches); ZEPHIR_INIT_VAR(params); array_init(params); ZEPHIR_INIT_VAR(rex); ZVAL_STRING(rex, "/@(//w+)(?://s*(?://(//s*)?(.*?)(?://s*//))?)??//s*(?:/n|//*///)/", 1); ZEPHIR_INIT_VAR(annotations); array_init(annotations); ZEPHIR_INIT_VAR(regex1); ZVAL_STRING(regex1, "/(//w+)//s*=//s*(//[[^//]]*//]|/"[^/"]*/"|[^,)]*)//s*(?:,|$)/", 1); ZEPHIR_INIT_VAR(val); ZVAL_BOOL(val, 1); ZEPHIR_INIT_VAR(_0); ZVAL_LONG(_0, 2); Z_SET_ISREF_P(matches); ZEPHIR_CALL_FUNCTION(&hasAnnotations, "preg_match_all", &_1, rex, docComment, matches, _0); Z_UNSET_ISREF_P(matches); zephir_check_call_status(); if (!zephir_is_true(hasAnnotations)) { array_init(return_value); RETURN_MM(); } zephir_is_iterable(matches, &_3, &_2, 0, 0, "lynx/Annotation/RegexDocParser.zep", 67); for ( ; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS ; zephir_hash_move_forward_ex(_3, &_2) ) { ZEPHIR_GET_HVALUE(anno, _4); ZEPHIR_INIT_NVAR(annoName); zephir_array_fetch_long(&_5, anno, 1, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 33 TSRMLS_CC); zephir_fast_strtolower(annoName, _5); ZEPHIR_INIT_NVAR(val); ZVAL_BOOL(val, 1); if (zephir_array_isset_long(anno, 2)) { zephir_array_fetch_long(&_6, anno, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 38 TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 2); Z_SET_ISREF_P(params); ZEPHIR_CALL_FUNCTION(&hasParams, "preg_match_all", &_1, regex1, _6, params, _0); Z_UNSET_ISREF_P(params); zephir_check_call_status(); if (zephir_is_true(hasParams)) { ZEPHIR_INIT_NVAR(val); array_init(val); zephir_is_iterable(params, &_8, &_7, 0, 0, "lynx/Annotation/RegexDocParser.zep", 46); for ( ; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS ; zephir_hash_move_forward_ex(_8, &_7) ) { ZEPHIR_GET_HVALUE(param, _9); zephir_array_fetch_long(&_12, param, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 43 TSRMLS_CC); ZEPHIR_CALL_SELF(&_10, "parsevalue", &_11, _12); zephir_check_call_status(); ZEPHIR_OBS_NVAR(_13); zephir_array_fetch_long(&_13, param, 1, PH_NOISY, "lynx/Annotation/RegexDocParser.zep", 43 TSRMLS_CC); zephir_array_update_zval(&val, _13, &_10, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_INIT_NVAR(val); zephir_array_fetch_long(&_12, anno, 2, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 47 TSRMLS_CC); zephir_fast_trim(val, _12, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); if (ZEPHIR_IS_STRING(val, "")) { ZEPHIR_INIT_NVAR(val); ZVAL_BOOL(val, 1); } else { ZEPHIR_CALL_SELF(&_10, "parsevalue", &_11, val); zephir_check_call_status(); ZEPHIR_CPY_WRT(val, _10); } } } if (zephir_array_isset(annotations, annoName)) { zephir_array_fetch(&_6, annotations, annoName, PH_NOISY | PH_READONLY, "lynx/Annotation/RegexDocParser.zep", 58 TSRMLS_CC); if (!(Z_TYPE_P(_6) == IS_ARRAY)) { ZEPHIR_INIT_NVAR(_14); array_init_size(_14, 2); ZEPHIR_OBS_NVAR(_13); zephir_array_fetch(&_13, annotations, annoName, PH_NOISY, "lynx/Annotation/RegexDocParser.zep", 59 TSRMLS_CC); zephir_array_fast_append(_14, _13); zephir_array_update_zval(&annotations, annoName, &_14, PH_COPY | PH_SEPARATE); } zephir_array_update_multi(&annotations, &val TSRMLS_CC, SL("za"), 2, annoName); } else {//.........这里部分代码省略.........
开发者ID:Green-Cat,项目名称:lynx,代码行数:101,
示例10: PHP_METHOD/** * Stores cached content into the file backend and stops the frontend * * @param int|string keyName * @param string content * @param long lifetime * @param boolean stopBuffer */PHP_METHOD(Phalcon_Cache_Backend_Memcache, save) { int ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend, *memcache = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp, *ttl = NULL, *success = NULL, *options, *specialKey, *keys = NULL, *isBuffering = NULL, *_0, *_1 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { keyName = ZEPHIR_GLOBAL(global_null); } if (!content) { content = ZEPHIR_GLOBAL(global_null); } if (!lifetime) { lifetime = ZEPHIR_GLOBAL(global_null); } if (!stopBuffer_param) { stopBuffer = 1; } else { stopBuffer = zephir_get_boolval(stopBuffer_param); } if (!(zephir_is_true(keyName))) { ZEPHIR_OBS_VAR(lastKey); zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); ZEPHIR_INIT_NVAR(lastKey); ZEPHIR_CONCAT_VV(lastKey, _0, keyName); } if (!(zephir_is_true(lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/memcache.zep", 172); return; } ZEPHIR_OBS_VAR(frontend); zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); ZEPHIR_OBS_VAR(memcache); zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); if (Z_TYPE_P(memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(memcache); zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (Z_TYPE_P(content) == IS_NULL) { ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(cachedContent, content); } ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); zephir_check_call_status(); if (Z_TYPE_P(lifetime) == IS_NULL) { ZEPHIR_OBS_VAR(tmp); zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); if (!(zephir_is_true(tmp))) { ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(ttl, tmp); } } else { ZEPHIR_CPY_WRT(ttl, lifetime); } if (zephir_is_numeric(cachedContent)) { ZEPHIR_INIT_VAR(_1); ZVAL_LONG(_1, 0); ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, cachedContent, _1, ttl); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, 0); ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, preparedContent, _1, ttl); zephir_check_call_status(); } if (!(zephir_is_true(success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in memcached", "phalcon/cache/backend/memcache.zep", 219); return; } ZEPHIR_OBS_VAR(options); zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); ZEPHIR_OBS_VAR(specialKey); if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 225); return; } if (Z_TYPE_P(specialKey) != IS_NULL) { ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:brainformatik,项目名称:cphalcon,代码行数:101,
示例11: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_InclusionIn, validate) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *validation, validation_sub, *field, field_sub, value, domain, message, label, replacePairs, strict, fieldDomain, code, _0, _1, _4, _2$$6, _3$$7, _5$$9, _6$$9, _7$$9; zval *this_ptr = getThis(); ZVAL_UNDEF(&validation_sub); ZVAL_UNDEF(&field_sub); ZVAL_UNDEF(&value); ZVAL_UNDEF(&domain); ZVAL_UNDEF(&message); ZVAL_UNDEF(&label); ZVAL_UNDEF(&replacePairs); ZVAL_UNDEF(&strict); ZVAL_UNDEF(&fieldDomain); ZVAL_UNDEF(&code); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_2$$6); ZVAL_UNDEF(&_3$$7); ZVAL_UNDEF(&_5$$9); ZVAL_UNDEF(&_6$$9); ZVAL_UNDEF(&_7$$9); 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(&_0); ZVAL_STRING(&_0, "domain"); ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, &_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", 81); return; } ZEPHIR_INIT_VAR(&strict); ZVAL_BOOL(&strict, 0); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "strict"); ZEPHIR_CALL_METHOD(&_1, this_ptr, "hasoption", NULL, 0, &_0); zephir_check_call_status(); if (zephir_is_true(&_1)) { ZEPHIR_INIT_VAR(&_2$$6); ZVAL_STRING(&_2$$6, "strict"); ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, &_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", 89 TSRMLS_CC); ZEPHIR_CPY_WRT(&strict, &_3$$7); } if (((Z_TYPE_P(&strict) == IS_TRUE || Z_TYPE_P(&strict) == IS_FALSE) != 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Option 'strict' must be a bool", "phalcon/validation/validator/inclusionin.zep", 93); return; } } ZEPHIR_CALL_FUNCTION(&_4, "in_array", NULL, 455, &value, &domain, &strict); zephir_check_call_status(); if (!(zephir_is_true(&_4))) { ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$9); ZVAL_STRING(&_5$$9, "InclusionIn"); ZEPHIR_CALL_METHOD(&message, this_ptr, "preparemessage", NULL, 0, validation, field, &_5$$9); 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, 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); ZEPHIR_INIT_NVAR(&_5$$9); object_init_ex(&_5$$9, phalcon_messages_message_ce); ZEPHIR_CALL_FUNCTION(&_6$$9, "strtr", NULL, 48, &message, &replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7$$9); ZVAL_STRING(&_7$$9, "InclusionIn"); ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", NULL, 300, &_6$$9, field, &_7$$9, &code); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$9); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);//.........这里部分代码省略.........
开发者ID:niden,项目名称:cphalcon,代码行数:101,
示例12: PHP_METHOD/** * Phalcon/Config/Adapter/Yaml constructor * * @throws /Phalcon/Config/Exception */PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct) { zephir_fcall_cache_entry *_5 = NULL; zephir_nts_static zephir_fcall_cache_entry *_2 = NULL, *_7 = NULL, *_8 = NULL; int ndocs = 0, ZEPHIR_LAST_CALL_STATUS; zval *callbacks = NULL; zval *filePath_param = NULL, *callbacks_param = NULL, *yamlConfig = NULL, _0, *_1 = NULL, *_3 = NULL, *_4 = NULL, *_6; zval *filePath = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &filePath_param, &callbacks_param); if (unlikely(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(filePath_param) == IS_STRING)) { zephir_get_strval(filePath, filePath_param); } else { ZEPHIR_INIT_VAR(filePath); ZVAL_EMPTY_STRING(filePath); } if (!callbacks_param) { ZEPHIR_INIT_VAR(callbacks); array_init(callbacks); } else { callbacks = callbacks_param; } ZEPHIR_SINIT_VAR(_0); ZVAL_STRING(&_0, "yaml", 0); ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", &_2, &_0); zephir_check_call_status(); if (!(zephir_is_true(_1))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Yaml extension not loaded", "phalcon/config/adapter/yaml.zep", 62); return; } if (!ZEPHIR_IS_STRING_IDENTICAL(callbacks, "")) { ZEPHIR_INIT_VAR(_3); ZVAL_LONG(_3, 0); ZEPHIR_INIT_VAR(_4); ZVAL_LONG(_4, ndocs); Z_SET_ISREF_P(_4); ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", &_5, filePath, _3, _4, callbacks); Z_UNSET_ISREF_P(_4); zephir_check_call_status(); } else { ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", &_5, filePath); zephir_check_call_status(); } if (ZEPHIR_IS_FALSE_IDENTICAL(yamlConfig)) { ZEPHIR_INIT_NVAR(_3); object_init_ex(_3, phalcon_config_exception_ce); ZEPHIR_INIT_NVAR(_4); zephir_basename(_4, filePath TSRMLS_CC); ZEPHIR_INIT_VAR(_6); ZEPHIR_CONCAT_SVS(_6, "Configuration file ", _4, " can't be loaded"); ZEPHIR_CALL_METHOD(NULL, _3, "__construct", &_7, _6); zephir_check_call_status(); zephir_throw_exception_debug(_3, "phalcon/config/adapter/yaml.zep", 72 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_yaml_ce, this_ptr, "__construct", &_8, yamlConfig); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:flaver12,项目名称:cphalcon,代码行数:76,
示例13: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_File, validate) { zend_bool _1, _2, _3, _5, _6, _11, _12, _14, _20, _21, _50, _57$$16, _64$$21; zend_long ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *_SERVER, *_POST, *_FILES, *value = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *types = NULL, *byteUnits = NULL, *unit = NULL, *maxSize = NULL, *matches = NULL, *bytes = NULL, *mime = NULL, *tmp = NULL, *width = NULL, *height = NULL, *minResolution = NULL, *maxResolution = NULL, *minWidth = NULL, *maxWidth = NULL, *minHeight = NULL, *maxHeight = NULL, *fieldTypes = NULL, *code = NULL, *minResolutionArray = NULL, *maxResolutionArray = NULL, *_0, *_4, *_7, *_13, *_15, *_16 = NULL, *_25 = NULL, *_26 = NULL, *_42 = NULL, *_49 = NULL, *_51 = NULL, *_8$$3 = NULL, *_9$$3 = NULL, *_10$$3 = NULL, *_17$$4 = NULL, *_18$$4 = NULL, *_19$$4 = NULL, *_22$$5 = NULL, *_23$$5 = NULL, *_24$$5 = NULL, *_27$$6 = NULL, *_29$$6, *_30$$6, *_31$$6, *_32$$6, *_33$$6 = NULL, *_34$$6, *_35$$6, _36$$6, *_37$$6, *_38$$6 = NULL, *_28$$7, *_39$$9 = NULL, *_40$$9 = NULL, *_41$$9 = NULL, *_43$$10, _44$$13, *_45$$13, *_46$$15 = NULL, *_47$$15 = NULL, *_48$$15 = NULL, *_52$$16, *_53$$16 = NULL, *_54$$16 = NULL, *_61$$16 = NULL, *_55$$17, *_56$$18, *_58$$20 = NULL, *_59$$20 = NULL, *_60$$20 = NULL, *_62$$21, *_63$$22, *_65$$23 = NULL, *_66$$23 = NULL, *_67$$23 = NULL; ZEPHIR_MM_GROW(); zephir_get_global(&_FILES, SS("_FILES") TSRMLS_CC); zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); 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_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&label, this_ptr, "preparelabel", NULL, 0, validation, field); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&code, this_ptr, "preparecode", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_0, _SERVER, SL("REQUEST_METHOD"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 112 TSRMLS_CC); _1 = ZEPHIR_IS_STRING(_0, "POST"); if (_1) { _1 = ZEPHIR_IS_EMPTY(_POST); } _2 = _1; if (_2) { _2 = ZEPHIR_IS_EMPTY(_FILES); } _3 = _2; if (_3) { zephir_array_fetch_string(&_4, _SERVER, SL("CONTENT_LENGTH"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 112 TSRMLS_CC); _3 = ZEPHIR_GT_LONG(_4, 0); } _5 = _3; if (!(_5)) { _6 = zephir_array_isset_string(value, SS("error")); if (_6) { zephir_array_fetch_string(&_7, value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 112 TSRMLS_CC); _6 = ZEPHIR_IS_LONG_IDENTICAL(_7, 1); } _5 = _6; } if (_5) { ZEPHIR_INIT_VAR(_8$$3); ZVAL_STRING(_8$$3, "FileIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_9$$3); ZVAL_STRING(_9$$3, "messageIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "preparemessage", NULL, 0, validation, field, _8$$3, _9$$3); zephir_check_temp_parameter(_8$$3); zephir_check_temp_parameter(_9$$3); 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$$3); object_init_ex(_8$$3, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_10$$3, "strtr", NULL, 27, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_9$$3); ZVAL_STRING(_9$$3, "FileIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _8$$3, "__construct", NULL, 470, _10$$3, field, _9$$3, code); zephir_check_temp_parameter(_9$$3); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _8$$3); zephir_check_call_status(); RETURN_MM_BOOL(0); } _11 = !(zephir_array_isset_string(value, SS("error"))); if (!(_11)) { _11 = !(zephir_array_isset_string(value, SS("tmp_name"))); } _12 = _11; if (!(_12)) { zephir_array_fetch_string(&_13, value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 128 TSRMLS_CC); _12 = !ZEPHIR_IS_LONG_IDENTICAL(_13, 0); } _14 = _12; if (!(_14)) { zephir_array_fetch_string(&_15, value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 128 TSRMLS_CC); ZEPHIR_CALL_FUNCTION(&_16, "is_uploaded_file", NULL, 247, _15); zephir_check_call_status(); _14 = !zephir_is_true(_16); } if (_14) { ZEPHIR_INIT_VAR(_17$$4);//.........这里部分代码省略.........
开发者ID:zamronypj,项目名称:cphalcon,代码行数:101,
示例14: PHP_METHODPHP_METHOD(Test_Quantum, harmos) { zend_bool _13, _16, _32, _35; zval *_10 = NULL, *_11 = NULL, *_12 = NULL; zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL, *_8 = NULL, *_36 = NULL; int i, j, n, ZEPHIR_LAST_CALL_STATUS, _14, _15, _17, _18, _33, _34; zval *x_param = NULL, *psr, *psi, *p2, *v, *paramater, *fp = NULL, *tmp, *_0 = NULL, _1 = zval_used_for_init, _2 = zval_used_for_init, *_3 = NULL, *_5 = NULL, *_7 = NULL, *_9 = NULL, *_19, *_20, *_21, *_22, *_23, *_24, *_25, *_26, _27 = zval_used_for_init, *_28, *_29, *_30, *_31; double x, dt, dx, k0, item_psr, item_psi; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &x_param); x = zephir_get_doubleval(x_param); dx = 0.02; k0 = (3.0 * 3.14159265358979323846); dt = zephir_safe_div_double_long((dx * dx), 4.0 TSRMLS_CC); ZEPHIR_INIT_VAR(paramater); zephir_create_array(paramater, 4, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_0); ZVAL_DOUBLE(_0, dx); zephir_array_fast_append(paramater, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, k0); zephir_array_fast_append(paramater, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, dt); zephir_array_fast_append(paramater, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, x); zephir_array_fast_append(paramater, _0); i = 0; ZEPHIR_INIT_VAR(psr); array_init(psr); ZEPHIR_INIT_VAR(psi); array_init(psi); ZEPHIR_INIT_VAR(p2); array_init(p2); ZEPHIR_INIT_VAR(v); array_init(v); ZEPHIR_SINIT_VAR(_1); ZVAL_STRING(&_1, "harmos.txt", 0); ZEPHIR_SINIT_VAR(_2); ZVAL_STRING(&_2, "w", 0); ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 30, &_1, &_2); zephir_check_call_status(); if (!(zephir_is_true(fp))) { RETURN_MM_LONG(1); } while (1) { if (!(i <= 751)) { break; } ZEPHIR_SINIT_NVAR(_1); ZVAL_DOUBLE(&_1, (k0 * x)); ZEPHIR_CALL_FUNCTION(&_3, "sin", &_4, 10, &_1); zephir_check_call_status(); ZEPHIR_SINIT_NVAR(_1); ZVAL_DOUBLE(&_1, ((x * x) * 2.0)); ZEPHIR_CALL_FUNCTION(&_5, "exp", &_6, 1, &_1); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_7); div_function(_7, _3, _5 TSRMLS_CC); item_psi = zephir_get_numberval(_7); ZEPHIR_SINIT_NVAR(_1); ZVAL_DOUBLE(&_1, (k0 * x)); ZEPHIR_CALL_FUNCTION(&_3, "cos", &_8, 11, &_1); zephir_check_call_status(); ZEPHIR_SINIT_NVAR(_1); ZVAL_DOUBLE(&_1, ((x * x) * 2.0)); ZEPHIR_CALL_FUNCTION(&_5, "exp", &_6, 1, &_1); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_9); div_function(_9, _3, _5 TSRMLS_CC); item_psr = zephir_get_numberval(_9); ZEPHIR_INIT_NVAR(_10); zephir_create_array(_10, 1, 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, item_psr); zephir_array_fast_append(_10, _0); zephir_array_update_long(&psr, i, &_10, PH_COPY | PH_SEPARATE, "test/quantum.zep", 39); ZEPHIR_INIT_NVAR(_11); zephir_create_array(_11, 1, 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, item_psi); zephir_array_fast_append(_11, _0); zephir_array_update_long(&psi, i, &_11, PH_COPY | PH_SEPARATE, "test/quantum.zep", 40); ZEPHIR_INIT_NVAR(_12); zephir_create_array(_12, 1, 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(_0); ZVAL_DOUBLE(_0, (double) ((double) (5.0 * x) * x)); zephir_array_fast_append(_12, _0); zephir_array_update_long(&v, i, &_12, PH_COPY | PH_SEPARATE, "test/quantum.zep", 41); x = (x + dx); i++; } i = 1; j = 1; ZEPHIR_INIT_VAR(tmp);//.........这里部分代码省略.........
开发者ID:alessiot25,项目名称:zephir,代码行数:101,
示例15: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_CreditCard, validate) { int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *value = NULL, *valid = NULL, *_0$$3 = NULL, *_2$$3 = NULL, *_3$$3, *_1$$5; 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_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 438, value); zephir_check_call_status(); if (!(zephir_is_true(valid))) { ZEPHIR_INIT_VAR(_0$$3); ZVAL_STRING(_0$$3, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _0$$3); zephir_check_temp_parameter(_0$$3); 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(_0$$3); ZVAL_STRING(_0$$3, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _0$$3); zephir_check_temp_parameter(_0$$3); 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_VAR(_1$$5); ZVAL_STRING(_1$$5, "CreditCard", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _1$$5); zephir_check_temp_parameter(_1$$5); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_0$$3); object_init_ex(_0$$3, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_2$$3, "strtr", NULL, 55, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_3$$3); ZVAL_STRING(_3$$3, "CreditCard", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 434, _2$$3, field, _3$$3); zephir_check_temp_parameter(_3$$3); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _0$$3); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:Dmitry-Kucher,项目名称:cphalcon,代码行数:69,
示例16: PHP_METHOD/** * Writes the log to the stream itself */PHP_METHOD(Phalcon_Logger_Adapter_Firephp, logInternal) { HashTable *_8; HashPosition _7; zephir_fcall_cache_entry *_2 = NULL; zval *context = NULL; int type, time, ZEPHIR_LAST_CALL_STATUS; zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *chunk = NULL, *format = NULL, *chString = NULL, *content = NULL, *key = NULL, *index = NULL, *_0, *_3 = NULL, *_4, *_5, _6, **_9, _1$$3 = zval_used_for_init; zval *message = NULL, *_10$$4 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); zephir_get_strval(message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); zephir_get_arrval(context, context_param); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); if (!(zephir_is_true(_0))) { ZEPHIR_SINIT_VAR(_1$$3); ZVAL_STRING(&_1$$3, "X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2", 0); ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3); zephir_check_call_status(); ZEPHIR_SINIT_NVAR(_1$$3); ZVAL_STRING(&_1$$3, "X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3", 0); ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3); zephir_check_call_status(); ZEPHIR_SINIT_NVAR(_1$$3); ZVAL_STRING(&_1$$3, "X-Wf-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1", 0); ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, &_1$$3); zephir_check_call_status(); if (1) { zephir_update_property_this(this_ptr, SL("_initialized"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); } else { zephir_update_property_this(this_ptr, SL("_initialized"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_3, this_ptr, "getformatter", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(_4); ZVAL_LONG(_4, type); ZEPHIR_INIT_VAR(_5); ZVAL_LONG(_5, time); ZEPHIR_CALL_METHOD(&format, _3, "format", NULL, 0, message, _4, _5, context); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_6); ZVAL_LONG(&_6, 4500); ZEPHIR_CALL_FUNCTION(&chunk, "str_split", NULL, 74, format, &_6); zephir_check_call_status(); ZEPHIR_OBS_VAR(index); zephir_read_property_this(&index, this_ptr, SL("_index"), PH_NOISY_CC); zephir_is_iterable(chunk, &_8, &_7, 0, 0, "phalcon/logger/adapter/firephp.zep", 92); for ( ; zephir_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS ; zephir_hash_move_forward_ex(_8, &_7) ) { ZEPHIR_GET_HMKEY(key, _8, _7); ZEPHIR_GET_HVALUE(chString, _9); zephir_get_strval(_10$$4, index); ZEPHIR_INIT_NVAR(content); ZEPHIR_CONCAT_SVSV(content, "X-Wf-1-1-1-", _10$$4, ": ", chString); if (zephir_array_isset_long(chunk, (zephir_get_numberval(key) + 1))) { zephir_concat_self_str(&content, SL("|//") TSRMLS_CC); } ZEPHIR_CALL_FUNCTION(NULL, "header", &_2, 248, content); zephir_check_call_status(); ZEPHIR_SEPARATE(index); zephir_increment(index); } zephir_update_property_this(this_ptr, SL("_index"), index TSRMLS_CC); ZEPHIR_MM_RESTORE();}
开发者ID:ntesic,项目名称:cphalcon,代码行数:78,
示例17: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_File, validate) { zephir_fcall_cache_entry *_10 = NULL, *_12 = NULL, *_29 = NULL; zend_bool _2, _3, _4, _6, _7, _13, _14, _15, _17, _18, _20, _24, _25, _37, _38, _40; int ZEPHIR_LAST_CALL_STATUS; zval *field = NULL; zval *validation, *field_param = NULL, *value = NULL, *message = NULL, *label = NULL, *replacePairs = NULL, *types = NULL, *byteUnits, *unit = NULL, *maxSize = NULL, *matches, *bytes, *mime = NULL, *tmp = NULL, *width, *height, *minResolution, *maxResolution, *minWidth = NULL, *maxWidth, *minHeight = NULL, *maxHeight, *_0 = NULL, *_SERVER, *_1, *_POST, *_FILES, *_5, *_8, *_9 = NULL, *_11 = NULL, *_16, *_19, *_21, *_22 = NULL, *_23 = NULL, *_26 = NULL, *_27, *_28, *_30 = NULL, *_31, _32 = zval_used_for_init, *_33, *_34 = NULL, *_35 = NULL, *_36, *_39 = NULL, *_41 = NULL; ZEPHIR_MM_GROW(); zephir_get_global(&_FILES, SS("_FILES") TSRMLS_CC); zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); 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, "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(); } zephir_array_fetch_string(&_1, _SERVER, SL("REQUEST_METHOD"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 62 TSRMLS_CC); _2 = ZEPHIR_IS_STRING(_1, "POST"); if (_2) { _2 = ZEPHIR_IS_EMPTY(_POST); } _3 = _2; if (_3) { _3 = ZEPHIR_IS_EMPTY(_FILES); } _4 = _3; if (_4) { zephir_array_fetch_string(&_5, _SERVER, SL("CONTENT_LENGTH"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 62 TSRMLS_CC); _4 = ZEPHIR_GT_LONG(_5, 0); } _6 = _4; if (!(_6)) { _7 = zephir_array_isset_string(value, SS("error")); if (_7) { zephir_array_fetch_string(&_8, value, SL("error"), PH_NOISY | PH_READONLY, "phalcon/validation/validator/file.zep", 62 TSRMLS_CC); _7 = ZEPHIR_IS_LONG_IDENTICAL(_8, 1); } _6 = _7; } if (_6) { ZEPHIR_INIT_NVAR(_0); ZVAL_STRING(_0, "messageIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _0); zephir_check_temp_parameter(_0); 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(_0); ZVAL_STRING(_0, "FileIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_0); object_init_ex(_0, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_9, "strtr", &_10, 53, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_11); ZVAL_STRING(_11, "FileIniSize", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _0, "__construct", &_12, 436, _9, field, _11); zephir_check_temp_parameter(_11); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _0); zephir_check_call_status(); RETURN_MM_BOOL(0); } ZEPHIR_INIT_NVAR(_11); ZVAL_STRING(_11, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_9, this_ptr, "issetoption", NULL, 0, _11); zephir_check_temp_parameter(_11); zephir_check_call_status(); _13 = zephir_is_true(_9); if (_13) {//.........这里部分代码省略.........
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:101,
示例18: 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) { HashTable *_7$$4; HashPosition _6$$4; zval *_18; zend_bool _11, _14; zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *meta = NULL, *body = NULL, *backtrace = NULL, *encoded = NULL, *len = NULL, *lastTrace = NULL, *_1 = NULL, *_2, *_3, *_9, *_10, *_12, *_13, *_15, *_0$$3 = NULL, *param$$4 = NULL, *backtraceItem$$4 = NULL, *key$$4 = NULL, **_8$$4, *_4$$5, *_5$$6, *_16$$11, *_17$$11; 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$$3, this_ptr, "interpolate", NULL, 0, message, context); zephir_check_call_status(); zephir_get_strval(message, _0$$3); } ZEPHIR_INIT_VAR(meta); zephir_create_array(meta, 1, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_2); ZVAL_LONG(_2, type); ZEPHIR_CALL_METHOD(&_1, this_ptr, "gettypestring", NULL, 0, _2); zephir_check_call_status(); zephir_array_update_string(&meta, SL("Type"), &_1, PH_COPY | PH_SEPARATE); _3 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); if (zephir_is_true(_3)) { ZEPHIR_INIT_VAR(param$$4); ZVAL_LONG(param$$4, 2); ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", NULL, 165, param$$4); zephir_check_call_status(); ZEPHIR_MAKE_REF(backtrace); ZEPHIR_CALL_FUNCTION(&lastTrace, "end", NULL, 183, backtrace); ZEPHIR_UNREF(backtrace); zephir_check_call_status(); if (zephir_array_isset_string(lastTrace, SS("file"))) { zephir_array_fetch_string(&_4$$5, lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 130 TSRMLS_CC); zephir_array_update_string(&meta, SL("File"), &_4$$5, PH_COPY | PH_SEPARATE); } if (zephir_array_isset_string(lastTrace, SS("line"))) { zephir_array_fetch_string(&_5$$6, lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 134 TSRMLS_CC); zephir_array_update_string(&meta, SL("Line"), &_5$$6, PH_COPY | PH_SEPARATE); } zephir_is_iterable(backtrace, &_7$$4, &_6$$4, 1, 0, "phalcon/logger/formatter/firephp.zep", 143); for ( ; zend_hash_get_current_data_ex(_7$$4, (void**) &_8$$4, &_6$$4) == SUCCESS ; zend_hash_move_forward_ex(_7$$4, &_6$$4) ) { ZEPHIR_GET_HMKEY(key$$4, _7$$4, _6$$4); ZEPHIR_GET_HVALUE(backtraceItem$$4, _8$$4); zephir_array_unset_string(&backtraceItem$$4, SS("object"), PH_SEPARATE); zephir_array_unset_string(&backtraceItem$$4, SS("args"), PH_SEPARATE); zephir_array_update_zval(&backtrace, key$$4, &backtraceItem$$4, PH_COPY | PH_SEPARATE); } zend_hash_destroy(_7$$4); FREE_HASHTABLE(_7$$4); } _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) { ZEPHIR_CPY_WRT(body, message); } else if (_14) { ZEPHIR_INIT_NVAR(body); ZVAL_STRING(body, "", 1); } else { ZEPHIR_INIT_NVAR(body); array_init(body); _16$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC);//.........这里部分代码省略.........
开发者ID:zamronypj,项目名称:cphalcon,代码行数:101,
示例19: PHP_METHOD/** * Returns a cached content * * @param int|string keyName * @param int lifetime * @return mixed */PHP_METHOD(Phalcon_Cache_Backend_File, get) { zephir_nts_static zephir_fcall_cache_entry *_8 = NULL; int ttl, modifiedTime, ZEPHIR_LAST_CALL_STATUS; zval *keyName, *lifetime = NULL, *prefixedKey, *cacheDir, *cacheFile, *frontend, *lastLifetime, *cachedContent, *ret = NULL, *_0, *_1 = NULL, *_2, *_3 = NULL, *_4, *_5, *_6, *_7; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &lifetime); if (!lifetime) { lifetime = ZEPHIR_GLOBAL(global_null); } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkey", NULL, keyName); zephir_check_call_status(); ZEPHIR_INIT_VAR(prefixedKey); ZEPHIR_CONCAT_VV(prefixedKey, _0, _1); zephir_update_property_this(this_ptr, SL("_lastKey"), prefixedKey TSRMLS_CC); ZEPHIR_OBS_VAR(cacheDir); _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); if (!(zephir_array_isset_string_fetch(&cacheDir, _2, SS("cacheDir"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 115); return; } ZEPHIR_INIT_VAR(cacheFile); ZEPHIR_CONCAT_VV(cacheFile, cacheDir, prefixedKey); if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS) == 1) { ZEPHIR_OBS_VAR(frontend); zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (!(zephir_is_true(lifetime))) { ZEPHIR_OBS_VAR(lastLifetime); zephir_read_property_this(&lastLifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); if (!(zephir_is_true(lastLifetime))) { ZEPHIR_CALL_METHOD(&_3, frontend, "getlifetime", NULL); zephir_check_call_status(); ttl = zephir_get_intval(_3); } else { ttl = zephir_get_intval(lastLifetime); } } else { ttl = zephir_get_intval(lifetime); } ZEPHIR_INIT_VAR(_4); zephir_filemtime(_4, cacheFile TSRMLS_CC); modifiedTime = zephir_get_intval(_4); ZEPHIR_INIT_VAR(_5); zephir_time(_5); if (!((zephir_get_numberval(_5) - ttl) > modifiedTime)) { ZEPHIR_INIT_VAR(cachedContent); zephir_file_get_contents(cachedContent, cacheFile TSRMLS_CC); if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { ZEPHIR_INIT_VAR(_6); object_init_ex(_6, phalcon_cache_exception_ce); ZEPHIR_INIT_VAR(_7); ZEPHIR_CONCAT_SVS(_7, "Cache file ", cacheFile, " could not be opened"); ZEPHIR_CALL_METHOD(NULL, _6, "__construct", &_8, _7); zephir_check_call_status(); zephir_throw_exception_debug(_6, "phalcon/cache/backend/file.zep", 151 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } if (zephir_is_numeric(cachedContent)) { RETURN_CCTOR(cachedContent); } else { ZEPHIR_CALL_METHOD(&ret, frontend, "afterretrieve", NULL, cachedContent); zephir_check_call_status(); RETURN_CCTOR(ret); } } } ZEPHIR_MM_RESTORE();}
开发者ID:flaver12,项目名称:cphalcon,代码行数:82,
示例20: PHP_METHOD/** * Validates the data from the decoded JWT. * * @return boolean TRUE if the JWT request is valid and can be decoded. Otherwise, FALSE is returned. * * @see OAuth2/GrantType/GrantTypeInterface::getTokenData() */PHP_METHOD(OAuth2_GrantType_JwtBearer, validateRequest) { zend_bool _14, _21; zephir_fcall_cache_entry *_9 = NULL, *_12 = NULL; zval *_6; int ZEPHIR_LAST_CALL_STATUS; zval *request, *response, *undecodedJWT = NULL, *jwt = NULL, *notBefore, *jti = NULL, *key = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3 = NULL, *_4, *_5 = NULL, *_7, *_8 = NULL, *_10, *_11 = NULL, *_13 = NULL, *_15, *_16, *_17, *_18, *_19, *_20, *_22, *_23, *_24, *_25, *_26, *_27, *_28; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &request, &response); if (!(zephir_instance_of_ev(request, oauth2_requestinterface_ce TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Parameter 'request' must be an instance of 'OAuth2//RequestInterface'", "", 0); return; } if (!(zephir_instance_of_ev(response, oauth2_responseinterface_ce TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Parameter 'response' must be an instance of 'OAuth2//ResponseInterface'", "", 0); return; } ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "assertion", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_0, request, "request", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); if (!(zephir_is_true(_0))) { ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, 400); ZEPHIR_INIT_VAR(_2); ZVAL_STRING(_2, "invalid_request", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_VAR(_3); ZVAL_STRING(_3, "Missing parameters: /"assertion/" required", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, response, "seterror", NULL, _1, _2, _3); zephir_check_temp_parameter(_2); zephir_check_temp_parameter(_3); zephir_check_call_status(); RETURN_MM_BOOL(0); } ZEPHIR_INIT_NVAR(_1); ZVAL_STRING(_1, "assertion", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&undecodedJWT, request, "request", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); _4 = zephir_fetch_nproperty_this(this_ptr, SL("jwtUtil"), PH_NOISY_CC); ZEPHIR_INIT_NVAR(_1); ZVAL_STRING(_1, "assertion", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_5, request, "request", NULL, _1); zephir_check_temp_parameter(_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_1); ZVAL_NULL(_1); ZEPHIR_INIT_NVAR(_2); ZVAL_BOOL(_2, 0); ZEPHIR_CALL_METHOD(&jwt, _4, "decode", NULL, _5, _1, _2); zephir_check_call_status(); if (!(zephir_is_true(jwt))) { ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, 400); ZEPHIR_INIT_NVAR(_2); ZVAL_STRING(_2, "invalid_request", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "JWT is malformed", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, response, "seterror", NULL, _1, _2, _3); zephir_check_temp_parameter(_2); zephir_check_temp_parameter(_3); zephir_check_call_status(); RETURN_MM_BOOL(0); } ZEPHIR_INIT_NVAR(_1); ZEPHIR_INIT_VAR(_6); array_init_size(_6, 12); zephir_array_update_string(&_6, SL("scope"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("iss"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("sub"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("aud"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("exp"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("nbf"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("iat"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("jti"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6, SL("typ"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); zephir_fast_array_merge(_1, &(_6), &(jwt) TSRMLS_CC); ZEPHIR_CPY_WRT(jwt, _1); if (!(zephir_array_isset_string(jwt, SS("iss")))) { ZEPHIR_INIT_NVAR(_1); ZVAL_LONG(_1, 400); ZEPHIR_INIT_NVAR(_2); ZVAL_STRING(_2, "invalid_grant", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_INIT_NVAR(_3); ZVAL_STRING(_3, "Invalid issuer (iss) provided", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, response, "seterror", NULL, _1, _2, _3); zephir_check_temp_parameter(_2); zephir_check_temp_parameter(_3);//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:php-oauth2-server,代码行数:101,
示例21: PHP_METHOD/** * Executes the validation */PHP_METHOD(Phalcon_Validation_Validator_Regex, validate) { int ZEPHIR_LAST_CALL_STATUS; zend_bool failed, _2; zval *field = NULL; zval *validation, *field_param = NULL, *matches, *message = NULL, *value = NULL, *label = NULL, *replacePairs, *_0 = NULL, *_1 = NULL, *_3 = NULL, *_4 = NULL, *_5, *_6 = NULL, *_7; 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(matches); ZVAL_NULL(matches); 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); ZEPHIR_INIT_VAR(_4); ZVAL_STRING(_4, "pattern", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_3, this_ptr, "getoption", NULL, 0, _4); zephir_check_temp_parameter(_4); zephir_check_call_status(); zephir_preg_match(_1, _3, value, matches, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(_1)) { zephir_array_fetch_long(&_5, matches, 0, PH_NOISY | PH_READONLY, "phalcon/validation/validator/regex.zep", 62 TSRMLS_CC); failed = !ZEPHIR_IS_EQUAL(_5, value); } else { failed = 1; } if (failed == 1) { ZEPHIR_INIT_NVAR(_4); ZVAL_STRING(_4, "label", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&label, this_ptr, "getoption", NULL, 0, _4); zephir_check_temp_parameter(_4); 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(_4); ZVAL_STRING(_4, "message", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _4); zephir_check_temp_parameter(_4); 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(_4); ZVAL_STRING(_4, "Regex", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&message, validation, "getdefaultmessage", NULL, 0, _4); zephir_check_temp_parameter(_4); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(_4); object_init_ex(_4, phalcon_validation_message_ce); ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 53, message, replacePairs); zephir_check_call_status(); ZEPHIR_INIT_VAR(_7); ZVAL_STRING(_7, "Regex", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 432, _6, field, _7); zephir_check_temp_parameter(_7); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, _4); zephir_check_call_status(); RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1);}
开发者ID:halfbakedsneed,项目名称:cphalcon,代码行数:96,
示例22: PHP_METHOD/** * Redirect by HTTP to another action or URL * *<code> * //Using a string redirect (internal/external) * $response->redirect("posts/index"); * $response->redirect("http://en.wikipedia.org", true); * $response->redirect("http://www.example.com/new-location", true, 301); * * //Making a redirection based on a named route * $response->redirect(array( * "for" => "index-lang", * "lang" => "jp", * "controller" => "index" * )); *</code> * * @param string|array location * @param boolean externalRedirect * @param int statusCode * @return /Phalcon/Http/Response */PHP_METHOD(Phalcon_Http_Response, redirect) { int statusCode, ZEPHIR_LAST_CALL_STATUS; zend_bool externalRedirect, _10, _0$$5; zval *location = NULL, *externalRedirect_param = NULL, *statusCode_param = NULL, *header = NULL, *url = NULL, *dependencyInjector = NULL, *matched = NULL, *view = NULL, *_7 = NULL, *_8 = NULL, _1$$5, *_2$$5 = NULL, *_3$$6, _4$$6, *_5$$10 = NULL, *_6$$10, *_9$$11; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &location, &externalRedirect_param, &statusCode_param); if (!location) { ZEPHIR_CPY_WRT(location, ZEPHIR_GLOBAL(global_null)); } else { ZEPHIR_SEPARATE_PARAM(location); } if (!externalRedirect_param) { externalRedirect = 0; } else { externalRedirect = zephir_get_boolval(externalRedirect_param); } if (!statusCode_param) { statusCode = 302; } else { statusCode = zephir_get_intval(statusCode_param); } if (!(zephir_is_true(location))) { ZEPHIR_INIT_NVAR(location); ZVAL_STRING(location, "", 1); } if (externalRedirect) { ZEPHIR_CPY_WRT(header, location); } else { _0$$5 = Z_TYPE_P(location) == IS_STRING; if (_0$$5) { ZEPHIR_SINIT_VAR(_1$$5); ZVAL_STRING(&_1$$5, "://", 0); ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 236, location, &_1$$5); zephir_check_call_status(); _0$$5 = zephir_is_true(_2$$5); } if (_0$$5) { ZEPHIR_INIT_VAR(_3$$6); ZEPHIR_SINIT_VAR(_4$$6); ZVAL_STRING(&_4$$6, "/^[^:///?#]++:/", 0); ZEPHIR_INIT_VAR(matched); zephir_preg_match(matched, &_4$$6, location, _3$$6, 0, 0 , 0 TSRMLS_CC); if (zephir_is_true(matched)) { ZEPHIR_CPY_WRT(header, location); } else { ZEPHIR_INIT_NVAR(header); ZVAL_NULL(header); } } else { ZEPHIR_INIT_NVAR(header); ZVAL_NULL(header); } } ZEPHIR_CALL_METHOD(&dependencyInjector, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(header))) { ZEPHIR_INIT_VAR(_6$$10); ZVAL_STRING(_6$$10, "url", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_5$$10, dependencyInjector, "getshared", NULL, 0, _6$$10); zephir_check_temp_parameter(_6$$10); zephir_check_call_status(); ZEPHIR_CPY_WRT(url, _5$$10); ZEPHIR_CALL_METHOD(&header, url, "get", NULL, 0, location); zephir_check_call_status(); } ZEPHIR_INIT_VAR(_8); ZVAL_STRING(_8, "view", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_7, dependencyInjector, "has", NULL, 0, _8); zephir_check_temp_parameter(_8); zephir_check_call_status(); if (zephir_is_true(_7)) { ZEPHIR_INIT_VAR(_9$$11); ZVAL_STRING(_9$$11, "view", ZEPHIR_TEMP_PARAM_COPY);//.........这里部分代码省略.........
开发者ID:AlexKomrakov,项目名称:cphalcon,代码行数:101,
示例23: PHP_METHOD/** * Resolves the service * * @param array parameters * @param /Phalcon/DiInterface dependencyInjector * @return mixed */PHP_METHOD(Phalcon_Di_Service, resolve) { zend_class_entry *_1$$15; zend_bool found = 0; int ZEPHIR_LAST_CALL_STATUS; zval *parameters = NULL, *dependencyInjector = NULL, *shared = NULL, *definition = NULL, *sharedInstance = NULL, *instance = NULL, *builder = NULL, *_0$$15 = NULL, *_2$$22, *_3$$22, *_4$$22; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters, &dependencyInjector); if (!parameters) { parameters = ZEPHIR_GLOBAL(global_null); } if (!dependencyInjector) { dependencyInjector = ZEPHIR_GLOBAL(global_null); } ZEPHIR_OBS_VAR(shared); zephir_read_property_this(&shared, this_ptr, SL("_shared"), PH_NOISY_CC); if (zephir_is_true(shared)) { ZEPHIR_OBS_VAR(sharedInstance); zephir_read_property_this(&sharedInstance, this_ptr, SL("_sharedInstance"), PH_NOISY_CC); if (Z_TYPE_P(sharedInstance) != IS_NULL) { RETURN_CCTOR(sharedInstance); } } found = 1; ZEPHIR_INIT_VAR(instance); ZVAL_NULL(instance); ZEPHIR_OBS_VAR(definition); zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); if (Z_TYPE_P(definition) == IS_STRING) { if (zephir_class_exists(definition, 1 TSRMLS_CC)) { if (Z_TYPE_P(parameters) == IS_ARRAY) { if (zephir_fast_count_int(parameters TSRMLS_CC)) { ZEPHIR_INIT_NVAR(instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, definition, parameters TSRMLS_CC); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, definition TSRMLS_CC); zephir_check_call_status(); } } else { ZEPHIR_INIT_NVAR(instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, definition TSRMLS_CC); zephir_check_call_status(); } } else { found = 0; } } else { if (Z_TYPE_P(definition) == IS_OBJECT) { if (zephir_instance_of_ev(definition, zend_ce_closure TSRMLS_CC)) { if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { _1$$15 = zend_fetch_class(SL("Closure"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); ZEPHIR_CALL_CE_STATIC(&_0$$15, _1$$15, "bind", NULL, 0, definition, dependencyInjector); zephir_check_call_status(); ZEPHIR_CPY_WRT(definition, _0$$15); } if (Z_TYPE_P(parameters) == IS_ARRAY) { ZEPHIR_INIT_NVAR(instance); ZEPHIR_CALL_USER_FUNC_ARRAY(instance, definition, parameters); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(instance); ZEPHIR_CALL_USER_FUNC(instance, definition); zephir_check_call_status(); } } else { ZEPHIR_CPY_WRT(instance, definition); } } else { if (Z_TYPE_P(definition) == IS_ARRAY) { ZEPHIR_INIT_VAR(builder); object_init_ex(builder, phalcon_di_service_builder_ce); if (zephir_has_constructor(builder TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, builder, "__construct", NULL, 0); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&instance, builder, "build", NULL, 181, dependencyInjector, definition, parameters); zephir_check_call_status(); } else { found = 0; } } } if (found == 0) { ZEPHIR_INIT_VAR(_2$$22); object_init_ex(_2$$22, phalcon_di_exception_ce); _3$$22 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); ZEPHIR_INIT_VAR(_4$$22);//.........这里部分代码省略.........
开发者ID:bschantz,项目名称:cphalcon,代码行数:101,
注:本文中的zephir_is_true函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zephir_read_property函数代码示例 C++ zephir_hash_move_forward_ex函数代码示例 |