diff --git a/.github/actions/build-phalcon-win/action.yml b/.github/actions/build-phalcon-win/action.yml index 5ec1ed16fa8..c35cfb93e92 100644 --- a/.github/actions/build-phalcon-win/action.yml +++ b/.github/actions/build-phalcon-win/action.yml @@ -74,7 +74,7 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.12.1 + uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ inputs.arch }} @@ -82,7 +82,7 @@ runs: # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll' # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.12.1 + uses: ilammy/msvc-dev-cmd@v1 if: ${{ inputs.php_version }} == '7.4' with: arch: ${{ inputs.arch }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5f039bb4c4..bb497642292 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,8 +19,8 @@ on: env: # All versions should be declared here - PHALCON_VERSION: 5.7.0 - ZEPHIR_PARSER_VERSION: 1.6.0 + PHALCON_VERSION: 5.8.0 + ZEPHIR_PARSER_VERSION: 1.6.1 # For tests LANG: en_US.UTF-8 @@ -92,9 +92,7 @@ jobs: name: - ubuntu-gcc - -# Removing temporarily macos builds since it fails due to the container setup -# - macos-clang + - macos-clang # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} diff --git a/.gitignore b/.gitignore index 102236d6c5f..2014b3cbf03 100644 --- a/.gitignore +++ b/.gitignore @@ -59,9 +59,17 @@ autom4te.cache/ /vendor /ide/ +# Jetbrains IDE +.idea/ +*.iml + .zephir/ .temp/ +# JetBrains IDE +*.iml +.idea/ + # Zephir compiler zephir.phar zephir-*.phar @@ -75,3 +83,6 @@ tests/_output/* .php_cs.cache .env zephir + +# Docker +docker-compose.override.yml diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index eb2f9587e6f..c7a95c671a7 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -1,5 +1,36 @@ # Changelog +## [5.8.0](https://github.com/phalcon/cphalcon/releases/tag/v5.8.0) (2024-07-09) + +### Changed + +- Changed `Phalcon\Mvc\Model`, `Phalcon\Support\Collection` and `Phalcon\Support\Registry` to correctly implement `\Serializable` interface. [#16591](https://github.com/phalcon/cphalcon/issues/16591) +- Changed the `Phalcon\Mvc\Router\Group::getHostname()` to return `null` also. [#16601](https://github.com/phalcon/cphalcon/issues/16601) +- Changed `Phalcon\Mvc\View\Engine\Volt\Compiler::compileSource` to also return `array` [#16608](https://github.com/phalcon/cphalcon/issues/16608) + +### Added + +- Added events and `Phalcon\Events\Manager` for `Phalcon\Storage\Adapter\Apcu`, + `Phalcon\Storage\Adapter\Redis`, + `Phalcon\Storage\Adapter\Memory`, + `Phalcon\Storage\Adapter\Libmemcached`, + `Phalcon\Storage\Adapter\Stream`, + `Phalcon\Storage\Adapter\Weak`, + `Phalcon\Cache\Adapter\Apcu`, + `Phalcon\Cache\Adapter\Redis`, + `Phalcon\Cache\Adapter\Memory`, + `Phalcon\Cache\Adapter\Libmemcached`, + `Phalcon\Cache\Adapter\Stream`, + `Phalcon\Cache\Adapter\Weak` + `Phalcon\Cache\AbstractCache`. [#16606](https://github.com/phalcon/cphalcon/issues/16606) + +### Fixed + +- Fixed `Phalcon\Support\Helper\PascalCase` causing memory leak by anonymous function [#16593](https://github.com/phalcon/cphalcon/issues/16593) +- Fixed `Phalcon\Mvc\Model\Query` to rollback failed transactions and re-throw exception for data consistency [#16604](https://github.com/phalcon/cphalcon/issues/16604) + +### Removed + ## [5.7.0](https://github.com/phalcon/cphalcon/releases/tag/v5.7.0) (2024-05-17) ### Changed diff --git a/build/phalcon/phalcon.zep.c b/build/phalcon/phalcon.zep.c index e7a275dc3e2..2f6a9e5faa1 100644 --- a/build/phalcon/phalcon.zep.c +++ b/build/phalcon/phalcon.zep.c @@ -13562,22 +13562,21 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure) static PHP_METHOD(phalcon_0__closure, __invoke) { - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element, element_sub, _0; + zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&_0); - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) + ZVAL_UNDEF(&number_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&file_sub); + ZVAL_UNDEF(&line_sub); + ZVAL_BOOL(&__$true, 1); + ZEND_PARSE_PARAMETERS_START(4, 4) + Z_PARAM_ZVAL(number) + Z_PARAM_ZVAL(message) + Z_PARAM_ZVAL(file) + Z_PARAM_ZVAL(line) ZEND_PARSE_PARAMETERS_END(); - ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); - zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, element); - zephir_check_call_status(); - zephir_ucfirst(return_value, &_0); - RETURN_MM(); + zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -13598,42 +13597,6 @@ ZEPHIR_INIT_CLASS(phalcon_10__closure) } static PHP_METHOD(phalcon_10__closure, __invoke) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *action, action_sub, _0; - - ZVAL_UNDEF(&action_sub); - ZVAL_UNDEF(&_0); - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(action) - ZEND_PARSE_PARAMETERS_END(); - ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); - zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - zephir_fetch_params(1, 1, 0, &action); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "-"); - zephir_uncamelize(return_value, action, &_0); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(phalcon_11__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 11__closure, phalcon, 11__closure, phalcon_11__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_11__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; @@ -13662,14 +13625,14 @@ static PHP_METHOD(phalcon_11__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_12__closure) +ZEPHIR_INIT_CLASS(phalcon_11__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 12__closure, phalcon, 12__closure, phalcon_12__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 11__closure, phalcon, 11__closure, phalcon_11__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_12__closure, __invoke) +static PHP_METHOD(phalcon_11__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; @@ -13700,14 +13663,14 @@ static PHP_METHOD(phalcon_12__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_13__closure) +ZEPHIR_INIT_CLASS(phalcon_12__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 13__closure, phalcon, 13__closure, phalcon_13__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 12__closure, phalcon, 12__closure, phalcon_12__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_13__closure, __invoke) +static PHP_METHOD(phalcon_12__closure, __invoke) { zend_bool _0; zval *element, element_sub; @@ -13734,14 +13697,14 @@ static PHP_METHOD(phalcon_13__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_14__closure) +ZEPHIR_INIT_CLASS(phalcon_13__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 14__closure, phalcon, 14__closure, phalcon_14__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 13__closure, phalcon, 13__closure, phalcon_13__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_14__closure, __invoke) +static PHP_METHOD(phalcon_13__closure, __invoke) { zend_bool _0; zval *element, element_sub; @@ -13776,42 +13739,6 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure) } static PHP_METHOD(phalcon_1__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); - ZEND_PARSE_PARAMETERS_START(4, 4) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - ZEND_PARSE_PARAMETERS_END(); - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(phalcon_2__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 2__closure, phalcon, 2__closure, phalcon_2__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_2__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; @@ -13842,14 +13769,14 @@ static PHP_METHOD(phalcon_2__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_3__closure) +ZEPHIR_INIT_CLASS(phalcon_2__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 3__closure, phalcon, 3__closure, phalcon_3__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 2__closure, phalcon, 2__closure, phalcon_2__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_3__closure, __invoke) +static PHP_METHOD(phalcon_2__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; @@ -13878,14 +13805,14 @@ static PHP_METHOD(phalcon_3__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_4__closure) +ZEPHIR_INIT_CLASS(phalcon_3__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 4__closure, phalcon, 4__closure, phalcon_4__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 3__closure, phalcon, 3__closure, phalcon_3__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_4__closure, __invoke) +static PHP_METHOD(phalcon_3__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; @@ -13916,14 +13843,14 @@ static PHP_METHOD(phalcon_4__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_5__closure) +ZEPHIR_INIT_CLASS(phalcon_4__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 5__closure, phalcon, 5__closure, phalcon_5__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 4__closure, phalcon, 4__closure, phalcon_4__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_5__closure, __invoke) +static PHP_METHOD(phalcon_4__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; @@ -13952,14 +13879,14 @@ static PHP_METHOD(phalcon_5__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_6__closure) +ZEPHIR_INIT_CLASS(phalcon_5__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 6__closure, phalcon, 6__closure, phalcon_6__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 5__closure, phalcon, 5__closure, phalcon_5__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_6__closure, __invoke) +static PHP_METHOD(phalcon_5__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; @@ -13990,14 +13917,14 @@ static PHP_METHOD(phalcon_6__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_7__closure) +ZEPHIR_INIT_CLASS(phalcon_6__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 7__closure, phalcon, 7__closure, phalcon_7__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 6__closure, phalcon, 6__closure, phalcon_6__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_7__closure, __invoke) +static PHP_METHOD(phalcon_6__closure, __invoke) { zval *file, file_sub; @@ -14019,14 +13946,14 @@ static PHP_METHOD(phalcon_7__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_8__closure) +ZEPHIR_INIT_CLASS(phalcon_7__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 8__closure, phalcon, 8__closure, phalcon_8__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 7__closure, phalcon, 7__closure, phalcon_7__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_8__closure, __invoke) +static PHP_METHOD(phalcon_7__closure, __invoke) { zend_bool _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -14062,14 +13989,14 @@ static PHP_METHOD(phalcon_8__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_9__closure) +ZEPHIR_INIT_CLASS(phalcon_8__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 9__closure, phalcon, 9__closure, phalcon_9__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 8__closure, phalcon, 8__closure, phalcon_8__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_9__closure, __invoke) +static PHP_METHOD(phalcon_8__closure, __invoke) { zend_bool _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -14105,6 +14032,42 @@ static PHP_METHOD(phalcon_9__closure, __invoke) +ZEPHIR_INIT_CLASS(phalcon_9__closure) +{ + ZEPHIR_REGISTER_CLASS(phalcon, 9__closure, phalcon, 9__closure, phalcon_9__closure_method_entry, ZEND_ACC_FINAL_CLASS); + + return SUCCESS; +} + +static PHP_METHOD(phalcon_9__closure, __invoke) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *action, action_sub, _0; + + ZVAL_UNDEF(&action_sub); + ZVAL_UNDEF(&_0); + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(action) + ZEND_PARSE_PARAMETERS_END(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 1, 0, &action); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "-"); + zephir_uncamelize(return_value, action, &_0); + RETURN_MM(); +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Tag) { ZEPHIR_REGISTER_CLASS(Phalcon, Tag, phalcon, tag, phalcon_tag_method_entry, 0); @@ -15449,7 +15412,7 @@ static PHP_METHOD(Phalcon_Tag, preload) if (_1) { if (zephir_array_isset_long(¶ms, 1)) { zephir_memory_observe(&attributes); - zephir_array_fetch_long(&attributes, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 842); + zephir_array_fetch_long(&attributes, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 840); } else { ZEPHIR_INIT_VAR(&_4$$7); zephir_create_array(&_4$$7, 1, 0); @@ -15602,7 +15565,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_array_update_string(&order, SL("class"), &__$null, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&attrs); array_init(&attrs); - zephir_is_iterable(&order, 0, "phalcon/Tag.zep", 937); + zephir_is_iterable(&order, 0, "phalcon/Tag.zep", 935); if (Z_TYPE_P(&order) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&order), _2, _3, _0) { @@ -15642,7 +15605,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - zephir_is_iterable(&attributes, 0, "phalcon/Tag.zep", 943); + zephir_is_iterable(&attributes, 0, "phalcon/Tag.zep", 941); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _6, _7, _4) { @@ -15685,7 +15648,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) ZEPHIR_CPY_WRT(&escaper, &_8); zephir_array_unset_string(&attrs, SL("escape"), PH_SEPARATE); ZEPHIR_CPY_WRT(&newCode, &code); - zephir_is_iterable(&attrs, 0, "phalcon/Tag.zep", 967); + zephir_is_iterable(&attrs, 0, "phalcon/Tag.zep", 965); if (Z_TYPE_P(&attrs) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attrs), _11, _12, _9) { @@ -15715,7 +15678,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) ZEPHIR_CONCAT_SVSVS(&_17$$13, "Value at index: '", &key, "' type: '", &_16$$13, "' cannot be rendered"); ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 33, &_17$$13); zephir_check_call_status(); - zephir_throw_exception_debug(&_15$$13, "phalcon/Tag.zep", 954); + zephir_throw_exception_debug(&_15$$13, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); return; } @@ -15761,7 +15724,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) ZEPHIR_CONCAT_SVSVS(&_25$$18, "Value at index: '", &key, "' type: '", &_24$$18, "' cannot be rendered"); ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 33, &_25$$18); zephir_check_call_status(); - zephir_throw_exception_debug(&_23$$18, "phalcon/Tag.zep", 954); + zephir_throw_exception_debug(&_23$$18, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); return; } @@ -15977,7 +15940,7 @@ static PHP_METHOD(Phalcon_Tag, setDefault) _0$$3 = Z_TYPE_P(value) == IS_OBJECT; } if (UNEXPECTED(_0$$3)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Only scalar values can be assigned to UI components", "phalcon/Tag.zep", 1060); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Only scalar values can be assigned to UI components", "phalcon/Tag.zep", 1058); return; } } @@ -16157,12 +16120,12 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) } if (zephir_array_isset_long(¶ms, 1)) { zephir_memory_observe(&_1$$5); - zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 1129); + zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 1127); local = zephir_get_boolval(&_1$$5); } else { if (zephir_array_isset_string(¶ms, SL("local"))) { zephir_memory_observe(&_2$$7); - zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/Tag.zep", 1132); + zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/Tag.zep", 1130); local = zephir_get_boolval(&_2$$7); zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } @@ -16174,7 +16137,7 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) } if (!(zephir_array_isset_string(¶ms, SL("href")))) { if (zephir_array_isset_long(¶ms, 0)) { - zephir_array_fetch_long(&_4$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1144); + zephir_array_fetch_long(&_4$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1142); zephir_array_update_string(¶ms, SL("href"), &_4$$10, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_VAR(&_5$$11); @@ -16185,7 +16148,7 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) if (local) { ZEPHIR_CALL_SELF(&_6$$12, "geturlservice", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_8$$12, ¶ms, SL("href"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1156); + zephir_array_fetch_string(&_8$$12, ¶ms, SL("href"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1154); ZEPHIR_CALL_METHOD(&_7$$12, &_6$$12, "getstatic", NULL, 0, &_8$$12); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("href"), &_7$$12, PH_COPY | PH_SEPARATE); @@ -16406,17 +16369,17 @@ static PHP_METHOD(Phalcon_Tag, textArea) } if (!(zephir_array_isset_long(¶ms, 0))) { if (zephir_array_isset_string(¶ms, SL("id"))) { - zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1279); + zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1277); zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } } zephir_memory_observe(&id); - zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1283); + zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1281); if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { zephir_memory_observe(&name); - zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1288); + zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1286); if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } @@ -16426,7 +16389,7 @@ static PHP_METHOD(Phalcon_Tag, textArea) } if (zephir_array_isset_string(¶ms, SL("value"))) { zephir_memory_observe(&content); - zephir_array_fetch_string(&content, ¶ms, SL("value"), PH_NOISY, "phalcon/Tag.zep", 1300); + zephir_array_fetch_string(&content, ¶ms, SL("value"), PH_NOISY, "phalcon/Tag.zep", 1298); zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); } else { ZEPHIR_CALL_SELF(&content, "getvalue", NULL, 0, &id, ¶ms); @@ -16572,14 +16535,14 @@ static PHP_METHOD(Phalcon_Tag, inputField) ZEPHIR_INIT_VAR(¶ms); array_init(¶ms); if (Z_TYPE_P(parameters) != IS_ARRAY) { - zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/Tag.zep", 1398); + zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/Tag.zep", 1396); } else { ZEPHIR_CPY_WRT(¶ms, parameters); } if (asValue == 0) { zephir_memory_observe(&id); if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0))) { - zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1405); + zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1403); zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } zephir_memory_observe(&name); @@ -16591,7 +16554,7 @@ static PHP_METHOD(Phalcon_Tag, inputField) zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&id) == IS_STRING) { - _1$$10 = !(zephir_memnstr_str(&id, SL("["), "phalcon/Tag.zep", 1420)); + _1$$10 = !(zephir_memnstr_str(&id, SL("["), "phalcon/Tag.zep", 1418)); if (_1$$10) { _1$$10 = !(zephir_array_isset_string(¶ms, SL("id"))); } @@ -16663,16 +16626,16 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) ZEPHIR_CPY_WRT(¶ms, parameters); } if (!(zephir_array_isset_long(¶ms, 0))) { - zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1466); + zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1464); zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } zephir_memory_observe(&id); - zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1469); + zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1467); if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { zephir_memory_observe(&name); - zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1474); + zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1472); if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } @@ -16735,2963 +16698,3136 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) -ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception) +ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_AbstractDispatcher) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Tag, Exception, phalcon, tag_exception, zend_ce_exception, NULL, 0); - - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Dispatcher, AbstractDispatcher, phalcon, dispatcher_abstractdispatcher, phalcon_di_abstractinjectionaware_ce, phalcon_dispatcher_abstractdispatcher_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); -ZEPHIR_INIT_CLASS(Phalcon_Tag_Select) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Tag, Select, phalcon, tag_select, phalcon_tag_select_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("activeHandler"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("activeMethodMap"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("actionName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("actionSuffix"), "Action", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("camelCaseMap"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultAction"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultNamespace"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("defaultHandler"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerHashes"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("handlerSuffix"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("eventsManager"), ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("finished"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("forwarded"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("isControllerInitialize"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("lastHandler"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("modelBinder"), ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_dispatcher_abstractdispatcher_ce, SL("modelBinding"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("moduleName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("namespaceName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("params"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousActionName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousHandlerName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_dispatcher_abstractdispatcher_ce, SL("previousNamespaceName"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_dispatcher_abstractdispatcher_ce, SL("returnedValue"), ZEND_ACC_PROTECTED); + phalcon_dispatcher_abstractdispatcher_ce->create_object = zephir_init_properties_Phalcon_Dispatcher_AbstractDispatcher; + zend_class_implements(phalcon_dispatcher_abstractdispatcher_ce, 1, phalcon_dispatcher_dispatcherinterface_ce); + zend_class_implements(phalcon_dispatcher_abstractdispatcher_ce, 1, phalcon_events_eventsawareinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Tag_Select, selectField) +static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, callActionMethod) { - zend_bool _1$$19; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _2, _3, _0$$5, _4$$22, _5$$22, _6$$23, _8$$23, _9$$23, _10$$25, _12$$25, _13$$25; + zval params, _0; + zval actionMethod; + zval *handler, handler_sub, *actionMethod_param = NULL, *params_param = NULL; - ZVAL_UNDEF(¶meters_sub); - ZVAL_UNDEF(&data_sub); - ZVAL_NULL(&__$null); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&actionMethod); ZVAL_UNDEF(¶ms); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&id); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&useEmpty); - ZVAL_UNDEF(&code); - ZVAL_UNDEF(&emptyValue); - ZVAL_UNDEF(&emptyText); - ZVAL_UNDEF(&options); - ZVAL_UNDEF(&using); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_0$$5); - ZVAL_UNDEF(&_4$$22); - ZVAL_UNDEF(&_5$$22); - ZVAL_UNDEF(&_6$$23); - ZVAL_UNDEF(&_8$$23); - ZVAL_UNDEF(&_9$$23); - ZVAL_UNDEF(&_10$$25); - ZVAL_UNDEF(&_12$$25); - ZVAL_UNDEF(&_13$$25); - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(parameters) + ZVAL_UNDEF(&_0); + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_ZVAL(handler) + Z_PARAM_STR(actionMethod) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(data) + Z_PARAM_ARRAY(params) ZEND_PARSE_PARAMETERS_END(); ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - zephir_fetch_params(1, 1, 1, ¶meters, &data); - if (!data) { - data = &data_sub; - data = &__$null; - } - if (Z_TYPE_P(parameters) != IS_ARRAY) { + zephir_fetch_params(1, 2, 1, &handler, &actionMethod_param, ¶ms_param); + zephir_get_strval(&actionMethod, actionMethod_param); + if (!params_param) { ZEPHIR_INIT_VAR(¶ms); - zephir_create_array(¶ms, 2, 0); - zephir_array_fast_append(¶ms, parameters); - zephir_array_fast_append(¶ms, data); - } else { - ZEPHIR_CPY_WRT(¶ms, parameters); - } - zephir_memory_observe(&id); - if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0))) { - zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag/Select.zep", 50); - zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - } - if (!(zephir_memnstr_str(&id, SL("["), "phalcon/Tag/Select.zep", 56))) { - if (!(zephir_array_isset_string(¶ms, SL("id")))) { - zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); - } - } - zephir_memory_observe(&name); - if (!(zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0))) { - zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); - } else { - if (!(zephir_is_true(&name))) { - zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); - } - } - zephir_memory_observe(&value); - if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) { - ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", NULL, 0, &id, ¶ms); - zephir_check_call_status(); + array_init(¶ms); } else { - zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); - } - zephir_memory_observe(&useEmpty); - if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) { - zephir_memory_observe(&emptyValue); - if (!(zephir_array_isset_string_fetch(&emptyValue, ¶ms, SL("emptyValue"), 0))) { - ZEPHIR_INIT_NVAR(&emptyValue); - ZVAL_STRING(&emptyValue, ""); - } else { - zephir_array_unset_string(¶ms, SL("emptyValue"), PH_SEPARATE); - } - zephir_memory_observe(&emptyText); - if (!(zephir_array_isset_string_fetch(&emptyText, ¶ms, SL("emptyText"), 0))) { - ZEPHIR_INIT_NVAR(&emptyText); - ZVAL_STRING(&emptyText, "Choose..."); - } else { - zephir_array_unset_string(¶ms, SL("emptyText"), PH_SEPARATE); - } - zephir_array_unset_string(¶ms, SL("useEmpty"), PH_SEPARATE); - } - zephir_memory_observe(&options); - if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0))) { - ZEPHIR_CPY_WRT(&options, data); - } - if (Z_TYPE_P(&options) == IS_OBJECT) { - zephir_memory_observe(&using); - if (UNEXPECTED(!(zephir_array_isset_string_fetch(&using, ¶ms, SL("using"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter is required", "phalcon/Tag/Select.zep", 101); - return; - } - _1$$19 = Z_TYPE_P(&using) != IS_ARRAY; - if (_1$$19) { - _1$$19 = Z_TYPE_P(&using) != IS_OBJECT; - } - if (UNEXPECTED(_1$$19)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter should be an array", "phalcon/Tag/Select.zep", 107); - return; - } + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); } - zephir_array_unset_string(¶ms, SL("using"), PH_SEPARATE); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "", &_3); - if (zephir_is_true(&useEmpty)) { - ZEPHIR_INIT_VAR(&_4$$22); - ZEPHIR_GET_CONSTANT(&_4$$22, "PHP_EOL"); - ZEPHIR_INIT_VAR(&_5$$22); - ZEPHIR_CONCAT_SVSVSV(&_5$$22, "\t", &_4$$22); - zephir_concat_self(&code, &_5$$22); - } - if (Z_TYPE_P(&options) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_8$$23); - ZEPHIR_GET_CONSTANT(&_8$$23, "PHP_EOL"); - ZEPHIR_INIT_VAR(&_9$$23); - ZEPHIR_CONCAT_SV(&_9$$23, "", &_8$$23); - ZEPHIR_CALL_SELF(&_6$$23, "optionsfromresultset", &_7, 0, &options, &using, &value, &_9$$23); - zephir_check_call_status(); - zephir_concat_self(&code, &_6$$23); - } else { - if (Z_TYPE_P(&options) == IS_ARRAY) { - ZEPHIR_INIT_VAR(&_12$$25); - ZEPHIR_GET_CONSTANT(&_12$$25, "PHP_EOL"); - ZEPHIR_INIT_VAR(&_13$$25); - ZEPHIR_CONCAT_SV(&_13$$25, "", &_12$$25); - ZEPHIR_CALL_SELF(&_10$$25, "optionsfromarray", &_11, 0, &options, &value, &_13$$25); - zephir_check_call_status(); - zephir_concat_self(&code, &_10$$25); - } - } - zephir_concat_self_str(&code, SL("")); - RETURN_CCTOR(&code); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) +static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, dispatch) { - zend_string *_3; - zend_ulong _2; + zval _44$$10; + zend_bool hasService = 0, hasEventsManager = 0, isNewHandler = 0, _5$$5, _16$$13, _21$$15, _29$$18, _34$$20, _42$$23, _52$$25, _56$$31, _62$$33, _66$$36, _72$$38, _78$$43, _83$$46, _88$$48, _105$$59, _110$$62, _115$$64, _118$$67, _123$$69, _130$$73; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval closeOption, _12$$8, _13$$8, _22$$16, _23$$16; - zval *data_param = NULL, *value, value_sub, *closeOption_param = NULL, strValue, strOptionValue, code, optionValue, optionText, escaped, *_0, _1, _5$$4, _6$$4, _8$$4, _9$$4, _10$$6, _11$$7, _14$$9, _15$$10, _16$$12, _17$$12, _18$$12, _19$$12, _20$$14, _21$$15, _24$$17, _25$$18; - zval data; + zephir_fcall_cache_entry *_11 = NULL, *_12 = NULL, *_15 = NULL, *_20 = NULL, *_23 = NULL, *_25 = NULL, *_28 = NULL, *_30 = NULL, *_33 = NULL, *_35 = NULL, *_41 = NULL, *_43 = NULL, *_47 = NULL, *_51 = NULL, *_55 = NULL, *_58 = NULL, *_61 = NULL, *_64 = NULL, *_68 = NULL, *_71 = NULL, *_74 = NULL, *_77 = NULL, *_82 = NULL, *_87 = NULL, *_94 = NULL, *_100 = NULL, *_104 = NULL, *_109 = NULL, *_114 = NULL, *_122 = NULL, *_126 = NULL, *_129 = NULL; + zval __$true, __$false, value, handler, container, namespaceName, handlerName, actionName, eventsManager, handlerClass, status, actionMethod, modelBinder, bindCacheKey, handlerHash, e, _0, _1$$3, _2$$3, _3$$5, _4$$5, _6$$5, _7$$4, _8$$7, _9$$11, _10$$11, _13$$13, _14$$13, _17$$13, _18$$12, _19$$15, _22$$15, _24$$10, _36$$10, _37$$10, _38$$10, _102$$10, _26$$18, _27$$18, _31$$20, _32$$20, _39$$23, _40$$23, _45$$26, _46$$26, _48$$26, _49$$25, _50$$25, _53$$31, _54$$31, _57$$31, _59$$30, _60$$33, _63$$33, _65$$36, _67$$36, _69$$35, _70$$38, _73$$38, _75$$41, _76$$43, _79$$43, _80$$46, _81$$46, _84$$46, _85$$45, _86$$48, _89$$48, _90$$50, _91$$50, _92$$51, _93$$51, _95$$51, _96$$54, _97$$54, _98$$57, _99$$57, _101$$57, _103$$59, _106$$59, _107$$62, _108$$62, _111$$62, _112$$61, _113$$64, _116$$64, _117$$67, _119$$67, _120$$66, _121$$69, _124$$69, _125$$72, _127$$71, _128$$73, _131$$73, _132$$76, _133$$75, _134$$77; + zend_long ZEPHIR_LAST_CALL_STATUS, numberDispatches = 0; + zval *this_ptr = getThis(); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&strValue); - ZVAL_UNDEF(&strOptionValue); - ZVAL_UNDEF(&code); - ZVAL_UNDEF(&optionValue); - ZVAL_UNDEF(&optionText); - ZVAL_UNDEF(&escaped); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_9$$4); - ZVAL_UNDEF(&_10$$6); - ZVAL_UNDEF(&_11$$7); - ZVAL_UNDEF(&_14$$9); - ZVAL_UNDEF(&_15$$10); - ZVAL_UNDEF(&_16$$12); - ZVAL_UNDEF(&_17$$12); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&handlerName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&handlerClass); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&actionMethod); + ZVAL_UNDEF(&modelBinder); + ZVAL_UNDEF(&bindCacheKey); + ZVAL_UNDEF(&handlerHash); + ZVAL_UNDEF(&e); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_13$$13); + ZVAL_UNDEF(&_14$$13); + ZVAL_UNDEF(&_17$$13); ZVAL_UNDEF(&_18$$12); - ZVAL_UNDEF(&_19$$12); - ZVAL_UNDEF(&_20$$14); - ZVAL_UNDEF(&_21$$15); - ZVAL_UNDEF(&_24$$17); - ZVAL_UNDEF(&_25$$18); - ZVAL_UNDEF(&closeOption); - ZVAL_UNDEF(&_12$$8); - ZVAL_UNDEF(&_13$$8); - ZVAL_UNDEF(&_22$$16); - ZVAL_UNDEF(&_23$$16); - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_ARRAY(data) - Z_PARAM_ZVAL(value) - Z_PARAM_STR(closeOption) - ZEND_PARSE_PARAMETERS_END(); + ZVAL_UNDEF(&_19$$15); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_24$$10); + ZVAL_UNDEF(&_36$$10); + ZVAL_UNDEF(&_37$$10); + ZVAL_UNDEF(&_38$$10); + ZVAL_UNDEF(&_102$$10); + ZVAL_UNDEF(&_26$$18); + ZVAL_UNDEF(&_27$$18); + ZVAL_UNDEF(&_31$$20); + ZVAL_UNDEF(&_32$$20); + ZVAL_UNDEF(&_39$$23); + ZVAL_UNDEF(&_40$$23); + ZVAL_UNDEF(&_45$$26); + ZVAL_UNDEF(&_46$$26); + ZVAL_UNDEF(&_48$$26); + ZVAL_UNDEF(&_49$$25); + ZVAL_UNDEF(&_50$$25); + ZVAL_UNDEF(&_53$$31); + ZVAL_UNDEF(&_54$$31); + ZVAL_UNDEF(&_57$$31); + ZVAL_UNDEF(&_59$$30); + ZVAL_UNDEF(&_60$$33); + ZVAL_UNDEF(&_63$$33); + ZVAL_UNDEF(&_65$$36); + ZVAL_UNDEF(&_67$$36); + ZVAL_UNDEF(&_69$$35); + ZVAL_UNDEF(&_70$$38); + ZVAL_UNDEF(&_73$$38); + ZVAL_UNDEF(&_75$$41); + ZVAL_UNDEF(&_76$$43); + ZVAL_UNDEF(&_79$$43); + ZVAL_UNDEF(&_80$$46); + ZVAL_UNDEF(&_81$$46); + ZVAL_UNDEF(&_84$$46); + ZVAL_UNDEF(&_85$$45); + ZVAL_UNDEF(&_86$$48); + ZVAL_UNDEF(&_89$$48); + ZVAL_UNDEF(&_90$$50); + ZVAL_UNDEF(&_91$$50); + ZVAL_UNDEF(&_92$$51); + ZVAL_UNDEF(&_93$$51); + ZVAL_UNDEF(&_95$$51); + ZVAL_UNDEF(&_96$$54); + ZVAL_UNDEF(&_97$$54); + ZVAL_UNDEF(&_98$$57); + ZVAL_UNDEF(&_99$$57); + ZVAL_UNDEF(&_101$$57); + ZVAL_UNDEF(&_103$$59); + ZVAL_UNDEF(&_106$$59); + ZVAL_UNDEF(&_107$$62); + ZVAL_UNDEF(&_108$$62); + ZVAL_UNDEF(&_111$$62); + ZVAL_UNDEF(&_112$$61); + ZVAL_UNDEF(&_113$$64); + ZVAL_UNDEF(&_116$$64); + ZVAL_UNDEF(&_117$$67); + ZVAL_UNDEF(&_119$$67); + ZVAL_UNDEF(&_120$$66); + ZVAL_UNDEF(&_121$$69); + ZVAL_UNDEF(&_124$$69); + ZVAL_UNDEF(&_125$$72); + ZVAL_UNDEF(&_127$$71); + ZVAL_UNDEF(&_128$$73); + ZVAL_UNDEF(&_131$$73); + ZVAL_UNDEF(&_132$$76); + ZVAL_UNDEF(&_133$$75); + ZVAL_UNDEF(&_134$$77); + ZVAL_UNDEF(&_44$$10); ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param); - zephir_get_arrval(&data, data_param); - zephir_get_strval(&closeOption, closeOption_param); - ZEPHIR_INIT_VAR(&code); - ZVAL_STRING(&code, ""); - zephir_is_iterable(&data, 0, "phalcon/Tag/Select.zep", 186); - if (Z_TYPE_P(&data) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&optionValue); - if (_3 != NULL) { - ZVAL_STR_COPY(&optionValue, _3); - } else { - ZVAL_LONG(&optionValue, _2); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&container, &_0); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "A dependency injection container is required to access related dispatching services"); + ZVAL_LONG(&_2$$3, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwdispatchexception", NULL, 0, &_1$$3, &_2$$3); + zephir_check_call_status(); + RETURN_MM_BOOL(0); + } + zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + hasEventsManager = Z_TYPE_P(&eventsManager) == IS_OBJECT; + if (1) { + zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false); + } + if (hasEventsManager) { + + /* try_start_1: */ + + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "dispatch:beforeDispatchLoop"); + ZEPHIR_CALL_METHOD(&_3$$5, &eventsManager, "fire", NULL, 0, &_4$$5, this_ptr); + zephir_check_call_status_or_jump(try_end_1); + _5$$5 = ZEPHIR_IS_FALSE_IDENTICAL(&_3$$5); + if (_5$$5) { + zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY); + _5$$5 = !ZEPHIR_IS_FALSE_IDENTICAL(&_6$$5); } - ZEPHIR_INIT_NVAR(&optionText); - ZVAL_COPY(&optionText, _0); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 286, &optionValue); - zephir_check_call_status(); - if (Z_TYPE_P(&optionText) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(&_5$$4); - ZEPHIR_GET_CONSTANT(&_5$$4, "PHP_EOL"); - ZEPHIR_CALL_SELF(&_6$$4, "optionsfromarray", &_7, 0, &optionText, value, &closeOption); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_8$$4); - ZEPHIR_GET_CONSTANT(&_8$$4, "PHP_EOL"); - ZEPHIR_INIT_NVAR(&_9$$4); - ZEPHIR_CONCAT_SVSVVSV(&_9$$4, "\t", &_5$$4, &_6$$4, "\t", &_8$$4); - zephir_concat_self(&code, &_9$$4); - continue; + if (_5$$5) { + RETURN_MM_BOOL(0); } - if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(&optionValue, value)) { - ZEPHIR_INIT_NVAR(&_10$$6); - ZEPHIR_CONCAT_SVSVV(&_10$$6, "\t", &_16$$12, &_17$$12, "\t", &_18$$12); - zephir_concat_self(&code, &_19$$12); + break; + } + if (1) { + zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("finished"), &__$false); + } + ZEPHIR_CALL_METHOD(NULL, this_ptr, "resolveemptyproperties", &_12, 0); + zephir_check_call_status(); + if (hasEventsManager) { + + /* try_start_2: */ + + ZEPHIR_INIT_NVAR(&_14$$13); + ZVAL_STRING(&_14$$13, "dispatch:beforeDispatch"); + ZEPHIR_CALL_METHOD(&_13$$13, &eventsManager, "fire", &_15, 0, &_14$$13, this_ptr); + zephir_check_call_status_or_jump(try_end_2); + _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_13$$13); + if (!(_16$$13)) { + zephir_read_property(&_17$$13, this_ptr, ZEND_STRL("finished"), PH_NOISY_CC | PH_READONLY); + _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_17$$13); + } + if (_16$$13) { continue; } - if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(&optionValue, value)) { - ZEPHIR_INIT_NVAR(&_20$$14); - ZEPHIR_CONCAT_SVSVV(&_20$$14, "\t", &_8$$23); + ZEPHIR_CALL_SELF(&_6$$23, "optionsfromresultset", &_7, 0, &options, &using, &value, &_9$$23); + zephir_check_call_status(); + zephir_concat_self(&code, &_6$$23); + } else { + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_12$$25); + ZEPHIR_GET_CONSTANT(&_12$$25, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_13$$25); + ZEPHIR_CONCAT_SV(&_13$$25, "", &_12$$25); + ZEPHIR_CALL_SELF(&_10$$25, "optionsfromarray", &_11, 0, &options, &value, &_13$$25); + zephir_check_call_status(); + zephir_concat_self(&code, &_10$$25); + } + } + zephir_concat_self_str(&code, SL("")); + RETURN_CCTOR(&code); } -static PHP_METHOD(Phalcon_DataMapper_Query_Select, columns) +static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) { zend_string *_3; zend_ulong _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *columns_param = NULL, key, value, *_0, _1, _6, _7, _8, _9, _4$$5, _5$$8; - zval columns, localColumns; - zval *this_ptr = getThis(); + zval closeOption, _12$$8, _13$$8, _22$$16, _23$$16; + zval *data_param = NULL, *value, value_sub, *closeOption_param = NULL, strValue, strOptionValue, code, optionValue, optionText, escaped, *_0, _1, _5$$4, _6$$4, _8$$4, _9$$4, _10$$6, _11$$7, _14$$9, _15$$10, _16$$12, _17$$12, _18$$12, _19$$12, _20$$14, _21$$15, _24$$17, _25$$18; + zval data; - ZVAL_UNDEF(&columns); - ZVAL_UNDEF(&localColumns); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&value); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&strValue); + ZVAL_UNDEF(&strOptionValue); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&optionValue); + ZVAL_UNDEF(&optionText); + ZVAL_UNDEF(&escaped); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_5$$8); - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(columns) + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_16$$12); + ZVAL_UNDEF(&_17$$12); + ZVAL_UNDEF(&_18$$12); + ZVAL_UNDEF(&_19$$12); + ZVAL_UNDEF(&_20$$14); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$18); + ZVAL_UNDEF(&closeOption); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$16); + ZEND_PARSE_PARAMETERS_START(3, 3) + Z_PARAM_ARRAY(data) + Z_PARAM_ZVAL(value) + Z_PARAM_STR(closeOption) ZEND_PARSE_PARAMETERS_END(); ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - zephir_fetch_params(1, 1, 0, &columns_param); - zephir_get_arrval(&columns, columns_param); - ZEPHIR_INIT_VAR(&localColumns); - array_init(&localColumns); - zephir_is_iterable(&columns, 0, "phalcon/DataMapper/Query/Select.zep", 187); - if (Z_TYPE_P(&columns) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _2, _3, _0) + zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param); + zephir_get_arrval(&data, data_param); + zephir_get_strval(&closeOption, closeOption_param); + ZEPHIR_INIT_VAR(&code); + ZVAL_STRING(&code, ""); + zephir_is_iterable(&data, 0, "phalcon/Tag/Select.zep", 186); + if (Z_TYPE_P(&data) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0) { - ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&optionValue); if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); + ZVAL_STR_COPY(&optionValue, _3); } else { - ZVAL_LONG(&key, _2); + ZVAL_LONG(&optionValue, _2); } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - if (Z_TYPE_P(&key) == IS_LONG) { - zephir_array_append(&localColumns, &value, PH_SEPARATE, "phalcon/DataMapper/Query/Select.zep", 181); + ZEPHIR_INIT_NVAR(&optionText); + ZVAL_COPY(&optionText, _0); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 286, &optionValue); + zephir_check_call_status(); + if (Z_TYPE_P(&optionText) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_5$$4); + ZEPHIR_GET_CONSTANT(&_5$$4, "PHP_EOL"); + ZEPHIR_CALL_SELF(&_6$$4, "optionsfromarray", &_7, 0, &optionText, value, &closeOption); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_8$$4); + ZEPHIR_GET_CONSTANT(&_8$$4, "PHP_EOL"); + ZEPHIR_INIT_NVAR(&_9$$4); + ZEPHIR_CONCAT_SVSVVSV(&_9$$4, "\t", &_5$$4, &_6$$4, "\t", &_8$$4); + zephir_concat_self(&code, &_9$$4); + continue; + } + if (Z_TYPE_P(value) == IS_ARRAY) { + if (zephir_fast_in_array(&optionValue, value)) { + ZEPHIR_INIT_NVAR(&_10$$6); + ZEPHIR_CONCAT_SVSVV(&_10$$6, "\t", &_16$$12, &_17$$12, "\t", &_18$$12); + zephir_concat_self(&code, &_19$$12); + continue; + } + if (Z_TYPE_P(value) == IS_ARRAY) { + if (zephir_fast_in_array(&optionValue, value)) { + ZEPHIR_INIT_NVAR(&_20$$14); + ZEPHIR_CONCAT_SVSVV(&_20$$14, "\t