这篇教程C++ zephir_hash_get_current_data_ex函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中zephir_hash_get_current_data_ex函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_hash_get_current_data_ex函数的具体用法?C++ zephir_hash_get_current_data_ex怎么用?C++ zephir_hash_get_current_data_ex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了zephir_hash_get_current_data_ex函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PHP_METHOD/** * Sets the path for a domain */PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory) { int ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_3 = NULL; HashTable *_1; HashPosition _0; zval *directory, *key = NULL, *value = NULL, **_2, *_4 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &directory); zephir_update_property_this(this_ptr, SL("_directory"), directory TSRMLS_CC); if (Z_TYPE_P(directory) == IS_ARRAY) { if (zephir_fast_count_int(directory TSRMLS_CC)) { zephir_is_iterable(directory, &_1, &_0, 0, 0, "phalcon/translate/adapter/gettext.zep", 180); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(key, _1, _0); ZEPHIR_GET_HVALUE(value, _2); ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_3, 423, key, value); zephir_check_call_status(); } } } else { ZEPHIR_CALL_METHOD(&_4, this_ptr, "getdefaultdomain", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", &_3, 423, _4, directory); zephir_check_call_status(); } ZEPHIR_MM_RESTORE();}
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:39,
示例2: PHP_METHODPHP_METHOD(Test_Flow, testFor2) { HashTable *_2; HashPosition _1; double c; zval *v = NULL, *k = NULL, *b, *_0 = NULL, **_3; ZEPHIR_MM_GROW(); c = (double) (0); ZEPHIR_INIT_VAR(b); zephir_create_array(b, 4, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(_0); ZVAL_LONG(_0, 1); zephir_array_fast_append(b, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 2); zephir_array_fast_append(b, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 3); zephir_array_fast_append(b, _0); ZEPHIR_INIT_NVAR(_0); ZVAL_LONG(_0, 4); zephir_array_fast_append(b, _0); zephir_is_iterable(b, &_2, &_1, 0, 0, "test/flow.zep", 453); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(k, _2, _1); ZEPHIR_GET_HVALUE(v, _3); c += zephir_get_numberval(k); } RETURN_MM_DOUBLE(c);}
开发者ID:AveVlad,项目名称:zephir,代码行数:36,
示例3: 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,
示例4: PHP_METHOD/** * Unregisters one or all listeners for an event. * * @param string|/Xpl/Event/Event event Event ID or object. * @param callable callback [Optional] Callback to remove. If no callback is given, * then all of the event's listeners are removed. * @return /Xpl/Event/Manager * * @throws /InvalidArgumentException if event is not a string or Event instance. */PHP_METHOD(Xpl_Event_Manager, off) { HashTable *_6$$8; HashPosition _5$$8; int ZEPHIR_LAST_CALL_STATUS; zval *event, *callback = NULL, *id = NULL, *listeners = NULL, *_4, *_0$$4, *_1$$5, *_2$$5, *_3$$5, *i$$8 = NULL, *listener$$8 = NULL, **_7$$8, *_8$$9 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &event, &callback); if (!callback) { callback = ZEPHIR_GLOBAL(global_null); } if (Z_TYPE_P(event) == IS_STRING) { ZEPHIR_CPY_WRT(id, event); } else if (zephir_instance_of_ev(event, xpl_event_event_ce TSRMLS_CC)) { ZEPHIR_OBS_VAR(_0$$4); zephir_read_property(&_0$$4, event, SL("id"), PH_NOISY_CC); ZEPHIR_CPY_WRT(id, _0$$4); } else { ZEPHIR_INIT_VAR(_1$$5); object_init_ex(_1$$5, spl_ce_InvalidArgumentException); ZEPHIR_INIT_VAR(_2$$5); zephir_gettype(_2$$5, event TSRMLS_CC); ZEPHIR_INIT_VAR(_3$$5); ZEPHIR_CONCAT_SV(_3$$5, "Event must be string or instance of Event, given: ", _2$$5); ZEPHIR_CALL_METHOD(NULL, _1$$5, "__construct", NULL, 5, _3$$5); zephir_check_call_status(); zephir_throw_exception_debug(_1$$5, "xpl/event/manager.zep", 118 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_VAR(listeners); _4 = zephir_fetch_nproperty_this(this_ptr, SL("listeners"), PH_NOISY_CC); if (zephir_array_isset_fetch(&listeners, _4, id, 0 TSRMLS_CC)) { if (Z_TYPE_P(callback) == IS_NULL) { zephir_array_unset(&listeners, id, PH_SEPARATE); } else { zephir_is_iterable(listeners, &_6$$8, &_5$$8, 1, 0, "xpl/event/manager.zep", 137); for ( ; zephir_hash_get_current_data_ex(_6$$8, (void**) &_7$$8, &_5$$8) == SUCCESS ; zephir_hash_move_forward_ex(_6$$8, &_5$$8) ) { ZEPHIR_GET_HMKEY(i$$8, _6$$8, _5$$8); ZEPHIR_GET_HVALUE(listener$$8, _7$$8); ZEPHIR_OBS_NVAR(_8$$9); zephir_read_property(&_8$$9, listener$$8, SL("callback"), PH_NOISY_CC); if (ZEPHIR_IS_EQUAL(callback, _8$$9)) { zephir_array_unset(&listeners, i$$8, PH_SEPARATE); } } zend_hash_destroy(_6$$8); FREE_HASHTABLE(_6$$8); } zephir_update_property_array(this_ptr, SL("listeners"), id, listeners TSRMLS_CC); } RETURN_THIS();}
开发者ID:wells5609,项目名称:xpl,代码行数:71,
示例5: 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,
示例6: PHP_METHODPHP_METHOD(Yb_Std, groupIndexedValues) { HashTable *_1; HashPosition _0; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *groupKey = NULL, *indexKey = NULL, *valueKey = NULL; zval *data_param = NULL, *groupKey_param = NULL, *indexKey_param = NULL, *valueKey_param = NULL, *k = NULL, *v = NULL, *arr = NULL, *groupValue = NULL, *indexValue = NULL, *valueValue = NULL, **_2, *_3$$4 = NULL, *_4$$4 = NULL, *_6$$5 = NULL, *_7$$5 = NULL, *_8$$6 = NULL, *_9$$6 = NULL, *_10$$7 = NULL, *_11$$7 = NULL; zval *data = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &data_param, &groupKey_param, &indexKey_param, &valueKey_param); zephir_get_arrval(data, data_param); zephir_get_strval(groupKey, groupKey_param); zephir_get_strval(indexKey, indexKey_param); zephir_get_strval(valueKey, valueKey_param); ZEPHIR_INIT_VAR(arr); array_init(arr); zephir_is_iterable(data, &_1, &_0, 0, 0, "yb/std.zep", 359); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(k, _1, _0); ZEPHIR_GET_HVALUE(v, _2); if (unlikely(Z_TYPE_P(v) != IS_ARRAY)) { ZEPHIR_INIT_NVAR(_3$$4); object_init_ex(_3$$4, yb_exception_ce); ZEPHIR_INIT_LNVAR(_4$$4); ZEPHIR_CONCAT_SV(_4$$4, "Invalid item type, array required at: ", k); ZEPHIR_CALL_METHOD(NULL, _3$$4, "__construct", &_5, 2, _4$$4); zephir_check_call_status(); zephir_throw_exception_debug(_3$$4, "yb/std.zep", 344 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(groupValue); if (unlikely(!(zephir_array_isset_fetch(&groupValue, v, groupKey, 0 TSRMLS_CC)))) { ZEPHIR_INIT_NVAR(_6$$5); object_init_ex(_6$$5, yb_exception_ce); ZEPHIR_INIT_LNVAR(_7$$5); ZEPHIR_CONCAT_SV(_7$$5, "Cannot find value of group at: ", k); ZEPHIR_CALL_METHOD(NULL, _6$$5, "__construct", &_5, 2, _7$$5); zephir_check_call_status(); zephir_throw_exception_debug(_6$$5, "yb/std.zep", 347 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(indexValue); if (unlikely(!(zephir_array_isset_fetch(&indexValue, v, indexKey, 0 TSRMLS_CC)))) { ZEPHIR_INIT_NVAR(_8$$6); object_init_ex(_8$$6, yb_exception_ce); ZEPHIR_INIT_LNVAR(_9$$6); ZEPHIR_CONCAT_SV(_9$$6, "Cannot find value of index at: ", k); ZEPHIR_CALL_METHOD(NULL, _8$$6, "__construct", &_5, 2, _9$$6); zephir_check_call_status(); zephir_throw_exception_debug(_8$$6, "yb/std.zep", 350 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(valueValue); if (unlikely(!(zephir_array_isset_fetch(&valueValue, v, valueKey, 0 TSRMLS_CC)))) { ZEPHIR_INIT_NVAR(_10$$7); object_init_ex(_10$$7, yb_exception_ce); ZEPHIR_INIT_LNVAR(_11$$7); ZEPHIR_CONCAT_SV(_11$$7, "Cannot find value of value at: ", k); ZEPHIR_CALL_METHOD(NULL, _10$$7, "__construct", &_5, 2, _11$$7); zephir_check_call_status(); zephir_throw_exception_debug(_10$$7, "yb/std.zep", 353 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } zephir_array_update_multi(&arr, &valueValue TSRMLS_CC, SL("zz"), 2, groupValue, indexValue); } RETURN_CCTOR(arr);}
开发者ID:VergilTang,项目名称:yb,代码行数:80,
示例7: PHP_METHOD/** * Handles routing information received from the rewrite engine * *<code> * //Read the info from the rewrite engine * $router->handle(); * * //Manually passing an URL * $router->handle('/posts/edit/1'); *</code> * * @param string uri */PHP_METHOD(Test_Router, handle) { zephir_nts_static zephir_fcall_cache_entry *_12 = NULL; HashTable *_2, *_9; HashPosition _1, _8; int ZEPHIR_LAST_CALL_STATUS; zval *uri = NULL, *realUri = NULL, *request = NULL, *currentHostName = NULL, *routeFound = NULL, *parts = NULL, *params, *matches, *notFoundPaths, *vnamespace, *module, *controller, *action, *paramsStr, *strParams = NULL, *paramsMerge = NULL, *route = NULL, *methods = NULL, *dependencyInjector = NULL, *hostname = NULL, *regexHostName = NULL, *matched = NULL, *pattern = NULL, *handledUri = NULL, *beforeMatch = NULL, *paths = NULL, *converters = NULL, *part = NULL, *position = NULL, *matchPosition = NULL, *_0, **_3, *_4, *_5 = NULL, *_6 = NULL, *_7 = NULL, **_10, _11, *_13, *_14, *_15, *_16; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri); if (!uri) { uri = ZEPHIR_GLOBAL(global_null); } if (!(zephir_is_true(uri))) { ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri", NULL); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(realUri, uri); } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_removeExtraSlashes"), PH_NOISY_CC); if (zephir_is_true(_0)) { ZEPHIR_CALL_METHOD(&handledUri, this_ptr, "doremoveextraslashes", NULL, realUri); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(handledUri, realUri); } ZEPHIR_INIT_VAR(request); ZVAL_NULL(request); ZEPHIR_INIT_VAR(currentHostName); ZVAL_NULL(currentHostName); ZEPHIR_INIT_VAR(routeFound); ZVAL_BOOL(routeFound, 0); ZEPHIR_INIT_VAR(parts); array_init(parts); ZEPHIR_INIT_VAR(params); array_init(params); ZEPHIR_INIT_VAR(matches); ZVAL_NULL(matches); zephir_update_property_this(this_ptr, SL("_wasMatched"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_matchedRoute"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); zephir_is_iterable(_0, &_2, &_1, 0, 1); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_backwards_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(route, _3); ZEPHIR_CALL_METHOD(&methods, route, "gethttpmethods", NULL); zephir_check_call_status(); if (Z_TYPE_P(methods) != IS_NULL) { if (Z_TYPE_P(request) == IS_NULL) { _4 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CPY_WRT(dependencyInjector, _4); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "A dependency injection container is required to access the 'request' service"); return; } ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "request", 0); ZEPHIR_CALL_METHOD(&request, dependencyInjector, "getshared", NULL, _5); zephir_check_temp_parameter(_5); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&_6, request, "ismethod", NULL, methods); zephir_check_call_status(); if (ZEPHIR_IS_FALSE(_6)) { continue; } } ZEPHIR_CALL_METHOD(&hostname, route, "gethostname", NULL); zephir_check_call_status(); if (Z_TYPE_P(hostname) != IS_NULL) { if (Z_TYPE_P(request) == IS_NULL) { ZEPHIR_OBS_NVAR(dependencyInjector); zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "A dependency injection container is required to access the 'request' service"); return; } ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "request", 0); ZEPHIR_CALL_METHOD(&request, dependencyInjector, "getshared", NULL, _5); zephir_check_temp_parameter(_5); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:101,
示例8: PHP_METHOD/** * Returns current row in the resultset */PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) { zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL; HashTable *_2, *_5; HashPosition _1, _4; int dirtyState, ZEPHIR_LAST_CALL_STATUS; zval *row, *hydrateMode, *alias = NULL, *activeRow = NULL, *type = NULL, *columnTypes, *column = NULL, *columnValue = NULL, *value = NULL, *attribute = NULL, *source = NULL, *attributes = NULL, *columnMap = NULL, *rowModel = NULL, *keepSnapshots = NULL, *sqlAlias = NULL, *_0, **_3, **_6, *_7 = NULL, *_9, *_10 = NULL, _12 = zval_used_for_init, _13 = zval_used_for_init; ZEPHIR_MM_GROW(); ZEPHIR_OBS_VAR(activeRow); zephir_read_property_this(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC); if (Z_TYPE_P(activeRow) != IS_NULL) { RETURN_CCTOR(activeRow); } ZEPHIR_OBS_VAR(row); zephir_read_property_this(&row, this_ptr, SL("_row"), PH_NOISY_CC); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_disableHydration"), PH_NOISY_CC); if (zephir_is_true(_0)) { zephir_update_property_this(this_ptr, SL("_activeRow"), row TSRMLS_CC); RETURN_CCTOR(row); } if (Z_TYPE_P(row) != IS_ARRAY) { zephir_update_property_this(this_ptr, SL("_activeRow"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); RETURN_MM_BOOL(0); } ZEPHIR_OBS_VAR(hydrateMode); zephir_read_property_this(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); do { if (ZEPHIR_IS_LONG(hydrateMode, 0)) { ZEPHIR_INIT_NVAR(activeRow); object_init_ex(activeRow, phalcon_mvc_model_row_ce); if (zephir_has_constructor(activeRow TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, activeRow, "__construct", NULL, 0); zephir_check_call_status(); } break; } if (ZEPHIR_IS_LONG(hydrateMode, 1)) { ZEPHIR_INIT_NVAR(activeRow); array_init(activeRow); break; } ZEPHIR_INIT_NVAR(activeRow); object_init(activeRow); break; } while(0); ZEPHIR_OBS_VAR(columnTypes); zephir_read_property_this(&columnTypes, this_ptr, SL("_columnTypes"), PH_NOISY_CC); dirtyState = 0; zephir_is_iterable(columnTypes, &_2, &_1, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 235); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HMKEY(alias, _2, _1); ZEPHIR_GET_HVALUE(column, _3); if (Z_TYPE_P(column) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/mvc/model/resultset/complex.zep", 136); return; } ZEPHIR_OBS_NVAR(type); zephir_array_fetch_string(&type, column, SL("type"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 139 TSRMLS_CC); if (ZEPHIR_IS_STRING(type, "object")) { ZEPHIR_OBS_NVAR(source); zephir_array_fetch_string(&source, column, SL("column"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 145 TSRMLS_CC); ZEPHIR_OBS_NVAR(attributes); zephir_array_fetch_string(&attributes, column, SL("attributes"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 146 TSRMLS_CC); ZEPHIR_OBS_NVAR(columnMap); zephir_array_fetch_string(&columnMap, column, SL("columnMap"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 147 TSRMLS_CC); ZEPHIR_INIT_NVAR(rowModel); array_init(rowModel); zephir_is_iterable(attributes, &_5, &_4, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 165); for ( ; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS ; zephir_hash_move_forward_ex(_5, &_4) ) { ZEPHIR_GET_HVALUE(attribute, _6); ZEPHIR_OBS_NVAR(columnValue); ZEPHIR_INIT_LNVAR(_7); ZEPHIR_CONCAT_SVSV(_7, "_", source, "_", attribute); zephir_array_fetch(&columnValue, row, _7, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 158 TSRMLS_CC); zephir_array_update_zval(&rowModel, attribute, &columnValue, PH_COPY | PH_SEPARATE); } do { if (ZEPHIR_IS_LONG(hydrateMode, 0)) { ZEPHIR_OBS_NVAR(keepSnapshots); if (!(zephir_array_isset_string_fetch(&keepSnapshots, column, SS("keepSnapshots"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(keepSnapshots); ZVAL_BOOL(keepSnapshots, 0); } zephir_array_fetch_string(&_9, column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 180 TSRMLS_CC); ZEPHIR_INIT_NVAR(_10); ZVAL_LONG(_10, dirtyState); ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_8, 0, _9, rowModel, columnMap, _10, keepSnapshots); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:JulianZhao,项目名称:cphalcon,代码行数:101,
示例9: PHP_METHOD//.........这里部分代码省略......... ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 3); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 23); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); ZEPHIR_INIT_BNVAR(_0); array_init_size(_0, 5); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 23); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 7); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 12); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); ZEPHIR_INIT_BNVAR(_0); array_init_size(_0, 5); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 12); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 25); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 5); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); ZEPHIR_INIT_BNVAR(_0); array_init_size(_0, 5); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 24); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 7); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 11); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); ZEPHIR_INIT_BNVAR(_0); array_init_size(_0, 5); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 11); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 27); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 4); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); ZEPHIR_INIT_BNVAR(_0); array_init_size(_0, 5); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 11); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 27); zephir_array_fast_append(_0, _1); ZEPHIR_INIT_BNVAR(_1); ZVAL_LONG(_1, 4); zephir_array_fast_append(_0, _1); zephir_array_fast_append(box, _0); zephir_is_iterable(box, &_3, &_2, 0, 0); for ( ; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS ; zephir_hash_move_forward_ex(_3, &_2) ) { ZEPHIR_GET_HVALUE(side, _4); j = 0; _7 = 2; _6 = 0; _5 = 0; if ((_6 <= _7)) { while (1) { if (_5) { _6++; if (!((_6 <= _7))) { break; } } else { _5 = 1; } i = _6; zephir_array_fetch_long(&_8, side, i, PH_NOISY | PH_READONLY TSRMLS_CC); j += zephir_get_numberval(_8); } } if ((j != 42)) { ZEPHIR_THROW_EXCEPTION_STR(test_exception_ce, "not true"); return; } } ZEPHIR_MM_RESTORE();}
开发者ID:RandomStuffs22,项目名称:zephir,代码行数:101,
示例10: PHP_METHOD/** * Tries to render the view with every engine registered in the component * * @param string path * @param array params */PHP_METHOD(Phalcon_Mvc_View_Simple, _internalRender) { zephir_fcall_cache_entry *_11 = NULL, *_12 = NULL; HashTable *_4; HashPosition _3; int ZEPHIR_LAST_CALL_STATUS; zend_bool notExists, mustClean, _7, _9; zval *path_param = NULL, *params, *eventsManager, *engines = NULL, *extension = NULL, *engine = NULL, *viewEnginePath = NULL, *viewsDirPath, *_0 = NULL, *_1 = NULL, *_2, **_5, *_6 = NULL, _8 = zval_used_for_init, *_10 = NULL; zval *path = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &path_param, ¶ms); if (unlikely(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(path_param) == IS_STRING)) { zephir_get_strval(path, path_param); } else { ZEPHIR_INIT_VAR(path); ZVAL_EMPTY_STRING(path); } ZEPHIR_OBS_VAR(eventsManager); zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); if (Z_TYPE_P(eventsManager) == IS_OBJECT) { zephir_update_property_this(this_ptr, SL("_activeRenderPath"), path TSRMLS_CC); } if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_VAR(_1); ZVAL_STRING(_1, "view:beforeRender", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_0, eventsManager, "fire", NULL, 0, _1, this_ptr); zephir_check_temp_parameter(_1); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { RETURN_MM_NULL(); } } notExists = 1; mustClean = 1; _2 = zephir_fetch_nproperty_this(this_ptr, SL("_viewsDir"), PH_NOISY_CC); ZEPHIR_INIT_VAR(viewsDirPath); ZEPHIR_CONCAT_VV(viewsDirPath, _2, path); ZEPHIR_CALL_METHOD(&engines, this_ptr, "_loadtemplateengines", NULL, 0); zephir_check_call_status(); zephir_is_iterable(engines, &_4, &_3, 0, 0, "phalcon/mvc/view/simple.zep", 261); for ( ; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS ; zephir_hash_move_forward_ex(_4, &_3) ) { ZEPHIR_GET_HMKEY(extension, _4, _3); ZEPHIR_GET_HVALUE(engine, _5); ZEPHIR_INIT_LNVAR(_6); ZEPHIR_CONCAT_VV(_6, viewsDirPath, extension); if ((zephir_file_exists(_6 TSRMLS_CC) == SUCCESS)) { ZEPHIR_INIT_NVAR(viewEnginePath); ZEPHIR_CONCAT_VV(viewEnginePath, viewsDirPath, extension); } else { _7 = zephir_is_true(extension); if (_7) { ZEPHIR_SINIT_NVAR(_8); ZVAL_LONG(&_8, -zephir_fast_strlen_ev(extension)); ZEPHIR_INIT_NVAR(_1); zephir_substr(_1, viewsDirPath, zephir_get_intval(&_8), 0, ZEPHIR_SUBSTR_NO_LENGTH); _7 = ZEPHIR_IS_EQUAL(_1, extension); } _9 = _7; if (_9) { _9 = (zephir_file_exists(viewsDirPath TSRMLS_CC) == SUCCESS); } if (_9) { ZEPHIR_CPY_WRT(viewEnginePath, viewsDirPath); } else { ZEPHIR_INIT_NVAR(viewEnginePath); ZVAL_STRING(viewEnginePath, "", 1); } } if (zephir_is_true(viewEnginePath)) { if (Z_TYPE_P(eventsManager) == IS_OBJECT) { ZEPHIR_INIT_NVAR(_10); ZVAL_STRING(_10, "view:beforeRenderView", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_0, eventsManager, "fire", &_11, 0, _10, this_ptr, viewEnginePath); zephir_check_temp_parameter(_10); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { continue; } } ZEPHIR_CALL_METHOD(NULL, engine, "render", NULL, 0, viewEnginePath, params, (mustClean ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false))); zephir_check_call_status(); notExists = 0;//.........这里部分代码省略.........
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:101,
示例11: PHP_METHOD/** * Returns an array of Phalcon/Db/Column objects describing a table * * <code> * print_r($connection->describeColumns("posts")); * </code> */PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) { zephir_fcall_cache_entry *_16 = NULL, *_20 = NULL, *_21 = NULL; zend_bool _9; 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, *_10, *_11 = NULL, *_12, *_13, _14 = zval_used_for_init, *_15 = NULL, *_17, *_18, *_19 = NULL; 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, 0, table, schema); zephir_check_call_status(); ZEPHIR_INIT_VAR(_3); ZVAL_LONG(_3, 3); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); zephir_check_call_status(); zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 291); 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, 2, PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 108 TSRMLS_CC); while (1) { if (zephir_memnstr_str(columnType, SL("tinyint(1)"), "phalcon/db/adapter/pdo/sqlite.zep", 115)) { ZEPHIR_INIT_NVAR(_3); ZVAL_LONG(_3, 8); zephir_array_update_string(&definition, SL("type"), &_3, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 5); zephir_array_update_string(&definition, SL("bindType"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(columnType); ZVAL_STRING(columnType, "boolean", 1); break; } if (zephir_memnstr_str(columnType, SL("bigint"), "phalcon/db/adapter/pdo/sqlite.zep", 125)) { ZEPHIR_INIT_NVAR(_7); ZVAL_LONG(_7, 14); 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; } _9 = zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/sqlite.zep", 135); if (!(_9)) { _9 = zephir_memnstr_str(columnType, SL("INT"), "phalcon/db/adapter/pdo/sqlite.zep", 135); } if (_9) { 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); zephir_array_fetch_long(&_10, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 141 TSRMLS_CC); if (zephir_is_true(_10)) { zephir_array_update_string(&definition, SL("autoIncrement"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); } break; } if (zephir_memnstr_str(columnType, SL("varchar"), "phalcon/db/adapter/pdo/sqlite.zep", 150)) { 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("date"), "phalcon/db/adapter/pdo/sqlite.zep", 158)) {//.........这里部分代码省略.........
开发者ID:brainformatik,项目名称:cphalcon,代码行数:101,
示例12: PHP_METHOD/** * Sanitizes a value with a specified single or set of filters */PHP_METHOD(Phalcon_Filter, sanitize) { zephir_fcall_cache_entry *_8 = NULL; int ZEPHIR_LAST_CALL_STATUS; HashTable *_1, *_5, *_10; HashPosition _0, _4, _9; zend_bool noRecursive, _3; zval *value = NULL, *filters, *noRecursive_param = NULL, *filter = NULL, *arrayValue = NULL, *itemKey = NULL, *itemValue = NULL, *sanitizedValue, **_2, **_6, *_7 = NULL, **_11; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &value, &filters, &noRecursive_param); ZEPHIR_SEPARATE_PARAM(value); if (!noRecursive_param) { noRecursive = 0; } else { noRecursive = zephir_get_boolval(noRecursive_param); } if (Z_TYPE_P(filters) == IS_ARRAY) { if (Z_TYPE_P(value) != IS_NULL) { zephir_is_iterable(filters, &_1, &_0, 0, 0, "phalcon/filter.zep", 107); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HVALUE(filter, _2); _3 = Z_TYPE_P(value) == IS_ARRAY; if (_3) { _3 = !noRecursive; } if (_3) { ZEPHIR_INIT_NVAR(arrayValue); array_init(arrayValue); zephir_is_iterable(value, &_5, &_4, 0, 0, "phalcon/filter.zep", 102); for ( ; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS ; zephir_hash_move_forward_ex(_5, &_4) ) { ZEPHIR_GET_HMKEY(itemKey, _5, _4); ZEPHIR_GET_HVALUE(itemValue, _6); ZEPHIR_CALL_METHOD(&_7, this_ptr, "_sanitize", &_8, itemValue, filter); zephir_check_call_status(); zephir_array_update_zval(&arrayValue, itemKey, &_7, PH_COPY | PH_SEPARATE); } ZEPHIR_CPY_WRT(value, arrayValue); } else { ZEPHIR_CALL_METHOD(&_7, this_ptr, "_sanitize", &_8, value, filter); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, _7); } } } RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } _3 = Z_TYPE_P(value) == IS_ARRAY; if (_3) { _3 = !noRecursive; } if (_3) { ZEPHIR_INIT_VAR(sanitizedValue); array_init(sanitizedValue); zephir_is_iterable(value, &_10, &_9, 0, 0, "phalcon/filter.zep", 119); for ( ; zephir_hash_get_current_data_ex(_10, (void**) &_11, &_9) == SUCCESS ; zephir_hash_move_forward_ex(_10, &_9) ) { ZEPHIR_GET_HMKEY(itemKey, _10, _9); ZEPHIR_GET_HVALUE(itemValue, _11); ZEPHIR_CALL_METHOD(&_7, this_ptr, "_sanitize", &_8, itemValue, filters); zephir_check_call_status(); zephir_array_update_zval(&sanitizedValue, itemKey, &_7, PH_COPY | PH_SEPARATE); } RETURN_CCTOR(sanitizedValue); } ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_sanitize", &_8, value, filters); zephir_check_call_status(); RETURN_MM();}
开发者ID:KKrushnabate,项目名称:cphalcon,代码行数:85,
示例13: PHP_METHOD/** * Phalcon/Config/Adapter/Ini constructor */PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) { HashTable *_5, *_8$$5; HashPosition _4, _7$$5; zephir_fcall_cache_entry *_12 = NULL, *_16 = NULL, *_17 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *filePath_param = NULL, *iniConfig = NULL, _0, *config = NULL, *section = NULL, *sections = NULL, *directives = NULL, *path = NULL, *lastValue = NULL, **_6, *_1$$3, *_2$$3, *_3$$3, **_9$$5, *_10$$6 = NULL, *_13$$7 = NULL, _14$$7 = zval_used_for_init, *_15$$8 = NULL; zval *filePath = NULL, *_11$$6 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_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); } ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 1); ZEPHIR_CALL_FUNCTION(&iniConfig, "parse_ini_file", NULL, 134, filePath, ZEPHIR_GLOBAL(global_true), &_0); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(iniConfig)) { ZEPHIR_INIT_VAR(_1$$3); object_init_ex(_1$$3, phalcon_config_exception_ce); ZEPHIR_INIT_VAR(_2$$3); zephir_basename(_2$$3, filePath TSRMLS_CC); ZEPHIR_INIT_VAR(_3$$3); ZEPHIR_CONCAT_SVS(_3$$3, "Configuration file ", _2$$3, " can't be loaded"); ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); zephir_check_call_status(); zephir_throw_exception_debug(_1$$3, "phalcon/config/adapter/ini.zep", 67 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_INIT_VAR(config); array_init(config); zephir_is_iterable(iniConfig, &_5, &_4, 0, 0, "phalcon/config/adapter/ini.zep", 88); for ( ; zephir_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS ; zephir_hash_move_forward_ex(_5, &_4) ) { ZEPHIR_GET_HMKEY(section, _5, _4); ZEPHIR_GET_HVALUE(directives, _6); if (Z_TYPE_P(directives) == IS_ARRAY) { ZEPHIR_INIT_NVAR(sections); array_init(sections); zephir_is_iterable(directives, &_8$$5, &_7$$5, 0, 0, "phalcon/config/adapter/ini.zep", 80); for ( ; zephir_hash_get_current_data_ex(_8$$5, (void**) &_9$$5, &_7$$5) == SUCCESS ; zephir_hash_move_forward_ex(_8$$5, &_7$$5) ) { ZEPHIR_GET_HMKEY(path, _8$$5, _7$$5); ZEPHIR_GET_HVALUE(lastValue, _9$$5); zephir_get_strval(_11$$6, path); ZEPHIR_CALL_METHOD(&_10$$6, this_ptr, "_parseinistring", &_12, 0, _11$$6, lastValue); zephir_check_call_status(); zephir_array_append(§ions, _10$$6, PH_SEPARATE, "phalcon/config/adapter/ini.zep", 78); } if (zephir_fast_count_int(sections TSRMLS_CC)) { ZEPHIR_INIT_NVAR(_13$$7); ZEPHIR_SINIT_NVAR(_14$$7); ZVAL_STRING(&_14$$7, "array_merge_recursive", 0); ZEPHIR_CALL_USER_FUNC_ARRAY(_13$$7, &_14$$7, sections); zephir_check_call_status(); zephir_array_update_zval(&config, section, &_13$$7, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_CALL_METHOD(&_15$$8, this_ptr, "_cast", &_16, 135, directives); zephir_check_call_status(); zephir_array_update_zval(&config, section, &_15$$8, PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, this_ptr, "__construct", &_17, 19, config); zephir_check_call_status(); ZEPHIR_MM_RESTORE();}
开发者ID:AmazingDreams,项目名称:cphalcon,代码行数:87,
示例14: PHP_METHOD/** * Outputs a message formatting it with HTML * *<code> * $flash->outputMessage('error', message); *</code> * * @param string|array message * @return string|void */PHP_METHOD(Phalcon_Flash, outputMessage) { HashTable *_3$$8; HashPosition _2$$8; zend_bool automaticHtml = 0, implicitFlush = 0; zval *type_param = NULL, *message, *content = NULL, *cssClasses = NULL, *classes = NULL, *typeClasses = NULL, *eol = NULL, *msg = NULL, *htmlMessage = NULL, *_0 = NULL, *_1$$5, **_4$$8; zval *type = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &message); zephir_get_strval(type, type_param); ZEPHIR_OBS_VAR(_0); zephir_read_property_this(&_0, this_ptr, SL("_automaticHtml"), PH_NOISY_CC); automaticHtml = zephir_get_boolval(_0); if (automaticHtml == 1) { ZEPHIR_OBS_VAR(classes); zephir_read_property_this(&classes, this_ptr, SL("_cssClasses"), PH_NOISY_CC); ZEPHIR_OBS_VAR(typeClasses); if (zephir_array_isset_fetch(&typeClasses, classes, type, 0 TSRMLS_CC)) { ZEPHIR_INIT_VAR(cssClasses); if (Z_TYPE_P(typeClasses) == IS_ARRAY) { ZEPHIR_INIT_VAR(_1$$5); zephir_fast_join_str(_1$$5, SL(" "), typeClasses TSRMLS_CC); ZEPHIR_CONCAT_SVS(cssClasses, " class=/"", _1$$5, "/""); } else { ZEPHIR_CONCAT_SVS(cssClasses, " class=/"", typeClasses, "/""); } } else { ZEPHIR_INIT_NVAR(cssClasses); ZVAL_STRING(cssClasses, "", 1); } ZEPHIR_INIT_VAR(eol); ZEPHIR_GET_CONSTANT(eol, "PHP_EOL"); } ZEPHIR_OBS_NVAR(_0); zephir_read_property_this(&_0, this_ptr, SL("_implicitFlush"), PH_NOISY_CC); implicitFlush = zephir_get_boolval(_0); if (Z_TYPE_P(message) == IS_ARRAY) { if (implicitFlush == 0) { ZEPHIR_INIT_VAR(content); ZVAL_STRING(content, "", 1); } zephir_is_iterable(message, &_3$$8, &_2$$8, 0, 0, "phalcon/flash.zep", 204); for ( ; zephir_hash_get_current_data_ex(_3$$8, (void**) &_4$$8, &_2$$8) == SUCCESS ; zephir_hash_move_forward_ex(_3$$8, &_2$$8) ) { ZEPHIR_GET_HVALUE(msg, _4$$8); if (automaticHtml == 1) { ZEPHIR_INIT_NVAR(htmlMessage); ZEPHIR_CONCAT_SVSVSV(htmlMessage, "<div", cssClasses, ">", msg, "</div>", eol); } else { ZEPHIR_CPY_WRT(htmlMessage, msg); } if (implicitFlush == 1) { zend_print_zval(htmlMessage, 0); } else { zephir_concat_self(&content, htmlMessage TSRMLS_CC); zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC); } } if (implicitFlush == 0) { RETURN_CCTOR(content); } } else { if (automaticHtml == 1) { ZEPHIR_INIT_NVAR(htmlMessage); ZEPHIR_CONCAT_SVSVSV(htmlMessage, "<div", cssClasses, ">", message, "</div>", eol); } else { ZEPHIR_CPY_WRT(htmlMessage, message); } if (implicitFlush == 1) { zend_print_zval(htmlMessage, 0); } else { zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC); RETURN_CCTOR(htmlMessage); } } ZEPHIR_MM_RESTORE();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:94,
示例15: PHP_METHOD//.........这里部分代码省略......... if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("VARCHAR") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL); zephir_check_call_status(); ZEPHIR_INIT_VAR(_1); ZEPHIR_CONCAT_SVS(_1, "(", _0, ")"); zephir_concat_self(&columnSql, _1 TSRMLS_CC); break; } if (ZEPHIR_IS_LONG(type, 3)) { if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("NUMERIC") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, column, "getscale", NULL); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_1); ZEPHIR_CONCAT_SVSVS(_1, "(", _0, ",", _2, ")"); zephir_concat_self(&columnSql, _1 TSRMLS_CC); break; } if (ZEPHIR_IS_LONG(type, 4)) { if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC); } break; } if (ZEPHIR_IS_LONG(type, 5)) { if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("CHARACTER") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_0, column, "getsize", NULL); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_1); ZEPHIR_CONCAT_SVS(_1, "(", _0, ")"); zephir_concat_self(&columnSql, _1 TSRMLS_CC); break; } if (ZEPHIR_IS_LONG(type, 6)) { if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("TEXT") TSRMLS_CC); } break; } if (ZEPHIR_IS_LONG(type, 7)) { if (ZEPHIR_IS_EMPTY(columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT") TSRMLS_CC); } break; } if (ZEPHIR_IS_EMPTY(columnSql)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Unrecognized SQLite data type", "phalcon/db/dialect/sqlite.zep", 112); return; } ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL); zephir_check_call_status(); if (!(ZEPHIR_IS_EMPTY(typeValues))) { if (Z_TYPE_P(typeValues) == IS_ARRAY) { ZEPHIR_INIT_VAR(valueSql); ZVAL_STRING(valueSql, "", 1); zephir_is_iterable(typeValues, &_4, &_3, 0, 0, "phalcon/db/dialect/sqlite.zep", 123); for ( ; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS ; zephir_hash_move_forward_ex(_4, &_3) ) { ZEPHIR_GET_HVALUE(value, _5); ZEPHIR_SINIT_NVAR(_6); ZVAL_STRING(&_6, "/"", 0); ZEPHIR_CALL_FUNCTION(&_0, "addcslashes", &_7, value, &_6); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_1); ZEPHIR_CONCAT_SVS(_1, "/"", _0, "/", "); zephir_concat_self(&valueSql, _1 TSRMLS_CC); } ZEPHIR_SINIT_NVAR(_6); ZVAL_LONG(&_6, 0); ZEPHIR_SINIT_VAR(_8); ZVAL_LONG(&_8, -2); ZEPHIR_INIT_VAR(_9); zephir_substr(_9, valueSql, 0 , -2 , 0); ZEPHIR_INIT_VAR(_10); ZEPHIR_CONCAT_SVS(_10, "(", _9, ")"); zephir_concat_self(&columnSql, _10 TSRMLS_CC); } else { ZEPHIR_SINIT_NVAR(_8); ZVAL_STRING(&_8, "/"", 0); ZEPHIR_CALL_FUNCTION(&_2, "addcslashes", &_7, typeValues, &_8); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_10); ZEPHIR_CONCAT_SVS(_10, "(/"", _2, "/")"); zephir_concat_self(&columnSql, _10 TSRMLS_CC); } } } while(0); RETURN_CCTOR(columnSql);}
开发者ID:flaver12,项目名称:cphalcon,代码行数:101,
示例16: PHP_METHOD/** * Executes the validator */PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate) { HashTable *_2$$5, *_22$$16; HashPosition _1$$5, _21$$16; zend_class_entry *_33; zephir_fcall_cache_entry *_6 = NULL, *_12 = NULL, *_31 = NULL; int ZEPHIR_LAST_CALL_STATUS, number = 0; zval *record, *field = NULL, *dependencyInjector = NULL, *metaData = NULL, *message = NULL, *bindTypes = NULL, *bindDataTypes = NULL, *columnMap = NULL, *conditions = NULL, *bindParams = NULL, *composeField = NULL, *columnField = NULL, *bindType = NULL, *primaryField = NULL, *attributeField = NULL, *params = NULL, *className = NULL, *replacePairs = NULL, *_0 = NULL, *_19 = NULL, *_32 = NULL, **_3$$5, *_4$$8 = NULL, *_5$$8 = NULL, *_7$$10 = NULL, *_8$$10 = NULL, _9$$6 = zval_used_for_init, *_10$$6 = NULL, *_11$$6 = NULL, *_13$$13, *_14$$13, *_15$$15, *_16$$15, *_17$$11, *_18$$11 = NULL, *_20$$16 = NULL, **_23$$16, *_24$$20 = NULL, *_25$$20 = NULL, *_26$$22 = NULL, *_27$$22 = NULL, _28$$19 = zval_used_for_init, *_29$$19 = NULL, *_30$$19 = NULL, *_34$$24 = NULL, *_36$$24 = NULL, *_35$$25; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); ZEPHIR_CALL_METHOD(&dependencyInjector, record, "getdi", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(_0); ZVAL_STRING(_0, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _0); zephir_check_temp_parameter(_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(bindTypes); array_init(bindTypes); ZEPHIR_CALL_METHOD(&bindDataTypes, metaData, "getbindtypes", NULL, 0, record); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).column_renaming) { ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, record); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(columnMap); ZVAL_NULL(columnMap); } ZEPHIR_INIT_VAR(conditions); array_init(conditions); ZEPHIR_INIT_VAR(bindParams); array_init(bindParams); number = 0; ZEPHIR_INIT_NVAR(_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_ARRAY) { zephir_is_iterable(field, &_2$$5, &_1$$5, 0, 0, "phalcon/mvc/model/validator/uniqueness.zep", 127); for ( ; zephir_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS ; zephir_hash_move_forward_ex(_2$$5, &_1$$5) ) { ZEPHIR_GET_HVALUE(composeField, _3$$5); if (Z_TYPE_P(columnMap) == IS_ARRAY) { ZEPHIR_OBS_NVAR(columnField); if (!(zephir_array_isset_fetch(&columnField, columnMap, composeField, 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(_4$$8); object_init_ex(_4$$8, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_5$$8); ZEPHIR_CONCAT_SVS(_5$$8, "Column '", composeField, "' isn't part of the column map"); ZEPHIR_CALL_METHOD(NULL, _4$$8, "__construct", &_6, 9, _5$$8); zephir_check_call_status(); zephir_throw_exception_debug(_4$$8, "phalcon/mvc/model/validator/uniqueness.zep", 104 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { ZEPHIR_CPY_WRT(columnField, composeField); } ZEPHIR_OBS_NVAR(bindType); if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, columnField, 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(_7$$10); object_init_ex(_7$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_8$$10); ZEPHIR_CONCAT_SVS(_8$$10, "Column '", columnField, "' isn't part of the table columns"); ZEPHIR_CALL_METHOD(NULL, _7$$10, "__construct", &_6, 9, _8$$10); zephir_check_call_status(); zephir_throw_exception_debug(_7$$10, "phalcon/mvc/model/validator/uniqueness.zep", 114 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_SINIT_NVAR(_9$$6); ZVAL_LONG(&_9$$6, number); ZEPHIR_INIT_LNVAR(_10$$6); ZEPHIR_CONCAT_SVSV(_10$$6, "[", composeField, "] = ?", &_9$$6); zephir_array_append(&conditions, _10$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 120); ZEPHIR_CALL_METHOD(&_11$$6, record, "readattribute", &_12, 0, composeField); zephir_check_call_status(); zephir_array_append(&bindParams, _11$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 121); zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 122); number++; } } else { if (Z_TYPE_P(columnMap) == IS_ARRAY) { ZEPHIR_OBS_NVAR(columnField); if (!(zephir_array_isset_fetch(&columnField, columnMap, field, 0 TSRMLS_CC))) { ZEPHIR_INIT_VAR(_13$$13); object_init_ex(_13$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(_14$$13); ZEPHIR_CONCAT_SVS(_14$$13, "Column '", field, "' isn't part of the column map"); ZEPHIR_CALL_METHOD(NULL, _13$$13, "__construct", &_6, 9, _14$$13);//.........这里部分代码省略.........
开发者ID:Studentsov,项目名称:cphalcon,代码行数:101,
示例17: PHP_METHOD/** * Produce the routing parameters from the rewrite information */PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) { zephir_fcall_cache_entry *_9 = NULL, *_17 = NULL, *_18 = NULL; HashTable *_2, *_7, *_11, *_15; HashPosition _1, _6, _10, _14; int ZEPHIR_LAST_CALL_STATUS; zval *uri_param = NULL, *realUri = NULL, *annotationsService = NULL, *handlers, *controllerSuffix, *scope = NULL, *prefix = NULL, *dependencyInjector = NULL, *handler = NULL, *controllerName = NULL, *lowerControllerName = NULL, *namespaceName = NULL, *moduleName = NULL, *sufixed = NULL, *handlerAnnotations = NULL, *classAnnotations = NULL, *annotations = NULL, *annotation = NULL, *methodAnnotations = NULL, *lowercased = NULL, *method = NULL, *collection = NULL, *_0, **_3, *_4, *_5 = NULL, **_8, **_12, *_13 = NULL, **_16; zval *uri = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri_param); if (!uri_param) { ZEPHIR_INIT_VAR(uri); ZVAL_EMPTY_STRING(uri); } else { if (unlikely(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(uri_param) == IS_STRING)) { zephir_get_strval(uri, uri_param); } else { ZEPHIR_INIT_VAR(uri); ZVAL_EMPTY_STRING(uri); } } if (!(!(!uri) && Z_STRLEN_P(uri))) { ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri", NULL, 0); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(realUri, uri); } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_processed"), PH_NOISY_CC); if (!(zephir_is_true(_0))) { ZEPHIR_INIT_VAR(annotationsService); ZVAL_NULL(annotationsService); ZEPHIR_OBS_VAR(handlers); zephir_read_property_this(&handlers, this_ptr, SL("_handlers"), PH_NOISY_CC); if (Z_TYPE_P(handlers) == IS_ARRAY) { ZEPHIR_OBS_VAR(controllerSuffix); zephir_read_property_this(&controllerSuffix, this_ptr, SL("_controllerSuffix"), PH_NOISY_CC); zephir_is_iterable(handlers, &_2, &_1, 0, 0, "phalcon/mvc/router/annotations.zep", 208); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(scope, _3); if (Z_TYPE_P(scope) == IS_ARRAY) { ZEPHIR_OBS_NVAR(prefix); zephir_array_fetch_long(&prefix, scope, 0, PH_NOISY, "phalcon/mvc/router/annotations.zep", 117 TSRMLS_CC); if (!(ZEPHIR_IS_EMPTY(prefix))) { if (!(zephir_start_with(realUri, prefix, NULL))) { continue; } } if (Z_TYPE_P(annotationsService) != IS_OBJECT) { _4 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CPY_WRT(dependencyInjector, _4); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "A dependency injection container is required to access the 'annotations' service", "phalcon/mvc/router/annotations.zep", 129); return; } ZEPHIR_INIT_NVAR(_5); ZVAL_STRING(_5, "annotations", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&annotationsService, dependencyInjector, "getshared", NULL, 0, _5); zephir_check_temp_parameter(_5); zephir_check_call_status(); } ZEPHIR_OBS_NVAR(handler); zephir_array_fetch_long(&handler, scope, 1, PH_NOISY, "phalcon/mvc/router/annotations.zep", 138 TSRMLS_CC); if (zephir_memnstr_str(handler, SL("//"), "phalcon/mvc/router/annotations.zep", 140)) { ZEPHIR_INIT_NVAR(controllerName); zephir_get_class_ns(controllerName, handler, 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(lowerControllerName); zephir_uncamelize(lowerControllerName, controllerName); ZEPHIR_INIT_NVAR(namespaceName); zephir_get_ns_class(namespaceName, handler, 0 TSRMLS_CC); } else { ZEPHIR_CPY_WRT(controllerName, handler); ZEPHIR_INIT_NVAR(lowerControllerName); zephir_uncamelize(lowerControllerName, controllerName); ZEPHIR_INIT_NVAR(namespaceName); ZVAL_NULL(namespaceName); } zephir_update_property_this(this_ptr, SL("_routePrefix"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); ZEPHIR_OBS_NVAR(moduleName); zephir_array_isset_long_fetch(&moduleName, scope, 2, 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(sufixed); ZEPHIR_CONCAT_VV(sufixed, handler, controllerSuffix); ZEPHIR_CALL_METHOD(&handlerAnnotations, annotationsService, "get", NULL, 0, sufixed); zephir_check_call_status(); if (Z_TYPE_P(handlerAnnotations) == IS_OBJECT) { ZEPHIR_CALL_METHOD(&classAnnotations, handlerAnnotations, "getclassannotations", NULL, 0); zephir_check_call_status();//.........这里部分代码省略.........
开发者ID:AlloVince,项目名称:cphalcon,代码行数:101,
示例18: PHP_METHOD/** * Renders a view using the template engine */PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render) { HashTable *_1; HashPosition _0; int ZEPHIR_LAST_CALL_STATUS; zend_bool mustClean; zval *templatePath_param = NULL, *params, *mustClean_param = NULL, *compiler = NULL, *compiledTemplatePath = NULL, *key = NULL, *value = NULL, **_2, *_3 = NULL, *_4, *_5 = NULL; zval *templatePath = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &templatePath_param, ¶ms, &mustClean_param); if (unlikely(Z_TYPE_P(templatePath_param) != IS_STRING && Z_TYPE_P(templatePath_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(templatePath_param) == IS_STRING)) { zephir_get_strval(templatePath, templatePath_param); } else { ZEPHIR_INIT_VAR(templatePath); ZVAL_EMPTY_STRING(templatePath); } if (!mustClean_param) { mustClean = 0; } else { mustClean = zephir_get_boolval(mustClean_param); } if (mustClean) { ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 371); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&compiler, this_ptr, "getcompiler", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, compiler, "compile", NULL, 0, templatePath); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&compiledTemplatePath, compiler, "getcompiledtemplatepath", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { zephir_is_iterable(params, &_1, &_0, 0, 0, "phalcon/mvc/view/engine/volt.zep", 118); for ( ; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS ; zephir_hash_move_forward_ex(_1, &_0) ) { ZEPHIR_GET_HMKEY(key, _1, _0); ZEPHIR_GET_HVALUE(value, _2); ZEPHIR_CPY_WRT(_3, value); if (zephir_set_symbol(key, _3 TSRMLS_CC) == FAILURE){ return; } } } if (zephir_require_zval(compiledTemplatePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } if (mustClean) { _4 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); ZEPHIR_CALL_FUNCTION(&_5, "ob_get_contents", NULL, 117); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, _4, "setcontent", NULL, 0, _5); zephir_check_call_status(); } ZEPHIR_MM_RESTORE();}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:70,
示例19: PHP_METHOD/** * Listens for notifications from the models manager */PHP_METHOD(Phalcon_Mvc_Collection_Behavior_SoftDelete, notify) { HashTable *_5$$7; HashPosition _4$$7; zephir_fcall_cache_entry *_7 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *type_param = NULL, *model, *options = NULL, *value = NULL, *field = NULL, *updateModel = NULL, *message = NULL, *_0$$3, *_1$$3 = NULL, *_2$$6 = NULL, *_3$$7 = NULL, **_6$$7; zval *type = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); if (unlikely(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); RETURN_MM_NULL(); } if (likely(Z_TYPE_P(type_param) == IS_STRING)) { zephir_get_strval(type, type_param); } else { ZEPHIR_INIT_VAR(type); ZVAL_EMPTY_STRING(type); } if (ZEPHIR_IS_STRING(type, "beforeDelete")) { ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_VAR(value); if (!(zephir_array_isset_string_fetch(&value, options, SS("value"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'value' is required", "phalcon/mvc/collection/behavior/softdelete.zep", 51); return; } ZEPHIR_OBS_VAR(field); if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'field' is required", "phalcon/mvc/collection/behavior/softdelete.zep", 58); return; } ZEPHIR_INIT_VAR(_0$$3); ZVAL_BOOL(_0$$3, 1); ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, 0, _0$$3); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1$$3, model, "readattribute", NULL, 0, field); zephir_check_call_status(); if (!ZEPHIR_IS_EQUAL(_1$$3, value)) { ZEPHIR_INIT_VAR(updateModel); if (zephir_clone(updateModel, model TSRMLS_CC) == FAILURE) { RETURN_MM(); } ZEPHIR_CALL_METHOD(NULL, updateModel, "writeattribute", NULL, 0, field, value); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2$$6, updateModel, "save", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(_2$$6))) { ZEPHIR_CALL_METHOD(&_3$$7, updateModel, "getmessages", NULL, 0); zephir_check_call_status(); zephir_is_iterable(_3$$7, &_5$$7, &_4$$7, 0, 0, "phalcon/mvc/collection/behavior/softdelete.zep", 90); for ( ; zephir_hash_get_current_data_ex(_5$$7, (void**) &_6$$7, &_4$$7) == SUCCESS ; zephir_hash_move_forward_ex(_5$$7, &_4$$7) ) { ZEPHIR_GET_HVALUE(message, _6$$7); ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_7, 0, message); zephir_check_call_status(); } RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, value); zephir_check_call_status(); } } ZEPHIR_MM_RESTORE();}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:76,
示例20: PHP_METHOD/** * Handles routing information received from command-line arguments * * @param array arguments */PHP_METHOD(Phalcon_Cli_Router, handle) { zephir_fcall_cache_entry *_18 = NULL; zval *_15 = NULL; zval *_5 = NULL, *_10 = NULL; int ZEPHIR_LAST_CALL_STATUS; HashTable *_3, *_7; HashPosition _2, _6; zend_bool _0; zval *arguments = NULL, *moduleName = NULL, *taskName = NULL, *actionName = NULL, *params = NULL, *route = NULL, *parts = NULL, *pattern = NULL, *routeFound = NULL, *matches, *paths = NULL, *beforeMatch = NULL, *converters = NULL, *converter = NULL, *part = NULL, *position = NULL, *matchPosition = NULL, *strParams, *_1, **_4, **_8, *_9 = NULL, *_11, *_12, *_13, *_14, _16, *_17 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &arguments); if (!arguments) { arguments = ZEPHIR_GLOBAL(global_null); } ZEPHIR_INIT_VAR(routeFound); ZVAL_BOOL(routeFound, 0); ZEPHIR_INIT_VAR(parts); array_init(parts); ZEPHIR_INIT_VAR(params); array_init(params); ZEPHIR_INIT_VAR(matches); ZVAL_NULL(matches); zephir_update_property_this(this_ptr, SL("_wasMatched"), (0) ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); zephir_update_property_this(this_ptr, SL("_matchedRoute"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); if (Z_TYPE_P(arguments) != IS_ARRAY) { _0 = Z_TYPE_P(arguments) != IS_STRING; if (_0) { _0 = Z_TYPE_P(arguments) != IS_NULL; } if (_0) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_router_exception_ce, "Arguments must be an array or string", "phalcon/cli/router.zep", 204); return; } _1 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); zephir_is_iterable(_1, &_3, &_2, 0, 1, "phalcon/cli/router.zep", 304); for ( ; zephir_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS ; zephir_hash_move_backwards_ex(_3, &_2) ) { ZEPHIR_GET_HVALUE(route, _4); ZEPHIR_CALL_METHOD(&pattern, route, "getcompiledpattern", NULL, 0); zephir_check_call_status(); if (zephir_memnstr_str(pattern, SL("^"), "phalcon/cli/router.zep", 214)) { ZEPHIR_INIT_NVAR(routeFound); zephir_preg_match(routeFound, pattern, arguments, matches, 0, 0 , 0 TSRMLS_CC); } else { ZEPHIR_INIT_NVAR(routeFound); ZVAL_BOOL(routeFound, ZEPHIR_IS_EQUAL(pattern, arguments)); } if (zephir_is_true(routeFound)) { ZEPHIR_CALL_METHOD(&beforeMatch, route, "getbeforematch", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(beforeMatch) != IS_NULL) { if (!(zephir_is_callable(beforeMatch TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_router_exception_ce, "Before-Match callback is not callable in matched route", "phalcon/cli/router.zep", 232); return; } ZEPHIR_INIT_NVAR(_5); zephir_create_array(_5, 3, 0 TSRMLS_CC); zephir_array_fast_append(_5, arguments); zephir_array_fast_append(_5, route); zephir_array_fast_append(_5, this_ptr); ZEPHIR_INIT_NVAR(routeFound); ZEPHIR_CALL_USER_FUNC_ARRAY(routeFound, beforeMatch, _5); zephir_check_call_status(); } } if (zephir_is_true(routeFound)) { ZEPHIR_CALL_METHOD(&paths, route, "getpaths", NULL, 0); zephir_check_call_status(); ZEPHIR_CPY_WRT(parts, paths); if (Z_TYPE_P(matches) == IS_ARRAY) { ZEPHIR_CALL_METHOD(&converters, route, "getconverters", NULL, 0); zephir_check_call_status(); zephir_is_iterable(paths, &_7, &_6, 0, 0, "phalcon/cli/router.zep", 293); for ( ; zephir_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS ; zephir_hash_move_forward_ex(_7, &_6) ) { ZEPHIR_GET_HMKEY(part, _7, _6); ZEPHIR_GET_HVALUE(position, _8); ZEPHIR_OBS_NVAR(matchPosition); if (zephir_array_isset_fetch(&matchPosition, matches, position, 0 TSRMLS_CC)) { if (Z_TYPE_P(converters) == IS_ARRAY) { ZEPHIR_OBS_NVAR(converter); if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) { ZEPHIR_INIT_NVAR(_9); ZEPHIR_INIT_NVAR(_5); zephir_create_array(_5, 1, 0 TSRMLS_CC); zephir_array_fast_append(_5, matchPosition);//.........这里部分代码省略.........
开发者ID:spuy767,项目名称:cphalcon,代码行数:101,
示例21: PHP_METHOD/** * Validate a set of data according to a set of rules * * @param array|object data * @param object entity * @return /Phalcon/Validation/Message/Group */PHP_METHOD(Phalcon_Validation, validate) { zend_bool _0$$7; HashTable *_2, *_10$$16; HashPosition _1, _9$$16; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *data = NULL, *entity = NULL, *validators = NULL, *messages = NULL, *scope = NULL, *field = NULL, *validator = NULL, *status = NULL, *combinedFieldsValidators = NULL, **_3, *_4$$10 = NULL, *_6$$10 = NULL, *_7$$14 = NULL, *_8$$14 = NULL, **_11$$16, *_12$$17 = NULL, *_13$$17 = NULL, *_14$$21 = NULL, *_15$$21 = NULL, *_16$$23; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &data, &entity); if (!data) { data = ZEPHIR_GLOBAL(global_null); } if (!entity) { entity = ZEPHIR_GLOBAL(global_null); } ZEPHIR_OBS_VAR(validators); zephir_read_property_this(&validators, this_ptr, SL("_validators"), PH_NOISY_CC); ZEPHIR_OBS_VAR(combinedFieldsValidators); zephir_read_property_this(&combinedFieldsValidators, this_ptr, SL("_combinedFieldsValidators"), PH_NOISY_CC); if (Z_TYPE_P(validators) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "There are no validators to validate", "phalcon/validation.zep", 94); return; } zephir_update_property_this(this_ptr, SL("_values"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); ZEPHIR_INIT_VAR(messages); object_init_ex(messages, phalcon_validation_message_group_ce); ZEPHIR_CALL_METHOD(NULL, messages, "__construct", NULL, 3); zephir_check_call_status(); if (Z_TYPE_P(entity) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "setentity", NULL, 0, entity); zephir_check_call_status(); } if ((zephir_method_exists_ex(this_ptr, SS("beforevalidation") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&status, this_ptr, "beforevalidation", NULL, 0, data, entity, messages); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { RETURN_CCTOR(status); } } zephir_update_property_this(this_ptr, SL("_messages"), messages TSRMLS_CC); if (Z_TYPE_P(data) != IS_NULL) { _0$$7 = Z_TYPE_P(data) == IS_ARRAY; if (!(_0$$7)) { _0$$7 = Z_TYPE_P(data) == IS_OBJECT; } if (_0$$7) { zephir_update_property_this(this_ptr, SL("_data"), data TSRMLS_CC); } else { zephir_var_dump(&data TSRMLS_CC); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "Invalid data to validate", "phalcon/validation.zep", 128); return; } } zephir_is_iterable(validators, &_2, &_1, 0, 0, "phalcon/validation.zep", 162); for ( ; zephir_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zephir_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(scope, _3); if (Z_TYPE_P(scope) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "The validator scope is not valid", "phalcon/validation.zep", 135); return; } ZEPHIR_OBS_NVAR(field); zephir_array_fetch_long(&field, scope, 0, PH_NOISY, "phalcon/validation.zep", 138 TSRMLS_CC); ZEPHIR_OBS_NVAR(validator); zephir_array_fetch_long(&validator, scope, 1, PH_NOISY, "phalcon/validation.zep", 139 TSRMLS_CC); if (Z_TYPE_P(validator) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_validation_exception_ce, "One of the validators is not valid", "phalcon/validation.zep", 142); return; } ZEPHIR_CALL_METHOD(&_4$$10, this_ptr, "prechecking", &_5, 0, field, validator); zephir_check_call_status(); if (zephir_is_true(_4$$10)) { continue; } ZEPHIR_CALL_METHOD(&_6$$10, validator, "validate", NULL, 0, this_ptr, field); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$10)) { ZEPHIR_INIT_NVAR(_8$$14); ZVAL_STRING(_8$$14, "cancelOnFail", ZEPHIR_TEMP_PARAM_COPY); ZEPHIR_CALL_METHOD(&_7$$14, validator, "getoption", NULL, 0, _8$$14); zephir_check_temp_parameter(_8$$14); zephir_check_call_status(); if (zephir_is_true(_7$$14)) { break; } }//.........这里部分代码省略.........
开发者ID:SDpower,项目名称:cphalcon,代码行数:101,
示例22: PHP_METHOD/** * Create/Returns a new transaction or an existing one */PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) { HashTable *_2$$5; HashPosition _1$$5; int ZEPHIR_LAST_CALL_STATUS; zval *autoBegin_param = NULL, *dependencyInjector = NULL, *transaction = NULL, *transactions = NULL, *_0, *_5, *_6, **_3$$5, *_4$$7 = NULL; zend_bool autoBegin; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &autoBegin_param); if (!autoBegin_param) { autoBegin = 1; } else { autoBegin = zephir_get_boolval(autoBegin_param); } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CPY_WRT(dependencyInjector, _0); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_transaction_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model/transaction/manager.zep", 188); return; } _0 = zephir_fetch_nproperty_this(this_ptr, SL("_number"), PH_NOISY_CC); if (zephir_is_true(_0)) { ZEPHIR_OBS_VAR(transactions); zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); if (Z_TYPE_P(transactions) == IS_ARRAY) { zephir_is_iterable(transactions, &_2$$5, &_1$$5, 0, 1, "phalcon/mvc/model/transaction/manager.zep", 200); for ( ; zephir_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS ; zephir_hash_move_backwards_ex(_2$$5, &_1$$5) ) { ZEPHIR_GET_HVALUE(transaction, _3$$5); if (Z_TYPE_P(transaction) == IS_OBJECT) { ZEPHIR_INIT_NVAR(_4$$7); ZVAL_BOOL(_4$$7, 0); ZEPHIR_CALL_METHOD(NULL, transaction, "setisnewtransaction", NULL, 0, _4$$7); zephir_check_call_status(); RETURN_CCTOR(transaction); } } } } ZEPHIR_INIT_NVAR(transaction); object_init_ex(transaction, phalcon_mvc_model_transaction_ce); _5 = zephir_fetch_nproperty_this(this_ptr, SL("_service"), PH_NOISY_CC); ZEPHIR_INIT_VAR(_6); if (autoBegin) { ZVAL_BOOL(_6, 1); } else { ZVAL_BOOL(_6, 0); } ZEPHIR_CALL_METHOD(NULL, transaction, "__construct", NULL, 352, dependencyInjector, _6, _5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, transaction, "settransactionmanager", NULL, 353, this_ptr); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("_transactions"), transaction TSRMLS_CC); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_number") TSRMLS_CC)); RETURN_CCTOR(transaction);}
开发者ID:Dmitry-Kucher,项目名称:cphalcon,代码行数:66,
示例23: PHP_METHOD/** * Resolves an annotation expression * * @param array expr * @return mixed */PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) { HashTable *_2$$7; HashPosition _1$$7; zephir_fcall_cache_entry *_5 = NULL; int ZEPHIR_LAST_CALL_STATUS; zval *expr_param = NULL, *value = NULL, *item = NULL, *resolvedItem = NULL, *arrayValue = NULL, *name = NULL, *type = NULL, *_0$$7, **_3$$7, *_4$$8, *_6$$12, *_7$$12; zval *expr = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); expr = expr_param; ZEPHIR_OBS_VAR(type); zephir_array_fetch_string(&type, expr, SL("type"), PH_NOISY, "phalcon/annotations/annotation.zep", 96 TSRMLS_CC); do { if (ZEPHIR_IS_LONG(type, 301) || ZEPHIR_IS_LONG(type, 302) || ZEPHIR_IS_LONG(type, 303) || ZEPHIR_IS_LONG(type, 307)) { ZEPHIR_OBS_VAR(value); zephir_array_fetch_string(&value, expr, SL("value"), PH_NOISY, "phalcon/annotations/annotation.zep", 103 TSRMLS_CC); break; } if (ZEPHIR_IS_LONG(type, 304)) { ZEPHIR_INIT_NVAR(value); ZVAL_NULL(value); break; } if (ZEPHIR_IS_LONG(type, 305)) { ZEPHIR_INIT_NVAR(value); ZVAL_BOOL(value, 0); break; } if (ZEPHIR_IS_LONG(type, 306)) { ZEPHIR_INIT_NVAR(value); ZVAL_BOOL(value, 1); break; } if (ZEPHIR_IS_LONG(type, 308)) { ZEPHIR_INIT_VAR(arrayValue); array_init(arrayValue); zephir_array_fetch_string(&_0$$7, expr, SL("items"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 120 TSRMLS_CC); zephir_is_iterable(_0$$7, &_2$$7, &_1$$7, 0, 0, "phalcon/annotations/annotation.zep", 128); for ( ; zephir_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS ; zephir_hash_move_forward_ex(_2$$7, &_1$$7) ) { ZEPHIR_GET_HVALUE(item, _3$$7); zephir_array_fetch_string(&_4$$8, item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 121 TSRMLS_CC); ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_5, 87, _4$$8); zephir_check_call_status(); ZEPHIR_OBS_NVAR(name); if (zephir_array_isset_string_fetch(&name, item, SS("name"), 0 TSRMLS_CC)) { zephir_array_update_zval(&arrayValue, name, &resolvedItem, PH_COPY | PH_SEPARATE); } else { zephir_array_append(&arrayValue, resolvedItem, PH_SEPARATE, "phalcon/annotations/annotation.zep", 125); } } RETURN_CCTOR(arrayValue); } if (ZEPHIR_IS_LONG(type, 300)) { object_init_ex(return_value, phalcon_annotations_annotation_ce); ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 88, expr); zephir_check_call_status(); RETURN_MM(); } ZEPHIR_INIT_VAR(_6$$12); object_init_ex(_6$$12, phalcon_annotations_exception_ce); ZEPHIR_INIT_VAR(_7$$12); ZEPHIR_CONCAT_SVS(_7$$12, "The expression ", type, " is unknown"); ZEPHIR_CALL_METHOD(NULL, _6$$12, "__construct", NULL, 9, _7$$12); zephir_check_call_status(); zephir_throw_exception_debug(_6$$12, "phalcon/annotations/annotation.zep", 134 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); RETURN_CCTOR(value);}
开发者ID:8V017UW2RQ70,项目名称:cphalcon,代码行数:86,
示例24: 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,
注:本文中的zephir_hash_get_current_data_ex函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ zephir_hash_move_forward_ex函数代码示例 C++ zephir_has_constructor函数代码示例 |