diff --git a/.ci/release-notes.sh b/.ci/release-notes.sh index 284ccdc9a71..5e059dbce4c 100755 --- a/.ci/release-notes.sh +++ b/.ci/release-notes.sh @@ -17,18 +17,8 @@ set -o pipefail # How to use: # release-notes.sh CHANGELOG.md -startline=$(cat "$1" | grep -nE "^## " | head -n 1 | cut -d ":" -f 1) -finishline=$(($(cat "$1" | grep -nE "^# " | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) +startline=$(cat < "$1" | grep -nE "^## " | head -n 1 | cut -d ":" -f 1) +finishline=$(($(cat < "$1" | grep -nE "^# " | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1)) changelog=$(sed -n "${startline},${finishline}p" "$1"); - -: "${GITHUB_ACTIONS:=0}" - -if [ "$GITHUB_ACTIONS" = "true" ] -then - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A'}" - changelog="${changelog//$'\r'/'%0D'}" -fi - echo "${changelog}" diff --git a/.github/actions/build-phalcon-win/action.yml b/.github/actions/build-phalcon-win/action.yml index bdd9e71426f..4ad30a4934d 100644 --- a/.github/actions/build-phalcon-win/action.yml +++ b/.github/actions/build-phalcon-win/action.yml @@ -75,10 +75,20 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.9.0 + uses: ilammy/msvc-dev-cmd@v1.10.0 with: arch: ${{ inputs.arch }} + # Workaround for + # 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.10.0 + if: ${{ inputs.php_version }} == '7.4' + with: + arch: ${{ inputs.arch }} + toolset: 14.16 + - name: Getting Details About Installed PHP shell: powershell run: | @@ -90,37 +100,6 @@ runs: .\.github\actions\build-phalcon-win\Expand-Item7zip.ps1 "${{ inputs.pecl }}" "${env:TEMP}" .\.github\actions\build-phalcon-win\Expand-Item7zip.ps1 "${env:TEMP}\phalcon-pecl.tar" "${{ env.PHP_PECL_PATH }}\phalcon" - - name: PSR extension | init, phpize - shell: powershell - run: | - git clone https://github.com/jbboehr/php-psr.git ${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }} - if (-not (Test-Path "${{ env.PHP_DEVPACK }}\include\ext\psr")) { - mkdir "${{ env.PHP_DEVPACK }}\include\ext\psr" - } - Set-Location "${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }}" - phpize - - - name: PSR extension | configure - working-directory: '${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }}' - shell: powershell - run: | - echo "::group::Configure" - .\configure.bat --enable-psr - echo "::endgroup::" - - - name: PSR extension | build - working-directory: '${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }}' - shell: powershell - run: | - nmake - nmake install - - - name: PSR extension | Inspecting Extension DLL File - shell: powershell - run: | - php --ri psr - Get-PhpExtension "${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }}\${{ env.RELEASE_FOLDER }}\php_psr.dll" - - name: Phalcon | phpize working-directory: '${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}' shell: powershell @@ -131,8 +110,7 @@ runs: working-directory: '${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}' shell: powershell run: | - .\configure.bat --enable-phalcon ` - --with-extra-libs="${{ env.PHP_PECL_PATH }}\psr\psr-${{ env.PSR_VERSION }}\${{ env.RELEASE_FOLDER }}" + .\configure.bat --enable-phalcon - name: Phalcon | Build Project working-directory: '${{ env.PHP_PECL_PATH }}\phalcon\phalcon-${{ env.PHALCON_VERSION }}' diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 7123b1263d2..b92ebba94ab 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -7,18 +7,16 @@ on: jobs: build: - if: "!contains(github.event.head_commit.message, 'ci skip')" - runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - php-versions: [ '7.4', '8.0' ] + php: [ '7.4', '8.0', '8.1' ] - name: Build Dockerfile PHP ${{ matrix.php-versions }} + name: Build Dockerfile PHP ${{ matrix.php }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build Dockerfile - run: docker build docker/${{ matrix.php-versions }} + run: docker build docker/${{ matrix.php }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43abd296288..f64be095837 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,9 @@ on: env: # All versions should be declared here - PHALCON_VERSION: 5.0.0beta3 - ZEPHIR_PARSER_VERSION: 1.4.2 - ZEPHIR_VERSION: 0.15.2 - PSR_VERSION: 1.1.0 + PHALCON_VERSION: 5.0.0RC1 + ZEPHIR_PARSER_VERSION: 1.5.0 + ZEPHIR_VERSION: 0.16.0 # For tests LANG: en_US.UTF-8 @@ -33,7 +32,7 @@ env: TOOLS_DIR: 'C:\tools' # PHP extensions required by Composer - EXTENSIONS: apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, sqlite3, yaml, redis + EXTENSIONS: apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, sqlite3, yaml, redis, :memcache jobs: # Configure Workflow for correct run reusable workflow @@ -49,7 +48,7 @@ jobs: - id: setup-zephir-ext name: Setup Zephir Extensions run: | - echo "::set-output name=extensions::psr-${{ env.PSR_VERSION }}, zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }}" + echo "::set-output name=extensions::zephir_parser-${{ env.ZEPHIR_PARSER_VERSION }}" # PHP CodeSniffer inspection phpcs: @@ -57,16 +56,16 @@ jobs: with: standard: ./phpcs.xml - # Generates stubs and validates with PSALM + # Generate stubs and validates with PSALM stubs: needs: setup_workflow - uses: zephir-lang/templates/.github/workflows/phalcon-stubs.yml@main + uses: zephir-lang/templates/.github/workflows/phalcon-stubs-zephir-composer.yml@main with: extensions: ${{ needs.setup_workflow.outputs.zephir_extensions }} generate: needs: setup_workflow - uses: zephir-lang/templates/.github/workflows/phalcon-pecl.yml@main + uses: zephir-lang/templates/.github/workflows/phalcon-pecl-8.1.yml@main with: extensions: ${{ needs.setup_workflow.outputs.zephir_extensions }} secrets: @@ -74,54 +73,36 @@ jobs: build-and-test: name: tests / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }}-${{ matrix.arch }} - needs: [generate] - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - php: [ '7.4', '8.0' ] + php: [ '7.4', '8.0', '8.1' ] ts: [ 'nts', 'ts' ] arch: [ 'x64' ] name: - ubuntu-gcc - macos-clang - - windows2016-vc15 - - windows2019-vs16 # matrix names should be in next format: # {php}-{ts}-{os.name}-{compiler}-{arch} include: # Linux - - name: ubuntu-gcc - os: ubuntu-18.04 - compiler: gcc - + - { name: ubuntu-gcc, os: ubuntu-18.04, compiler: gcc } # macOS - - name: macos-clang - os: macos-10.15 - compiler: clang - + - { name: macos-clang, os: macos-10.15, compiler: clang } # Windows - - name: windows2016-vc15 - os: windows-2016 - compiler: vc15 - - - name: windows2019-vs16 - os: windows-2019 - compiler: vs16 - - exclude: - - name: windows2019-vs16 - php: '7.4' - - - name: windows2016-vc15 - php: '8.0' + - { php: '7.4', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } + - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15' } + - { php: '8.0', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '8.1', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } + - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16' } steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup platform specific environment shell: pwsh @@ -134,7 +115,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }}, psr-${{ env.PSR_VERSION }} + extensions: ${{ env.EXTENSIONS }} ini-values: apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }} tools: pecl, phpize, php-config coverage: xdebug @@ -228,6 +209,13 @@ jobs: if: always() run: vendor/bin/codecept run --coverage-xml=coverage-${{ matrix.php }}.xml --ext DotReporter cli + - name: Check Release notes parser + if: runner.os == 'Linux' + shell: bash + run: | + echo "-- Creating Release Notes" + ./.ci/release-notes.sh ./CHANGELOG-5.0.md + install: needs: setup_workflow uses: zephir-lang/templates/.github/workflows/phalcon-install-from-build.yml@main @@ -242,7 +230,7 @@ jobs: mysql: image: mysql:5.7 ports: - - 3306 + - "3306:3306" env: MYSQL_ROOT_PASSWORD: secret MYSQL_USER: phalcon @@ -251,26 +239,32 @@ jobs: postgres: image: postgres:12-alpine ports: - - 5432 + - "5432:5432" env: + POSTGRES_USER: phalcon POSTGRES_PASSWORD: secret POSTGRES_DB: phalcon + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 redis: image: redis:5-alpine ports: - - 6379 + - "6379:6379" memcached: image: memcached:1.5-alpine ports: - - 11211 + - "11211:11211" strategy: fail-fast: false matrix: - php: [ '7.4', '8.0' ] + php: [ '7.4', '8.0', '8.1' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -359,7 +353,8 @@ jobs: - name: Run Database Tests (Postgres) env: - DATA_POSTGRES_USER: postgres + DATA_POSTGRES_USER: phalcon + DATA_POSTGRES_PASS: secret DATA_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }} DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }} DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }} @@ -380,7 +375,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get the release version id: get-version @@ -399,7 +394,7 @@ jobs: find ./build-artifacts -type f -name phalcon*.zip -exec cp {} ./build-artifacts/release/ ";" find ./build-artifacts -type f -name phalcon*.tgz -exec cp {} ./build-artifacts/release/ ";" echo "-- Creating Release Notes" - GITHUB_ACTIONS=false ./.ci/release-notes.sh ./CHANGELOG-5.0.md > ./build-artifacts/release/release-notes.md + ./.ci/release-notes.sh ./CHANGELOG-5.0.md > ./build-artifacts/release/release-notes.md - name: Create Release uses: ncipollo/release-action@v1 diff --git a/.github/workflows/packagecloud-cleanup.yml b/.github/workflows/packagecloud-cleanup.yml deleted file mode 100644 index 6dfce250e2a..00000000000 --- a/.github/workflows/packagecloud-cleanup.yml +++ /dev/null @@ -1,30 +0,0 @@ -# TODO: Move to phalcon/packagecloud - -name: Cleanup Packagecloud packages - -on: - schedule: - - cron: '0 2 * * *' # Daily at 02:00 - -jobs: - build: - # To prevent build a particular commit use - # git commit -m "......... [ci skip]" - if: "!contains(github.event.head_commit.message, 'ci skip')" - - runs-on: ubuntu-20.04 - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Cleanup Packagecloud - run: php .ci/cleanup-packages.php - env: - PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }} diff --git a/.gitignore b/.gitignore index 1f3b0465585..f37bf9f31fb 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ ext/run-tests.php *.la *.log *.loT +*.dep *.gch *.h.ghc *.phc diff --git a/BACKERS.md b/BACKERS.md index 8498914bc53..53c10f2db75 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -106,15 +106,13 @@ Thanks for the support - - + - diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index ff4574a3d64..bdddcfddfad 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -1,3 +1,46 @@ +# [5.0.0rc1](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0RC1) (2022-05-31) + +## Changed +- Changed `Phalcon\Session\Bag::__construct()` to accept a `Phalcon\Session\Manager` as the first parameter and `name` as the second one [#15904](https://github.com/phalcon/cphalcon/issues/15904) +- Changed `Phalcon\Logger\Logger` to no longer depend on PSR interfaces [#15925](https://github.com/phalcon/cphalcon/issues/15925) +- Changed `Phalcon\Cache\Cache` to no longer depend on PSR interfaces [#15927](https://github.com/phalcon/cphalcon/issues/15927) +- Changed `Phalcon\Html\Link` to no longer depend on PSR interfaces [#15930](https://github.com/phalcon/cphalcon/issues/15930) + +## Fixed +- Fixed `Phalcon\Html\Helper\Input\Numeric` to produce correct elements [#15896](https://github.com/phalcon/cphalcon/issues/15896) +- Fixed `Phalcon\Storage\Adapter\*` to correctly store `null` values [#15904](https://github.com/phalcon/cphalcon/issues/15904) + +## Added +- Added `Phalcon\Encryption\Crypt::isValidDecryptLength($input)` to allow checking for the length of the decryption string [#15879](https://github.com/phalcon/cphalcon/issues/15879) +- Added `Phalcon\Di\InitializationAwareInterface` to allow auto calling the `initialize` method when accessing service through DIC [#15916](https://github.com/phalcon/cphalcon/pull/15916) +- Added + - `Phalcon\Storage\Serializer\MemcachedIgbinary` + - `Phalcon\Storage\Serializer\MemcachedJson` + - `Phalcon\Storage\Serializer\MemcachedPhp` + - `Phalcon\Storage\Serializer\RedisIgbinary` + - `Phalcon\Storage\Serializer\RedisJson` + - `Phalcon\Storage\Serializer\RedisMsgpack` + - `Phalcon\Storage\Serializer\RedisNone` + - `Phalcon\Storage\Serializer\RedisPhp` to be used if adapter serialization is required [#15904](https://github.com/phalcon/cphalcon/issues/15904) +- Added + - `Phalcon\Logger\LoggerInterface` + - `Phalcon\Logger\AbstractLogger` to be used in the logger class but also the proxy-psr3 repo [#15925](https://github.com/phalcon/cphalcon/issues/15925) +- Added + - `Phalcon\Cache\CacheInterface` + - `Phalcon\Cache\AbstractCache` to be used in the cache class but also the proxy-psr16 repo [#15927](https://github.com/phalcon/cphalcon/issues/15927) +- Added + - EvolvableLinkInterface.zep + - `Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface` + - `Phalcon\Html\Link\Interfaces\LinkInterface` + - `Phalcon\Html\Link\Interfaces\LinkProviderInterface` + - `Phalcon\Html\Link\AbstractLink` + - `Phalcon\Html\Link\AbstractLinkProvider` to be used in the link class but also the proxy-psr13 repo [#15930](https://github.com/phalcon/cphalcon/issues/15930) +- Added `Phalcon\Translate\Adapter\Csv::toArray()` and `Phalcon\Translate\Adapter\NativeArray::toArray()` to return the translation array back [#15902](https://github.com/phalcon/cphalcon/issues/15902) + +## Removed +- Removed `Phalcon\Container\Container` and moved its contents to the `proxy-psr11` repo [#15928](https://github.com/phalcon/cphalcon/issues/15928) +- Removed `Phalcon\Http\Message\*` and `Phalcon\Http\Server\*` classes. This removes PSR from Phalcon. PSR-7 available in v6 [#15929](https://github.com/phalcon/cphalcon/issues/15929) + # [5.0.0beta3](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0beta3) (2022-02-06) ## Changed @@ -10,6 +53,15 @@ - Fixed `Phalcon\Mvc\Router\Route::getName()` and `Phalcon\Mvc\Router\Route::getHostname()` to also return `null` [#15880](https://github.com/phalcon/cphalcon/issues/15880) - Fixed `Phalcon\Mvc\Router\RouteInterface::getName()` and `Phalcon\Mvc\Router\RouteInterface::getHostname()` to also return `null` [#15880](https://github.com/phalcon/cphalcon/issues/15880) - Fixed `Phalcon\Mvc\Model::findFirst()` to return `mixed` or `null` [#15883](https://github.com/phalcon/cphalcon/issues/15883) +- Fixed `Phalcon\Mvc\Model::belongsTo()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model::hasMany()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model::hasOne()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model::hasOneThrough()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model\Manager::addHasMany()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model\Manager::addHasManyToMany()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model\Manager::addHasOne()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model\Manager::addHasOneThrough()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) +- Fixed `Phalcon\Mvc\Model\Manager::addBelongsTo()` parameter `options` array by default [#15971](https://github.com/phalcon/cphalcon/issues/15971) ## Added - Added `Phalcon\Html\Helper\Title:setSeparator` to allow setting the separator independently [#15866](https://github.com/phalcon/cphalcon/issues/15866) @@ -402,3 +454,8 @@ - Fixed signature of `Phalcon\Assets\Manager::addCss()` - Fixed signature of `Phalcon\Assets\Manager::addJs()` - Fixed signature of `Phalcon\Db\Adapter\AdapterInterface::execute()`, `Phalcon\Db\Adapter\AdapterInterface::fetchOne()` and `Phalcon\Db\Adapter\AdapterInterface::query()` +- Fixed `Phalcon\Annotations\Reader::parse()` to return constants annotations [#15919](https://github.com/phalcon/cphalcon/issues/15919) +- Added `Phalcon\Annotations\Reflection::getConstantsAnnotations()` method that returns constants annotations [#15919](https://github.com/phalcon/cphalcon/issues/15919) +- Changes to the `Phalcon\Annotations\Adapter\AdapterInterface`: + - Added `getConstant()` method that returns class constant annotations collection + - Added `getConstants()` method that returns class constants annotations array list diff --git a/README.md b/README.md index 20c1bbc3b14..8820a6d61cc 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,6 @@ Phalcon is written in [Zephir/C](https://zephir-lang.com/) with platform indepen As a result, Phalcon is available on Microsoft Windows, GNU/Linux, FreeBSD and macOS. You can either download a binary package for the system of your choice or build it from source. -**NOTE:** Phalcon requires the [PSR PHP extension](https://github.com/jbboehr/php-psr) to be installed and enabled. - ## Installation For detailed installation instructions you can check our [installation](https://docs.phalcon.io/4.0/en/installation) page in the docs. @@ -64,10 +62,10 @@ Steps: ## Sponsors -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)] +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)] - +OpenCollective Contributors ## Backers @@ -75,7 +73,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/phalcon#backer)] - +OpenCollective Contributors ## License diff --git a/build/config/config.w32 b/build/config/config.w32 index 850b5241531..e1efd8ea9b9 100644 --- a/build/config/config.w32 +++ b/build/config/config.w32 @@ -10,5 +10,4 @@ if (PHP_PHALCON != "no") { EXTENSION("phalcon", "phalcon.zep.c", null, "-I"+configure_module_dirname); ADD_FLAG("CFLAGS", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); ADD_FLAG("LDFLAGS", "/LTCG"); - ADD_EXTENSION_DEP("phalcon", "psr"); } diff --git a/build/phalcon/config.w32 b/build/phalcon/config.w32 index 850b5241531..e1efd8ea9b9 100644 --- a/build/phalcon/config.w32 +++ b/build/phalcon/config.w32 @@ -10,5 +10,4 @@ if (PHP_PHALCON != "no") { EXTENSION("phalcon", "phalcon.zep.c", null, "-I"+configure_module_dirname); ADD_FLAG("CFLAGS", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); ADD_FLAG("LDFLAGS", "/LTCG"); - ADD_EXTENSION_DEP("phalcon", "psr"); } diff --git a/build/phalcon/phalcon.zep.c b/build/phalcon/phalcon.zep.c index 4e1e577b208..4bddc2814ae 100644 --- a/build/phalcon/phalcon.zep.c +++ b/build/phalcon/phalcon.zep.c @@ -3943,7 +3943,7 @@ static void zephir_fast_count(zval *result, zval *value) } } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else @@ -3990,7 +3990,7 @@ static int zephir_fast_count_ev(zval *value) return (int) count > 0; } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else @@ -4035,7 +4035,7 @@ static int zephir_fast_count_int(zval *value) return (int) count; } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else @@ -9114,14 +9114,22 @@ static int zephir_require_ret(zval *return_value_ptr, const char *require_path) } #endif - ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#if PHP_VERSION_ID >= 80100 + zend_string *zend_string_path = zend_string_init(require_path, strlen(require_path), 0); + + zend_stream_init_filename_ex(&file_handle, zend_string_path); + ret = php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); + + zval_ptr_dtor(zend_string_path); +#else + ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#endif if (ret != SUCCESS) { return FAILURE; } new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); if (new_op_array) { - if (file_handle.handle.stream.handle) { ZVAL_NULL(&dummy); if (!file_handle.opened_path) { @@ -9176,7 +9184,16 @@ static int zephir_require_once_ret(zval *return_value_ptr, const char *require_p } #endif - ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#if PHP_VERSION_ID >= 80100 + zend_string *zend_string_path = zend_string_init(require_path, strlen(require_path), 0); + + zend_stream_init_filename_ex(&file_handle, zend_string_path); + ret = php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); + + zval_ptr_dtor(zend_string_path); +#else + ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#endif if (ret != SUCCESS) { return FAILURE; } @@ -9272,7 +9289,13 @@ static int zephir_file_exists(zval *filename) return FAILURE; } +#if PHP_VERSION_ID >= 80100 + zend_string *file = zend_string_init(Z_STRVAL_P(filename), Z_STRLEN_P(filename), 0); + php_stat(file, FS_EXISTS, &return_value); + zval_ptr_dtor(file); +#else php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_EXISTS, &return_value); +#endif if (Z_TYPE(return_value) != IS_TRUE) { return FAILURE; @@ -9489,7 +9512,13 @@ static void zephir_file_put_contents(zval *return_value, zval *filename, zval *d static void zephir_filemtime(zval *return_value, zval *path) { if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { +#if PHP_VERSION_ID >= 80100 + zend_string *file = zend_string_init(Z_STRVAL_P(path), Z_STRLEN_P(path), 0); + php_stat(file, FS_MTIME, return_value); + zval_ptr_dtor(file); +#else php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_MTIME, return_value); +#endif } else { ZVAL_FALSE(return_value); } @@ -13824,29 +13853,29 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure) static PHP_METHOD(phalcon_0__closure, __invoke) { - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *element, element_sub, _0; zval *this_ptr = getThis(); - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&element_sub); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_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_START(1, 1) + Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); + ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, element); + zephir_check_call_status(); + zephir_ucfirst(return_value, &_0); + RETURN_MM(); } @@ -14000,186 +14029,6 @@ ZEPHIR_INIT_CLASS(phalcon_13__closure) } static PHP_METHOD(phalcon_13__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_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(); -#endif - - - 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_14__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 14__closure, phalcon, 14__closure, phalcon_14__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_14__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(phalcon_15__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 15__closure, phalcon, 15__closure, phalcon_15__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_15__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_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(); -#endif - - - 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_16__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 16__closure, phalcon, 16__closure, phalcon_16__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_16__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(phalcon_17__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 17__closure, phalcon, 17__closure, phalcon_17__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_17__closure, __invoke) { zend_bool _0; zval *element, element_sub; @@ -14214,14 +14063,14 @@ static PHP_METHOD(phalcon_17__closure, __invoke) -ZEPHIR_INIT_CLASS(phalcon_18__closure) +ZEPHIR_INIT_CLASS(phalcon_14__closure) { - ZEPHIR_REGISTER_CLASS(phalcon, 18__closure, phalcon, 18__closure, phalcon_18__closure_method_entry, ZEND_ACC_FINAL_CLASS); + ZEPHIR_REGISTER_CLASS(phalcon, 14__closure, phalcon, 14__closure, phalcon_14__closure_method_entry, ZEND_ACC_FINAL_CLASS); return SUCCESS; } -static PHP_METHOD(phalcon_18__closure, __invoke) +static PHP_METHOD(phalcon_14__closure, __invoke) { zend_bool _0; zval *element, element_sub; @@ -14264,96 +14113,96 @@ 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, *context, context_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - - 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) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element, element_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - 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(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(phalcon_3__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 3__closure, phalcon, 3__closure, phalcon_3__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -static PHP_METHOD(phalcon_3__closure, __invoke) +{ + zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&number_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&file_sub); + ZVAL_UNDEF(&line_sub); + ZVAL_BOOL(&__$true, 1); +#if PHP_VERSION_ID >= 80000 + bool is_null_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(); +#endif + + + 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; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&number_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&file_sub); + ZVAL_UNDEF(&line_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_BOOL(&__$true, 1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(5, 5) + Z_PARAM_ZVAL(number) + Z_PARAM_ZVAL(message) + Z_PARAM_ZVAL(file) + Z_PARAM_ZVAL(line) + Z_PARAM_ZVAL(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); + + + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(phalcon_3__closure) +{ + ZEPHIR_REGISTER_CLASS(phalcon, 3__closure, phalcon, 3__closure, phalcon_3__closure_method_entry, ZEND_ACC_FINAL_CLASS); + + return SUCCESS; +} + +static PHP_METHOD(phalcon_3__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; zval *this_ptr = getThis(); @@ -15140,7 +14989,7 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) object_init_ex(&_3$$4, phalcon_tag_exception_ce); ZEPHIR_CALL_METHOD(&_4$$4, &ex, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 31, &_4$$4); + ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 29, &_4$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$4, "phalcon/Tag.zep", 308); ZEPHIR_MM_RESTORE(); @@ -15440,7 +15289,7 @@ static PHP_METHOD(Phalcon_Tag, getTitle) zephir_read_static_property_ce(&_6$$3, phalcon_tag_ce, SL("documentPrependTitle"), PH_NOISY_CC); ZEPHIR_CPY_WRT(&documentPrependTitle, &_6$$3); if (!(ZEPHIR_IS_EMPTY(&documentPrependTitle))) { - ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 310, &documentPrependTitle); + ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 292, &documentPrependTitle); zephir_check_call_status(); zephir_is_iterable(&tmp$$5, 0, "phalcon/Tag.zep", 443); if (Z_TYPE_P(&tmp$$5) == IS_ARRAY) { @@ -16222,7 +16071,7 @@ static PHP_METHOD(Phalcon_Tag, preload) zephir_fast_str_replace(&_5$$5, &_6$$5, &_7$$5, &href); ZEPHIR_INIT_VAR(&_8$$5); ZVAL_STRING(&_8$$5, "preload"); - ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 0, &_8$$5, &_5$$5, &attributes); + ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 496, &_8$$5, &_5$$5, &attributes); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_8$$5); object_init_ex(&_8$$5, phalcon_html_link_serializer_header_ce); @@ -16234,7 +16083,7 @@ static PHP_METHOD(Phalcon_Tag, preload) ZEPHIR_INIT_VAR(&_10$$5); zephir_create_array(&_10$$5, 1, 0); zephir_array_fast_append(&_10$$5, &link); - ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 0, &_10$$5); + ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 497, &_10$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&header); ZEPHIR_CONCAT_SV(&header, "Link: ", &_9$$5); @@ -16486,7 +16335,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_16$$13, &value); ZEPHIR_INIT_NVAR(&_17$$13); ZEPHIR_CONCAT_SVSVS(&_17$$13, "Value at index: '", &key, "' type: '", &_16$$13, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 31, &_17$$13); + ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 29, &_17$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$13, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -16532,7 +16381,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_24$$18, &value); ZEPHIR_INIT_NVAR(&_25$$18); ZEPHIR_CONCAT_SVSVS(&_25$$18, "Value at index: '", &key, "' type: '", &_24$$18, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 31, &_25$$18); + ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 29, &_25$$18); zephir_check_call_status(); zephir_throw_exception_debug(&_23$$18, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -17341,7 +17190,7 @@ static PHP_METHOD(Phalcon_Tag, textArea) ZVAL_STRING(&_1, "", &_2, ""); @@ -17787,7 +17636,7 @@ static PHP_METHOD(Phalcon_Forms_Form, __construct) zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &userOptions); ZEPHIR_INIT_VAR(&_1); object_init_ex(&_1, phalcon_html_attributes_ce); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1); if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("initialize")) == SUCCESS)) { @@ -18331,7 +18180,7 @@ static PHP_METHOD(Phalcon_Forms_Form, get) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 343); ZEPHIR_MM_RESTORE(); @@ -18383,7 +18232,7 @@ static PHP_METHOD(Phalcon_Forms_Form, getAttributes) if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, phalcon_html_attributes_ce); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1$$3); } @@ -18496,7 +18345,7 @@ static PHP_METHOD(Phalcon_Forms_Form, getLabel) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 418); ZEPHIR_MM_RESTORE(); @@ -18942,7 +18791,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) if (_7) { ZEPHIR_INIT_NVAR(&validation); object_init_ex(&validation, phalcon_filter_validation_ce); - ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 332); + ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 314); zephir_check_call_status(); } zephir_read_property(&_8, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY); @@ -18965,7 +18814,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) { ZEPHIR_INIT_NVAR(&validator); ZVAL_COPY(&validator, _11$$10); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -18979,7 +18828,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) } ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); zephir_check_call_status(); @@ -18989,7 +18838,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 334, &name, &filters); + ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 316, &name, &filters); zephir_check_call_status(); } } ZEND_HASH_FOREACH_END(); @@ -19017,7 +18866,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) { ZEPHIR_INIT_NVAR(&validator); ZVAL_COPY(&validator, _15$$15); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -19031,7 +18880,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) } ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); zephir_check_call_status(); @@ -19041,7 +18890,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 334, &name, &filters); + ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 316, &name, &filters); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, &_8, "next", NULL, 0); @@ -19049,7 +18898,7 @@ static PHP_METHOD(Phalcon_Forms_Form, isValid) } } ZEPHIR_INIT_NVAR(&element); - ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 335, data, entity); + ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 317, data, entity); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_17, &messages, "count", NULL, 0); zephir_check_call_status(); @@ -19141,7 +18990,7 @@ static PHP_METHOD(Phalcon_Forms_Form, label) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 748); ZEPHIR_MM_RESTORE(); @@ -19212,7 +19061,7 @@ static PHP_METHOD(Phalcon_Forms_Form, render) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 772); ZEPHIR_MM_RESTORE(); @@ -19623,7 +19472,7 @@ static PHP_METHOD(Phalcon_Forms_Manager, create) ZEPHIR_INIT_VAR(&form); object_init_ex(&form, phalcon_forms_form_ce); - ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 336, entity); + ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 318, entity); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("forms"), &name, &form); RETURN_CCTOR(&form); @@ -19662,7 +19511,7 @@ static PHP_METHOD(Phalcon_Forms_Manager, get) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "There is no form with name='", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Manager.zep", 46); ZEPHIR_MM_RESTORE(); @@ -21066,7 +20915,7 @@ static PHP_METHOD(Phalcon_Forms_Element_Select, addOption) if (Z_TYPE_P(option) == IS_ARRAY) { - zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 53); + zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 51); if (Z_TYPE_P(option) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(option), _2$$3, _3$$3, _0$$3) { @@ -21410,7 +21259,7 @@ static PHP_METHOD(Phalcon_Html_Attributes, renderAttributes) ZVAL_LONG(&_5$$4, 3); ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_STRING(&_6$$4, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_7$$4, "htmlspecialchars", &_8, 337, &value, &_5$$4, &_6$$4, &__$true); + ZEPHIR_CALL_FUNCTION(&_7$$4, "htmlspecialchars", &_8, 319, &value, &_5$$4, &_6$$4, &__$true); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_9$$4); ZEPHIR_CONCAT_VSVS(&_9$$4, &key, "=\"", &_7$$4, "\" "); @@ -21438,7 +21287,7 @@ static PHP_METHOD(Phalcon_Html_Attributes, renderAttributes) ZVAL_LONG(&_11$$6, 3); ZEPHIR_INIT_NVAR(&_12$$6); ZVAL_STRING(&_12$$6, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_13$$6, "htmlspecialchars", &_8, 337, &value, &_11$$6, &_12$$6, &__$true); + ZEPHIR_CALL_FUNCTION(&_13$$6, "htmlspecialchars", &_8, 319, &value, &_11$$6, &_12$$6, &__$true); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$6); ZEPHIR_CONCAT_VSVS(&_14$$6, &key, "=\"", &_13$$6, "\" "); @@ -21638,7 +21487,7 @@ static PHP_METHOD(Phalcon_Html_Breadcrumbs, render) ZEPHIR_INIT_VAR(&urls); zephir_array_keys(&urls, &elements); ZEPHIR_MAKE_REF(&urls); - ZEPHIR_CALL_FUNCTION(&lastUrl, "end", NULL, 338, &urls); + ZEPHIR_CALL_FUNCTION(&lastUrl, "end", NULL, 320, &urls); ZEPHIR_UNREF(&urls); zephir_check_call_status(); ZEPHIR_OBS_VAR(&lastLabel); @@ -21836,7 +21685,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, attributes) zephir_read_property(&_0, this_ptr, ZEND_STRL("encoding"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("doubleEncode"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2, 3); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 337, &input, &_2, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 319, &input, &_2, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -21864,9 +21713,9 @@ static PHP_METHOD(Phalcon_Html_Escaper, css) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 339, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 321, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapecss", NULL, 340, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapecss", NULL, 322, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -21930,7 +21779,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) { ZEPHIR_INIT_NVAR(&charset); ZVAL_COPY(&charset, _2); - ZEPHIR_CALL_FUNCTION(&_4$$5, "mb_detect_encoding", &_5, 341, &input, &charset, &__$true); + ZEPHIR_CALL_FUNCTION(&_4$$5, "mb_detect_encoding", &_5, 323, &input, &charset, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_4$$5)) { RETURN_CCTOR(&charset); @@ -21947,7 +21796,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) } ZEPHIR_CALL_METHOD(&charset, &_0, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$7, "mb_detect_encoding", &_5, 341, &input, &charset, &__$true); + ZEPHIR_CALL_FUNCTION(&_6$$7, "mb_detect_encoding", &_5, 323, &input, &charset, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_6$$7)) { RETURN_CCTOR(&charset); @@ -21957,7 +21806,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) } } ZEPHIR_INIT_NVAR(&charset); - ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_5, 341, &input); + ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_5, 323, &input); zephir_check_call_status(); RETURN_MM(); } @@ -22147,7 +21996,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, html) zephir_read_property(&_0, this_ptr, ZEND_STRL("flags"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("encoding"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2, this_ptr, ZEND_STRL("doubleEncode"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 337, &input, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 319, &input, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -22175,9 +22024,9 @@ static PHP_METHOD(Phalcon_Html_Escaper, js) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 339, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 321, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapejs", NULL, 342, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapejs", NULL, 324, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -22206,11 +22055,11 @@ static PHP_METHOD(Phalcon_Html_Escaper, normalizeEncoding) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 343, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 325, &input); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "UTF-32"); - ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 344, &input, &_1, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 326, &input, &_1, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -22342,7 +22191,7 @@ static PHP_METHOD(Phalcon_Html_Escaper, url) zephir_get_strval(&input, input_param); - ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 345, &input); + ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 327, &input); zephir_check_call_status(); RETURN_MM(); } @@ -22799,36 +22648,211 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Escaper_Exception) -ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLink) +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLink) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLink, phalcon, html_link_evolvablelink, phalcon_html_link_link_ce, phalcon_html_link_evolvablelink_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, AbstractLink, phalcon, html_link_abstractlink, phalcon_html_link_abstractlink_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - zend_class_implements(phalcon_html_link_evolvablelink_ce, 1, zephir_get_internal_ce(SL("psr\\link\\evolvablelinkinterface"))); + zend_declare_property_null(phalcon_html_link_abstractlink_ce, SL("attributes"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_html_link_abstractlink_ce, SL("href"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_html_link_abstractlink_ce, SL("rels"), ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_html_link_abstractlink_ce, SL("templated"), 0, ZEND_ACC_PROTECTED); return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute, attribute_sub, *value, value_sub, newInstance, _0; + zval attributes; + zval *rel_param = NULL, *href_param = NULL, *attributes_param = NULL, _0, _1, _2, _3$$3, _4$$3; + zval rel, href; zval *this_ptr = getThis(); - ZVAL_UNDEF(&attribute_sub); + ZVAL_UNDEF(&rel); + ZVAL_UNDEF(&href); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&attributes); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 3) + Z_PARAM_OPTIONAL + Z_PARAM_STR(rel) + Z_PARAM_STR(href) + Z_PARAM_ARRAY(attributes) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 3, &rel_param, &href_param, &attributes_param); + if (!rel_param) { + ZEPHIR_INIT_VAR(&rel); + ZVAL_STRING(&rel, ""); + } else { + zephir_get_strval(&rel, rel_param); + } + if (!href_param) { + ZEPHIR_INIT_VAR(&href); + ZVAL_STRING(&href, ""); + } else { + zephir_get_strval(&href, href_param); + } + if (!attributes_param) { + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); + } else { + zephir_get_arrval(&attributes, attributes_param); + } + + + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_support_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22, &attributes); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_0); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_support_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("rels"), &_1); + zephir_update_property_zval(this_ptr, ZEND_STRL("href"), &href); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "hrefistemplated", NULL, 0, &href); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("templated"), &_2); + if (1 != ZEPHIR_IS_EMPTY(&rel)) { + zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_4$$3, 1); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "set", NULL, 0, &rel, &_4$$3); + zephir_check_call_status(); + } + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetAttributes) +{ + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetHref) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "href"); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetRels) +{ + zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_1, 0); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getkeys", NULL, 0, &_1); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doIsTemplated) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "templated"); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, hrefIsTemplated) +{ + zend_bool _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *href_param = NULL, _0, _1, _3; + zval href; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&href); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(href) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); + + + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "{"); + ZEPHIR_CALL_FUNCTION(&_1, "mb_strpos", NULL, 82, &href, &_0); + zephir_check_call_status(); + _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); + if (_2) { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "}"); + ZEPHIR_CALL_FUNCTION(&_3, "mb_strpos", NULL, 82, &href, &_0); + zephir_check_call_status(); + _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_3); + } + RETURN_MM_BOOL(_2); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithAttribute) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *value, value_sub, newInstance, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZVAL_UNDEF(&value_sub); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(attribute) + Z_PARAM_STR(key) Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &attribute, &value); + zephir_fetch_params(1, 2, 0, &key_param, &value); + zephir_get_strval(&key, key_param); ZEPHIR_INIT_VAR(&newInstance); @@ -22836,65 +22860,69 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) RETURN_MM(); } zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, attribute, value); + ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &key, value); zephir_check_call_status(); RETURN_CCTOR(&newInstance); } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withHref) +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithHref) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *href, href_sub, newInstance, _0; + zval *href_param = NULL, newInstance, _0; + zval href; zval *this_ptr = getThis(); - ZVAL_UNDEF(&href_sub); + ZVAL_UNDEF(&href); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(href) + Z_PARAM_STR(href) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &href); + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); ZEPHIR_INIT_VAR(&newInstance); if (zephir_clone(&newInstance, this_ptr) == FAILURE) { RETURN_MM(); } - zephir_update_property_zval(&newInstance, ZEND_STRL("href"), href); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hrefistemplated", NULL, 0, href); + zephir_update_property_zval(&newInstance, ZEND_STRL("href"), &href); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hrefistemplated", NULL, 0, &href); zephir_check_call_status(); zephir_update_property_zval(&newInstance, ZEND_STRL("templated"), &_0); RETURN_CCTOR(&newInstance); } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel) +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithRel) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, newInstance, _0, _1; + zval *key_param = NULL, newInstance, _0, _1; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(rel) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &rel); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); ZEPHIR_INIT_VAR(&newInstance); @@ -22903,31 +22931,33 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel) } zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, rel, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &key, &_1); zephir_check_call_status(); RETURN_CCTOR(&newInstance); } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute) +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutAttribute) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute, attribute_sub, newInstance, _0; + zval *key_param = NULL, newInstance, _0; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&attribute_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(attribute) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &attribute); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); ZEPHIR_INIT_VAR(&newInstance); @@ -22935,31 +22965,33 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute) RETURN_MM(); } zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, attribute); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &key); zephir_check_call_status(); RETURN_CCTOR(&newInstance); } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel) +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutRel) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, newInstance, _0; + zval *key_param = NULL, newInstance, _0; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(rel) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &rel); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); ZEPHIR_INIT_VAR(&newInstance); @@ -22967,7 +22999,7 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel) RETURN_MM(); } zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, rel); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &key); zephir_check_call_status(); RETURN_CCTOR(&newInstance); } @@ -22982,15 +23014,193 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel) -ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLinkProvider) +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLinkProvider) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLinkProvider, phalcon, html_link_evolvablelinkprovider, phalcon_html_link_linkprovider_ce, phalcon_html_link_evolvablelinkprovider_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, AbstractLinkProvider, phalcon, html_link_abstractlinkprovider, phalcon_html_link_abstractlinkprovider_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + zend_declare_property_null(phalcon_html_link_abstractlinkprovider_ce, SL("links"), ZEND_ACC_PROTECTED); + phalcon_html_link_abstractlinkprovider_ce->create_object = zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider; - zend_class_implements(phalcon_html_link_evolvablelinkprovider_ce, 1, zephir_get_internal_ce(SL("psr\\link\\evolvablelinkproviderinterface"))); return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, __construct) +{ + zend_bool _5$$3, _11$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_4 = NULL, *_8 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *links_param = NULL, link, *_0, _1, _2$$3, _3$$3, _6$$3, _7$$4, _9$$5, _10$$5, _12$$5, _13$$6; + zval links; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&links); + ZVAL_UNDEF(&link); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_13$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(links) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &links_param); + if (!links_param) { + ZEPHIR_INIT_VAR(&links); + array_init(&links); + } else { + zephir_get_arrval(&links, links_param); + } + + + zephir_is_iterable(&links, 0, "phalcon/Html/Link/AbstractLinkProvider.zep", 42); + if (Z_TYPE_P(&links) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) + { + ZEPHIR_INIT_NVAR(&link); + ZVAL_COPY(&link, _0); + ZEPHIR_INIT_NVAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Phalcon\\Html\\Link\\Interfaces\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$3, "is_a", &_4, 83, &link, &_2$$3); + zephir_check_call_status(); + _5$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3); + if (!(_5$$3)) { + ZEPHIR_INIT_NVAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Psr\\Link\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_6$$3, "is_a", &_4, 83, &link, &_2$$3); + zephir_check_call_status(); + _5$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_6$$3); + } + if (_5$$3) { + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getkey", &_8, 0, &link); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("links"), &_7$$4, &link); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, &links, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&link, &links, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_9$$5); + ZVAL_STRING(&_9$$5, "Phalcon\\Html\\Link\\Interfaces\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_10$$5, "is_a", &_4, 83, &link, &_9$$5); + zephir_check_call_status(); + _11$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_10$$5); + if (!(_11$$5)) { + ZEPHIR_INIT_NVAR(&_9$$5); + ZVAL_STRING(&_9$$5, "Psr\\Link\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_12$$5, "is_a", &_4, 83, &link, &_9$$5); + zephir_check_call_status(); + _11$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_12$$5); + } + if (_11$$5) { + ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "getkey", &_8, 0, &link); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("links"), &_13$$6, &link); + } + ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&link); + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "links"); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel) +{ + zval filtered; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *rel_param = NULL, link, rels, _0, *_1, _2; + zval rel; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rel); + ZVAL_UNDEF(&link); + ZVAL_UNDEF(&rels); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&filtered); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(rel) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); + + + ZEPHIR_INIT_VAR(&filtered); + array_init(&filtered); + zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/Html/Link/AbstractLinkProvider.zep", 80); + if (Z_TYPE_P(&_0) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&link); + ZVAL_COPY(&link, _1); + ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_fast_in_array(&rel, &rels)) { + zephir_array_append(&filtered, &link, PH_SEPARATE, "phalcon/Html/Link/AbstractLinkProvider.zep", 76); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_2)) { + break; + } + ZEPHIR_CALL_METHOD(&link, &_0, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_fast_in_array(&rel, &rels)) { + zephir_array_append(&filtered, &link, PH_SEPARATE, "phalcon/Html/Link/AbstractLinkProvider.zep", 76); + } + ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&link); + RETURN_CTOR(&filtered); +} + +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithLink) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; @@ -23003,7 +23213,7 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) + Z_PARAM_ZVAL(link) ZEND_PARSE_PARAMETERS_END(); #endif @@ -23022,22 +23232,21 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) RETURN_CCTOR(&newInstance); } -static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *link, link_sub, key, links, newInstance, _0; + zval *link, link_sub, key, newInstance, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&link_sub); ZVAL_UNDEF(&key); - ZVAL_UNDEF(&links); ZVAL_UNDEF(&newInstance); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) + Z_PARAM_ZVAL(link) ZEND_PARSE_PARAMETERS_END(); #endif @@ -23052,13 +23261,61 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) if (zephir_clone(&newInstance, this_ptr) == FAILURE) { RETURN_MM(); } - zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&links, &_0); - zephir_array_unset(&links, &key, PH_SEPARATE); - zephir_update_property_zval(&newInstance, ZEND_STRL("links"), &links); + zephir_unset_property_array(&newInstance, ZEND_STRL("links"), &key); + zephir_read_property(&_0, &newInstance, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_0, &key, PH_SEPARATE); RETURN_CCTOR(&newInstance); } +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, getKey) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *link, link_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&link_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(link) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &link); + + + ZEPHIR_RETURN_CALL_FUNCTION("spl_object_hash", NULL, 77, link); + zephir_check_call_status(); + RETURN_MM(); +} + +zend_object *zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider(zend_class_entry *class_type) +{ + zval _0, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + + + ZEPHIR_MM_GROW(); + + { + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("links"), &_1$$3); + } + ZEPHIR_MM_RESTORE(); + return Z_OBJ_P(this_ptr); + } +} + @@ -23069,187 +23326,215 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) -ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Link) +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLink) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, Link, phalcon, html_link_link, phalcon_html_link_link_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLink, phalcon, html_link_evolvablelink, phalcon_html_link_link_ce, phalcon_html_link_evolvablelink_method_entry, 0); - zend_declare_property_null(phalcon_html_link_link_ce, SL("attributes"), ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_html_link_link_ce, SL("href"), "", ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_html_link_link_ce, SL("rels"), ZEND_ACC_PROTECTED); - zend_declare_property_bool(phalcon_html_link_link_ce, SL("templated"), 0, ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_html_link_link_ce, 1, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))); + zend_class_implements(phalcon_html_link_evolvablelink_ce, 1, phalcon_html_link_interfaces_evolvablelinkinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Link_Link, __construct) +static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval attributes; - zval *rel_param = NULL, *href_param = NULL, *attributes_param = NULL, _0, _1, _2, _3$$3, _4$$3; - zval rel, href; + zval *attribute, attribute_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute_sub); + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_ZVAL(attribute) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &attribute, &value); + + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithattribute", NULL, 0, attribute, value); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withHref) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *href_param = NULL; + zval href; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel); ZVAL_UNDEF(&href); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&attributes); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 3) - Z_PARAM_OPTIONAL - Z_PARAM_STR(rel) + ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(href) - Z_PARAM_ARRAY(attributes) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &rel_param, &href_param, &attributes_param); - if (!rel_param) { - ZEPHIR_INIT_VAR(&rel); - ZVAL_STRING(&rel, ""); - } else { - zephir_get_strval(&rel, rel_param); - } - if (!href_param) { - ZEPHIR_INIT_VAR(&href); - ZVAL_STRING(&href, ""); - } else { - zephir_get_strval(&href, href_param); - } - if (!attributes_param) { - ZEPHIR_INIT_VAR(&attributes); - array_init(&attributes); - } else { - zephir_get_arrval(&attributes, attributes_param); - } + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 24); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithhref", NULL, 0, &href); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("rels"), &_0); - ZEPHIR_INIT_VAR(&_1); - object_init_ex(&_1, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24, &attributes); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1); - zephir_update_property_zval(this_ptr, ZEND_STRL("href"), &href); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "hrefistemplated", NULL, 0, &href); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("templated"), &_2); - if (!(ZEPHIR_IS_EMPTY(&rel))) { - zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZVAL_BOOL(&_4$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "set", NULL, 0, &rel, &_4$$3); - zephir_check_call_status(); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_Link, getAttributes) +static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *rel_param = NULL; + zval rel; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&rel); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(rel) + ZEND_PARSE_PARAMETERS_END(); +#endif ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithrel", NULL, 0, &rel); zephir_check_call_status(); RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_Link, getHref) +static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *attribute_param = NULL; + zval attribute; zval *this_ptr = getThis(); + ZVAL_UNDEF(&attribute); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(attribute) + ZEND_PARSE_PARAMETERS_END(); +#endif - RETURN_MEMBER(getThis(), "href"); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &attribute_param); + zephir_get_strval(&attribute, attribute_param); + + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutattribute", NULL, 0, &attribute); + zephir_check_call_status(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_Link, getRels) +static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel) { - zval _0, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *rel_param = NULL; + zval rel; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&rel); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(rel) + ZEND_PARSE_PARAMETERS_END(); +#endif ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); - zephir_read_property(&_0, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZVAL_BOOL(&_1, 0); - ZEPHIR_RETURN_CALL_METHOD(&_0, "getkeys", NULL, 0, &_1); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutrel", NULL, 0, &rel); zephir_check_call_status(); RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_Link, isTemplated) + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLinkProvider) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLinkProvider, phalcon, html_link_evolvablelinkprovider, phalcon_html_link_linkprovider_ce, phalcon_html_link_evolvablelinkprovider_method_entry, 0); + + zend_class_implements(phalcon_html_link_evolvablelinkprovider_ce, 1, phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce); + return SUCCESS; +} + +static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *link, link_sub; zval *this_ptr = getThis(); + ZVAL_UNDEF(&link_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_OBJECT_OF_CLASS(link, phalcon_html_link_interfaces_linkinterface_ce) + ZEND_PARSE_PARAMETERS_END(); +#endif - RETURN_MEMBER(getThis(), "templated"); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &link); + + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithlink", NULL, 0, link); + zephir_check_call_status(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_Link, hrefIsTemplated) +static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) { - zend_bool _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *href_param = NULL, _0, _1, _3, _4; - zval href; + zval *link, link_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&href); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&link_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(href) + Z_PARAM_OBJECT_OF_CLASS(link, phalcon_html_link_interfaces_linkinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &href_param); - zephir_get_strval(&href, href_param); + zephir_fetch_params(1, 1, 0, &link); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "{"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, &href, &_0, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); - if (_2) { - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "}"); - ZEPHIR_CALL_FUNCTION(&_4, "strrpos", NULL, 123, &href, &_3); - zephir_check_call_status(); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4); - } - RETURN_MM_BOOL(_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutlink", NULL, 0, link); + zephir_check_call_status(); + RETURN_MM(); } @@ -23262,208 +23547,132 @@ static PHP_METHOD(Phalcon_Html_Link_Link, hrefIsTemplated) -ZEPHIR_INIT_CLASS(Phalcon_Html_Link_LinkProvider) +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Link) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, LinkProvider, phalcon, html_link_linkprovider, phalcon_html_link_linkprovider_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, Link, phalcon, html_link_link, phalcon_html_link_abstractlink_ce, phalcon_html_link_link_method_entry, 0); - zend_declare_property_null(phalcon_html_link_linkprovider_ce, SL("links"), ZEND_ACC_PROTECTED); - phalcon_html_link_linkprovider_ce->create_object = zephir_init_properties_Phalcon_Html_Link_LinkProvider; - - zend_class_implements(phalcon_html_link_linkprovider_ce, 1, zephir_get_internal_ce(SL("psr\\link\\linkproviderinterface"))); + zend_class_implements(phalcon_html_link_link_ce, 1, phalcon_html_link_interfaces_linkinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, __construct) +static PHP_METHOD(Phalcon_Html_Link_Link, getAttributes) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *links_param = NULL, link, *_0, _1, _2$$4, _4$$6; - zval links; zval *this_ptr = getThis(); - ZVAL_UNDEF(&links); - ZVAL_UNDEF(&link); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_4$$6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(links) - ZEND_PARSE_PARAMETERS_END(); -#endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &links_param); - if (!links_param) { - ZEPHIR_INIT_VAR(&links); - array_init(&links); - } else { - zephir_get_arrval(&links, links_param); - } + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetattributes", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} - zephir_is_iterable(&links, 0, "phalcon/Html/Link/LinkProvider.zep", 40); - if (Z_TYPE_P(&links) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) - { - ZEPHIR_INIT_NVAR(&link); - ZVAL_COPY(&link, _0); - if (zephir_is_instance_of(&link, SL("Psr\\Link\\LinkInterface"))) { - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getkey", &_3, 0, &link); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("links"), &_2$$4, &link); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &links, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&link, &links, "current", NULL, 0); - zephir_check_call_status(); - if (zephir_is_instance_of(&link, SL("Psr\\Link\\LinkInterface"))) { - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getkey", &_3, 0, &link); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("links"), &_4$$6, &link); - } - ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&link); - ZEPHIR_MM_RESTORE(); +static PHP_METHOD(Phalcon_Html_Link_Link, getHref) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogethref", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks) +static PHP_METHOD(Phalcon_Html_Link_Link, getRels) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - RETURN_MEMBER(getThis(), "links"); + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetrels", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel) +static PHP_METHOD(Phalcon_Html_Link_Link, isTemplated) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, link, links, rels, _0, *_1, _2; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel_sub); - ZVAL_UNDEF(&link); - ZVAL_UNDEF(&links); - ZVAL_UNDEF(&rels); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(rel) - ZEND_PARSE_PARAMETERS_END(); -#endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &rel); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doistemplated", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} - ZEPHIR_INIT_VAR(&links); - array_init(&links); - zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_0, 0, "phalcon/Html/Link/LinkProvider.zep", 77); - if (Z_TYPE_P(&_0) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) - { - ZEPHIR_INIT_NVAR(&link); - ZVAL_COPY(&link, _1); - ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); - zephir_check_call_status(); - if (1 == zephir_fast_in_array(rel, &rels)) { - zephir_array_append(&links, &link, PH_SEPARATE, "phalcon/Html/Link/LinkProvider.zep", 73); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_2)) { - break; - } - ZEPHIR_CALL_METHOD(&link, &_0, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); - zephir_check_call_status(); - if (1 == zephir_fast_in_array(rel, &rels)) { - zephir_array_append(&links, &link, PH_SEPARATE, "phalcon/Html/Link/LinkProvider.zep", 73); - } - ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&link); - RETURN_CCTOR(&links); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_LinkProvider) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, LinkProvider, phalcon, html_link_linkprovider, phalcon_html_link_abstractlinkprovider_ce, phalcon_html_link_linkprovider_method_entry, 0); + + zend_class_implements(phalcon_html_link_linkprovider_ce, 1, phalcon_html_link_interfaces_linkproviderinterface_ce); + return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getKey) +static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *link, link_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&link_sub); + + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetlinks", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *rel, rel_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rel_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) + Z_PARAM_ZVAL(rel) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &link); + zephir_fetch_params(1, 1, 0, &rel); - ZEPHIR_RETURN_CALL_FUNCTION("spl_object_hash", NULL, 108, link); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetlinksbyrel", NULL, 0, rel); zephir_check_call_status(); RETURN_MM(); } -zend_object *zephir_init_properties_Phalcon_Html_Link_LinkProvider(zend_class_entry *class_type) -{ - zval _0, _1$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("links"), &_1$$3); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } -} - @@ -23549,7 +23758,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_NULL(&result); ZEPHIR_INIT_VAR(&elements); array_init(&elements); - zephir_is_iterable(&links, 0, "phalcon/Html/Link/Serializer/Header.zep", 72); + zephir_is_iterable(&links, 0, "phalcon/Html/Link/Serializer/Header.zep", 70); if (Z_TYPE_P(&links) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) { @@ -23574,7 +23783,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&_4$$3); ZEPHIR_CONCAT_SVS(&_4$$3, "rel=\"", &_3$$3, "\""); zephir_array_fast_append(&parts, &_4$$3); - zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 66); + zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 64); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _7$$3, _8$$3, _5$$3) { @@ -23587,7 +23796,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _5$$3); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _9$$6) { @@ -23595,7 +23804,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _9$$6); ZEPHIR_INIT_NVAR(&_11$$7); ZEPHIR_CONCAT_VSVS(&_11$$7, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_11$$7, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_11$$7, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -23610,7 +23819,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$8); ZEPHIR_CONCAT_VSVS(&_12$$8, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_12$$8, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_12$$8, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -23621,11 +23830,11 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_13$$9); ZEPHIR_CONCAT_VSVS(&_13$$9, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_13$$9, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_13$$9, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } } ZEND_HASH_FOREACH_END(); @@ -23643,7 +23852,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CALL_METHOD(&value, &attributes, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _14$$12) { @@ -23651,7 +23860,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _14$$12); ZEPHIR_INIT_NVAR(&_16$$13); ZEPHIR_CONCAT_VSVS(&_16$$13, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_16$$13, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_16$$13, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -23666,7 +23875,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_17$$14); ZEPHIR_CONCAT_VSVS(&_17$$14, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_17$$14, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_17$$14, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -23677,11 +23886,11 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_18$$15); ZEPHIR_CONCAT_VSVS(&_18$$15, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_18$$15, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_18$$15, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); @@ -23696,7 +23905,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_fast_join_str(&_20$$3, SL("; "), &parts); ZEPHIR_INIT_NVAR(&_4$$3); ZEPHIR_CONCAT_SVSV(&_4$$3, "<", &_19$$3, ">", &_20$$3); - zephir_array_append(&elements, &_4$$3, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 69); + zephir_array_append(&elements, &_4$$3, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 67); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); @@ -23729,7 +23938,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CONCAT_SVS(&_24$$17, "rel=\"", &_23$$17, "\""); zephir_array_fast_append(&_22$$17, &_24$$17); ZEPHIR_CPY_WRT(&parts, &_22$$17); - zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 66); + zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 64); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _27$$17, _28$$17, _25$$17) { @@ -23742,7 +23951,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _25$$17); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _29$$20) { @@ -23750,7 +23959,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _29$$20); ZEPHIR_INIT_NVAR(&_31$$21); ZEPHIR_CONCAT_VSVS(&_31$$21, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_31$$21, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_31$$21, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -23765,7 +23974,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_32$$22); ZEPHIR_CONCAT_VSVS(&_32$$22, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_32$$22, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_32$$22, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -23776,11 +23985,11 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_33$$23); ZEPHIR_CONCAT_VSVS(&_33$$23, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_33$$23, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_33$$23, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } } ZEND_HASH_FOREACH_END(); @@ -23798,7 +24007,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CALL_METHOD(&value, &attributes, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _34$$26) { @@ -23806,7 +24015,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _34$$26); ZEPHIR_INIT_NVAR(&_36$$27); ZEPHIR_CONCAT_VSVS(&_36$$27, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_36$$27, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_36$$27, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -23821,7 +24030,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_37$$28); ZEPHIR_CONCAT_VSVS(&_37$$28, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_37$$28, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_37$$28, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -23832,11 +24041,11 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_38$$29); ZEPHIR_CONCAT_VSVS(&_38$$29, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_38$$29, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_38$$29, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); @@ -23851,7 +24060,7 @@ static PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_fast_join_str(&_40$$17, SL("; "), &parts); ZEPHIR_INIT_NVAR(&_24$$17); ZEPHIR_CONCAT_SVSV(&_24$$17, "<", &_39$$17, ">", &_40$$17); - zephir_array_append(&elements, &_24$$17, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 69); + zephir_array_append(&elements, &_24$$17, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 67); ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); zephir_check_call_status(); } @@ -23892,6 +24101,89 @@ ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Serializer_SerializerInterface, serialize); +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, EvolvableLinkInterface, phalcon, html_link_interfaces_evolvablelinkinterface, phalcon_html_link_interfaces_evolvablelinkinterface_method_entry); + + zend_class_implements(phalcon_html_link_interfaces_evolvablelinkinterface_ce, 1, phalcon_html_link_interfaces_linkinterface_ce); + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withHref); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withRel); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutRel); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withAttribute); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutAttribute); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, EvolvableLinkProviderInterface, phalcon, html_link_interfaces_evolvablelinkproviderinterface, phalcon_html_link_interfaces_evolvablelinkproviderinterface_method_entry); + + zend_class_implements(phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce, 1, phalcon_html_link_interfaces_linkproviderinterface_ce); + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withLink); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withoutLink); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, LinkInterface, phalcon, html_link_interfaces_linkinterface, phalcon_html_link_interfaces_linkinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getAttributes); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getHref); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getRels); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, isTemplated); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkProviderInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, LinkProviderInterface, phalcon, html_link_interfaces_linkproviderinterface, phalcon_html_link_interfaces_linkproviderinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinks); +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinksByRel); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Html_Attributes_AttributesInterface) { ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Attributes, AttributesInterface, phalcon, html_attributes_attributesinterface, phalcon_html_attributes_attributesinterface_method_entry); @@ -25830,7 +26122,7 @@ static PHP_METHOD(Phalcon_Html_Helper_Meta, addHttp) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "http-equiv"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addelement", NULL, 347, &_0, &httpEquiv, &content); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addelement", NULL, 329, &_0, &httpEquiv, &content); zephir_check_call_status(); RETURN_MM(); } @@ -25863,7 +26155,7 @@ static PHP_METHOD(Phalcon_Html_Helper_Meta, addName) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "name"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 347, &_0, &name, &content); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 329, &_0, &name, &content); zephir_check_call_status(); RETURN_THIS(); } @@ -25896,7 +26188,7 @@ static PHP_METHOD(Phalcon_Html_Helper_Meta, addProperty) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "property"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 347, &_0, &name, &content); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 329, &_0, &name, &content); zephir_check_call_status(); RETURN_THIS(); } @@ -26431,7 +26723,7 @@ static PHP_METHOD(Phalcon_Html_Helper_Title, __toString) zephir_read_property(&_2, this_ptr, ZEND_STRL("title"), PH_NOISY_CC); zephir_array_fast_append(&_1, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("append"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&items, "array_merge", NULL, 348, &_0, &_1, &_3); + ZEPHIR_CALL_FUNCTION(&items, "array_merge", NULL, 330, &_0, &_1, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); zephir_read_property(&_5, this_ptr, ZEND_STRL("indent"), PH_NOISY_CC | PH_READONLY); @@ -26980,9 +27272,9 @@ static PHP_METHOD(Phalcon_Html_Helper_Input_Checkbox, __toString) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processchecked", NULL, 121); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "processchecked", NULL, 90); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&unchecked, this_ptr, "processunchecked", NULL, 122); + ZEPHIR_CALL_METHOD(&unchecked, this_ptr, "processunchecked", NULL, 91); zephir_check_call_status(); ZEPHIR_CALL_PARENT(&element, phalcon_html_helper_input_checkbox_ce, getThis(), "__tostring", &_0, 0); zephir_check_call_status(); @@ -27399,7 +27691,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Helper_Input_Numeric) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Helper\\Input, Numeric, phalcon, html_helper_input_numeric, phalcon_html_helper_input_abstractinput_ce, NULL, 0); - zend_declare_property_string(phalcon_html_helper_input_numeric_ce, SL("type"), "numeric", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_html_helper_input_numeric_ce, SL("type"), "number", ZEND_ACC_PROTECTED); return SUCCESS; } @@ -27547,7 +27839,7 @@ static PHP_METHOD(Phalcon_Html_Helper_Input_Select, add) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "processvalue", NULL, 346, &attributes, &value); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "processvalue", NULL, 328, &attributes, &value); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attributes, &_0); ZEPHIR_INIT_VAR(&_1); @@ -28143,7 +28435,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, __construct) if (Z_TYPE_P(padFactory) == IS_NULL) { ZEPHIR_INIT_NVAR(padFactory); object_init_ex(padFactory, phalcon_encryption_crypt_padfactory_ce); - ZEPHIR_CALL_METHOD(NULL, padFactory, "__construct", NULL, 239); + ZEPHIR_CALL_METHOD(NULL, padFactory, "__construct", NULL, 220); zephir_check_call_status(); } zephir_update_property_zval(this_ptr, ZEND_STRL("padFactory"), padFactory); @@ -28235,14 +28527,14 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) ZVAL_STRING(&_1, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 240); + ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 221); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 241, &mode); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 222, &mode); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "8bit"); - ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 242, &input, &_0, &ivLength, &_1); + ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 223, &input, &_0, &ivLength, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&digest); ZVAL_STRING(&digest, ""); @@ -28252,24 +28544,24 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, ""); - ZEPHIR_CALL_FUNCTION(&_3$$5, "hash", NULL, 99, &hashAlgorithm, &_2$$5, &__$true); + ZEPHIR_CALL_FUNCTION(&_3$$5, "hash", NULL, 68, &hashAlgorithm, &_2$$5, &__$true); zephir_check_call_status(); ZEPHIR_INIT_VAR(&hashLength); ZVAL_LONG(&hashLength, zephir_fast_strlen_ev(&_3$$5)); ZEPHIR_INIT_NVAR(&_2$$5); ZVAL_STRING(&_2$$5, "8bit"); - ZEPHIR_CALL_FUNCTION(&digest, "mb_substr", NULL, 242, &input, &ivLength, &hashLength, &_2$$5); + ZEPHIR_CALL_FUNCTION(&digest, "mb_substr", NULL, 223, &input, &ivLength, &hashLength, &_2$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$5); zephir_add_function(&_4$$5, &ivLength, &hashLength); ZEPHIR_INIT_NVAR(&_2$$5); ZVAL_STRING(&_2$$5, "8bit"); - ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 242, &input, &_4$$5, &__$null, &_2$$5); + ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 223, &input, &_4$$5, &__$null, &_2$$5); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_5$$6); ZVAL_STRING(&_5$$6, "8bit"); - ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 242, &input, &ivLength, &__$null, &_5$$6); + ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 223, &input, &ivLength, &__$null, &_5$$6); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&decrypted, this_ptr, "decryptgcmccmauth", NULL, 0, &mode, &cipherText, &decryptKey, &iv); @@ -28280,7 +28572,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) ZEPHIR_CPY_WRT(&decrypted, &_6); zephir_read_property(&_7, this_ptr, ZEND_STRL("useSigning"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7)) { - ZEPHIR_CALL_FUNCTION(&_8$$7, "hash_hmac", NULL, 243, &hashAlgorithm, &padded, &decryptKey, &__$true); + ZEPHIR_CALL_FUNCTION(&_8$$7, "hash_hmac", NULL, 224, &hashAlgorithm, &padded, &decryptKey, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_IDENTICAL(&digest, &_8$$7)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_mismatch_ce, "Hash does not match.", "phalcon/Encryption/Crypt.zep", 224); @@ -28349,7 +28641,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decryptBase64) ZEPHIR_CONCAT_VV(&_4$$3, &_2$$3, &_1$$3); zephir_get_strval(&input, &_4$$3); } - ZEPHIR_CALL_FUNCTION(&_5, "base64_decode", NULL, 244, &input); + ZEPHIR_CALL_FUNCTION(&_5, "base64_decode", NULL, 225, &input); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, &_5, &key); zephir_check_call_status(); @@ -28416,9 +28708,9 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encrypt) ZVAL_STRING(&_1, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 240); + ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 221); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 241, &mode); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 222, &mode); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&iv, this_ptr, "phpopensslrandompseudobytes", NULL, 0, &ivLength); zephir_check_call_status(); @@ -28434,7 +28726,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encrypt) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(&_2$$6, this_ptr, "gethashalgorithm", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&digest, "hash_hmac", NULL, 243, &_2$$6, &padded, &encryptKey, &__$true); + ZEPHIR_CALL_FUNCTION(&digest, "hash_hmac", NULL, 224, &_2$$6, &padded, &encryptKey, &__$true); zephir_check_call_status(); ZEPHIR_CONCAT_VVV(return_value, &iv, &digest, &encrypted); RETURN_MM(); @@ -28489,7 +28781,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encryptBase64) if (safe) { ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "encrypt", NULL, 0, &input, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 245, &_0$$3); + ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 226, &_0$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "+/"); @@ -28504,7 +28796,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encryptBase64) } ZEPHIR_CALL_METHOD(&_5, this_ptr, "encrypt", NULL, 0, &input, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_5); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_5); zephir_check_call_status(); RETURN_MM(); } @@ -28563,11 +28855,11 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getAvailableHashAlgorithms) ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfunctionexists", NULL, 0, &_1); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac_algos", NULL, 246); + ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac_algos", NULL, 227); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_FUNCTION("hash_algos", NULL, 247); + ZEPHIR_RETURN_CALL_FUNCTION("hash_algos", NULL, 228); zephir_check_call_status(); RETURN_MM(); } @@ -28599,6 +28891,42 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getKey) RETURN_MEMBER(getThis(), "key"); } +static PHP_METHOD(Phalcon_Encryption_Crypt, isValidDecryptLength) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *input_param = NULL, length, _0, _1; + zval input; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&input); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(input) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &input_param); + zephir_get_strval(&input, input_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&length, this_ptr, "phpopensslcipherivlength", NULL, 0, &_0); + zephir_check_call_status(); + if (ZEPHIR_IS_FALSE_IDENTICAL(&length)) { + RETURN_MM_BOOL(0); + } + ZEPHIR_CALL_FUNCTION(&_1, "mb_strlen", NULL, 229, &input); + zephir_check_call_status(); + RETURN_MM_BOOL(ZEPHIR_LE(&length, &_1)); +} + static PHP_METHOD(Phalcon_Encryption_Crypt, setAuthData) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -28702,7 +29030,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, setCipher) ZVAL_STRING(&_0, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getivlength", NULL, 248, &cipher); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getivlength", NULL, 230, &cipher); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("ivLength"), &_1); zephir_update_property_zval(this_ptr, ZEND_STRL("cipher"), &cipher); @@ -28867,11 +29195,11 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, checkCipherHashIsAvailable) object_init_ex(&_1$$5, phalcon_encryption_crypt_exception_exception_ce); ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, "The %s algorithm '%s' is not supported on this system."); - ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 140, &_2$$5, &type, &cipher); + ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 112, &_2$$5, &type, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 31, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 29, &_3$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$5, "phalcon/Encryption/Crypt.zep", 587); + zephir_throw_exception_debug(&_1$$5, "phalcon/Encryption/Crypt.zep", 608); ZEPHIR_MM_RESTORE(); return; } @@ -28932,10 +29260,10 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, cryptPadText) ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "ecb"); zephir_array_fast_append(&_1, &_2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 249, &_1, &mode); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 231, &_1, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_CALL_FUNCTION(&_3$$3, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&_3$$3, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); paddingSize = (blockSize - zephir_safe_mod_zval_long(&_3$$3, blockSize)); _4$$3 = paddingSize >= 256; @@ -28943,7 +29271,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, cryptPadText) _4$$3 = paddingSize < 0; } if (_4$$3) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Padding size cannot be less than 0 or greater than 256", "phalcon/Encryption/Crypt.zep", 620); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Padding size cannot be less than 0 or greater than 256", "phalcon/Encryption/Crypt.zep", 641); return; } zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("padFactory"), PH_NOISY_CC | PH_READONLY); @@ -29029,7 +29357,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, cryptUnpadText) ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "ecb"); zephir_array_fast_append(&_3, &_4); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 249, &_3, &mode); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 231, &_3, &mode); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2); } @@ -29107,7 +29435,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decryptGetUnpadded) ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "ecb"); zephir_array_fast_append(&_1, &_2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 249, &_1, &mode); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 231, &_1, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("padding"), PH_NOISY_CC | PH_READONLY); @@ -29175,7 +29503,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decryptGcmCcmAuth) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "gcm"); zephir_array_fast_append(&_2, &_3); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 249, &_2, &mode); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 231, &_2, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authData"), PH_NOISY_CC | PH_READONLY); @@ -29190,15 +29518,15 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, decryptGcmCcmAuth) ZEPHIR_INIT_VAR(&encrypted); zephir_fast_str_replace(&encrypted, &authTag, &_5$$3, &cipherText); ZVAL_LONG(&_4$$3, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 251, &encrypted, &cipher, &decryptKey, &_4$$3, &iv, &authTag, &authData); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 232, &encrypted, &cipher, &decryptKey, &_4$$3, &iv, &authTag, &authData); zephir_check_call_status(); } else { ZVAL_LONG(&_6$$4, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 251, &cipherText, &cipher, &decryptKey, &_6$$4, &iv); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 232, &cipherText, &cipher, &decryptKey, &_6$$4, &iv); zephir_check_call_status(); } if (ZEPHIR_IS_FALSE_IDENTICAL(&decrypted)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not decrypt data", "phalcon/Encryption/Crypt.zep", 761); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not decrypt data", "phalcon/Encryption/Crypt.zep", 782); return; } RETURN_CCTOR(&decrypted); @@ -29250,7 +29578,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encryptGetPadded) ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "ecb"); zephir_array_fast_append(&_3, &_4); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 249, &_3, &mode); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 231, &_3, &mode); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2); } @@ -29319,13 +29647,13 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encryptGcmCcm) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "gcm"); zephir_array_fast_append(&_2, &_3); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 249, &_2, &mode); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 231, &_2, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&authData, &_4$$3); if (1 == ZEPHIR_IS_EMPTY(&authData)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Auth data must be provided when using AEAD mode", "phalcon/Encryption/Crypt.zep", 820); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Auth data must be provided when using AEAD mode", "phalcon/Encryption/Crypt.zep", 841); return; } zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authTag"), PH_NOISY_CC | PH_READONLY); @@ -29334,17 +29662,17 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, encryptGcmCcm) ZEPHIR_CPY_WRT(&authTagLength, &_4$$3); ZVAL_LONG(&_4$$3, 1); ZEPHIR_MAKE_REF(&authTag); - ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 252, &padded, &cipher, &encryptKey, &_4$$3, &iv, &authTag, &authData, &authTagLength); + ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 233, &padded, &cipher, &encryptKey, &_4$$3, &iv, &authTag, &authData, &authTagLength); ZEPHIR_UNREF(&authTag); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("authTag"), &authTag); } else { ZVAL_LONG(&_5$$5, 1); - ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 252, &padded, &cipher, &encryptKey, &_5$$5, &iv); + ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 233, &padded, &cipher, &encryptKey, &_5$$5, &iv); zephir_check_call_status(); } if (ZEPHIR_IS_FALSE_IDENTICAL(&encrypted)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not encrypt data", "phalcon/Encryption/Crypt.zep", 849); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not encrypt data", "phalcon/Encryption/Crypt.zep", 870); return; } ZEPHIR_CONCAT_VV(return_value, &encrypted, &authTag); @@ -29376,14 +29704,14 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, initializeAvailableCiphers) ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfunctionexists", NULL, 0, &_1); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "This class requires the openssl extension for PHP", "phalcon/Encryption/Crypt.zep", 871); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "This class requires the openssl extension for PHP", "phalcon/Encryption/Crypt.zep", 892); return; } - ZEPHIR_CALL_FUNCTION(&available, "openssl_get_cipher_methods", NULL, 253, &__$true); + ZEPHIR_CALL_FUNCTION(&available, "openssl_get_cipher_methods", NULL, 234, &__$true); zephir_check_call_status(); ZEPHIR_INIT_VAR(&allowed); array_init(&allowed); - zephir_is_iterable(&available, 0, "phalcon/Encryption/Crypt.zep", 888); + zephir_is_iterable(&available, 0, "phalcon/Encryption/Crypt.zep", 909); if (Z_TYPE_P(&available) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&available), _2) { @@ -29504,9 +29832,9 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getBlockSize) zephir_read_property(&_2, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, ""); - ZEPHIR_CALL_FUNCTION(&_4, "str_ireplace", NULL, 254, &_1, &_3, &_2); + ZEPHIR_CALL_FUNCTION(&_4, "str_ireplace", NULL, 235, &_1, &_3, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getivlength", NULL, 248, &_4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getivlength", NULL, 230, &_4); zephir_check_call_status(); RETURN_MM(); } @@ -29534,10 +29862,10 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getIvLength) zephir_get_strval(&cipher, cipher_param); - ZEPHIR_CALL_FUNCTION(&length, "openssl_cipher_iv_length", NULL, 255, &cipher); + ZEPHIR_CALL_FUNCTION(&length, "openssl_cipher_iv_length", NULL, 236, &cipher); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&length)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Cannot calculate the initialization vector (IV) length of the cipher", "phalcon/Encryption/Crypt.zep", 941); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Cannot calculate the initialization vector (IV) length of the cipher", "phalcon/Encryption/Crypt.zep", 962); return; } RETURN_CCTOR(&length); @@ -29564,7 +29892,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getMode) zephir_read_property(&_0, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "-"); - ZEPHIR_CALL_FUNCTION(&_2, "strrpos", NULL, 123, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "strrpos", NULL, 237, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&position); ZVAL_LONG(&position, zephir_get_intval(&_2)); @@ -29602,6 +29930,33 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, phpFunctionExists) RETURN_MM_BOOL((zephir_function_exists(&name) == SUCCESS)); } +static PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *cipher_param = NULL; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(cipher) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &cipher_param); + zephir_get_strval(&cipher, cipher_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("openssl_cipher_iv_length", NULL, 236, &cipher); + zephir_check_call_status(); + RETURN_MM(); +} + static PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -29624,7 +29979,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes) ZVAL_LONG(&_0, length); - ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 256, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 238, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -29802,7 +30157,7 @@ static PHP_METHOD(Phalcon_Encryption_Security, checkHash) if (_0) { RETURN_MM_BOOL(0); } - ZEPHIR_RETURN_CALL_FUNCTION("password_verify", NULL, 260, &password, &passwordHash); + ZEPHIR_RETURN_CALL_FUNCTION("password_verify", NULL, 242, &password, &passwordHash); zephir_check_call_status(); RETURN_MM(); } @@ -29852,13 +30207,13 @@ static PHP_METHOD(Phalcon_Encryption_Security, checkToken) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "processtokenkey", NULL, 261, &tokenKey); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "processtokenkey", NULL, 243, &tokenKey); zephir_check_call_status(); zephir_get_strval(&tokenKey, &_0); if (!(!(ZEPHIR_IS_EMPTY(&tokenKey)))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&userToken, this_ptr, "processusertoken", NULL, 262, &tokenKey, tokenValue); + ZEPHIR_CALL_METHOD(&userToken, this_ptr, "processusertoken", NULL, 244, &tokenKey, tokenValue); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&knownToken, this_ptr, "getrequesttoken", NULL, 0); zephir_check_call_status(); @@ -29925,16 +30280,16 @@ static PHP_METHOD(Phalcon_Encryption_Security, computeHmac) ZVAL_BOOL(&_0, (raw ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 243, &algo, &data, &key, &_0); + ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 224, &algo, &data, &key, &_0); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&hmac))) { ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, phalcon_encryption_security_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Unknown hashing algorithm: %s"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &algo); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &algo); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Encryption/Security.zep", 219); ZEPHIR_MM_RESTORE(); @@ -30011,7 +30366,7 @@ static PHP_METHOD(Phalcon_Encryption_Security, getHashInformation) zephir_get_strval(&hash, hash_param); - ZEPHIR_RETURN_CALL_FUNCTION("password_get_info", NULL, 263, &hash); + ZEPHIR_RETURN_CALL_FUNCTION("password_get_info", NULL, 245, &hash); zephir_check_call_status(); RETURN_MM(); } @@ -30271,11 +30626,11 @@ static PHP_METHOD(Phalcon_Encryption_Security, hash) } - ZEPHIR_CALL_METHOD(&cost, this_ptr, "processcost", NULL, 264, &options); + ZEPHIR_CALL_METHOD(&cost, this_ptr, "processcost", NULL, 246, &options); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&formatted, "sprintf", NULL, 140, &_0, &cost); + ZEPHIR_CALL_FUNCTION(&formatted, "sprintf", NULL, 112, &_0, &cost); zephir_check_call_status(); ZEPHIR_INIT_VAR(&prefix); ZVAL_STRING(&prefix, ""); @@ -30305,14 +30660,14 @@ static PHP_METHOD(Phalcon_Encryption_Security, hash) if (ZEPHIR_IS_LONG(&_1, 5)) { ZEPHIR_INIT_VAR(&_2$$6); ZVAL_STRING(&_2$$6, "$2a$%s$"); - ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 140, &_2$$6, &formatted); + ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 112, &_2$$6, &formatted); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&_1, 6)) { ZEPHIR_INIT_VAR(&_3$$7); ZVAL_STRING(&_3$$7, "$2x$%s$"); - ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 140, &_3$$7, &formatted); + ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 112, &_3$$7, &formatted); zephir_check_call_status(); break; } @@ -30326,7 +30681,7 @@ static PHP_METHOD(Phalcon_Encryption_Security, hash) zephir_check_call_status(); ZEPHIR_INIT_VAR(&salt); ZEPHIR_CONCAT_VVS(&salt, &prefix, &_4$$9, "$"); - ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 265, &password, &salt); + ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 247, &password, &salt); zephir_check_call_status(); RETURN_MM(); } @@ -30334,11 +30689,11 @@ static PHP_METHOD(Phalcon_Encryption_Security, hash) zephir_create_array(&_6, 1, 0); zephir_array_update_string(&_6, SL("cost"), &cost, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&options, &_6); - ZEPHIR_CALL_METHOD(&algorithm, this_ptr, "processalgorithm", NULL, 266); + ZEPHIR_CALL_METHOD(&algorithm, this_ptr, "processalgorithm", NULL, 248); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "processargonoptions", NULL, 267, &options); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "processargonoptions", NULL, 249, &options); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("password_hash", NULL, 268, &password, &algorithm, &arguments); + ZEPHIR_RETURN_CALL_FUNCTION("password_hash", NULL, 250, &password, &algorithm, &arguments); zephir_check_call_status(); RETURN_MM(); } @@ -30900,7 +31255,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_PadFactory, padNumberToService) ZVAL_LONG(&_1, number); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "noop"); - ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 171, &map, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 150, &map, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -30999,13 +31354,13 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, pad) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, (paddingSize - 1)); ZEPHIR_CALL_FUNCTION(&_2, "str_repeat", NULL, 1, &_1, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); - ZEPHIR_CALL_FUNCTION(&_3, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "chr", NULL, 239, &_0); zephir_check_call_status(); ZEPHIR_CONCAT_VV(return_value, &_2, &_3); RETURN_MM(); @@ -31055,7 +31410,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, unpad) ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 258, &last); + ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 240, &last); zephir_check_call_status(); if (ZEPHIR_LE_LONG(&ord, blockSize)) { ZEPHIR_CPY_WRT(&paddingSize, &ord); @@ -31063,7 +31418,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, unpad) ZVAL_STRING(&repeat, ""); if (ZEPHIR_GT_LONG(&paddingSize, 1)) { ZVAL_LONG(&_2$$4, 0); - ZEPHIR_CALL_FUNCTION(&_3$$4, "chr", NULL, 257, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "chr", NULL, 239, &_2$$4); zephir_check_call_status(); ZVAL_LONG(&_2$$4, (zephir_get_numberval(&paddingSize) - 1)); ZEPHIR_CALL_FUNCTION(&repeat, "str_repeat", NULL, 1, &_3$$4, &_2$$4); @@ -31146,15 +31501,15 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Iso10126, pad) } ZEPHIR_INIT_NVAR(&counter); ZVAL_LONG(&counter, _1); - ZEPHIR_CALL_FUNCTION(&_3$$3, "rand", &_4, 259); + ZEPHIR_CALL_FUNCTION(&_3$$3, "rand", &_4, 241); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_5$$3, "chr", &_6, 257, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "chr", &_6, 239, &_3$$3); zephir_check_call_status(); zephir_concat_self(&padding, &_5$$3); } } ZVAL_LONG(&_7, paddingSize); - ZEPHIR_CALL_FUNCTION(&_8, "chr", &_6, 257, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "chr", &_6, 239, &_7); zephir_check_call_status(); zephir_concat_self(&padding, &_8); RETURN_CCTOR(&padding); @@ -31194,7 +31549,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Iso10126, unpad) ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 258, &last); + ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 240, &last); zephir_check_call_status(); RETURN_MM(); } @@ -31242,10 +31597,10 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, pad) ZVAL_LONG(&_0, 0x80); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_2, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, (paddingSize - 1)); ZEPHIR_CALL_FUNCTION(&_3, "str_repeat", NULL, 1, &_2, &_0); @@ -31288,9 +31643,9 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) paddingSize = 0; - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); while (1) { @@ -31298,7 +31653,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/IsoIek.zep", 48); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_IDENTICAL(&_1, &_3); } @@ -31314,7 +31669,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) } zephir_array_fetch_long(&_6, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/IsoIek.zep", 55); ZVAL_LONG(&_2, 0x80); - ZEPHIR_CALL_FUNCTION(&_7, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_7, "chr", &_4, 239, &_2); zephir_check_call_status(); if (ZEPHIR_IS_EQUAL(&_6, &_7)) { paddingSize++; @@ -31450,7 +31805,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Pkcs7, pad) ZVAL_LONG(&_0, paddingSize); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); ZEPHIR_RETURN_CALL_FUNCTION("str_repeat", NULL, 1, &_1, &_0); @@ -31492,17 +31847,17 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Pkcs7, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); ZVAL_LONG(&_0, (zephir_get_numberval(&length) - 1)); ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 258, &last); + ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 240, &last); zephir_check_call_status(); if (ZEPHIR_LE_LONG(&ord, blockSize)) { ZEPHIR_CPY_WRT(&paddingSize, &ord); - ZEPHIR_CALL_FUNCTION(&_2$$3, "chr", NULL, 257, &paddingSize); + ZEPHIR_CALL_FUNCTION(&_2$$3, "chr", NULL, 239, &paddingSize); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 1, &_2$$3, &paddingSize); zephir_check_call_status(); @@ -31597,9 +31952,9 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Space, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); paddingSize = 0; @@ -31608,7 +31963,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Space, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/Space.zep", 48); ZVAL_LONG(&_2, 32); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_EQUAL(&_1, &_3); } @@ -31666,7 +32021,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, pad) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); ZEPHIR_RETURN_CALL_FUNCTION("str_repeat", NULL, 1, &_1, &_0); @@ -31705,9 +32060,9 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); paddingSize = 0; @@ -31716,7 +32071,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/Zero.zep", 48); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_EQUAL(&_1, &_3); } @@ -31871,7 +32226,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, base64) ZVAL_LONG(&_1, len); ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -31919,7 +32274,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, base64Safe) ZVAL_LONG(&_1, len); ZEPHIR_CALL_METHOD(&_0, this_ptr, "base64", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 245, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 226, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "+/"); @@ -31931,7 +32286,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, base64Safe) ZVAL_STRING(&_3, "#[^a-z0-9_=-]+#i"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, ""); - ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 50, &_3, &_4, &s); + ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 37, &_3, &_4, &s); zephir_check_call_status(); ZEPHIR_CPY_WRT(&s, &_5); if (!(padding)) { @@ -31973,7 +32328,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, bytes) len = 16; } ZVAL_LONG(&_0, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 282, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 264, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -32012,10 +32367,10 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, hex) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "H*"); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 283, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 265, &_2, &_0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&_3); - ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 23, &_3); + ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 21, &_3); ZEPHIR_UNREF(&_3); zephir_check_call_status(); RETURN_MM(); @@ -32049,7 +32404,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, number) } ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 284, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 266, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -32079,7 +32434,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, uuid) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "N1a/n1b/n1c/n1d/n1e/N1f"); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 283, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 265, &_2, &_0); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&ary, "array_values", NULL, 14, &_3); zephir_check_call_status(); @@ -32094,7 +32449,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, uuid) ZEPHIR_INIT_VAR(&_7); ZVAL_STRING(&_7, "%08x-%04x-%04x-%04x-%04x%08x"); ZEPHIR_MAKE_REF(&ary); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &ary, &_7); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &ary, &_7); ZEPHIR_UNREF(&ary); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7); @@ -32152,7 +32507,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_Random, base) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "C*"); - ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 283, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 265, &_1, &_0); zephir_check_call_status(); zephir_is_iterable(&bytes, 0, "phalcon/Encryption/Security/Random.zep", 351); if (Z_TYPE_P(&bytes) == IS_ARRAY) { @@ -32280,7 +32635,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, init) zephir_update_property_zval(this_ptr, ZEND_STRL("passphrase"), &_0); ZEPHIR_INIT_NVAR(&_0); object_init_ex(&_0, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("claims"), &_0); ZEPHIR_INIT_VAR(&_1); @@ -32289,7 +32644,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, init) zephir_create_array(&_2, 2, 0); add_assoc_stringl_ex(&_2, SL("typ"), SL("JWT")); add_assoc_stringl_ex(&_2, SL("alg"), SL("none")); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("jose"), &_1); RETURN_THIS(); @@ -32608,27 +32963,27 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, getToken) } ZEPHIR_CALL_METHOD(&_2, this_ptr, "getclaims", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 269, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 251, &_2); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedClaims, this_ptr, "encodeurl", NULL, 270, &_1); + ZEPHIR_CALL_METHOD(&encodedClaims, this_ptr, "encodeurl", NULL, 252, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&claims); object_init_ex(&claims, phalcon_encryption_security_jwt_token_item_ce); ZEPHIR_CALL_METHOD(&_3, this_ptr, "getclaims", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &claims, "__construct", NULL, 271, &_3, &encodedClaims); + ZEPHIR_CALL_METHOD(NULL, &claims, "__construct", NULL, 253, &_3, &encodedClaims); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_5, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "encode", NULL, 269, &_5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "encode", NULL, 251, &_5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedHeaders, this_ptr, "encodeurl", NULL, 270, &_4); + ZEPHIR_CALL_METHOD(&encodedHeaders, this_ptr, "encodeurl", NULL, 252, &_4); zephir_check_call_status(); ZEPHIR_INIT_VAR(&headers); object_init_ex(&headers, phalcon_encryption_security_jwt_token_item_ce); ZEPHIR_CALL_METHOD(&_6, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 271, &_6, &encodedHeaders); + ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 253, &_6, &encodedHeaders); zephir_check_call_status(); zephir_read_property(&_7, this_ptr, ZEND_STRL("signer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_8); @@ -32636,14 +32991,14 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, getToken) zephir_read_property(&_9, this_ptr, ZEND_STRL("passphrase"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&signatureHash, &_7, "sign", NULL, 0, &_8, &_9); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedSignature, this_ptr, "encodeurl", NULL, 270, &signatureHash); + ZEPHIR_CALL_METHOD(&encodedSignature, this_ptr, "encodeurl", NULL, 252, &signatureHash); zephir_check_call_status(); ZEPHIR_INIT_VAR(&signature); object_init_ex(&signature, phalcon_encryption_security_jwt_token_signature_ce); - ZEPHIR_CALL_METHOD(NULL, &signature, "__construct", NULL, 272, &signatureHash, &encodedSignature); + ZEPHIR_CALL_METHOD(NULL, &signature, "__construct", NULL, 254, &signatureHash, &encodedSignature); zephir_check_call_status(); object_init_ex(return_value, phalcon_encryption_security_jwt_token_token_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 273, &headers, &claims, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 255, &headers, &claims, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -33082,7 +33437,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, encodeUrl) } - ZEPHIR_CALL_FUNCTION(&_0, "base64_encode", NULL, 245, &input); + ZEPHIR_CALL_FUNCTION(&_0, "base64_encode", NULL, 226, &input); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "+/"); @@ -33143,16 +33498,16 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Encryption/Security/JWT/Builder.zep", 451); ZEPHIR_MM_RESTORE(); @@ -33323,7 +33678,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateExpiration) _4 = zephir_is_true(&_2); if (_4) { ZVAL_LONG(&_6, timestamp); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "gettimestamp", NULL, 281, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "gettimestamp", NULL, 263, &_6); zephir_check_call_status(); zephir_read_property(&_6, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_7, &_6, "getclaims", NULL, 0); @@ -33417,7 +33772,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateIssuedAt) ZVAL_LONG(&_1, timestamp); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 281, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 263, &_1); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0); @@ -33509,7 +33864,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateNotBefore) ZVAL_LONG(&_1, timestamp); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 281, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 263, &_1); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0); @@ -33911,7 +34266,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, parse) } - ZEPHIR_CALL_METHOD(&results, this_ptr, "parsetoken", NULL, 275, &token); + ZEPHIR_CALL_METHOD(&results, this_ptr, "parsetoken", NULL, 257, &token); zephir_check_call_status(); ZEPHIR_OBS_VAR(&encodedHeaders); zephir_array_fetch_long(&encodedHeaders, &results, 0, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 33); @@ -33919,14 +34274,14 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, parse) zephir_array_fetch_long(&encodedClaims, &results, 1, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 34); ZEPHIR_OBS_VAR(&encodedSignature); zephir_array_fetch_long(&encodedSignature, &results, 2, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 35); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "decodeheaders", NULL, 276, &encodedHeaders); + ZEPHIR_CALL_METHOD(&headers, this_ptr, "decodeheaders", NULL, 258, &encodedHeaders); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&claims, this_ptr, "decodeclaims", NULL, 277, &encodedClaims); + ZEPHIR_CALL_METHOD(&claims, this_ptr, "decodeclaims", NULL, 259, &encodedClaims); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&signature, this_ptr, "decodesignature", NULL, 278, &headers, &encodedSignature); + ZEPHIR_CALL_METHOD(&signature, this_ptr, "decodesignature", NULL, 260, &headers, &encodedSignature); zephir_check_call_status(); object_init_ex(return_value, phalcon_encryption_security_jwt_token_token_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 273, &headers, &claims, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 255, &headers, &claims, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -33961,10 +34316,10 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeClaims) zephir_get_strval(&claims, claims_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 279, &claims); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 261, &claims); zephir_check_call_status(); ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 280, &_0, &_1); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 262, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&decoded) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Claims (not an array)", "phalcon/Encryption/Security/JWT/Token/Parser.zep", 59); @@ -33985,7 +34340,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeClaims) zephir_array_update_string(&decoded, SL("aud"), &_4$$4, PH_COPY | PH_SEPARATE); } object_init_ex(return_value, phalcon_encryption_security_jwt_token_item_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 271, &decoded, &claims); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 253, &decoded, &claims); zephir_check_call_status(); RETURN_MM(); } @@ -34015,10 +34370,10 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeHeaders) zephir_get_strval(&headers, headers_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 279, &headers); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 261, &headers); zephir_check_call_status(); ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 280, &_0, &_1); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 262, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&decoded) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Header (not an array)", "phalcon/Encryption/Security/JWT/Token/Parser.zep", 88); @@ -34029,7 +34384,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeHeaders) return; } object_init_ex(return_value, phalcon_encryption_security_jwt_token_item_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 271, &decoded, &headers); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 253, &decoded, &headers); zephir_check_call_status(); RETURN_MM(); } @@ -34076,11 +34431,11 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeSignature) ZVAL_STRING(&decoded, ""); ZEPHIR_INIT_NVAR(&signature); } else { - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decodeurl", NULL, 279, &signature); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decodeurl", NULL, 261, &signature); zephir_check_call_status(); } object_init_ex(return_value, phalcon_encryption_security_jwt_token_signature_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 272, &decoded, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 254, &decoded, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -34187,16 +34542,16 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 163); ZEPHIR_MM_RESTORE(); @@ -34257,7 +34612,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeUrl) ZVAL_STRING(&_4, "+/"); ZEPHIR_CALL_FUNCTION(&_5, "strtr", NULL, 5, &input, &_3, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&data, "base64_decode", NULL, 244, &_5); + ZEPHIR_CALL_FUNCTION(&data, "base64_decode", NULL, 225, &_5); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) { ZEPHIR_INIT_NVAR(&data); @@ -34643,7 +34998,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, sign) } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethash", NULL, 274, &payload, &passphrase); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethash", NULL, 256, &payload, &passphrase); zephir_check_call_status(); RETURN_MM(); } @@ -34701,7 +35056,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, verify) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gethash", NULL, 274, &payload, &passphrase); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gethash", NULL, 256, &payload, &passphrase); zephir_check_call_status(); RETURN_MM_BOOL(zephir_hash_equals(&source, &_0)); } @@ -34751,7 +35106,7 @@ static PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, getHash) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getalgorithm", NULL, 0); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac", NULL, 243, &_0, &payload, &passphrase, &__$true); + ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac", NULL, 224, &_0, &payload, &passphrase, &__$true); zephir_check_call_status(); RETURN_MM(); } @@ -34963,12 +35318,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Application) static PHP_METHOD(Phalcon_Mvc_Application, handle) { - zval _17$$21; - zend_class_entry *_6$$8; - zend_bool returnedResponse = 0, _10$$7, _13$$12, _31$$31, _33$$31; + zval _17$$20; + zend_class_entry *_6$$7; + zend_bool returnedResponse = 0, _1, _10$$6, _13$$11, _31$$30, _33$$30; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, __$false, container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, controller, possibleResponse, renderStatus, matchedRoute, match, _0, _3, _4, _21, _22, _23, _24, _41, _1$$4, _2$$4, _5$$8, _7$$7, _8$$9, _9$$9, _11$$13, _12$$13, _14$$19, _15$$19, _16$$16, _18$$23, _19$$24, _20$$24, _25$$26, _26$$26, _27$$28, _28$$28, _29$$30, _30$$30, _32$$32, _34$$35, _35$$36, _36$$36, _37$$39, _38$$39, _39$$40, _40$$41; + zval *uri_param = NULL, __$false, container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, controller, possibleResponse, renderStatus, matchedRoute, match, _0, _2, _3, _4, _21, _22, _23, _24, _41, _5$$7, _7$$6, _8$$8, _9$$8, _11$$12, _12$$12, _14$$18, _15$$18, _16$$15, _18$$22, _19$$23, _20$$23, _25$$25, _26$$25, _27$$27, _28$$27, _29$$29, _30$$29, _32$$31, _34$$34, _35$$35, _36$$35, _37$$38, _38$$38, _39$$39, _40$$40; zval uri; zval *this_ptr = getThis(); @@ -34992,6 +35347,7 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_UNDEF(&matchedRoute); ZVAL_UNDEF(&match); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_21); @@ -34999,35 +35355,33 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_UNDEF(&_23); ZVAL_UNDEF(&_24); ZVAL_UNDEF(&_41); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_5$$8); - ZVAL_UNDEF(&_7$$7); - ZVAL_UNDEF(&_8$$9); - ZVAL_UNDEF(&_9$$9); - ZVAL_UNDEF(&_11$$13); - ZVAL_UNDEF(&_12$$13); - ZVAL_UNDEF(&_14$$19); - ZVAL_UNDEF(&_15$$19); - ZVAL_UNDEF(&_16$$16); - ZVAL_UNDEF(&_18$$23); - ZVAL_UNDEF(&_19$$24); - ZVAL_UNDEF(&_20$$24); - ZVAL_UNDEF(&_25$$26); - ZVAL_UNDEF(&_26$$26); - ZVAL_UNDEF(&_27$$28); - ZVAL_UNDEF(&_28$$28); - ZVAL_UNDEF(&_29$$30); - ZVAL_UNDEF(&_30$$30); - ZVAL_UNDEF(&_32$$32); - ZVAL_UNDEF(&_34$$35); - ZVAL_UNDEF(&_35$$36); - ZVAL_UNDEF(&_36$$36); - ZVAL_UNDEF(&_37$$39); - ZVAL_UNDEF(&_38$$39); - ZVAL_UNDEF(&_39$$40); - ZVAL_UNDEF(&_40$$41); - ZVAL_UNDEF(&_17$$21); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_14$$18); + ZVAL_UNDEF(&_15$$18); + ZVAL_UNDEF(&_16$$15); + ZVAL_UNDEF(&_18$$22); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$23); + ZVAL_UNDEF(&_25$$25); + ZVAL_UNDEF(&_26$$25); + ZVAL_UNDEF(&_27$$27); + ZVAL_UNDEF(&_28$$27); + ZVAL_UNDEF(&_29$$29); + ZVAL_UNDEF(&_30$$29); + ZVAL_UNDEF(&_32$$31); + ZVAL_UNDEF(&_34$$34); + ZVAL_UNDEF(&_35$$35); + ZVAL_UNDEF(&_36$$35); + ZVAL_UNDEF(&_37$$38); + ZVAL_UNDEF(&_38$$38); + ZVAL_UNDEF(&_39$$39); + ZVAL_UNDEF(&_40$$40); + ZVAL_UNDEF(&_17$$20); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -35051,26 +35405,28 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&container, &_0); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { + if (Z_TYPE_P(&container) == IS_NULL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "A dependency injection container is required to access internal services", "phalcon/Mvc/Application.zep", 100); return; } zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&eventsManager, &_0); - if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_2$$4); - ZVAL_STRING(&_2$$4, "application:boot"); - ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr); + _1 = Z_TYPE_P(&eventsManager) != IS_NULL; + if (_1) { + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "application:boot"); + ZEPHIR_CALL_METHOD(&_2, &eventsManager, "fire", NULL, 0, &_3, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) { - RETURN_MM_BOOL(0); - } + _1 = ZEPHIR_IS_FALSE_IDENTICAL(&_2); } - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "router"); - ZEPHIR_CALL_METHOD(&_3, &container, "getshared", NULL, 0, &_4); + if (_1) { + RETURN_MM_BOOL(0); + } + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "router"); + ZEPHIR_CALL_METHOD(&_4, &container, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&router, &_3); + ZEPHIR_CPY_WRT(&router, &_4); ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &uri); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&matchedRoute, &router, "getmatchedroute", NULL, 0); @@ -35080,31 +35436,31 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_check_call_status(); if (Z_TYPE_P(&match) != IS_NULL) { if (zephir_is_instance_of(&match, SL("Closure"))) { - _6$$8 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); - ZEPHIR_CALL_CE_STATIC(&_5$$8, _6$$8, "bind", NULL, 0, &match, &container); + _6$$7 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_CE_STATIC(&_5$$7, _6$$7, "bind", NULL, 0, &match, &container); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&match, &_5$$8); + ZEPHIR_CPY_WRT(&match, &_5$$7); } - ZEPHIR_CALL_METHOD(&_7$$7, &router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$6, &router, "getparams", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&possibleResponse); - ZEPHIR_CALL_USER_FUNC_ARRAY(&possibleResponse, &match, &_7$$7); + ZEPHIR_CALL_USER_FUNC_ARRAY(&possibleResponse, &match, &_7$$6); zephir_check_call_status(); if (Z_TYPE_P(&possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(&_9$$9); - ZVAL_STRING(&_9$$9, "response"); - ZEPHIR_CALL_METHOD(&_8$$9, &container, "getshared", NULL, 0, &_9$$9); + ZEPHIR_INIT_VAR(&_9$$8); + ZVAL_STRING(&_9$$8, "response"); + ZEPHIR_CALL_METHOD(&_8$$8, &container, "getshared", NULL, 0, &_9$$8); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_8$$9); + ZEPHIR_CPY_WRT(&response, &_8$$8); ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); RETURN_CCTOR(&response); } - _10$$7 = Z_TYPE_P(&possibleResponse) == IS_OBJECT; - if (_10$$7) { - _10$$7 = zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce); + _10$$6 = Z_TYPE_P(&possibleResponse) == IS_OBJECT; + if (_10$$6) { + _10$$6 = zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce); } - if (_10$$7) { + if (_10$$6) { ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendheaders", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendcookies", NULL, 0); @@ -35123,22 +35479,22 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_NULL(&moduleObject); if (zephir_is_true(&moduleName)) { if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_12$$13); - ZVAL_STRING(&_12$$13, "application:beforeStartModule"); - ZEPHIR_CALL_METHOD(&_11$$13, &eventsManager, "fire", NULL, 0, &_12$$13, this_ptr, &moduleName); + ZEPHIR_INIT_VAR(&_12$$12); + ZVAL_STRING(&_12$$12, "application:beforeStartModule"); + ZEPHIR_CALL_METHOD(&_11$$12, &eventsManager, "fire", NULL, 0, &_12$$12, this_ptr, &moduleName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_11$$13)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_11$$12)) { RETURN_MM_BOOL(0); } } ZEPHIR_CALL_METHOD(&module, this_ptr, "getmodule", NULL, 0, &moduleName); zephir_check_call_status(); - _13$$12 = Z_TYPE_P(&module) != IS_ARRAY; - if (_13$$12) { - _13$$12 = Z_TYPE_P(&module) != IS_OBJECT; + _13$$11 = Z_TYPE_P(&module) != IS_ARRAY; + if (_13$$11) { + _13$$11 = Z_TYPE_P(&module) != IS_OBJECT; } - if (UNEXPECTED(_13$$12)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 198); + if (UNEXPECTED(_13$$11)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 196); return; } if (Z_TYPE_P(&module) == IS_ARRAY) { @@ -35150,13 +35506,13 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) ZEPHIR_OBS_VAR(&path); if (zephir_array_isset_string_fetch(&path, &module, SL("path"), 0)) { if (UNEXPECTED(!((zephir_file_exists(&path) == SUCCESS)))) { - ZEPHIR_INIT_VAR(&_14$$19); - object_init_ex(&_14$$19, phalcon_mvc_application_exception_ce); - ZEPHIR_INIT_VAR(&_15$$19); - ZEPHIR_CONCAT_SVS(&_15$$19, "Module definition path '", &path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_14$$19, "__construct", NULL, 31, &_15$$19); + ZEPHIR_INIT_VAR(&_14$$18); + object_init_ex(&_14$$18, phalcon_mvc_application_exception_ce); + ZEPHIR_INIT_VAR(&_15$$18); + ZEPHIR_CONCAT_SVS(&_15$$18, "Module definition path '", &path, "' doesn't exist"); + ZEPHIR_CALL_METHOD(NULL, &_14$$18, "__construct", NULL, 29, &_15$$18); zephir_check_call_status(); - zephir_throw_exception_debug(&_14$$19, "phalcon/Mvc/Application.zep", 220); + zephir_throw_exception_debug(&_14$$18, "phalcon/Mvc/Application.zep", 218); ZEPHIR_MM_RESTORE(); return; } @@ -35166,49 +35522,49 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) } } } - ZEPHIR_CALL_METHOD(&_16$$16, &container, "get", NULL, 0, &className); + ZEPHIR_CALL_METHOD(&_16$$15, &container, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&moduleObject, &_16$$16); + ZEPHIR_CPY_WRT(&moduleObject, &_16$$15); ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerautoloaders", NULL, 0, &container); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerservices", NULL, 0, &container); zephir_check_call_status(); } else { if (UNEXPECTED(!((zephir_is_instance_of(&module, SL("Closure")))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 241); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 239); return; } - ZEPHIR_INIT_VAR(&_17$$21); - zephir_create_array(&_17$$21, 1, 0); - zephir_array_fast_append(&_17$$21, &container); + ZEPHIR_INIT_VAR(&_17$$20); + zephir_create_array(&_17$$20, 1, 0); + zephir_array_fast_append(&_17$$20, &container); ZEPHIR_INIT_NVAR(&moduleObject); - ZEPHIR_CALL_USER_FUNC_ARRAY(&moduleObject, &module, &_17$$21); + ZEPHIR_CALL_USER_FUNC_ARRAY(&moduleObject, &module, &_17$$20); zephir_check_call_status(); } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_18$$23); - ZVAL_STRING(&_18$$23, "application:afterStartModule"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_18$$23, this_ptr, &moduleObject); + ZEPHIR_INIT_VAR(&_18$$22); + ZVAL_STRING(&_18$$22, "application:afterStartModule"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_18$$22, this_ptr, &moduleObject); zephir_check_call_status(); } } zephir_read_property(&_0, this_ptr, ZEND_STRL("implicitView"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&implicitView, &_0); if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { - ZEPHIR_INIT_VAR(&_20$$24); - ZVAL_STRING(&_20$$24, "view"); - ZEPHIR_CALL_METHOD(&_19$$24, &container, "getshared", NULL, 0, &_20$$24); + ZEPHIR_INIT_VAR(&_20$$23); + ZVAL_STRING(&_20$$23, "view"); + ZEPHIR_CALL_METHOD(&_19$$23, &container, "getshared", NULL, 0, &_20$$23); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&view, &_19$$24); + ZEPHIR_CPY_WRT(&view, &_19$$23); } - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "dispatcher"); - ZEPHIR_CALL_METHOD(&_3, &container, "getshared", NULL, 0, &_4); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "dispatcher"); + ZEPHIR_CALL_METHOD(&_4, &container, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&dispatcher, &_3); - ZEPHIR_CALL_METHOD(&_3, &router, "getmodulename", NULL, 0); + ZEPHIR_CPY_WRT(&dispatcher, &_4); + ZEPHIR_CALL_METHOD(&_4, &router, "getmodulename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setmodulename", NULL, 0, &_3); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setmodulename", NULL, 0, &_4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_21, &router, "getnamespacename", NULL, 0); zephir_check_call_status(); @@ -35231,11 +35587,11 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_check_call_status(); } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_26$$26); - ZVAL_STRING(&_26$$26, "application:beforeHandleRequest"); - ZEPHIR_CALL_METHOD(&_25$$26, &eventsManager, "fire", NULL, 0, &_26$$26, this_ptr, &dispatcher); + ZEPHIR_INIT_VAR(&_26$$25); + ZVAL_STRING(&_26$$25, "application:beforeHandleRequest"); + ZEPHIR_CALL_METHOD(&_25$$25, &eventsManager, "fire", NULL, 0, &_26$$25, this_ptr, &dispatcher); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$26)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$25)) { RETURN_MM_BOOL(0); } } @@ -35244,52 +35600,52 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) ZEPHIR_CALL_METHOD(&possibleResponse, &dispatcher, "getreturnedvalue", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&possibleResponse)) { - ZEPHIR_INIT_VAR(&_28$$28); - ZVAL_STRING(&_28$$28, "response"); - ZEPHIR_CALL_METHOD(&_27$$28, &container, "getshared", NULL, 0, &_28$$28); + ZEPHIR_INIT_VAR(&_28$$27); + ZVAL_STRING(&_28$$27, "response"); + ZEPHIR_CALL_METHOD(&_27$$27, &container, "getshared", NULL, 0, &_28$$27); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_27$$28); + ZEPHIR_CPY_WRT(&response, &_27$$27); } else { if (Z_TYPE_P(&possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(&_30$$30); - ZVAL_STRING(&_30$$30, "response"); - ZEPHIR_CALL_METHOD(&_29$$30, &container, "getshared", NULL, 0, &_30$$30); + ZEPHIR_INIT_VAR(&_30$$29); + ZVAL_STRING(&_30$$29, "response"); + ZEPHIR_CALL_METHOD(&_29$$29, &container, "getshared", NULL, 0, &_30$$29); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_29$$30); + ZEPHIR_CPY_WRT(&response, &_29$$29); ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); } else { - _31$$31 = (Z_TYPE_P(&possibleResponse) == IS_OBJECT); - if (_31$$31) { - _31$$31 = (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce)); + _31$$30 = (Z_TYPE_P(&possibleResponse) == IS_OBJECT); + if (_31$$30) { + _31$$30 = (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce)); } - returnedResponse = _31$$31; + returnedResponse = _31$$30; if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_32$$32); - ZVAL_STRING(&_32$$32, "application:afterHandleRequest"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$32, this_ptr, &controller); + ZEPHIR_INIT_VAR(&_32$$31); + ZVAL_STRING(&_32$$31, "application:afterHandleRequest"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$31, this_ptr, &controller); zephir_check_call_status(); } - _33$$31 = returnedResponse == 0; - if (_33$$31) { - _33$$31 = ZEPHIR_IS_TRUE_IDENTICAL(&implicitView); + _33$$30 = returnedResponse == 0; + if (_33$$30) { + _33$$30 = ZEPHIR_IS_TRUE_IDENTICAL(&implicitView); } - if (_33$$31) { + if (_33$$30) { if (Z_TYPE_P(&controller) == IS_OBJECT) { ZEPHIR_INIT_VAR(&renderStatus); ZVAL_BOOL(&renderStatus, 1); if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_34$$35); - ZVAL_STRING(&_34$$35, "application:viewRender"); - ZEPHIR_CALL_METHOD(&renderStatus, &eventsManager, "fire", NULL, 0, &_34$$35, this_ptr, &view); + ZEPHIR_INIT_VAR(&_34$$34); + ZVAL_STRING(&_34$$34, "application:viewRender"); + ZEPHIR_CALL_METHOD(&renderStatus, &eventsManager, "fire", NULL, 0, &_34$$34, this_ptr, &view); zephir_check_call_status(); } if (!ZEPHIR_IS_FALSE_IDENTICAL(&renderStatus)) { - ZEPHIR_CALL_METHOD(&_35$$36, &dispatcher, "getcontrollername", NULL, 0); + ZEPHIR_CALL_METHOD(&_35$$35, &dispatcher, "getcontrollername", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_36$$36, &dispatcher, "getactionname", NULL, 0); + ZEPHIR_CALL_METHOD(&_36$$35, &dispatcher, "getactionname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &_35$$36, &_36$$36); + ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &_35$$35, &_36$$35); zephir_check_call_status(); } } @@ -35301,24 +35657,24 @@ static PHP_METHOD(Phalcon_Mvc_Application, handle) if (returnedResponse == 1) { ZEPHIR_CPY_WRT(&response, &possibleResponse); } else { - ZEPHIR_INIT_VAR(&_38$$39); - ZVAL_STRING(&_38$$39, "response"); - ZEPHIR_CALL_METHOD(&_37$$39, &container, "getshared", NULL, 0, &_38$$39); + ZEPHIR_INIT_VAR(&_38$$38); + ZVAL_STRING(&_38$$38, "response"); + ZEPHIR_CALL_METHOD(&_37$$38, &container, "getshared", NULL, 0, &_38$$38); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_37$$39); + ZEPHIR_CPY_WRT(&response, &_37$$38); if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { - ZEPHIR_CALL_METHOD(&_39$$40, &view, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&_39$$39, &view, "getcontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &_39$$40); + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &_39$$39); zephir_check_call_status(); } } } } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_40$$41); - ZVAL_STRING(&_40$$41, "application:beforeSendResponse"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_40$$41, this_ptr, &response); + ZEPHIR_INIT_VAR(&_40$$40); + ZVAL_STRING(&_40$$40, "application:beforeSendResponse"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_40$$40, this_ptr, &response); zephir_check_call_status(); } zephir_read_property(&_0, this_ptr, ZEND_STRL("sendHeaders"), PH_NOISY_CC | PH_READONLY); @@ -35790,7 +36146,7 @@ static PHP_METHOD(Phalcon_Mvc_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "A dependency injection container is required to access the 'response' service"); ZVAL_LONG(&_3$$3, 0); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Dispatcher.zep", 228); ZEPHIR_MM_RESTORE(); @@ -35809,7 +36165,7 @@ static PHP_METHOD(Phalcon_Mvc_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&exception); object_init_ex(&exception, phalcon_mvc_dispatcher_exception_ce); ZVAL_LONG(&_0, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 31, &message, &_0); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 29, &message, &_0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, this_ptr, "handleexception", NULL, 0, &exception); zephir_check_call_status(); @@ -36286,11 +36642,11 @@ static PHP_METHOD(Phalcon_Mvc_Micro, getService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "get", NULL, 491, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "get", NULL, 411, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -36332,11 +36688,11 @@ static PHP_METHOD(Phalcon_Mvc_Micro, getSharedService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "getshared", NULL, 492, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "getshared", NULL, 412, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -36516,7 +36872,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_8$$8, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_9$$8); ZVAL_STRING(&_9$$8, "Matched route doesn't have an associated handler"); - ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 31, &_9$$8); + ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 29, &_9$$8); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_8$$8, "phalcon/Mvc/Micro.zep", 455); goto try_end_1; @@ -36560,7 +36916,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_16$$14, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_17$$14); ZVAL_STRING(&_17$$14, "'before' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_16$$14, "__construct", NULL, 31, &_17$$14); + ZEPHIR_CALL_METHOD(NULL, &_16$$14, "__construct", NULL, 29, &_17$$14); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_16$$14, "phalcon/Mvc/Micro.zep", 491); goto try_end_1; @@ -36599,7 +36955,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_20$$19, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_21$$19); ZVAL_STRING(&_21$$19, "'before' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_20$$19, "__construct", NULL, 31, &_21$$19); + ZEPHIR_CALL_METHOD(NULL, &_20$$19, "__construct", NULL, 29, &_21$$19); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_20$$19, "phalcon/Mvc/Micro.zep", 491); goto try_end_1; @@ -36720,7 +37076,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_40$$34, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_41$$34); ZVAL_STRING(&_41$$34, "'afterBinding' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_40$$34, "__construct", NULL, 31, &_41$$34); + ZEPHIR_CALL_METHOD(NULL, &_40$$34, "__construct", NULL, 29, &_41$$34); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_40$$34, "phalcon/Mvc/Micro.zep", 602); goto try_end_1; @@ -36759,7 +37115,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_44$$39, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_45$$39); ZVAL_STRING(&_45$$39, "'afterBinding' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_44$$39, "__construct", NULL, 31, &_45$$39); + ZEPHIR_CALL_METHOD(NULL, &_44$$39, "__construct", NULL, 29, &_45$$39); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_44$$39, "phalcon/Mvc/Micro.zep", 602); goto try_end_1; @@ -36811,7 +37167,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_51$$45, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_52$$45); ZVAL_STRING(&_52$$45, "One of the 'after' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_51$$45, "__construct", NULL, 31, &_52$$45); + ZEPHIR_CALL_METHOD(NULL, &_51$$45, "__construct", NULL, 29, &_52$$45); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_51$$45, "phalcon/Mvc/Micro.zep", 648); goto try_end_1; @@ -36850,7 +37206,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_55$$50, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_56$$50); ZVAL_STRING(&_56$$50, "One of the 'after' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_55$$50, "__construct", NULL, 31, &_56$$50); + ZEPHIR_CALL_METHOD(NULL, &_55$$50, "__construct", NULL, 29, &_56$$50); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_55$$50, "phalcon/Mvc/Micro.zep", 648); goto try_end_1; @@ -36888,7 +37244,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_61$$55, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_62$$55); ZVAL_STRING(&_62$$55, "Not-Found handler is not callable or is not defined"); - ZEPHIR_CALL_METHOD(NULL, &_61$$55, "__construct", NULL, 31, &_62$$55); + ZEPHIR_CALL_METHOD(NULL, &_61$$55, "__construct", NULL, 29, &_62$$55); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_61$$55, "phalcon/Mvc/Micro.zep", 681); goto try_end_1; @@ -36930,7 +37286,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_67$$60, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_68$$60); ZVAL_STRING(&_68$$60, "One of the 'finish' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_67$$60, "__construct", NULL, 31, &_68$$60); + ZEPHIR_CALL_METHOD(NULL, &_67$$60, "__construct", NULL, 29, &_68$$60); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_67$$60, "phalcon/Mvc/Micro.zep", 717); goto try_end_1; @@ -36972,7 +37328,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_72$$65, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_73$$65); ZVAL_STRING(&_73$$65, "One of the 'finish' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_72$$65, "__construct", NULL, 31, &_73$$65); + ZEPHIR_CALL_METHOD(NULL, &_72$$65, "__construct", NULL, 29, &_73$$65); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_72$$65, "phalcon/Mvc/Micro.zep", 717); goto try_end_1; @@ -37127,11 +37483,11 @@ static PHP_METHOD(Phalcon_Mvc_Micro, hasService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "has", NULL, 493, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "has", NULL, 413, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -37280,7 +37636,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, mount) if (zephir_is_true(&_0)) { ZEPHIR_INIT_VAR(&lazyHandler); object_init_ex(&lazyHandler, phalcon_mvc_micro_lazyloader_ce); - ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 494, &mainHandler); + ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 414, &mainHandler); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&lazyHandler, &mainHandler); @@ -37427,23 +37783,24 @@ static PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&offset_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasservice", NULL, 0, alias); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasservice", NULL, 0, offset); zephir_check_call_status(); RETURN_MM(); } @@ -37452,23 +37809,24 @@ static PHP_METHOD(Phalcon_Mvc_Micro, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&offset_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getservice", NULL, 0, alias); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getservice", NULL, 0, offset); zephir_check_call_status(); RETURN_MM(); } @@ -37477,25 +37835,26 @@ static PHP_METHOD(Phalcon_Mvc_Micro, offsetSet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub, *definition, definition_sub; + zval offset_sub, value_sub; + zval *offset, *value; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); - ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&value_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(alias) - Z_PARAM_ZVAL(definition) + Z_PARAM_ZVAL(offset) + Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &alias, &definition); + zephir_fetch_params(1, 2, 0, &offset, &value); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setservice", NULL, 0, alias, definition); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setservice", NULL, 0, offset, value); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -37504,34 +37863,36 @@ static PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub, container, _0; + zval offset_sub, _0, _2, _1$$3; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); - ZVAL_UNDEF(&container); + ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); 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_OBJECT) { - ZEPHIR_INIT_NVAR(&container); - object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 410); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &_1$$3); } - ZEPHIR_CALL_METHOD(NULL, &container, "remove", NULL, 495, alias); + zephir_read_property(&_2, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_2, "remove", NULL, 0, offset); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -37885,7 +38246,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, setService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } @@ -37894,7 +38255,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro, setService) } else { ZVAL_BOOL(&_0, 0); } - ZEPHIR_RETURN_CALL_METHOD(&container, "set", NULL, 496, &serviceName, definition, &_0); + ZEPHIR_RETURN_CALL_METHOD(&container, "set", NULL, 415, &serviceName, definition, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -38146,7 +38507,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, __call) zephir_get_arrval(&arguments, arguments_param); - ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 497, &method, &arguments); + ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 416, &method, &arguments); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&records)) { RETURN_CCTOR(&records); @@ -38168,7 +38529,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, __call) object_init_ex(&_2, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3); ZEPHIR_CONCAT_SVSVS(&_3, "The method '", &method, "' doesn't exist on model '", &modelName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 31, &_3); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 29, &_3); zephir_check_call_status(); zephir_throw_exception_debug(&_2, "phalcon/Mvc/Model.zep", 266); ZEPHIR_MM_RESTORE(); @@ -38206,7 +38567,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, __callStatic) zephir_get_arrval(&arguments, arguments_param); - ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 497, &method, &arguments); + ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 416, &method, &arguments); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&records)) { RETURN_CCTOR(&records); @@ -38217,7 +38578,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, __callStatic) object_init_ex(&_1, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVSVS(&_2, "The method '", &method, "' doesn't exist on model '", &modelName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 31, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 29, &_2); zephir_check_call_status(); zephir_throw_exception_debug(&_1, "phalcon/Mvc/Model.zep", 292); ZEPHIR_MM_RESTORE(); @@ -38534,13 +38895,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, __set) } } - ZEPHIR_CALL_METHOD(&_14, this_ptr, "possiblesetter", NULL, 498, &property, value); + ZEPHIR_CALL_METHOD(&_14, this_ptr, "possiblesetter", NULL, 417, &property, value); zephir_check_call_status(); if (zephir_is_true(&_14)) { RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_15, "property_exists", NULL, 304, this_ptr, &property); + ZEPHIR_CALL_FUNCTION(&_15, "property_exists", NULL, 286, this_ptr, &property); zephir_check_call_status(); if (zephir_is_true(&_15)) { ZEPHIR_CALL_METHOD(&manager, this_ptr, "getmodelsmanager", NULL, 0); @@ -38552,7 +38913,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, __set) object_init_ex(&_17$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_18$$21); ZEPHIR_CONCAT_SVS(&_18$$21, "Cannot access property '", &property, "' (not public)."); - ZEPHIR_CALL_METHOD(NULL, &_17$$21, "__construct", NULL, 31, &_18$$21); + ZEPHIR_CALL_METHOD(NULL, &_17$$21, "__construct", NULL, 29, &_18$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$21, "phalcon/Mvc/Model.zep", 499); ZEPHIR_MM_RESTORE(); @@ -38745,7 +39106,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) _7$$12 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_7$$12) { - ZEPHIR_CALL_SELF(&_8$$13, "caseinsensitivecolumnmap", &_9, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_8$$13, "caseinsensitivecolumnmap", &_9, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_8$$13); } @@ -38757,7 +39118,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) object_init_ex(&_10$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$16); ZEPHIR_CONCAT_SVS(&_11$$16, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$16, "__construct", &_12, 31, &_11$$16); + ZEPHIR_CALL_METHOD(NULL, &_10$$16, "__construct", &_12, 29, &_11$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$16, "phalcon/Mvc/Model.zep", 676); ZEPHIR_MM_RESTORE(); @@ -38777,7 +39138,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) } _13$$18 = zephir_is_true(&disableAssignSetters); if (!(_13$$18)) { - ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "possiblesetter", &_15, 498, &attributeField, &value); + ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "possiblesetter", &_15, 417, &attributeField, &value); zephir_check_call_status(); _13$$18 = !zephir_is_true(&_14$$18); } @@ -38802,7 +39163,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) _16$$22 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_16$$22) { - ZEPHIR_CALL_SELF(&_17$$23, "caseinsensitivecolumnmap", &_9, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_17$$23, "caseinsensitivecolumnmap", &_9, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_17$$23); } @@ -38814,7 +39175,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) object_init_ex(&_18$$26, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_19$$26); ZEPHIR_CONCAT_SVS(&_19$$26, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_18$$26, "__construct", &_12, 31, &_19$$26); + ZEPHIR_CALL_METHOD(NULL, &_18$$26, "__construct", &_12, 29, &_19$$26); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$26, "phalcon/Mvc/Model.zep", 676); ZEPHIR_MM_RESTORE(); @@ -38834,7 +39195,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, assign) } _20$$28 = zephir_is_true(&disableAssignSetters); if (!(_20$$28)) { - ZEPHIR_CALL_METHOD(&_21$$28, this_ptr, "possiblesetter", &_15, 498, &attributeField, &value); + ZEPHIR_CALL_METHOD(&_21$$28, this_ptr, "possiblesetter", &_15, 417, &attributeField, &value); zephir_check_call_status(); _20$$28 = !zephir_is_true(&_21$$28); } @@ -39100,7 +39461,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_6$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$9); ZEPHIR_CONCAT_SVS(&_7$$9, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$9, "__construct", &_8, 31, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_6$$9, "__construct", &_8, 29, &_7$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$9, "phalcon/Mvc/Model.zep", 852); ZEPHIR_MM_RESTORE(); @@ -39114,7 +39475,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_9$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$11); ZEPHIR_CONCAT_SVS(&_10$$11, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 31, &_10$$11); + ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 29, &_10$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model.zep", 861); ZEPHIR_MM_RESTORE(); @@ -39136,7 +39497,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) do { if (ZEPHIR_IS_LONG(&_12$$13, 0) || ZEPHIR_IS_LONG(&_12$$13, 21) || ZEPHIR_IS_LONG(&_12$$13, 22) || ZEPHIR_IS_LONG(&_12$$13, 26)) { ZVAL_LONG(&_13$$14, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 51, &value, &_13$$14); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 38, &value, &_13$$14); zephir_check_call_status(); break; } @@ -39210,7 +39571,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_17$$27, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$27); ZEPHIR_CONCAT_SVS(&_18$$27, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 31, &_18$$27); + ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 29, &_18$$27); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model.zep", 852); ZEPHIR_MM_RESTORE(); @@ -39224,7 +39585,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_19$$29, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$29); ZEPHIR_CONCAT_SVS(&_20$$29, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_19$$29, "__construct", &_8, 31, &_20$$29); + ZEPHIR_CALL_METHOD(NULL, &_19$$29, "__construct", &_8, 29, &_20$$29); zephir_check_call_status(); zephir_throw_exception_debug(&_19$$29, "phalcon/Mvc/Model.zep", 861); ZEPHIR_MM_RESTORE(); @@ -39246,7 +39607,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) do { if (ZEPHIR_IS_LONG(&_22$$31, 0) || ZEPHIR_IS_LONG(&_22$$31, 21) || ZEPHIR_IS_LONG(&_22$$31, 22) || ZEPHIR_IS_LONG(&_22$$31, 26)) { ZVAL_LONG(&_23$$32, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 51, &value, &_23$$32); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 38, &value, &_23$$32); zephir_check_call_status(); break; } @@ -39372,7 +39733,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) _4$$7 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_4$$7) { - ZEPHIR_CALL_SELF(&_5$$8, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_5$$8, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_5$$8); } @@ -39383,7 +39744,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) object_init_ex(&_7$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$10); ZEPHIR_CONCAT_SVS(&_8$$10, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_9, 31, &_8$$10); + ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_9, 29, &_8$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$10, "phalcon/Mvc/Model.zep", 988); ZEPHIR_MM_RESTORE(); @@ -39424,7 +39785,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) _10$$16 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_10$$16) { - ZEPHIR_CALL_SELF(&_11$$17, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_11$$17, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_11$$17); } @@ -39435,7 +39796,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) object_init_ex(&_12$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$19); ZEPHIR_CONCAT_SVS(&_13$$19, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_12$$19, "__construct", &_9, 31, &_13$$19); + ZEPHIR_CALL_METHOD(NULL, &_12$$19, "__construct", &_9, 29, &_13$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$19, "phalcon/Mvc/Model.zep", 988); ZEPHIR_MM_RESTORE(); @@ -39620,7 +39981,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, create) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &metaData, &_1); zephir_check_call_status(); @@ -39704,7 +40065,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_INIT_ZVAL_NREF(_0); ZVAL_LONG(&_0, 3); @@ -39713,7 +40074,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) array_init(&_1); zephir_update_property_zval(this_ptr, ZEND_STRL("errorMessages"), &_1); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checkforeignkeysreverserestrict", NULL, 501); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checkforeignkeysreverserestrict", NULL, 420); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_2$$3)) { RETURN_MM_BOOL(0); @@ -39752,7 +40113,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_5$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_6$$9); ZEPHIR_CONCAT_SVS(&_6$$9, "Column '", &primaryKey, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_7, 31, &_6$$9); + ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_7, 29, &_6$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model.zep", 1217); ZEPHIR_MM_RESTORE(); @@ -39765,7 +40126,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_8$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_9$$11); ZEPHIR_CONCAT_SVS(&_9$$11, "Column '", &primaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_8$$11, "__construct", &_7, 31, &_9$$11); + ZEPHIR_CALL_METHOD(NULL, &_8$$11, "__construct", &_7, 29, &_9$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$11, "phalcon/Mvc/Model.zep", 1227); ZEPHIR_MM_RESTORE(); @@ -39780,7 +40141,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_10$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$13); ZEPHIR_CONCAT_SVS(&_11$$13, "Cannot delete the record because the primary key attribute: '", &attributeField, "' was not set"); - ZEPHIR_CALL_METHOD(NULL, &_10$$13, "__construct", &_7, 31, &_11$$13); + ZEPHIR_CALL_METHOD(NULL, &_10$$13, "__construct", &_7, 29, &_11$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$13, "phalcon/Mvc/Model.zep", 1240); ZEPHIR_MM_RESTORE(); @@ -39811,7 +40172,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_15$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$15); ZEPHIR_CONCAT_SVS(&_16$$15, "Column '", &primaryKey, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_15$$15, "__construct", &_7, 31, &_16$$15); + ZEPHIR_CALL_METHOD(NULL, &_15$$15, "__construct", &_7, 29, &_16$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$15, "phalcon/Mvc/Model.zep", 1217); ZEPHIR_MM_RESTORE(); @@ -39824,7 +40185,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_17$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$17); ZEPHIR_CONCAT_SVS(&_18$$17, "Column '", &primaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$17, "__construct", &_7, 31, &_18$$17); + ZEPHIR_CALL_METHOD(NULL, &_17$$17, "__construct", &_7, 29, &_18$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$17, "phalcon/Mvc/Model.zep", 1227); ZEPHIR_MM_RESTORE(); @@ -39839,7 +40200,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_19$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$19); ZEPHIR_CONCAT_SVS(&_20$$19, "Cannot delete the record because the primary key attribute: '", &attributeField, "' was not set"); - ZEPHIR_CALL_METHOD(NULL, &_19$$19, "__construct", &_7, 31, &_20$$19); + ZEPHIR_CALL_METHOD(NULL, &_19$$19, "__construct", &_7, 29, &_20$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_19$$19, "phalcon/Mvc/Model.zep", 1240); ZEPHIR_MM_RESTORE(); @@ -39875,9 +40236,9 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) RETURN_MM_BOOL(1); } } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -39892,7 +40253,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, delete) ZEPHIR_CALL_METHOD(&success, &writeConnection, "delete", NULL, 0, &table, &_27, &values, &bindTypes); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_28$$25, this_ptr, "checkforeignkeysreversecascade", NULL, 504); + ZEPHIR_CALL_METHOD(&_28$$25, this_ptr, "checkforeignkeysreversecascade", NULL, 423); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_28$$25)) { RETURN_MM_BOOL(0); @@ -39922,7 +40283,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, dump) ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 505, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 424, this_ptr); zephir_check_call_status(); RETURN_MM(); } @@ -39967,7 +40328,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, find) } else { ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 506, ¶ms); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 425, ¶ms); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&resultset, &query, "execute", NULL, 0); zephir_check_call_status(); @@ -40032,7 +40393,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, findFirst) return; } ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_2, 506, ¶ms, &_3); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_2, 425, ¶ms, &_3); zephir_check_call_status(); ZVAL_BOOL(&_3, 1); ZEPHIR_CALL_METHOD(NULL, &query, "setuniquerow", NULL, 0, &_3); @@ -40502,7 +40863,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, getRelated) object_init_ex(&_2$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVSVS(&_3$$3, "There is no defined relations for the model '", &className, "' using alias '", &alias, "'"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$3, "phalcon/Mvc/Model.zep", 1950); ZEPHIR_MM_RESTORE(); @@ -40772,7 +41133,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasChanged) RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &changedFields)); } if (Z_TYPE_P(fieldName) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 507, fieldName, &changedFields); + ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 426, fieldName, &changedFields); zephir_check_call_status(); if (allFields) { RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&intersect, fieldName)); @@ -40836,7 +41197,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasUpdated) RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &updatedFields)); } if (Z_TYPE_P(fieldName) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 507, fieldName, &updatedFields); + ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 426, fieldName, &updatedFields); zephir_check_call_status(); if (allFields) { RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&intersect, fieldName)); @@ -40986,12 +41347,12 @@ static PHP_METHOD(Phalcon_Mvc_Model, query) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 508, container); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 427, container); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_3); zephir_get_called_class(&_3); - ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 509, &_3); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 428, &_3); zephir_check_call_status(); RETURN_CCTOR(&criteria); } @@ -41081,13 +41442,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, refresh) } ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_1); - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -41224,7 +41585,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, save) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "prepareSave"); @@ -41240,9 +41601,9 @@ static PHP_METHOD(Phalcon_Mvc_Model, save) RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -41252,7 +41613,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, save) } else { ZEPHIR_CPY_WRT(&table, &source); } - ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&exists, this_ptr, "has", NULL, 0, &metaData, &readConnection); zephir_check_call_status(); @@ -41283,7 +41644,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, save) object_init_ex(&_6$$11, phalcon_mvc_model_validationfailed_ce); ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "getmessages", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", NULL, 511, this_ptr, &_7$$11); + ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", NULL, 430, this_ptr, &_7$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$11, "phalcon/Mvc/Model.zep", 2561); ZEPHIR_MM_RESTORE(); @@ -41709,7 +42070,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_4$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_5$$7); ZEPHIR_CONCAT_SVS(&_5$$7, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_6, 31, &_5$$7); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_6, 29, &_5$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$7, "phalcon/Mvc/Model.zep", 2818); ZEPHIR_MM_RESTORE(); @@ -41725,7 +42086,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_7$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$10); ZEPHIR_CONCAT_SVS(&_8$$10, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_6, 31, &_8$$10); + ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_6, 29, &_8$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$10, "phalcon/Mvc/Model.zep", 2829); ZEPHIR_MM_RESTORE(); @@ -41759,7 +42120,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_9$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$14); ZEPHIR_CONCAT_SVS(&_10$$14, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_9$$14, "__construct", &_6, 31, &_10$$14); + ZEPHIR_CALL_METHOD(NULL, &_9$$14, "__construct", &_6, 29, &_10$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$14, "phalcon/Mvc/Model.zep", 2818); ZEPHIR_MM_RESTORE(); @@ -41775,7 +42136,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_11$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SVS(&_12$$17, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_6, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_6, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$17, "phalcon/Mvc/Model.zep", 2829); ZEPHIR_MM_RESTORE(); @@ -41870,7 +42231,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) _4$$4 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_4$$4) { - ZEPHIR_CALL_SELF(&_5$$6, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_5$$6, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_5$$6); } @@ -41881,7 +42242,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_7$$8, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$8); ZEPHIR_CONCAT_SVS(&_8$$8, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$8, "__construct", &_9, 31, &_8$$8); + ZEPHIR_CALL_METHOD(NULL, &_7$$8, "__construct", &_9, 29, &_8$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$8, "phalcon/Mvc/Model.zep", 2883); ZEPHIR_MM_RESTORE(); @@ -41897,7 +42258,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_10$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$11); ZEPHIR_CONCAT_SVS(&_11$$11, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", &_9, 31, &_11$$11); + ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", &_9, 29, &_11$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$11, "phalcon/Mvc/Model.zep", 2894); ZEPHIR_MM_RESTORE(); @@ -41929,7 +42290,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) _12$$12 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_12$$12) { - ZEPHIR_CALL_SELF(&_13$$14, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_13$$14, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_13$$14); } @@ -41940,7 +42301,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_14$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_15$$16); ZEPHIR_CONCAT_SVS(&_15$$16, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_14$$16, "__construct", &_9, 31, &_15$$16); + ZEPHIR_CALL_METHOD(NULL, &_14$$16, "__construct", &_9, 29, &_15$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_14$$16, "phalcon/Mvc/Model.zep", 2883); ZEPHIR_MM_RESTORE(); @@ -41956,7 +42317,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_16$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_17$$19); ZEPHIR_CONCAT_SVS(&_17$$19, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_16$$19, "__construct", &_9, 31, &_17$$19); + ZEPHIR_CALL_METHOD(NULL, &_16$$19, "__construct", &_9, 29, &_17$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$19, "phalcon/Mvc/Model.zep", 2894); ZEPHIR_MM_RESTORE(); @@ -42263,7 +42624,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, toArray) _3$$4 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_3$$4) { - ZEPHIR_CALL_SELF(&_4$$5, "caseinsensitivecolumnmap", &_5, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_4$$5, "caseinsensitivecolumnmap", &_5, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_4$$5); } @@ -42274,7 +42635,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, toArray) object_init_ex(&_6$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$7); ZEPHIR_CONCAT_SVS(&_7$$7, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", &_8, 31, &_7$$7); + ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", &_8, 29, &_7$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$7, "phalcon/Mvc/Model.zep", 3153); ZEPHIR_MM_RESTORE(); @@ -42314,7 +42675,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, toArray) _9$$14 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_9$$14) { - ZEPHIR_CALL_SELF(&_10$$15, "caseinsensitivecolumnmap", &_5, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_10$$15, "caseinsensitivecolumnmap", &_5, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_10$$15); } @@ -42325,7 +42686,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, toArray) object_init_ex(&_11$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SVS(&_12$$17, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_8, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_8, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$17, "phalcon/Mvc/Model.zep", 3153); ZEPHIR_MM_RESTORE(); @@ -42380,7 +42741,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, update) if (zephir_is_true(&_0)) { ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "has", NULL, 0, &metaData, &_2$$3); zephir_check_call_status(); @@ -43231,7 +43592,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_4$$7); ZEPHIR_CONCAT_SVS(&_4$$7, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 31, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 29, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model.zep", 3604); ZEPHIR_MM_RESTORE(); @@ -43269,7 +43630,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_12$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$15); ZEPHIR_CONCAT_SVS(&_13$$15, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_12$$15, "__construct", &_5, 31, &_13$$15); + ZEPHIR_CALL_METHOD(NULL, &_12$$15, "__construct", &_5, 29, &_13$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$15, "phalcon/Mvc/Model.zep", 3639); ZEPHIR_MM_RESTORE(); @@ -43320,7 +43681,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_20$$22, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_21$$22); ZEPHIR_CONCAT_SVS(&_21$$22, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_20$$22, "__construct", &_5, 31, &_21$$22); + ZEPHIR_CALL_METHOD(NULL, &_20$$22, "__construct", &_5, 29, &_21$$22); zephir_check_call_status(); zephir_throw_exception_debug(&_20$$22, "phalcon/Mvc/Model.zep", 3604); ZEPHIR_MM_RESTORE(); @@ -43358,7 +43719,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_28$$30, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_29$$30); ZEPHIR_CONCAT_SVS(&_29$$30, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_28$$30, "__construct", &_5, 31, &_29$$30); + ZEPHIR_CALL_METHOD(NULL, &_28$$30, "__construct", &_5, 29, &_29$$30); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$30, "phalcon/Mvc/Model.zep", 3639); ZEPHIR_MM_RESTORE(); @@ -43411,7 +43772,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_37$$38, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_38$$38); ZEPHIR_CONCAT_SVS(&_38$$38, "Identity column '", identityField, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_37$$38, "__construct", &_5, 31, &_38$$38); + ZEPHIR_CALL_METHOD(NULL, &_37$$38, "__construct", &_5, 29, &_38$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_37$$38, "phalcon/Mvc/Model.zep", 3690); ZEPHIR_MM_RESTORE(); @@ -43441,7 +43802,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_40$$45, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_41$$45); ZEPHIR_CONCAT_SVS(&_41$$45, "Identity column '", identityField, "' isn\'t part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_40$$45, "__construct", &_5, 31, &_41$$45); + ZEPHIR_CALL_METHOD(NULL, &_40$$45, "__construct", &_5, 29, &_41$$45); zephir_check_call_status(); zephir_throw_exception_debug(&_40$$45, "phalcon/Mvc/Model.zep", 3719); ZEPHIR_MM_RESTORE(); @@ -43480,9 +43841,9 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) ZEPHIR_CALL_METHOD(&sequenceName, this_ptr, "getsequencename", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&sequenceName); if (ZEPHIR_IS_EMPTY(&schema)) { @@ -43496,7 +43857,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_GLOBAL(orm).cast_last_insert_id_to_int)) { ZVAL_LONG(&_47$$55, 10); - ZEPHIR_CALL_FUNCTION(&_48$$55, "intval", NULL, 51, &lastInsertedId, &_47$$55); + ZEPHIR_CALL_FUNCTION(&_48$$55, "intval", NULL, 38, &lastInsertedId, &_47$$55); zephir_check_call_status(); ZEPHIR_CPY_WRT(&lastInsertedId, &_48$$55); } @@ -43694,7 +44055,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_4$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_5$$10); ZEPHIR_CONCAT_SVS(&_5$$10, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", &_6, 31, &_5$$10); + ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", &_6, 29, &_5$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$10, "phalcon/Mvc/Model.zep", 3862); ZEPHIR_MM_RESTORE(); @@ -43711,7 +44072,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_7$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$13); ZEPHIR_CONCAT_SVS(&_8$$13, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_7$$13, "__construct", &_6, 31, &_8$$13); + ZEPHIR_CALL_METHOD(NULL, &_7$$13, "__construct", &_6, 29, &_8$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$13, "phalcon/Mvc/Model.zep", 3876); ZEPHIR_MM_RESTORE(); @@ -43740,7 +44101,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_9$$23, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$23); ZEPHIR_CONCAT_SVS(&_10$$23, "Column '", &field, "' have not defined a data type"); - ZEPHIR_CALL_METHOD(NULL, &_9$$23, "__construct", &_6, 31, &_10$$23); + ZEPHIR_CALL_METHOD(NULL, &_9$$23, "__construct", &_6, 29, &_10$$23); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$23, "phalcon/Mvc/Model.zep", 3915); ZEPHIR_MM_RESTORE(); @@ -43823,7 +44184,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_20$$35, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_21$$35); ZEPHIR_CONCAT_SVS(&_21$$35, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_20$$35, "__construct", &_6, 31, &_21$$35); + ZEPHIR_CALL_METHOD(NULL, &_20$$35, "__construct", &_6, 29, &_21$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_20$$35, "phalcon/Mvc/Model.zep", 3862); ZEPHIR_MM_RESTORE(); @@ -43840,7 +44201,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_22$$38, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_23$$38); ZEPHIR_CONCAT_SVS(&_23$$38, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_22$$38, "__construct", &_6, 31, &_23$$38); + ZEPHIR_CALL_METHOD(NULL, &_22$$38, "__construct", &_6, 29, &_23$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_22$$38, "phalcon/Mvc/Model.zep", 3876); ZEPHIR_MM_RESTORE(); @@ -43869,7 +44230,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_24$$48, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_25$$48); ZEPHIR_CONCAT_SVS(&_25$$48, "Column '", &field, "' have not defined a data type"); - ZEPHIR_CALL_METHOD(NULL, &_24$$48, "__construct", &_6, 31, &_25$$48); + ZEPHIR_CALL_METHOD(NULL, &_24$$48, "__construct", &_6, 29, &_25$$48); zephir_check_call_status(); zephir_throw_exception_debug(&_24$$48, "phalcon/Mvc/Model.zep", 3915); ZEPHIR_MM_RESTORE(); @@ -43971,7 +44332,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_36$$63, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_37$$63); ZEPHIR_CONCAT_SVS(&_37$$63, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_36$$63, "__construct", &_6, 31, &_37$$63); + ZEPHIR_CALL_METHOD(NULL, &_36$$63, "__construct", &_6, 29, &_37$$63); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$63, "phalcon/Mvc/Model.zep", 4021); ZEPHIR_MM_RESTORE(); @@ -44007,7 +44368,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_38$$69, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_39$$69); ZEPHIR_CONCAT_SVS(&_39$$69, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_38$$69, "__construct", &_6, 31, &_39$$69); + ZEPHIR_CALL_METHOD(NULL, &_38$$69, "__construct", &_6, 29, &_39$$69); zephir_check_call_status(); zephir_throw_exception_debug(&_38$$69, "phalcon/Mvc/Model.zep", 4021); ZEPHIR_MM_RESTORE(); @@ -44176,7 +44537,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_3$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_4$$9); ZEPHIR_CONCAT_SVS(&_4$$9, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_5, 31, &_4$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_5, 29, &_4$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$9, "phalcon/Mvc/Model.zep", 4124); ZEPHIR_MM_RESTORE(); @@ -44207,7 +44568,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_7$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$14); ZEPHIR_CONCAT_SVS(&_8$$14, "Column '", &field, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_7$$14, "__construct", &_5, 31, &_8$$14); + ZEPHIR_CALL_METHOD(NULL, &_7$$14, "__construct", &_5, 29, &_8$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$14, "phalcon/Mvc/Model.zep", 4154); ZEPHIR_MM_RESTORE(); @@ -44238,7 +44599,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_12$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$17); ZEPHIR_CONCAT_SVS(&_13$$17, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_12$$17, "__construct", &_5, 31, &_13$$17); + ZEPHIR_CALL_METHOD(NULL, &_12$$17, "__construct", &_5, 29, &_13$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$17, "phalcon/Mvc/Model.zep", 4124); ZEPHIR_MM_RESTORE(); @@ -44269,7 +44630,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_15$$22, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$22); ZEPHIR_CONCAT_SVS(&_16$$22, "Column '", &field, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_15$$22, "__construct", &_5, 31, &_16$$22); + ZEPHIR_CALL_METHOD(NULL, &_15$$22, "__construct", &_5, 29, &_16$$22); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$22, "phalcon/Mvc/Model.zep", 4154); ZEPHIR_MM_RESTORE(); @@ -44312,9 +44673,9 @@ static PHP_METHOD(Phalcon_Mvc_Model, has) zephir_read_property(&_22$$27, this_ptr, ZEND_STRL("uniqueTypes"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&uniqueTypes, &_22$$27); } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -44673,7 +45034,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_4$$7); ZEPHIR_CONCAT_SVS(&_4$$7, "The static method '", &method, "' requires one argument"); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 31, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 29, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model.zep", 4449); ZEPHIR_MM_RESTORE(); @@ -44693,7 +45054,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) if (zephir_array_isset(&attributes, &extraMethod)) { ZEPHIR_CPY_WRT(&field, &extraMethod); } else { - ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 104, &extraMethod); + ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 73, &extraMethod); zephir_check_call_status(); if (zephir_array_isset(&attributes, &extraMethodFirst)) { ZEPHIR_CPY_WRT(&field, &extraMethodFirst); @@ -44705,7 +45066,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) object_init_ex(&_5$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_6$$13); ZEPHIR_CONCAT_SVS(&_6$$13, "Cannot resolve attribute '", &extraMethod, "' in the model"); - ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", NULL, 31, &_6$$13); + ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", NULL, 29, &_6$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$13, "phalcon/Mvc/Model.zep", 4486); ZEPHIR_MM_RESTORE(); @@ -44889,7 +45250,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, preSave) } } if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "checkforeignkeysrestrict", NULL, 0); + ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "checkforeignkeysrestrict", NULL, 431); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$8)) { RETURN_MM_BOOL(0); @@ -44934,7 +45295,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, preSave) object_init_ex(&_6$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$19); ZEPHIR_CONCAT_SVS(&_7$$19, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$19, "__construct", &_8, 31, &_7$$19); + ZEPHIR_CALL_METHOD(NULL, &_6$$19, "__construct", &_8, 29, &_7$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$19, "phalcon/Mvc/Model.zep", 4647); ZEPHIR_MM_RESTORE(); @@ -45022,7 +45383,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, preSave) object_init_ex(&_17$$39, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$39); ZEPHIR_CONCAT_SVS(&_18$$39, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$39, "__construct", &_8, 31, &_18$$39); + ZEPHIR_CALL_METHOD(NULL, &_17$$39, "__construct", &_8, 29, &_18$$39); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$39, "phalcon/Mvc/Model.zep", 4647); ZEPHIR_MM_RESTORE(); @@ -45735,7 +46096,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_15$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$10); ZEPHIR_CONCAT_SVS(&_16$$10, "The column '", &columns, "' needs to be present in the model"); - ZEPHIR_CALL_METHOD(NULL, &_15$$10, "__construct", &_17, 31, &_16$$10); + ZEPHIR_CALL_METHOD(NULL, &_15$$10, "__construct", &_17, 29, &_16$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$10, "phalcon/Mvc/Model.zep", 4992); ZEPHIR_MM_RESTORE(); @@ -46074,7 +46435,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_68$$43, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_69$$43); ZEPHIR_CONCAT_SVSVS(&_69$$43, "There are no defined relations for the model '", &className, "' using alias '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_68$$43, "__construct", &_17, 31, &_69$$43); + ZEPHIR_CALL_METHOD(NULL, &_68$$43, "__construct", &_17, 29, &_69$$43); zephir_check_call_status(); zephir_throw_exception_debug(&_68$$43, "phalcon/Mvc/Model.zep", 5144); ZEPHIR_MM_RESTORE(); @@ -46157,7 +46518,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_81$$51, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_82$$51); ZEPHIR_CONCAT_SVS(&_82$$51, "The column '", &columns, "' needs to be present in the model"); - ZEPHIR_CALL_METHOD(NULL, &_81$$51, "__construct", &_17, 31, &_82$$51); + ZEPHIR_CALL_METHOD(NULL, &_81$$51, "__construct", &_17, 29, &_82$$51); zephir_check_call_status(); zephir_throw_exception_debug(&_81$$51, "phalcon/Mvc/Model.zep", 4992); ZEPHIR_MM_RESTORE(); @@ -46496,7 +46857,7 @@ static PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_132$$84, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_133$$84); ZEPHIR_CONCAT_SVSVS(&_133$$84, "There are no defined relations for the model '", &className, "' using alias '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_132$$84, "__construct", &_17, 31, &_133$$84); + ZEPHIR_CALL_METHOD(NULL, &_132$$84, "__construct", &_17, 29, &_133$$84); zephir_check_call_status(); zephir_throw_exception_debug(&_132$$84, "phalcon/Mvc/Model.zep", 5144); ZEPHIR_MM_RESTORE(); @@ -46613,16 +46974,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, belongsTo) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -46630,13 +46991,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, belongsTo) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -46646,14 +47007,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, belongsTo) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addbelongsto", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addbelongsto", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -46755,16 +47118,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -46772,13 +47135,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasMany) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -46788,14 +47151,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasMany) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmany", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmany", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -46804,18 +47169,19 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referenceModel; - zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, _0; + zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(6, 7) @@ -46826,13 +47192,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -46851,15 +47217,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - ZEPHIR_INIT_VAR(options); - array_init(options); + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmanytomany", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmanytomany", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -46868,16 +47235,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOne) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -46885,13 +47252,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOne) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -46901,14 +47268,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOne) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasone", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasone", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -46917,19 +47286,19 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referenceModel; - zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(6, 7) @@ -46940,13 +47309,13 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -46965,14 +47334,16 @@ static PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasonethrough", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasonethrough", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -47416,6 +47787,175 @@ static PHP_METHOD(Phalcon_Mvc_Model, caseInsensitiveColumnMap) RETURN_MM(); } +static PHP_METHOD(Phalcon_Mvc_Model, __serialize) +{ + zend_bool _2, _3; + zval attributes, manager, dirtyState, snapshot, _0, _1, _4, _5$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&dirtyState); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$3); + + + ZEPHIR_MM_GROW(); + + ZEPHIR_INIT_VAR(&snapshot); + ZVAL_NULL(&snapshot); + ZEPHIR_CALL_METHOD(&attributes, this_ptr, "toarray", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("dirtyState"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dirtyState, &_0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmanager", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&manager, &_1); + ZEPHIR_CALL_METHOD(&_1, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); + zephir_check_call_status(); + _2 = zephir_is_true(&_1); + if (_2) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + _2 = Z_TYPE_P(&_0) != IS_NULL; + } + _3 = _2; + if (_3) { + zephir_read_property(&_4, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + _3 = !ZEPHIR_IS_EQUAL(&attributes, &_4); + } + if (_3) { + zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&snapshot, &_5$$3); + } + zephir_create_array(return_value, 3, 0); + zephir_array_update_string(return_value, SL("attributes"), &attributes, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("snapshot"), &snapshot, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("dirtyState"), &dirtyState, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Mvc_Model, __unserialize) +{ + zend_string *_7$$6; + zend_ulong _6$$6; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zephir_fcall_cache_entry *_1 = NULL; + zval *data_param = NULL, container, manager, key, value, snapshot, properties, dirtyState, _2, _3, _0$$3, *_4$$6, _5$$6; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&properties); + ZVAL_UNDEF(&dirtyState); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_5$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + if (!(zephir_array_isset_string(&data, SL("attributes")))) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_create_array(&_0$$3, 1, 0); + zephir_array_update_string(&_0$$3, SL("attributes"), &data, PH_COPY | PH_SEPARATE); + ZEPHIR_CPY_WRT(&data, &_0$$3); + } + ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_1, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injection container is required to access the services related to the ODM", "phalcon/Mvc/Model.zep", 5857); + return; + } + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "modelsManager"); + ZEPHIR_CALL_METHOD(&_2, &container, "getshared", NULL, 0, &_3); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&manager, &_2); + if (Z_TYPE_P(&manager) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The injected service 'modelsManager' is not valid", "phalcon/Mvc/Model.zep", 5872); + return; + } + zephir_update_property_zval(this_ptr, ZEND_STRL("modelsManager"), &manager); + ZEPHIR_CALL_METHOD(NULL, &manager, "initialize", NULL, 0, this_ptr); + zephir_check_call_status(); + ZEPHIR_OBS_VAR(&properties); + if (zephir_array_isset_string_fetch(&properties, &data, SL("attributes"), 0)) { + zephir_is_iterable(&properties, 0, "phalcon/Mvc/Model.zep", 5895); + if (Z_TYPE_P(&properties) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&properties), _6$$6, _7$$6, _4$$6) + { + ZEPHIR_INIT_NVAR(&key); + if (_7$$6 != NULL) { + ZVAL_STR_COPY(&key, _7$$6); + } else { + ZVAL_LONG(&key, _6$$6); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _4$$6); + zephir_update_property_zval_zval(this_ptr, &key, &value); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &properties, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_5$$6, &properties, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_5$$6)) { + break; + } + ZEPHIR_CALL_METHOD(&key, &properties, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&value, &properties, "current", NULL, 0); + zephir_check_call_status(); + zephir_update_property_zval_zval(this_ptr, &key, &value); + ZEPHIR_CALL_METHOD(NULL, &properties, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + } else { + ZEPHIR_INIT_NVAR(&properties); + array_init(&properties); + } + ZEPHIR_OBS_VAR(&dirtyState); + if (zephir_array_isset_string_fetch(&dirtyState, &data, SL("dirtyState"), 0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("dirtyState"), &dirtyState); + } + ZEPHIR_CALL_METHOD(&_2, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); + zephir_check_call_status(); + if (zephir_is_true(&_2)) { + if (zephir_array_isset_string_fetch(&snapshot, &data, SL("snapshot"), 1)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("snapshot"), &snapshot); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("snapshot"), &properties); + } + } + ZEPHIR_MM_RESTORE(); +} + zend_object *zephir_init_properties_Phalcon_Mvc_Model(zend_class_entry *class_type) { zval _0, _2, _4, _6, _8, _10, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8; @@ -47569,20 +48109,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc, Router, phalcon, mvc_router, phalcon_di_abstractinjectionaware_ce, phalcon_mvc_router_method_entry, 0); - zend_declare_property_null(phalcon_mvc_router_ce, SL("action"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("controller"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultAction"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultController"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultNamespace"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("action"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("controller"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultAction"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultController"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultNamespace"), "", ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultParams"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("eventsManager"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("keyRouteNames"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("keyRouteIds"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("matchedRoute"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("matches"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("module"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_mvc_router_ce, SL("namespaceName"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("module"), "", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("namespaceName"), "", ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("notFoundPaths"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_mvc_router_ce, SL("params"), ZEND_ACC_PROTECTED); zend_declare_property_bool(phalcon_mvc_router_ce, SL("removeExtraSlashes"), 0, ZEND_ACC_PROTECTED); @@ -47713,7 +48253,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, __construct) add_assoc_long_ex(&_1$$3, SL("controller"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^/([\\w0-9\\_\\-]+)[/]{0,1}$#u"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 124, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 96, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/Mvc/Router.zep", 171); ZEPHIR_INIT_NVAR(&_2$$3); @@ -47725,7 +48265,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, __construct) add_assoc_long_ex(&_3$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_4$$3); ZVAL_STRING(&_4$$3, "#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 124, &_4$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 96, &_4$$3, &_3$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/Mvc/Router.zep", 180); } @@ -47787,7 +48327,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, add) ZEPHIR_INIT_VAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 124, &pattern, paths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 96, &pattern, paths, httpMethods); zephir_check_call_status(); ZVAL_LONG(&_0, position); ZEPHIR_CALL_METHOD(NULL, this_ptr, "attach", NULL, 0, &route, &_0); @@ -48805,7 +49345,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, handle) ZVAL_LONG(&_0, 5); - ZEPHIR_CALL_FUNCTION(&_1, "parse_url", NULL, 125, &uri, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "parse_url", NULL, 97, &uri, &_0); zephir_check_call_status(); zephir_get_strval(&uri, &_1); zephir_read_property(&_0, this_ptr, ZEND_STRL("removeExtraSlashes"), PH_NOISY_CC | PH_READONLY); @@ -49000,7 +49540,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_28$$35, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_29$$35); ZEPHIR_CONCAT_SV(&_29$$35, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_28$$35, "__construct", &_30, 31, &_29$$35); + ZEPHIR_CALL_METHOD(NULL, &_28$$35, "__construct", &_30, 29, &_29$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$35, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -49066,7 +49606,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_36$$46, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_37$$46); ZEPHIR_CONCAT_SV(&_37$$46, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_36$$46, "__construct", &_30, 31, &_37$$46); + ZEPHIR_CALL_METHOD(NULL, &_36$$46, "__construct", &_30, 29, &_37$$46); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$46, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -49278,7 +49818,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_63$$84, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_64$$84); ZEPHIR_CONCAT_SV(&_64$$84, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_63$$84, "__construct", &_30, 31, &_64$$84); + ZEPHIR_CALL_METHOD(NULL, &_63$$84, "__construct", &_30, 29, &_64$$84); zephir_check_call_status(); zephir_throw_exception_debug(&_63$$84, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -49344,7 +49884,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_70$$95, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_71$$95); ZEPHIR_CONCAT_SV(&_71$$95, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_70$$95, "__construct", &_30, 31, &_71$$95); + ZEPHIR_CALL_METHOD(NULL, &_70$$95, "__construct", &_30, 29, &_71$$95); zephir_check_call_status(); zephir_throw_exception_debug(&_70$$95, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -49812,6 +50352,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, setDefaultNamespace) static PHP_METHOD(Phalcon_Mvc_Router, setDefaults) { + zval _0$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *defaults_param = NULL, namespaceName, module, controller, action, params; zval defaults; @@ -49823,6 +50364,7 @@ static PHP_METHOD(Phalcon_Mvc_Router, setDefaults) ZVAL_UNDEF(&controller); ZVAL_UNDEF(&action); ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -49837,7 +50379,8 @@ static PHP_METHOD(Phalcon_Mvc_Router, setDefaults) if (zephir_array_isset_string_fetch(&namespaceName, &defaults, SL("namespace"), 1)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("defaultNamespace"), &namespaceName); + zephir_cast_to_string(&_0$$3, &namespaceName); + zephir_update_property_zval(this_ptr, ZEND_STRL("defaultNamespace"), &_0$$3); } if (zephir_array_isset_string_fetch(&module, &defaults, SL("module"), 1)) { zephir_update_property_zval(this_ptr, ZEND_STRL("defaultModule"), &module); @@ -50218,7 +50761,7 @@ static PHP_METHOD(Phalcon_Mvc_Url, get) object_init_ex(&_12$$14, phalcon_mvc_url_exception_ce); ZEPHIR_INIT_VAR(&_13$$14); ZEPHIR_CONCAT_SVS(&_13$$14, "Cannot obtain a route using the name '", &routeName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_12$$14, "__construct", NULL, 31, &_13$$14); + ZEPHIR_CALL_METHOD(NULL, &_12$$14, "__construct", NULL, 29, &_13$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$14, "phalcon/Mvc/Url.zep", 161); ZEPHIR_MM_RESTORE(); @@ -50241,11 +50784,11 @@ static PHP_METHOD(Phalcon_Mvc_Url, get) ZVAL_STRING(&_18$$15, "#(?= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -57602,13 +58145,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -57618,9 +58161,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -57646,10 +58191,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_2, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_2, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 813); return; @@ -57679,8 +58224,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasOneThrough, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasOneThrough, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); @@ -57688,8 +58234,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasOneThrough); @@ -57705,6 +58249,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(7, 8) @@ -57716,13 +58261,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -57741,9 +58286,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -57778,12 +58325,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 3); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 0, intermediateFields, &intermediateModel, intermediateReferencedFields); + ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 439, intermediateFields, &intermediateModel, intermediateReferencedFields); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 926); return; @@ -57813,15 +58360,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&relation); @@ -57835,6 +58381,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) ZVAL_UNDEF(&_3); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -57843,13 +58390,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -57859,9 +58406,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -57887,10 +58436,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_2, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_2, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1017); return; @@ -57920,15 +58469,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasMany, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasMany, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasMany); @@ -57942,6 +58490,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) ZVAL_UNDEF(&_2); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -57950,13 +58499,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -57966,9 +58515,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -57995,10 +58546,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1104); return; @@ -58028,8 +58579,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasManyToMany, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasManyToMany, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); @@ -58037,8 +58589,6 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasManyToMany); @@ -58054,6 +58604,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(7, 8) @@ -58065,13 +58616,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -58090,9 +58641,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -58127,12 +58680,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 0, intermediateFields, &intermediateModel, intermediateReferencedFields); + ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 439, intermediateFields, &intermediateModel, intermediateReferencedFields); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1217); return; @@ -58804,7 +59357,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SVSVSVSVS(&_4$$3, "[", &intermediateModel, "].[", &intermediateFields, "] = [", &referencedModel, "].[", &_3$$3, "]"); zephir_array_append(&joinConditions, &_4$$3, PH_SEPARATE, "phalcon/Mvc/Model/Manager.zep", 1452); - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 0, &extraParameters, parameters); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 440, &extraParameters, parameters); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&builder, this_ptr, "createbuilder", NULL, 0, &_5$$3); zephir_check_call_status(); @@ -58935,10 +59488,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) ZEPHIR_CALL_METHOD(&_32, record, "getdi", NULL, 0); zephir_check_call_status(); zephir_array_update_string(&findParams, SL("di"), &_32, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 0, &findParams, parameters); + ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 440, &findParams, parameters); zephir_check_call_status(); if (Z_TYPE_P(&extraParameters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 0, &extraParameters, &findArguments); + ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 440, &extraParameters, &findArguments); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&findParams, &findArguments); @@ -59096,7 +59649,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, hasBelongsTo) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "belongsTo"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -59145,7 +59698,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasMany) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasMany"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -59194,7 +59747,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasOne) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasOne"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -59243,7 +59796,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasOneThrough) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasOneThrough"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -59292,7 +59845,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasManyToMany) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasManyToMany"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -60678,7 +61231,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAttributes) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 102); @@ -60710,7 +61263,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticCreateAttributes) ZVAL_LONG(&_0, 10); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 129); @@ -60742,7 +61295,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticUpdateAttributes) ZVAL_LONG(&_0, 11); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 156); @@ -60774,7 +61327,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getBindTypes) ZVAL_LONG(&_0, 9); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 183); @@ -60807,7 +61360,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getColumnMap) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 26, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 24, model, &_0); zephir_check_call_status(); _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { @@ -60843,7 +61396,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDefaultValues) ZVAL_LONG(&_0, 12); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 231); @@ -60875,7 +61428,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypes) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 255); @@ -60907,7 +61460,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypesNumeric) ZVAL_LONG(&_0, 5); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 282); @@ -60960,7 +61513,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getEmptyStringAttributes) ZVAL_LONG(&_0, 13); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 327); @@ -60991,7 +61544,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getIdentityField) ZVAL_LONG(&_0, 8); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -61019,7 +61572,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNonPrimaryKeyAttributes) ZVAL_LONG(&_0, 2); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 367); @@ -61051,7 +61604,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNotNullAttributes) ZVAL_LONG(&_0, 3); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 391); @@ -61083,7 +61636,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getPrimaryKeyAttributes) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 415); @@ -61116,7 +61669,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, getReverseColumnMap) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 26, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 24, model, &_0); zephir_check_call_status(); _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { @@ -61188,7 +61741,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, hasAttribute) if (Z_TYPE_P(&columnMap) == IS_ARRAY) { RETURN_MM_BOOL(zephir_array_isset(&columnMap, &attribute)); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "readmetadata", NULL, 27, model); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "readmetadata", NULL, 25, model); zephir_check_call_status(); zephir_array_fetch_long(&_1, &_0, 4, PH_READONLY, "phalcon/Mvc/Model/MetaData.zep", 482); RETURN_MM_BOOL(zephir_array_isset(&_1, &attribute)); @@ -61281,7 +61834,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMap) ZVAL_NULL(&_1$$4); ZVAL_NULL(&_2$$4); ZVAL_NULL(&_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &_1$$4, &_2$$4, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_NVAR(&data); @@ -61330,7 +61883,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex) ZVAL_NULL(&_1$$4); ZVAL_NULL(&_2$$4); ZVAL_NULL(&_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &_1$$4, &_2$$4, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_NVAR(&columnMapModel); @@ -61380,7 +61933,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaData) zephir_get_strval(&key, &_1); zephir_read_property(&_2, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_2, &key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_read_property(&_3, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); @@ -61433,7 +61986,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaDataIndex) zephir_read_property(&_2, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_3, &_2, &key, PH_READONLY, "phalcon/Mvc/Model/MetaData.zep", 626); if (!(zephir_array_isset_long(&_3, index))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_read_property(&_4, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); @@ -61489,7 +62042,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticCreateAttributes) ZVAL_LONG(&_0, 10); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -61520,7 +62073,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticUpdateAttributes) ZVAL_LONG(&_0, 11); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -61551,7 +62104,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, setEmptyStringAttributes) ZVAL_LONG(&_0, 13); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -61644,7 +62197,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, write) ZEPHIR_CALL_METHOD(&result, &_0$$3, "set", NULL, 0, &key, &data); zephir_check_call_status_or_jump(try_end_1); if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 30, &option); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 28, &option); zephir_check_call_status_or_jump(try_end_1); } @@ -61658,7 +62211,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, write) if (zephir_is_instance_of(&_1, SL("Exception"))) { zend_clear_exception(); ZEPHIR_CPY_WRT(&_2, &_1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 30, &option); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 28, &option); zephir_check_call_status(); } } @@ -61720,7 +62273,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) zephir_get_strval(&key, &_3); zephir_read_property(&_4, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_4, &key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_update_property_array_multi(this_ptr, SL("metaData"), data, SL("zl"), 2, &key, index); @@ -61793,7 +62346,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, initialize) object_init_ex(&_2$$8, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3$$8); ZEPHIR_CONCAT_SV(&_3$$8, "Invalid meta-data for model ", &className); - ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", NULL, 31, &_3$$8); + ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", NULL, 29, &_3$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$8, "phalcon/Mvc/Model/MetaData.zep", 817); ZEPHIR_MM_RESTORE(); @@ -61873,7 +62426,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData, throwWriteException) if (zephir_is_true(option)) { ZEPHIR_INIT_VAR(&_0$$3); object_init_ex(&_0$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &message); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &message); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/Model/MetaData.zep", 901); ZEPHIR_MM_RESTORE(); @@ -62256,9 +62809,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, clean) static PHP_METHOD(Phalcon_Mvc_Model_Query, execute) { + zval _5$$8; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *bindParams_param = NULL, *bindTypes_param = NULL, uniqueRow, cacheOptions, key, cacheService, cache, result, preparedResult, defaultBindParams, mergedParams, defaultBindTypes, mergedTypes, type, lifetime, intermediate, _0, _1$$3, _2$$9, _3$$19, _4$$19; + zval *bindParams_param = NULL, *bindTypes_param = NULL, uniqueRow, cacheOptions, key, cacheService, cache, result, preparedResult, defaultBindParams, mergedParams, defaultBindTypes, mergedTypes, type, lifetime, intermediate, _0, _1$$3, _2$$3, _3$$3, _4$$8, _6$$9, _7$$19, _8$$19; zval bindParams, bindTypes; zval *this_ptr = getThis(); @@ -62280,9 +62834,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, execute) ZVAL_UNDEF(&intermediate); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$9); - ZVAL_UNDEF(&_3$$19); - ZVAL_UNDEF(&_4$$19); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_7$$19); + ZVAL_UNDEF(&_8$$19); + ZVAL_UNDEF(&_5$$8); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) @@ -62315,12 +62873,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, execute) ZEPHIR_CPY_WRT(&cacheOptions, &_0); if (Z_TYPE_P(&cacheOptions) != IS_NULL) { if (UNEXPECTED(Z_TYPE_P(&cacheOptions) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid caching options", "phalcon/Mvc/Model/Query.zep", 275); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid caching options", "phalcon/Mvc/Model/Query.zep", 274); return; } ZEPHIR_OBS_VAR(&key); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&key, &cacheOptions, SL("key"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A cache key must be provided to identify the cached resultset in the cache backend", "phalcon/Mvc/Model/Query.zep", 284); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A cache key must be provided to identify the cached resultset in the cache backend", "phalcon/Mvc/Model/Query.zep", 283); return; } ZEPHIR_OBS_VAR(&lifetime); @@ -62336,19 +62894,30 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, execute) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&cache, &_1$$3, "getshared", NULL, 0, &cacheService); zephir_check_call_status(); - if (UNEXPECTED(!((zephir_is_instance_of(&cache, SL("Psr\\SimpleCache\\CacheInterface")))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache service must be an object implementing Psr\\SimpleCache\\CacheInterface", "phalcon/Mvc/Model/Query.zep", 301); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$3, "is_a", NULL, 83, &cache, &_2$$3); + zephir_check_call_status(); + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3))) { + ZEPHIR_INIT_VAR(&_4$$8); + object_init_ex(&_4$$8, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_5$$8); + ZEPHIR_CONCAT_SS(&_5$$8, "Cache service must be an object implementing ", "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_METHOD(NULL, &_4$$8, "__construct", NULL, 29, &_5$$8); + zephir_check_call_status(); + zephir_throw_exception_debug(&_4$$8, "phalcon/Mvc/Model/Query.zep", 303); + ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_METHOD(&result, &cache, "get", NULL, 0, &key); zephir_check_call_status(); if (!(ZEPHIR_IS_EMPTY(&result))) { if (UNEXPECTED(Z_TYPE_P(&result) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache didn't return a valid resultset", "phalcon/Mvc/Model/Query.zep", 310); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache didn't return a valid resultset", "phalcon/Mvc/Model/Query.zep", 312); return; } - ZVAL_BOOL(&_2$$9, 0); - ZEPHIR_CALL_METHOD(NULL, &result, "setisfresh", NULL, 0, &_2$$9); + ZVAL_BOOL(&_6$$9, 0); + ZEPHIR_CALL_METHOD(NULL, &result, "setisfresh", NULL, 0, &_6$$9); zephir_check_call_status(); if (zephir_is_true(&uniqueRow)) { ZEPHIR_CALL_METHOD(&preparedResult, &result, "getfirst", NULL, 0); @@ -62378,39 +62947,39 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, execute) ZEPHIR_CPY_WRT(&type, &_0); do { if (ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeselect", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeselect", NULL, 443, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 306)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeinsert", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeinsert", NULL, 444, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 300)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeupdate", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeupdate", NULL, 445, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 303)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executedelete", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executedelete", NULL, 446, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - ZEPHIR_INIT_VAR(&_3$$19); - object_init_ex(&_3$$19, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(&_4$$19); - ZEPHIR_CONCAT_SV(&_4$$19, "Unknown statement ", &type); - ZEPHIR_CALL_METHOD(NULL, &_3$$19, "__construct", NULL, 31, &_4$$19); + ZEPHIR_INIT_VAR(&_7$$19); + object_init_ex(&_7$$19, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_8$$19); + ZEPHIR_CONCAT_SV(&_8$$19, "Unknown statement ", &type); + ZEPHIR_CALL_METHOD(NULL, &_7$$19, "__construct", NULL, 29, &_8$$19); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$19, "phalcon/Mvc/Model/Query.zep", 393); + zephir_throw_exception_debug(&_7$$19, "phalcon/Mvc/Model/Query.zep", 395); ZEPHIR_MM_RESTORE(); return; } while(0); if (Z_TYPE_P(&cacheOptions) != IS_NULL) { if (!ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only PHQL statements that return resultsets can be cached", "phalcon/Mvc/Model/Query.zep", 406); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only PHQL statements that return resultsets can be cached", "phalcon/Mvc/Model/Query.zep", 408); return; } ZEPHIR_CALL_METHOD(NULL, &cache, "set", NULL, 0, &key, &result, &lifetime); @@ -62553,11 +63122,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSql) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("bindTypes"), PH_NOISY_CC | PH_READONLY); ZVAL_BOOL(&_3$$3, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "executeselect", NULL, 0, &intermediate, &_1$$3, &_2$$3, &_3$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "executeselect", NULL, 443, &intermediate, &_1$$3, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "This type of statement generates multiple SQL statements", "phalcon/Mvc/Model/Query.zep", 512); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "This type of statement generates multiple SQL statements", "phalcon/Mvc/Model/Query.zep", 514); return; } @@ -62622,7 +63191,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, parse) zephir_read_static_property_ce(&_2$$5, phalcon_mvc_model_query_ce, SL("internalPhqlCache"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset_fetch(&irPhql, &_2$$5, &uniqueId, 0)) { if (Z_TYPE_P(&irPhql) == IS_ARRAY) { - zephir_array_fetch_string(&_3$$7, &ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 565); + zephir_array_fetch_string(&_3$$7, &ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 567); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_3$$7); RETURN_CCTOR(&irPhql); } @@ -62634,22 +63203,22 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, parse) zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type); do { if (ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 447); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 306)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 448); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 300)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 449); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 303)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 450); zephir_check_call_status(); break; } @@ -62657,9 +63226,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, parse) object_init_ex(&_4$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_5$$13); ZEPHIR_CONCAT_SVSV(&_5$$13, "Unknown statement ", &type, ", when preparing: ", &phql); - ZEPHIR_CALL_METHOD(NULL, &_4$$13, "__construct", NULL, 31, &_5$$13); + ZEPHIR_CALL_METHOD(NULL, &_4$$13, "__construct", NULL, 29, &_5$$13); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$13, "phalcon/Mvc/Model/Query.zep", 599); + zephir_throw_exception_debug(&_4$$13, "phalcon/Mvc/Model/Query.zep", 601); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -62667,7 +63236,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, parse) } } if (UNEXPECTED(Z_TYPE_P(&irPhql) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted AST", "phalcon/Mvc/Model/Query.zep", 605); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted AST", "phalcon/Mvc/Model/Query.zep", 607); return; } if (Z_TYPE_P(&uniqueId) == IS_LONG) { @@ -62793,7 +63362,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) ZEPHIR_CALL_METHOD(&manager, container, "getshared", NULL, 0, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&manager) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsManager' is invalid", "phalcon/Mvc/Model/Query.zep", 669); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsManager' is invalid", "phalcon/Mvc/Model/Query.zep", 671); return; } ZEPHIR_INIT_NVAR(&_0); @@ -62801,7 +63370,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) ZEPHIR_CALL_METHOD(&metaData, container, "getshared", NULL, 0, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&metaData) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsMetaData' is invalid", "phalcon/Mvc/Model/Query.zep", 675); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsMetaData' is invalid", "phalcon/Mvc/Model/Query.zep", 677); return; } zephir_update_property_zval(this_ptr, ZEND_STRL("manager"), &manager); @@ -62985,13 +63554,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 743); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 745); if (UNEXPECTED(zephir_array_isset_long(&models, 1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Delete from several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Delete from several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 750); return; } ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 751); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 753); ZEPHIR_OBS_VAR(&model); zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0))) { @@ -62999,12 +63568,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) ZEPHIR_CALL_METHOD(&model, &_1$$4, "load", NULL, 0, &modelName); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 0, &model, &intermediate, &bindParams, &bindTypes); + ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 451, &model, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (!(zephir_fast_count_int(&records))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_2$$5, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_2$$5); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_2$$5); zephir_check_call_status(); RETURN_MM(); } @@ -63029,7 +63598,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_7$$7, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_7$$7, &record); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_7$$7, &record); zephir_check_call_status(); RETURN_MM(); } @@ -63040,7 +63609,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_9, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_9); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_9); zephir_check_call_status(); RETURN_MM(); } @@ -63119,7 +63688,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &intermediate, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 832); + zephir_array_fetch_string(&modelName, &intermediate, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 834); zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&model); @@ -63148,16 +63717,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) } } ZEPHIR_OBS_VAR(&values); - zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 867); + zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 869); if (UNEXPECTED(zephir_fast_count_int(&fields) != zephir_fast_count_int(&values))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The column count does not match the values count", "phalcon/Mvc/Model/Query.zep", 876); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The column count does not match the values count", "phalcon/Mvc/Model/Query.zep", 878); return; } ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&insertValues); array_init(&insertValues); - zephir_is_iterable(&values, 0, "phalcon/Mvc/Model/Query.zep", 947); + zephir_is_iterable(&values, 0, "phalcon/Mvc/Model/Query.zep", 949); if (Z_TYPE_P(&values) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _4, _5, _2) { @@ -63170,8 +63739,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _2); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 886); - zephir_array_fetch_string(&_6$$8, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&_6$$8, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 890); do { if (ZEPHIR_IS_LONG(&_6$$8, 260) || ZEPHIR_IS_LONG(&_6$$8, 258) || ZEPHIR_IS_LONG(&_6$$8, 259)) { ZEPHIR_CALL_METHOD(&insertValue, &dialect, "getsqlexpression", &_7, 0, &exprValue); @@ -63198,9 +63767,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_12$$12, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$12); ZEPHIR_CONCAT_SVS(&_13$$12, "Bound parameter '", &wildcard, "' cannot be replaced because it isn't in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 31, &_13$$12); + ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 29, &_13$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$12, "phalcon/Mvc/Model/Query.zep", 912); + zephir_throw_exception_debug(&_12$$12, "phalcon/Mvc/Model/Query.zep", 914); ZEPHIR_MM_RESTORE(); return; } @@ -63210,13 +63779,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&insertValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_15$$13, &dialect, "getsqlexpression", &_16, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 34, &_15$$13); + ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 32, &_15$$13); zephir_check_call_status(); break; } while(0); ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 925); + zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 927); _18$$8 = automaticFields; if (_18$$8) { _18$$8 = Z_TYPE_P(&columnMap) == IS_ARRAY; @@ -63228,9 +63797,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_19$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$15); ZEPHIR_CONCAT_SVS(&_20$$15, "Column '", &fieldName, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_19$$15, "__construct", &_14, 31, &_20$$15); + ZEPHIR_CALL_METHOD(NULL, &_19$$15, "__construct", &_14, 29, &_20$$15); zephir_check_call_status(); - zephir_throw_exception_debug(&_19$$15, "phalcon/Mvc/Model/Query.zep", 935); + zephir_throw_exception_debug(&_19$$15, "phalcon/Mvc/Model/Query.zep", 937); ZEPHIR_MM_RESTORE(); return; } @@ -63253,8 +63822,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_CALL_METHOD(&value, &values, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 886); - zephir_array_fetch_string(&_21$$17, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&_21$$17, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 890); do { if (ZEPHIR_IS_LONG(&_21$$17, 260) || ZEPHIR_IS_LONG(&_21$$17, 258) || ZEPHIR_IS_LONG(&_21$$17, 259)) { ZEPHIR_CALL_METHOD(&insertValue, &dialect, "getsqlexpression", &_22, 0, &exprValue); @@ -63281,9 +63850,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_27$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_28$$21); ZEPHIR_CONCAT_SVS(&_28$$21, "Bound parameter '", &wildcard, "' cannot be replaced because it isn't in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_27$$21, "__construct", &_14, 31, &_28$$21); + ZEPHIR_CALL_METHOD(NULL, &_27$$21, "__construct", &_14, 29, &_28$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_27$$21, "phalcon/Mvc/Model/Query.zep", 912); + zephir_throw_exception_debug(&_27$$21, "phalcon/Mvc/Model/Query.zep", 914); ZEPHIR_MM_RESTORE(); return; } @@ -63293,13 +63862,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&insertValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_29$$22, &dialect, "getsqlexpression", &_30, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 34, &_29$$22); + ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 32, &_29$$22); zephir_check_call_status(); break; } while(0); ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 925); + zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 927); _31$$17 = automaticFields; if (_31$$17) { _31$$17 = Z_TYPE_P(&columnMap) == IS_ARRAY; @@ -63311,9 +63880,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_32$$24, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_33$$24); ZEPHIR_CONCAT_SVS(&_33$$24, "Column '", &fieldName, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_32$$24, "__construct", &_14, 31, &_33$$24); + ZEPHIR_CALL_METHOD(NULL, &_32$$24, "__construct", &_14, 29, &_33$$24); zephir_check_call_status(); - zephir_throw_exception_debug(&_32$$24, "phalcon/Mvc/Model/Query.zep", 935); + zephir_throw_exception_debug(&_32$$24, "phalcon/Mvc/Model/Query.zep", 937); ZEPHIR_MM_RESTORE(); return; } @@ -63334,7 +63903,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZEPHIR_CALL_METHOD(&_34, &insertModel, "create", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_34, &insertModel); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_34, &insertModel); zephir_check_call_status(); RETURN_MM(); } @@ -63486,8 +64055,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_VAR(&connectionTypes); array_init(&connectionTypes); ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 984); - zephir_is_iterable(&models, 0, "phalcon/Mvc/Model/Query.zep", 1012); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 986); + zephir_is_iterable(&models, 0, "phalcon/Mvc/Model/Query.zep", 1014); if (Z_TYPE_P(&models) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&models), _1) { @@ -63507,7 +64076,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_check_call_status(); zephir_array_update_zval(&connectionTypes, &_6$$5, &__$true, PH_COPY | PH_SEPARATE); if (UNEXPECTED(zephir_fast_count_int(&connectionTypes) == 2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1007); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1009); return; } } @@ -63537,7 +64106,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_check_call_status(); zephir_array_update_zval(&connectionTypes, &_9$$9, &__$true, PH_COPY | PH_SEPARATE); if (UNEXPECTED(zephir_fast_count_int(&connectionTypes) == 2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1007); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1009); return; } } @@ -63547,23 +64116,23 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) } ZEPHIR_INIT_NVAR(&modelName); ZEPHIR_OBS_VAR(&columns); - zephir_array_fetch_string(&columns, &intermediate, SL("columns"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1012); + zephir_array_fetch_string(&columns, &intermediate, SL("columns"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1014); haveObjects = 0; haveScalars = 0; isComplex = 0; numberObjects = 0; ZEPHIR_CPY_WRT(&columns1, &columns); - zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1040); + zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1042); if (Z_TYPE_P(&columns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _10) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _10); if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1024); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1026); return; } - zephir_array_fetch_string(&_12$$11, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1027); + zephir_array_fetch_string(&_12$$11, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1029); if (ZEPHIR_IS_STRING(&_12$$11, "scalar")) { if (!(zephir_array_isset_string(&column, SL("balias")))) { isComplex = 1; @@ -63586,10 +64155,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1024); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1026); return; } - zephir_array_fetch_string(&_13$$16, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1027); + zephir_array_fetch_string(&_13$$16, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1029); if (ZEPHIR_IS_STRING(&_13$$16, "scalar")) { if (!(zephir_array_isset_string(&column, SL("balias")))) { isComplex = 1; @@ -63627,7 +64196,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) array_init(&simpleColumnMap); zephir_read_property(&_0, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&metaData, &_0); - zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1146); + zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1148); if (Z_TYPE_P(&columns) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _16, _17, _14) { @@ -63640,11 +64209,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _14); ZEPHIR_OBS_NVAR(&sqlColumn); - zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1063); - zephir_array_fetch_string(&_18$$28, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1066); + zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1065); + zephir_array_fetch_string(&_18$$28, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1068); if (ZEPHIR_IS_STRING(&_18$$28, "object")) { ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1067); + zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1069); ZEPHIR_OBS_NVAR(&instance); zephir_read_property(&_19$$29, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&instance, &_19$$29, &modelName, 0))) { @@ -63662,7 +64231,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&columnMap); ZVAL_NULL(&columnMap); } - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1103); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1105); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _23$$31) { @@ -63675,7 +64244,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_26$$34); ZEPHIR_CONCAT_SVSV(&_26$$34, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_25$$34, &_26$$34); - zephir_array_append(&selectColumns, &_25$$34, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_25$$34, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -63695,7 +64264,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_28$$35); ZEPHIR_CONCAT_SVSV(&_28$$35, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_27$$35, &_28$$35); - zephir_array_append(&selectColumns, &_27$$35, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_27$$35, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -63713,7 +64282,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_update_multi(&columns1, &_31$$36, SL("zs"), 3, &aliasCopy, SL("keepSnapshots")); } } else { - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1120); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1122); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _32$$37) { @@ -63723,7 +64292,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_34$$38, 2, 0); zephir_array_fast_append(&_34$$38, &attribute); zephir_array_fast_append(&_34$$38, &sqlColumn); - zephir_array_append(&selectColumns, &_34$$38, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_34$$38, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -63740,7 +64309,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_35$$39, 2, 0); zephir_array_fast_append(&_35$$39, &attribute); zephir_array_fast_append(&_35$$39, &sqlColumn); - zephir_array_append(&selectColumns, &_35$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_35$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -63763,7 +64332,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_fast_append(&_37$$42, &aliasCopy); ZEPHIR_CPY_WRT(&columnAlias, &_37$$42); } - zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1131); + zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1133); } _38$$28 = !isComplex; if (_38$$28) { @@ -63792,11 +64361,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sqlColumn); - zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1063); - zephir_array_fetch_string(&_39$$46, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1066); + zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1065); + zephir_array_fetch_string(&_39$$46, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1068); if (ZEPHIR_IS_STRING(&_39$$46, "object")) { ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1067); + zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1069); ZEPHIR_OBS_NVAR(&instance); zephir_read_property(&_40$$47, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&instance, &_40$$47, &modelName, 0))) { @@ -63814,7 +64383,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&columnMap); ZVAL_NULL(&columnMap); } - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1103); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1105); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _44$$49) { @@ -63827,7 +64396,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_47$$52); ZEPHIR_CONCAT_SVSV(&_47$$52, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_46$$52, &_47$$52); - zephir_array_append(&selectColumns, &_46$$52, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_46$$52, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -63847,7 +64416,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_49$$53); ZEPHIR_CONCAT_SVSV(&_49$$53, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_48$$53, &_49$$53); - zephir_array_append(&selectColumns, &_48$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_48$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -63865,7 +64434,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_update_multi(&columns1, &_52$$54, SL("zs"), 3, &aliasCopy, SL("keepSnapshots")); } } else { - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1120); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1122); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _53$$55) { @@ -63875,7 +64444,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_55$$56, 2, 0); zephir_array_fast_append(&_55$$56, &attribute); zephir_array_fast_append(&_55$$56, &sqlColumn); - zephir_array_append(&selectColumns, &_55$$56, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_55$$56, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -63892,7 +64461,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_56$$57, 2, 0); zephir_array_fast_append(&_56$$57, &attribute); zephir_array_fast_append(&_56$$57, &sqlColumn); - zephir_array_append(&selectColumns, &_56$$57, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_56$$57, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -63914,7 +64483,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_fast_append(&_58$$60, &aliasCopy); ZEPHIR_CPY_WRT(&columnAlias, &_58$$60); } - zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1131); + zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1133); } _59$$46 = !isComplex; if (_59$$46) { @@ -63939,7 +64508,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_VAR(&bindCounts); array_init(&bindCounts); zephir_array_update_string(&intermediate, SL("columns"), &selectColumns, PH_COPY | PH_SEPARATE); - zephir_is_iterable(&bindParams, 0, "phalcon/Mvc/Model/Query.zep", 1167); + zephir_is_iterable(&bindParams, 0, "phalcon/Mvc/Model/Query.zep", 1169); if (Z_TYPE_P(&bindParams) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&bindParams), _62, _63, _60) { @@ -63997,7 +64566,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&wildcard); ZEPHIR_INIT_VAR(&processedTypes); array_init(&processedTypes); - zephir_is_iterable(&bindTypes, 0, "phalcon/Mvc/Model/Query.zep", 1180); + zephir_is_iterable(&bindTypes, 0, "phalcon/Mvc/Model/Query.zep", 1182); if (Z_TYPE_P(&bindTypes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&bindTypes), _68, _69, _66) { @@ -64102,7 +64671,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) array_init(&simpleColumnMap); ZEPHIR_CALL_METHOD(&_74$$90, &metaData, "getattributes", NULL, 0, &resultObject); zephir_check_call_status(); - zephir_is_iterable(&_74$$90, 0, "phalcon/Mvc/Model/Query.zep", 1268); + zephir_is_iterable(&_74$$90, 0, "phalcon/Mvc/Model/Query.zep", 1270); if (Z_TYPE_P(&_74$$90) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_74$$90), _75$$90) { @@ -64112,7 +64681,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_77$$91, 2, 0); zephir_array_fast_append(&_77$$91, &attribute); ZEPHIR_OBS_NVAR(&_78$$91); - zephir_array_fetch(&_78$$91, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1266); + zephir_array_fetch(&_78$$91, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1268); zephir_array_fast_append(&_77$$91, &_78$$91); zephir_array_update_zval(&simpleColumnMap, &attribute, &_77$$91, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -64131,7 +64700,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_79$$92, 2, 0); zephir_array_fast_append(&_79$$92, &attribute); ZEPHIR_OBS_NVAR(&_80$$92); - zephir_array_fetch(&_80$$92, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1266); + zephir_array_fetch(&_80$$92, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1268); zephir_array_fast_append(&_79$$92, &_80$$92); zephir_array_update_zval(&simpleColumnMap, &attribute, &_79$$92, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &_74$$90, "next", NULL, 0); @@ -64141,7 +64710,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&attribute); } else { array_init(&simpleColumnMap); - zephir_is_iterable(&columnMap, 0, "phalcon/Mvc/Model/Query.zep", 1277); + zephir_is_iterable(&columnMap, 0, "phalcon/Mvc/Model/Query.zep", 1279); if (Z_TYPE_P(&columnMap) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columnMap), _83$$93, _84$$93, _81$$93) { @@ -64157,7 +64726,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_85$$94, 2, 0); zephir_array_fast_append(&_85$$94, &attribute); ZEPHIR_OBS_NVAR(&_86$$94); - zephir_array_fetch(&_86$$94, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1275); + zephir_array_fetch(&_86$$94, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1277); zephir_array_fast_append(&_85$$94, &_86$$94); zephir_array_update_zval(&simpleColumnMap, &column, &_85$$94, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -64178,7 +64747,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_87$$95, 2, 0); zephir_array_fast_append(&_87$$95, &attribute); ZEPHIR_OBS_NVAR(&_88$$95); - zephir_array_fetch(&_88$$95, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1275); + zephir_array_fetch(&_88$$95, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1277); zephir_array_fast_append(&_87$$95, &_88$$95); zephir_array_update_zval(&simpleColumnMap, &column, &_87$$95, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &columnMap, "next", NULL, 0); @@ -64206,24 +64775,24 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) object_init_ex(&_91$$98, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_92$$98); ZEPHIR_CONCAT_SVS(&_92$$98, "Resultset class \"", &resultsetClassName, "\" not found"); - ZEPHIR_CALL_METHOD(NULL, &_91$$98, "__construct", NULL, 31, &_92$$98); + ZEPHIR_CALL_METHOD(NULL, &_91$$98, "__construct", NULL, 29, &_92$$98); zephir_check_call_status(); - zephir_throw_exception_debug(&_91$$98, "phalcon/Mvc/Model/Query.zep", 1293); + zephir_throw_exception_debug(&_91$$98, "phalcon/Mvc/Model/Query.zep", 1295); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_INIT_VAR(&_93$$97); ZVAL_STRING(&_93$$97, "Phalcon\\Mvc\\Model\\ResultsetInterface"); - ZEPHIR_CALL_FUNCTION(&_94$$97, "is_subclass_of", NULL, 0, &resultsetClassName, &_93$$97); + ZEPHIR_CALL_FUNCTION(&_94$$97, "is_subclass_of", NULL, 435, &resultsetClassName, &_93$$97); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_94$$97))) { ZEPHIR_INIT_VAR(&_95$$99); object_init_ex(&_95$$99, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_96$$99); ZEPHIR_CONCAT_SVS(&_96$$99, "Resultset class \"", &resultsetClassName, "\" must be an implementation of Phalcon\\Mvc\\Model\\ResultsetInterface"); - ZEPHIR_CALL_METHOD(NULL, &_95$$99, "__construct", NULL, 31, &_96$$99); + ZEPHIR_CALL_METHOD(NULL, &_95$$99, "__construct", NULL, 29, &_96$$99); zephir_check_call_status(); - zephir_throw_exception_debug(&_95$$99, "phalcon/Mvc/Model/Query.zep", 1299); + zephir_throw_exception_debug(&_95$$99, "phalcon/Mvc/Model/Query.zep", 1301); ZEPHIR_MM_RESTORE(); return; } @@ -64247,12 +64816,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) } else { ZVAL_BOOL(&_98$$83, 0); } - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &simpleColumnMap, &resultObject, &resultData, &cache, &_98$$83); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 453, &simpleColumnMap, &resultObject, &resultData, &cache, &_98$$83); zephir_check_call_status(); RETURN_MM(); } object_init_ex(return_value, phalcon_mvc_model_resultset_complex_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &columns1, &resultData, &cache); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 454, &columns1, &resultData, &cache); zephir_check_call_status(); RETURN_MM(); } @@ -64330,13 +64899,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1347); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1349); if (UNEXPECTED(zephir_array_isset_long(&models, 1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Updating several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 1352); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Updating several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 1354); return; } ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1355); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1357); ZEPHIR_OBS_VAR(&model); zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0))) { @@ -64349,14 +64918,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_VAR(&fields); - zephir_array_fetch_string(&fields, &intermediate, SL("fields"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1374); + zephir_array_fetch_string(&fields, &intermediate, SL("fields"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1376); ZEPHIR_OBS_VAR(&values); - zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1375); + zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1377); ZEPHIR_INIT_VAR(&updateValues); array_init(&updateValues); ZEPHIR_CPY_WRT(&selectBindParams, &bindParams); ZEPHIR_CPY_WRT(&selectBindTypes, &bindTypes); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 1447); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 1449); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _4, _5, _2) { @@ -64369,17 +64938,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_INIT_NVAR(&field); ZVAL_COPY(&field, _2); ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1390); + zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1392); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1391); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1393); if (zephir_array_isset_string(&field, SL("balias"))) { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1394); + zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); } else { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); + zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1398); } - zephir_array_fetch_string(&_6$$5, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1399); + zephir_array_fetch_string(&_6$$5, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1401); do { if (ZEPHIR_IS_LONG(&_6$$5, 260) || ZEPHIR_IS_LONG(&_6$$5, 258) || ZEPHIR_IS_LONG(&_6$$5, 259)) { ZEPHIR_CALL_METHOD(&updateValue, &dialect, "getsqlexpression", &_7, 0, &exprValue); @@ -64406,9 +64975,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) object_init_ex(&_12$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$11); ZEPHIR_CONCAT_SVS(&_13$$11, "Bound parameter '", &wildcard, "' cannot be replaced because it's not in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", &_14, 31, &_13$$11); + ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", &_14, 29, &_13$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 1422); + zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 1424); ZEPHIR_MM_RESTORE(); return; } @@ -64417,14 +64986,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) break; } if (ZEPHIR_IS_LONG(&_6$$5, 277)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1431); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1433); return; } ZEPHIR_INIT_NVAR(&updateValue); object_init_ex(&updateValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_15$$13, &dialect, "getsqlexpression", &_16, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 34, &_15$$13); + ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 32, &_15$$13); zephir_check_call_status(); break; } while(0); @@ -64445,17 +65014,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1390); + zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1392); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1391); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1393); if (zephir_array_isset_string(&field, SL("balias"))) { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1394); + zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); } else { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); + zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1398); } - zephir_array_fetch_string(&_18$$14, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1399); + zephir_array_fetch_string(&_18$$14, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1401); do { if (ZEPHIR_IS_LONG(&_18$$14, 260) || ZEPHIR_IS_LONG(&_18$$14, 258) || ZEPHIR_IS_LONG(&_18$$14, 259)) { ZEPHIR_CALL_METHOD(&updateValue, &dialect, "getsqlexpression", &_19, 0, &exprValue); @@ -64482,9 +65051,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) object_init_ex(&_24$$20, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_25$$20); ZEPHIR_CONCAT_SVS(&_25$$20, "Bound parameter '", &wildcard, "' cannot be replaced because it's not in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_24$$20, "__construct", &_14, 31, &_25$$20); + ZEPHIR_CALL_METHOD(NULL, &_24$$20, "__construct", &_14, 29, &_25$$20); zephir_check_call_status(); - zephir_throw_exception_debug(&_24$$20, "phalcon/Mvc/Model/Query.zep", 1422); + zephir_throw_exception_debug(&_24$$20, "phalcon/Mvc/Model/Query.zep", 1424); ZEPHIR_MM_RESTORE(); return; } @@ -64493,14 +65062,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) break; } if (ZEPHIR_IS_LONG(&_18$$14, 277)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1431); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1433); return; } ZEPHIR_INIT_NVAR(&updateValue); object_init_ex(&updateValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_26$$22, &dialect, "getsqlexpression", &_27, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 34, &_26$$22); + ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 32, &_26$$22); zephir_check_call_status(); break; } while(0); @@ -64512,12 +65081,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) } ZEPHIR_INIT_NVAR(&field); ZEPHIR_INIT_NVAR(&number); - ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 0, &model, &intermediate, &selectBindParams, &selectBindTypes); + ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 451, &model, &intermediate, &selectBindParams, &selectBindTypes); zephir_check_call_status(); if (!(zephir_fast_count_int(&records))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_28$$23, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_28$$23); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_28$$23); zephir_check_call_status(); RETURN_MM(); } @@ -64544,7 +65113,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_33$$25, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_33$$25, &record); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_33$$25, &record); zephir_check_call_status(); RETURN_MM(); } @@ -64555,7 +65124,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_35, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_35); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_35); zephir_check_call_status(); RETURN_MM(); } @@ -64583,13 +65152,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getCallArgument) ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); - zephir_array_fetch_string(&_0, &argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1509); + zephir_array_fetch_string(&_0, &argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1511); if (ZEPHIR_IS_LONG(&_0, 352)) { zephir_create_array(return_value, 1, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("all")); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getexpression", NULL, 0, &argument); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getexpression", NULL, 455, &argument); zephir_check_call_status(); RETURN_MM(); } @@ -64639,8 +65208,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_VAR(&whenClauses); array_init(&whenClauses); - zephir_array_fetch_string(&_0, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1527); - zephir_is_iterable(&_0, 0, "phalcon/Mvc/Model/Query.zep", 1542); + zephir_array_fetch_string(&_0, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1529); + zephir_is_iterable(&_0, 0, "phalcon/Mvc/Model/Query.zep", 1544); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) { @@ -64650,24 +65219,24 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&_3$$4); zephir_create_array(&_3$$4, 3, 0); add_assoc_stringl_ex(&_3$$4, SL("type"), SL("when")); - zephir_array_fetch_string(&_5$$4, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1531); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 0, &_5$$4); + zephir_array_fetch_string(&_5$$4, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1533); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 455, &_5$$4); zephir_check_call_status(); zephir_array_update_string(&_3$$4, SL("expr"), &_4$$4, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_7$$4, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1532); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 0, &_7$$4); + zephir_array_fetch_string(&_7$$4, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1534); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 455, &_7$$4); zephir_check_call_status(); zephir_array_update_string(&_3$$4, SL("then"), &_4$$4, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_3$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1533); + zephir_array_append(&whenClauses, &_3$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1535); } else { ZEPHIR_INIT_NVAR(&_8$$5); zephir_create_array(&_8$$5, 2, 0); add_assoc_stringl_ex(&_8$$5, SL("type"), SL("else")); - zephir_array_fetch_string(&_10$$5, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1537); - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "getexpression", &_6, 0, &_10$$5); + zephir_array_fetch_string(&_10$$5, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1539); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "getexpression", &_6, 455, &_10$$5); zephir_check_call_status(); zephir_array_update_string(&_8$$5, SL("expr"), &_9$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_8$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1538); + zephir_array_append(&whenClauses, &_8$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1540); } } ZEND_HASH_FOREACH_END(); } else { @@ -64685,24 +65254,24 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&_11$$7); zephir_create_array(&_11$$7, 3, 0); add_assoc_stringl_ex(&_11$$7, SL("type"), SL("when")); - zephir_array_fetch_string(&_13$$7, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1531); - ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 0, &_13$$7); + zephir_array_fetch_string(&_13$$7, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1533); + ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 455, &_13$$7); zephir_check_call_status(); zephir_array_update_string(&_11$$7, SL("expr"), &_12$$7, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_14$$7, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1532); - ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 0, &_14$$7); + zephir_array_fetch_string(&_14$$7, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1534); + ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 455, &_14$$7); zephir_check_call_status(); zephir_array_update_string(&_11$$7, SL("then"), &_12$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_11$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1533); + zephir_array_append(&whenClauses, &_11$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1535); } else { ZEPHIR_INIT_NVAR(&_15$$8); zephir_create_array(&_15$$8, 2, 0); add_assoc_stringl_ex(&_15$$8, SL("type"), SL("else")); - zephir_array_fetch_string(&_17$$8, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1537); - ZEPHIR_CALL_METHOD(&_16$$8, this_ptr, "getexpression", &_6, 0, &_17$$8); + zephir_array_fetch_string(&_17$$8, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1539); + ZEPHIR_CALL_METHOD(&_16$$8, this_ptr, "getexpression", &_6, 455, &_17$$8); zephir_check_call_status(); zephir_array_update_string(&_15$$8, SL("expr"), &_16$$8, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_15$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1538); + zephir_array_append(&whenClauses, &_15$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1540); } ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); zephir_check_call_status(); @@ -64711,8 +65280,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&whenExpr); zephir_create_array(return_value, 3, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("case")); - zephir_array_fetch_string(&_19, &expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1544); - ZEPHIR_CALL_METHOD(&_18, this_ptr, "getexpression", &_6, 0, &_19); + zephir_array_fetch_string(&_19, &expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1546); + ZEPHIR_CALL_METHOD(&_18, this_ptr, "getexpression", &_6, 455, &_19); zephir_check_call_status(); zephir_array_update_string(return_value, SL("expr"), &_18, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("when-clauses"), &whenClauses, PH_COPY | PH_SEPARATE); @@ -64868,7 +65437,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } else { ZVAL_BOOL(&_0$$5, 0); } - ZEPHIR_CALL_METHOD(&left, this_ptr, "getexpression", NULL, 0, &exprLeft, &_0$$5); + ZEPHIR_CALL_METHOD(&left, this_ptr, "getexpression", NULL, 455, &exprLeft, &_0$$5); zephir_check_call_status(); } ZEPHIR_OBS_VAR(&exprRight); @@ -64878,7 +65447,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } else { ZVAL_BOOL(&_1$$6, 0); } - ZEPHIR_CALL_METHOD(&right, this_ptr, "getexpression", NULL, 0, &exprRight, &_1$$6); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getexpression", NULL, 455, &exprRight, &_1$$6); zephir_check_call_status(); } } @@ -64963,7 +65532,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) break; } if (ZEPHIR_IS_LONG(&exprType, 355)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getqualified", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getqualified", NULL, 456, &expr); zephir_check_call_status(); break; } @@ -65059,7 +65628,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_18$$25, 2, 0); add_assoc_stringl_ex(&_18$$25, SL("type"), SL("literal")); ZEPHIR_OBS_VAR(&_19$$25); - zephir_array_fetch_string(&_19$$25, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1760); + zephir_array_fetch_string(&_19$$25, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1762); zephir_array_update_string(&_18$$25, SL("value"), &_19$$25, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_18$$25); break; @@ -65082,9 +65651,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } if (ZEPHIR_IS_LONG(&exprType, 260)) { ZEPHIR_OBS_VAR(&value); - zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1781); + zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1783); if (quoting) { - if (zephir_memnstr_str(&value, SL("'"), "phalcon/Mvc/Model/Query.zep", 1788)) { + if (zephir_memnstr_str(&value, SL("'"), "phalcon/Mvc/Model/Query.zep", 1790)) { ZEPHIR_INIT_VAR(&escapedValue); phalcon_orm_singlequotes(&escapedValue, &value); } else { @@ -65107,7 +65676,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_23$$33, 2, 0); add_assoc_stringl_ex(&_23$$33, SL("type"), SL("placeholder")); ZEPHIR_INIT_VAR(&_24$$33); - zephir_array_fetch_string(&_25$$33, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1809); + zephir_array_fetch_string(&_25$$33, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1811); ZEPHIR_INIT_VAR(&_26$$33); ZVAL_STRING(&_26$$33, "?"); ZEPHIR_INIT_VAR(&_27$$33); @@ -65121,7 +65690,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) ZEPHIR_INIT_VAR(&_28$$34); zephir_create_array(&_28$$34, 2, 0); add_assoc_stringl_ex(&_28$$34, SL("type"), SL("placeholder")); - zephir_array_fetch_string(&_29$$34, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1818); + zephir_array_fetch_string(&_29$$34, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1820); ZEPHIR_INIT_VAR(&_30$$34); ZEPHIR_CONCAT_SV(&_30$$34, ":", &_29$$34); zephir_array_update_string(&_28$$34, SL("value"), &_30$$34, PH_COPY | PH_SEPARATE); @@ -65130,14 +65699,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } if (ZEPHIR_IS_LONG(&exprType, 277)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1823); - if (zephir_memnstr_str(&value, SL(":"), "phalcon/Mvc/Model/Query.zep", 1825)) { + zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1825); + if (zephir_memnstr_str(&value, SL(":"), "phalcon/Mvc/Model/Query.zep", 1827)) { ZEPHIR_INIT_VAR(&valueParts); zephir_fast_explode_str(&valueParts, SL(":"), &value, LONG_MAX); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_long(&name, &valueParts, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1827); + zephir_array_fetch_long(&name, &valueParts, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1829); ZEPHIR_OBS_VAR(&bindType); - zephir_array_fetch_long(&bindType, &valueParts, 1, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1828); + zephir_array_fetch_long(&bindType, &valueParts, 1, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1830); do { if (ZEPHIR_IS_STRING(&bindType, "str")) { ZEPHIR_INIT_VAR(&_31$$37); @@ -65225,9 +65794,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_50$$44, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_51$$44); ZEPHIR_CONCAT_SV(&_51$$44, "Bind value is required for array type placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_50$$44, "__construct", NULL, 31, &_51$$44); + ZEPHIR_CALL_METHOD(NULL, &_50$$44, "__construct", NULL, 29, &_51$$44); zephir_check_call_status(); - zephir_throw_exception_debug(&_50$$44, "phalcon/Mvc/Model/Query.zep", 1898); + zephir_throw_exception_debug(&_50$$44, "phalcon/Mvc/Model/Query.zep", 1900); ZEPHIR_MM_RESTORE(); return; } @@ -65236,9 +65805,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_52$$45, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_53$$45); ZEPHIR_CONCAT_SV(&_53$$45, "Bind type requires an array in placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_52$$45, "__construct", NULL, 31, &_53$$45); + ZEPHIR_CALL_METHOD(NULL, &_52$$45, "__construct", NULL, 29, &_53$$45); zephir_check_call_status(); - zephir_throw_exception_debug(&_52$$45, "phalcon/Mvc/Model/Query.zep", 1904); + zephir_throw_exception_debug(&_52$$45, "phalcon/Mvc/Model/Query.zep", 1906); ZEPHIR_MM_RESTORE(); return; } @@ -65247,9 +65816,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_54$$46, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_55$$46); ZEPHIR_CONCAT_SV(&_55$$46, "At least one value must be bound in placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_54$$46, "__construct", NULL, 31, &_55$$46); + ZEPHIR_CALL_METHOD(NULL, &_54$$46, "__construct", NULL, 29, &_55$$46); zephir_check_call_status(); - zephir_throw_exception_debug(&_54$$46, "phalcon/Mvc/Model/Query.zep", 1910); + zephir_throw_exception_debug(&_54$$46, "phalcon/Mvc/Model/Query.zep", 1912); ZEPHIR_MM_RESTORE(); return; } @@ -65268,9 +65837,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_58$$47, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_59$$47); ZEPHIR_CONCAT_SV(&_59$$47, "Unknown bind type: ", &bindType); - ZEPHIR_CALL_METHOD(NULL, &_58$$47, "__construct", NULL, 31, &_59$$47); + ZEPHIR_CALL_METHOD(NULL, &_58$$47, "__construct", NULL, 29, &_59$$47); zephir_check_call_status(); - zephir_throw_exception_debug(&_58$$47, "phalcon/Mvc/Model/Query.zep", 1925); + zephir_throw_exception_debug(&_58$$47, "phalcon/Mvc/Model/Query.zep", 1927); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -65452,18 +66021,18 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_79$$66, 2, 0); add_assoc_stringl_ex(&_79$$66, SL("type"), SL("literal")); ZEPHIR_OBS_VAR(&_80$$66); - zephir_array_fetch_string(&_80$$66, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2101); + zephir_array_fetch_string(&_80$$66, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2103); zephir_array_update_string(&_79$$66, SL("value"), &_80$$66, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_79$$66); break; } if (ZEPHIR_IS_LONG(&exprType, 350)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getfunctioncall", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getfunctioncall", NULL, 457, &expr); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&exprType, 409)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getcaseexpression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getcaseexpression", NULL, 458, &expr); zephir_check_call_status(); break; } @@ -65472,7 +66041,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_81$$69, 2, 0); add_assoc_stringl_ex(&_81$$69, SL("type"), SL("select")); ZVAL_BOOL(&_83$$69, 1); - ZEPHIR_CALL_METHOD(&_82$$69, this_ptr, "_prepareselect", NULL, 0, &expr, &_83$$69); + ZEPHIR_CALL_METHOD(&_82$$69, this_ptr, "_prepareselect", NULL, 447, &expr, &_83$$69); zephir_check_call_status(); zephir_array_update_string(&_81$$69, SL("value"), &_82$$69, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_81$$69); @@ -65482,9 +66051,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_84$$70, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_85$$70); ZEPHIR_CONCAT_SV(&_85$$70, "Unknown expression type ", &exprType); - ZEPHIR_CALL_METHOD(NULL, &_84$$70, "__construct", NULL, 31, &_85$$70); + ZEPHIR_CALL_METHOD(NULL, &_84$$70, "__construct", NULL, 29, &_85$$70); zephir_check_call_status(); - zephir_throw_exception_debug(&_84$$70, "phalcon/Mvc/Model/Query.zep", 2124); + zephir_throw_exception_debug(&_84$$70, "phalcon/Mvc/Model/Query.zep", 2126); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -65492,22 +66061,22 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) RETURN_CCTOR(&exprReturn); } if (zephir_array_isset_string(&expr, SL("domain"))) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualified", NULL, 0, &expr); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualified", NULL, 456, &expr); zephir_check_call_status(); RETURN_MM(); } if (zephir_array_isset_long(&expr, 0)) { ZEPHIR_INIT_VAR(&listItems); array_init(&listItems); - zephir_is_iterable(&expr, 0, "phalcon/Mvc/Model/Query.zep", 2147); + zephir_is_iterable(&expr, 0, "phalcon/Mvc/Model/Query.zep", 2149); if (Z_TYPE_P(&expr) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&expr), _86$$72) { ZEPHIR_INIT_NVAR(&exprListItem); ZVAL_COPY(&exprListItem, _86$$72); - ZEPHIR_CALL_METHOD(&_88$$73, this_ptr, "getexpression", NULL, 0, &exprListItem); + ZEPHIR_CALL_METHOD(&_88$$73, this_ptr, "getexpression", NULL, 455, &exprListItem); zephir_check_call_status(); - zephir_array_append(&listItems, &_88$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2144); + zephir_array_append(&listItems, &_88$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2146); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &expr, "rewind", NULL, 0); @@ -65520,9 +66089,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } ZEPHIR_CALL_METHOD(&exprListItem, &expr, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_89$$74, this_ptr, "getexpression", NULL, 0, &exprListItem); + ZEPHIR_CALL_METHOD(&_89$$74, this_ptr, "getexpression", NULL, 455, &exprListItem); zephir_check_call_status(); - zephir_array_append(&listItems, &_89$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2144); + zephir_array_append(&listItems, &_89$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2146); ZEPHIR_CALL_METHOD(NULL, &expr, "next", NULL, 0); zephir_check_call_status(); } @@ -65533,7 +66102,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_array_fast_append(return_value, &listItems); RETURN_MM(); } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown expression", "phalcon/Mvc/Model/Query.zep", 2153); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown expression", "phalcon/Mvc/Model/Query.zep", 2155); return; } @@ -65582,15 +66151,15 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) if (zephir_array_isset_long(&arguments, 0)) { ZEPHIR_INIT_VAR(&functionArgs); array_init(&functionArgs); - zephir_is_iterable(&arguments, 0, "phalcon/Mvc/Model/Query.zep", 2179); + zephir_is_iterable(&arguments, 0, "phalcon/Mvc/Model/Query.zep", 2181); if (Z_TYPE_P(&arguments) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _0$$6) { ZEPHIR_INIT_NVAR(&argument); ZVAL_COPY(&argument, _0$$6); - ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcallargument", &_3, 0, &argument); + ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcallargument", &_3, 459, &argument); zephir_check_call_status(); - zephir_array_append(&functionArgs, &_2$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2177); + zephir_array_append(&functionArgs, &_2$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2179); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &arguments, "rewind", NULL, 0); @@ -65603,9 +66172,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) } ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "getcallargument", &_3, 0, &argument); + ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "getcallargument", &_3, 459, &argument); zephir_check_call_status(); - zephir_array_append(&functionArgs, &_4$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2177); + zephir_array_append(&functionArgs, &_4$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2179); ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0); zephir_check_call_status(); } @@ -65614,7 +66183,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) } else { ZEPHIR_INIT_VAR(&_5$$9); zephir_create_array(&_5$$9, 1, 0); - ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "getcallargument", &_3, 0, &arguments); + ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "getcallargument", &_3, 459, &arguments); zephir_check_call_status(); zephir_array_fast_append(&_5$$9, &_6$$9); ZEPHIR_CPY_WRT(&functionArgs, &_5$$9); @@ -65623,7 +66192,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 4, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_7$$10); - zephir_array_fetch_string(&_7$$10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2189); + zephir_array_fetch_string(&_7$$10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2191); zephir_array_update_string(return_value, SL("name"), &_7$$10, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_8$$10); @@ -65634,7 +66203,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 3, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_9$$11); - zephir_array_fetch_string(&_9$$11, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2196); + zephir_array_fetch_string(&_9$$11, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2198); zephir_array_update_string(return_value, SL("name"), &_9$$11, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); RETURN_MM(); @@ -65643,7 +66212,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 2, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_10); - zephir_array_fetch_string(&_10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2205); + zephir_array_fetch_string(&_10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2207); zephir_array_update_string(return_value, SL("name"), &_10, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -65681,15 +66250,15 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) if (zephir_array_isset_long(&group, 0)) { ZEPHIR_INIT_VAR(&groupParts); array_init(&groupParts); - zephir_is_iterable(&group, 0, "phalcon/Mvc/Model/Query.zep", 2225); + zephir_is_iterable(&group, 0, "phalcon/Mvc/Model/Query.zep", 2227); if (Z_TYPE_P(&group) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&group), _0$$3) { ZEPHIR_INIT_NVAR(&groupItem); ZVAL_COPY(&groupItem, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getexpression", &_3, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getexpression", &_3, 455, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupParts, &_2$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2223); + zephir_array_append(&groupParts, &_2$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2225); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &group, "rewind", NULL, 0); @@ -65702,9 +66271,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) } ZEPHIR_CALL_METHOD(&groupItem, &group, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getexpression", &_3, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getexpression", &_3, 455, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupParts, &_4$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2223); + zephir_array_append(&groupParts, &_4$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2225); ZEPHIR_CALL_METHOD(NULL, &group, "next", NULL, 0); zephir_check_call_status(); } @@ -65713,7 +66282,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) } else { ZEPHIR_INIT_VAR(&_5$$6); zephir_create_array(&_5$$6, 1, 0); - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getexpression", &_3, 0, &group); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getexpression", &_3, 455, &group); zephir_check_call_status(); zephir_array_fast_append(&_5$$6, &_6$$6); ZEPHIR_CPY_WRT(&groupParts, &_5$$6); @@ -65752,13 +66321,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getLimitClause) array_init(&limit); ZEPHIR_OBS_VAR(&number); if (zephir_array_isset_string_fetch(&number, &limitClause, SL("number"), 0)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getexpression", NULL, 0, &number); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getexpression", NULL, 455, &number); zephir_check_call_status(); zephir_array_update_string(&limit, SL("number"), &_0$$3, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&offset); if (zephir_array_isset_string_fetch(&offset, &limitClause, SL("offset"), 0)) { - ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getexpression", NULL, 0, &offset); + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getexpression", NULL, 455, &offset); zephir_check_call_status(); zephir_array_update_string(&limit, SL("offset"), &_1$$4, PH_COPY | PH_SEPARATE); } @@ -65797,10 +66366,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoin) ZEPHIR_OBS_VAR(&qualified); if (zephir_array_isset_string_fetch(&qualified, &join, SL("qualified"), 0)) { - zephir_array_fetch_string(&_0$$3, &qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2261); + zephir_array_fetch_string(&_0$$3, &qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2263); if (ZEPHIR_IS_LONG(&_0$$3, 355)) { ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &qualified, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2262); + zephir_array_fetch_string(&modelName, &qualified, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2264); ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -65815,7 +66384,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoin) RETURN_MM(); } } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2277); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2279); return; } @@ -65847,7 +66416,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoinType) ZEPHIR_OBS_VAR(&type); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&type, &join, SL("type"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2288); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2290); return; } do { @@ -65873,9 +66442,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoinType) zephir_read_property(&_1, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVSV(&_2, "Unknown join type ", &type, ", when preparing: ", &_1); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 31, &_2); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 29, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(&_0, "phalcon/Mvc/Model/Query.zep", 2310); + zephir_throw_exception_debug(&_0, "phalcon/Mvc/Model/Query.zep", 2312); ZEPHIR_MM_RESTORE(); return; } @@ -66045,7 +66614,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&tables); - zephir_array_fetch_string(&tables, &select, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2346); + zephir_array_fetch_string(&tables, &select, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2348); if (!(zephir_array_isset_long(&tables, 0))) { ZEPHIR_INIT_VAR(&selectTables); zephir_create_array(&selectTables, 1, 0); @@ -66054,7 +66623,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CPY_WRT(&selectTables, &tables); } ZEPHIR_OBS_VAR(&joins); - zephir_array_fetch_string(&joins, &select, SL("joins"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2354); + zephir_array_fetch_string(&joins, &select, SL("joins"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2356); if (!(zephir_array_isset_long(&joins, 0))) { ZEPHIR_INIT_VAR(&selectJoins); zephir_create_array(&selectJoins, 1, 0); @@ -66062,45 +66631,45 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } else { ZEPHIR_CPY_WRT(&selectJoins, &joins); } - zephir_is_iterable(&selectJoins, 0, "phalcon/Mvc/Model/Query.zep", 2505); + zephir_is_iterable(&selectJoins, 0, "phalcon/Mvc/Model/Query.zep", 2507); if (Z_TYPE_P(&selectJoins) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectJoins), _1) { ZEPHIR_INIT_NVAR(&joinItem); ZVAL_COPY(&joinItem, _1); - ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 0, &manager, &joinItem); + ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 460, &manager, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&source); - zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2368); + zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); ZEPHIR_OBS_NVAR(&schema); - zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2369); + zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); ZEPHIR_OBS_NVAR(&model); - zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); + zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2372); ZEPHIR_OBS_NVAR(&realModelName); - zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); + zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2373); ZEPHIR_INIT_NVAR(&completeSource); zephir_create_array(&completeSource, 2, 0); zephir_array_fast_append(&completeSource, &source); zephir_array_fast_append(&completeSource, &schema); - ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 0, &joinItem); + ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 461, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&aliasExpr); if (zephir_array_isset_string_fetch(&aliasExpr, &joinItem, SL("alias"), 0)) { ZEPHIR_OBS_NVAR(&alias); - zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2383); + zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2385); if (UNEXPECTED(zephir_array_isset(&joinModels, &alias))) { ZEPHIR_INIT_NVAR(&_5$$9); object_init_ex(&_5$$9, phalcon_mvc_model_exception_ce); zephir_read_property(&_6$$9, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$9); ZEPHIR_CONCAT_SVSV(&_7$$9, "Cannot use '", &alias, "' as join alias because it was already used, when preparing: ", &_6$$9); - ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_8, 31, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_8, 29, &_7$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model/Query.zep", 2391); + zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model/Query.zep", 2393); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2397); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2399); zephir_array_update_zval(&joinTypes, &alias, &joinType, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&joinModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); @@ -66117,9 +66686,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_10$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$11); ZEPHIR_CONCAT_SVSV(&_11$$11, "Cannot use '", &realModelName, "' as join alias because it was already used, when preparing: ", &_10$$11); - ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 31, &_11$$11); + ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 29, &_11$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model/Query.zep", 2450); + zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model/Query.zep", 2452); ZEPHIR_MM_RESTORE(); return; } @@ -66146,40 +66715,40 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&joinItem, &selectJoins, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 0, &manager, &joinItem); + ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 460, &manager, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&source); - zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2368); + zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); ZEPHIR_OBS_NVAR(&schema); - zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2369); + zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); ZEPHIR_OBS_NVAR(&model); - zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); + zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2372); ZEPHIR_OBS_NVAR(&realModelName); - zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); + zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2373); ZEPHIR_INIT_NVAR(&_12$$12); zephir_create_array(&_12$$12, 2, 0); zephir_array_fast_append(&_12$$12, &source); zephir_array_fast_append(&_12$$12, &schema); ZEPHIR_CPY_WRT(&completeSource, &_12$$12); - ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 0, &joinItem); + ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 461, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&aliasExpr); if (zephir_array_isset_string_fetch(&aliasExpr, &joinItem, SL("alias"), 0)) { ZEPHIR_OBS_NVAR(&alias); - zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2383); + zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2385); if (UNEXPECTED(zephir_array_isset(&joinModels, &alias))) { ZEPHIR_INIT_NVAR(&_13$$14); object_init_ex(&_13$$14, phalcon_mvc_model_exception_ce); zephir_read_property(&_14$$14, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_15$$14); ZEPHIR_CONCAT_SVSV(&_15$$14, "Cannot use '", &alias, "' as join alias because it was already used, when preparing: ", &_14$$14); - ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 31, &_15$$14); + ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 29, &_15$$14); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$14, "phalcon/Mvc/Model/Query.zep", 2391); + zephir_throw_exception_debug(&_13$$14, "phalcon/Mvc/Model/Query.zep", 2393); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2397); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2399); zephir_array_update_zval(&joinTypes, &alias, &joinType, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&joinModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); @@ -66196,9 +66765,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_17$$16, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_18$$16); ZEPHIR_CONCAT_SVSV(&_18$$16, "Cannot use '", &realModelName, "' as join alias because it was already used, when preparing: ", &_17$$16); - ZEPHIR_CALL_METHOD(NULL, &_16$$16, "__construct", &_8, 31, &_18$$16); + ZEPHIR_CALL_METHOD(NULL, &_16$$16, "__construct", &_8, 29, &_18$$16); zephir_check_call_status(); - zephir_throw_exception_debug(&_16$$16, "phalcon/Mvc/Model/Query.zep", 2450); + zephir_throw_exception_debug(&_16$$16, "phalcon/Mvc/Model/Query.zep", 2452); ZEPHIR_MM_RESTORE(); return; } @@ -66224,7 +66793,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_update_property_zval(this_ptr, ZEND_STRL("sqlModelsAliases"), &sqlModelsAliases); zephir_update_property_zval(this_ptr, ZEND_STRL("sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); zephir_update_property_zval(this_ptr, ZEND_STRL("modelsInstances"), &modelsInstances); - zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2525); + zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2527); if (Z_TYPE_P(&joinPrepared) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _21, _22, _19) { @@ -66238,7 +66807,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZVAL_COPY(&joinItem, _19); ZEPHIR_OBS_NVAR(&joinExpr); if (zephir_array_isset_string_fetch(&joinExpr, &joinItem, SL("conditions"), 0)) { - ZEPHIR_CALL_METHOD(&_23$$18, this_ptr, "getexpression", &_24, 0, &joinExpr); + ZEPHIR_CALL_METHOD(&_23$$18, this_ptr, "getexpression", &_24, 455, &joinExpr); zephir_check_call_status(); zephir_array_update_zval(&joinPreCondition, &joinAliasName, &_23$$18, PH_COPY | PH_SEPARATE); } @@ -66258,7 +66827,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinExpr); if (zephir_array_isset_string_fetch(&joinExpr, &joinItem, SL("conditions"), 0)) { - ZEPHIR_CALL_METHOD(&_25$$20, this_ptr, "getexpression", &_24, 0, &joinExpr); + ZEPHIR_CALL_METHOD(&_25$$20, this_ptr, "getexpression", &_24, 455, &joinExpr); zephir_check_call_status(); zephir_array_update_zval(&joinPreCondition, &joinAliasName, &_25$$20, PH_COPY | PH_SEPARATE); } @@ -66271,7 +66840,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_0, this_ptr, ZEND_STRL("enableImplicitJoins"), PH_NOISY_CC | PH_READONLY); if (!(zephir_is_true(&_0))) { ZEPHIR_INIT_VAR(&_26$$21); - zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2537); + zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2539); if (Z_TYPE_P(&joinPrepared) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _29$$21, _30$$21, _27$$21) { @@ -66284,11 +66853,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_26$$21); ZVAL_COPY(&_26$$21, _27$$21); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2527); + zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2528); + zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2530); ZEPHIR_OBS_NVAR(&preCondition); - zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); + zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2531); ZEPHIR_INIT_NVAR(&_31$$22); zephir_create_array(&_31$$22, 3, 0); zephir_array_update_string(&_31$$22, SL("type"), &joinType, PH_COPY | PH_SEPARATE); @@ -66297,7 +66866,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_32$$22, 1, 0); zephir_array_fast_append(&_32$$22, &preCondition); zephir_array_update_string(&_31$$22, SL("conditions"), &_32$$22, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_31$$22, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2534); + zephir_array_append(&sqlJoins, &_31$$22, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2536); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &joinPrepared, "rewind", NULL, 0); @@ -66313,11 +66882,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&_26$$21, &joinPrepared, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2527); + zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2528); + zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2530); ZEPHIR_OBS_NVAR(&preCondition); - zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); + zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2531); ZEPHIR_INIT_NVAR(&_33$$23); zephir_create_array(&_33$$23, 3, 0); zephir_array_update_string(&_33$$23, SL("type"), &joinType, PH_COPY | PH_SEPARATE); @@ -66326,7 +66895,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_34$$23, 1, 0); zephir_array_fast_append(&_34$$23, &preCondition); zephir_array_update_string(&_33$$23, SL("conditions"), &_34$$23, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_33$$23, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2534); + zephir_array_append(&sqlJoins, &_33$$23, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2536); ZEPHIR_CALL_METHOD(NULL, &joinPrepared, "next", NULL, 0); zephir_check_call_status(); } @@ -66337,15 +66906,15 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&fromModels); array_init(&fromModels); - zephir_is_iterable(&selectTables, 0, "phalcon/Mvc/Model/Query.zep", 2552); + zephir_is_iterable(&selectTables, 0, "phalcon/Mvc/Model/Query.zep", 2554); if (Z_TYPE_P(&selectTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectTables), _35) { ZEPHIR_INIT_NVAR(&tableItem); ZVAL_COPY(&tableItem, _35); - zephir_array_fetch_string(&_37$$24, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_37$$24, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2548); ZEPHIR_OBS_NVAR(&_38$$24); - zephir_array_fetch_string(&_38$$24, &_37$$24, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_38$$24, &_37$$24, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2548); zephir_array_update_zval(&fromModels, &_38$$24, &__$true, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -66359,9 +66928,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&tableItem, &selectTables, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_39$$25, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_39$$25, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2548); ZEPHIR_OBS_NVAR(&_40$$25); - zephir_array_fetch_string(&_40$$25, &_39$$25, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_40$$25, &_39$$25, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2548); zephir_array_update_zval(&fromModels, &_40$$25, &__$true, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &selectTables, "next", NULL, 0); zephir_check_call_status(); @@ -66369,7 +66938,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&tableItem); ZEPHIR_INIT_VAR(&_41); - zephir_is_iterable(&fromModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); + zephir_is_iterable(&fromModels, 0, "phalcon/Mvc/Model/Query.zep", 2674); if (Z_TYPE_P(&fromModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fromModels), _44, _45, _42) { @@ -66381,7 +66950,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&_41); ZVAL_COPY(&_41, _42); - zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2670); + zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); if (Z_TYPE_P(&joinModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinModels), _48$$26, _49$$26, _46$$26) { @@ -66394,13 +66963,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&joinModel); ZVAL_COPY(&joinModel, _46$$26); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_50, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -66413,36 +66982,36 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_53$$31, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_54$$31); ZEPHIR_CONCAT_SVSVSV(&_54$$31, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_53$$31); - ZEPHIR_CALL_METHOD(NULL, &_52$$31, "__construct", &_8, 31, &_54$$31); + ZEPHIR_CALL_METHOD(NULL, &_52$$31, "__construct", &_8, 29, &_54$$31); zephir_check_call_status(); - zephir_throw_exception_debug(&_52$$31, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_52$$31, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_55$$32, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_55$$32))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _58$$35) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _58$$35); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -66455,14 +67024,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_60$$39); @@ -66472,7 +67041,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_61$$39); array_init(&_61$$39); zephir_array_update_string(&_60$$39, SL("conditions"), &_61$$39, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_60$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_60$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_62$$40); @@ -66483,7 +67052,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_63$$40, 1, 0); zephir_array_fast_append(&_63$$40, &preCondition); zephir_array_update_string(&_62$$40, SL("conditions"), &_63$$40, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_62$$40, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_62$$40, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } } ZEND_HASH_FOREACH_END(); } else { @@ -66500,13 +67069,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&joinModel, &joinModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_64, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -66519,36 +67088,36 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_67$$45, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_68$$45); ZEPHIR_CONCAT_SVSVSV(&_68$$45, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_67$$45); - ZEPHIR_CALL_METHOD(NULL, &_66$$45, "__construct", &_8, 31, &_68$$45); + ZEPHIR_CALL_METHOD(NULL, &_66$$45, "__construct", &_8, 29, &_68$$45); zephir_check_call_status(); - zephir_throw_exception_debug(&_66$$45, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_66$$45, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_69$$46, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_69$$46))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _70$$49) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _70$$49); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -66561,14 +67130,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_72$$53); @@ -66578,7 +67147,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_73$$53); array_init(&_73$$53); zephir_array_update_string(&_72$$53, SL("conditions"), &_73$$53, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_72$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_72$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_74$$54); @@ -66589,7 +67158,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_75$$54, 1, 0); zephir_array_fast_append(&_75$$54, &preCondition); zephir_array_update_string(&_74$$54, SL("conditions"), &_75$$54, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_74$$54, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_74$$54, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } ZEPHIR_CALL_METHOD(NULL, &joinModels, "next", NULL, 0); zephir_check_call_status(); @@ -66611,7 +67180,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_41, &fromModels, "current", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2670); + zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); if (Z_TYPE_P(&joinModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinModels), _78$$55, _79$$55, _76$$55) { @@ -66624,13 +67193,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&joinModel); ZVAL_COPY(&joinModel, _76$$55); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_80, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -66643,36 +67212,36 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_83$$60, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_84$$60); ZEPHIR_CONCAT_SVSVSV(&_84$$60, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_83$$60); - ZEPHIR_CALL_METHOD(NULL, &_82$$60, "__construct", &_8, 31, &_84$$60); + ZEPHIR_CALL_METHOD(NULL, &_82$$60, "__construct", &_8, 29, &_84$$60); zephir_check_call_status(); - zephir_throw_exception_debug(&_82$$60, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_82$$60, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_85$$61, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_85$$61))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _86$$64) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _86$$64); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -66685,14 +67254,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_88$$68); @@ -66702,7 +67271,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_89$$68); array_init(&_89$$68); zephir_array_update_string(&_88$$68, SL("conditions"), &_89$$68, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_88$$68, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_88$$68, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_90$$69); @@ -66713,7 +67282,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_91$$69, 1, 0); zephir_array_fast_append(&_91$$69, &preCondition); zephir_array_update_string(&_90$$69, SL("conditions"), &_91$$69, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_90$$69, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_90$$69, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } } ZEND_HASH_FOREACH_END(); } else { @@ -66730,13 +67299,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&joinModel, &joinModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_92, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -66749,36 +67318,36 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_95$$74, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_96$$74); ZEPHIR_CONCAT_SVSVSV(&_96$$74, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_95$$74); - ZEPHIR_CALL_METHOD(NULL, &_94$$74, "__construct", &_8, 31, &_96$$74); + ZEPHIR_CALL_METHOD(NULL, &_94$$74, "__construct", &_8, 29, &_96$$74); zephir_check_call_status(); - zephir_throw_exception_debug(&_94$$74, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_94$$74, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_97$$75, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_97$$75))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _98$$78) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _98$$78); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -66791,14 +67360,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_100$$82); @@ -66808,7 +67377,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_101$$82); array_init(&_101$$82); zephir_array_update_string(&_100$$82, SL("conditions"), &_101$$82, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_100$$82, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_100$$82, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_102$$83); @@ -66819,7 +67388,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_103$$83, 1, 0); zephir_array_fast_append(&_103$$83, &preCondition); zephir_array_update_string(&_102$$83, SL("conditions"), &_103$$83, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_102$$83, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_102$$83, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } ZEPHIR_CALL_METHOD(NULL, &joinModels, "next", NULL, 0); zephir_check_call_status(); @@ -66944,7 +67513,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) ZEPHIR_CALL_METHOD(&referencedModelName, relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&fields) == IS_ARRAY) { - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 2789); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 2791); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _3$$3, _4$$3, _1$$3) { @@ -66962,14 +67531,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVSVSV(&_7$$5, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_6$$5); - ZEPHIR_CALL_METHOD(NULL, &_5$$5, "__construct", &_8, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_5$$5, "__construct", &_8, 29, &_7$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$5, "phalcon/Mvc/Model/Query.zep", 2756); + zephir_throw_exception_debug(&_5$$5, "phalcon/Mvc/Model/Query.zep", 2758); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&intermediateField); - zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2762); + zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2764); ZEPHIR_INIT_NVAR(&sqlEqualsJoinCondition); zephir_create_array(&sqlEqualsJoinCondition, 4, 0); add_assoc_stringl_ex(&sqlEqualsJoinCondition, SL("type"), SL("binary-op")); @@ -66979,7 +67548,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_10$$4, SL("type"), 355); zephir_array_update_string(&_10$$4, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$4, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 0, &_10$$4); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 456, &_10$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("left"), &_9$$4, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_12$$4); @@ -66987,7 +67556,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_12$$4, SL("type"), SL("qualified")); zephir_array_update_string(&_12$$4, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_12$$4, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 0, &_12$$4); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 456, &_12$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("right"), &_9$$4, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -67010,14 +67579,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_15$$7); ZEPHIR_CONCAT_SVSVSV(&_15$$7, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_14$$7); - ZEPHIR_CALL_METHOD(NULL, &_13$$7, "__construct", &_8, 31, &_15$$7); + ZEPHIR_CALL_METHOD(NULL, &_13$$7, "__construct", &_8, 29, &_15$$7); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$7, "phalcon/Mvc/Model/Query.zep", 2756); + zephir_throw_exception_debug(&_13$$7, "phalcon/Mvc/Model/Query.zep", 2758); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&intermediateField); - zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2762); + zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2764); ZEPHIR_INIT_NVAR(&_16$$6); zephir_create_array(&_16$$6, 4, 0); add_assoc_stringl_ex(&_16$$6, SL("type"), SL("binary-op")); @@ -67027,7 +67596,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_18$$6, SL("type"), 355); zephir_array_update_string(&_18$$6, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_18$$6, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 0, &_18$$6); + ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 456, &_18$$6); zephir_check_call_status(); zephir_array_update_string(&_16$$6, SL("left"), &_17$$6, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_19$$6); @@ -67035,7 +67604,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_19$$6, SL("type"), SL("qualified")); zephir_array_update_string(&_19$$6, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_19$$6, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 0, &_19$$6); + ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 456, &_19$$6); zephir_check_call_status(); zephir_array_update_string(&_16$$6, SL("right"), &_17$$6, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&sqlEqualsJoinCondition, &_16$$6); @@ -67067,7 +67636,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_25$$8, SL("type"), 355); zephir_array_update_string(&_25$$8, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_25$$8, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_25$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_25$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("left"), &_24$$8, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_26$$8); @@ -67075,7 +67644,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_26$$8, SL("type"), SL("qualified")); zephir_array_update_string(&_26$$8, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_26$$8, SL("name"), &intermediateFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_26$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_26$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("right"), &_24$$8, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_22$$8, &_23$$8); @@ -67096,7 +67665,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_27$$8, SL("type"), 355); zephir_array_update_string(&_27$$8, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_27$$8, SL("name"), &intermediateReferencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_27$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_27$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("left"), &_24$$8, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_28$$8); @@ -67104,7 +67673,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_28$$8, SL("type"), SL("qualified")); zephir_array_update_string(&_28$$8, SL("domain"), &referencedModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_28$$8, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_28$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_28$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("right"), &_24$$8, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_22$$8, &_23$$8); @@ -67164,14 +67733,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) } ZEPHIR_INIT_VAR(&orderParts); array_init(&orderParts); - zephir_is_iterable(&orderColumns, 0, "phalcon/Mvc/Model/Query.zep", 2898); + zephir_is_iterable(&orderColumns, 0, "phalcon/Mvc/Model/Query.zep", 2900); if (Z_TYPE_P(&orderColumns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&orderColumns), _0) { ZEPHIR_INIT_NVAR(&orderItem); ZVAL_COPY(&orderItem, _0); - zephir_array_fetch_string(&_2$$5, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2880); - ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 0, &_2$$5); + zephir_array_fetch_string(&_2$$5, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2882); + ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 455, &_2$$5); zephir_check_call_status(); if (zephir_array_isset_string_fetch(&orderSort, &orderItem, SL("sort"), 1)) { if (ZEPHIR_IS_LONG(&orderSort, 327)) { @@ -67196,7 +67765,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) zephir_array_fast_append(&_7$$9, &orderPartExpr); ZEPHIR_CPY_WRT(&orderPartSort, &_7$$9); } - zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2895); + zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2897); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &orderColumns, "rewind", NULL, 0); @@ -67209,8 +67778,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) } ZEPHIR_CALL_METHOD(&orderItem, &orderColumns, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_8$$10, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2880); - ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 0, &_8$$10); + zephir_array_fetch_string(&_8$$10, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2882); + ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 455, &_8$$10); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&orderSort); if (zephir_array_isset_string_fetch(&orderSort, &orderItem, SL("sort"), 0)) { @@ -67237,7 +67806,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) zephir_array_fast_append(&_13$$14, &orderPartExpr); ZEPHIR_CPY_WRT(&orderPartSort, &_13$$14); } - zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2895); + zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2897); ZEPHIR_CALL_METHOD(NULL, &orderColumns, "next", NULL, 0); zephir_check_call_status(); } @@ -67321,13 +67890,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) ZEPHIR_OBS_VAR(&columnName); - zephir_array_fetch_string(&columnName, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2912); + zephir_array_fetch_string(&columnName, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2914); zephir_read_property(&_0, this_ptr, ZEND_STRL("nestingLevel"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&nestingLevel, &_0); zephir_read_property(&_0, this_ptr, ZEND_STRL("sqlColumnAliases"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_0, &nestingLevel)) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("sqlColumnAliases"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_2$$3, &_1$$3, &nestingLevel, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2920); + zephir_array_fetch(&_2$$3, &_1$$3, &nestingLevel, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2922); ZEPHIR_CPY_WRT(&sqlColumnAliases, &_2$$3); } else { ZEPHIR_INIT_NVAR(&sqlColumnAliases); @@ -67337,7 +67906,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) if (_3) { _4 = !(zephir_array_isset_string(&expr, SL("domain"))); if (!(_4)) { - zephir_array_fetch_string(&_5, &expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2925); + zephir_array_fetch_string(&_5, &expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2927); _4 = ZEPHIR_IS_EMPTY(&_5); } _3 = _4; @@ -67361,9 +67930,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_9$$7, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_10$$7); ZEPHIR_CONCAT_SVSV(&_10$$7, "Unknown model or alias '", &columnDomain, "' (11), when preparing: ", &_9$$7); - ZEPHIR_CALL_METHOD(NULL, &_8$$7, "__construct", NULL, 31, &_10$$7); + ZEPHIR_CALL_METHOD(NULL, &_8$$7, "__construct", NULL, 29, &_10$$7); zephir_check_call_status(); - zephir_throw_exception_debug(&_8$$7, "phalcon/Mvc/Model/Query.zep", 2946); + zephir_throw_exception_debug(&_8$$7, "phalcon/Mvc/Model/Query.zep", 2948); ZEPHIR_MM_RESTORE(); return; } @@ -67377,9 +67946,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_13$$9, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$9); ZEPHIR_CONCAT_SVSV(&_14$$9, "There is no model related to model or alias '", &columnDomain, "', when executing: ", &_13$$9); - ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", NULL, 31, &_14$$9); + ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", NULL, 29, &_14$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$9, "phalcon/Mvc/Model/Query.zep", 2965); + zephir_throw_exception_debug(&_12$$9, "phalcon/Mvc/Model/Query.zep", 2967); ZEPHIR_MM_RESTORE(); return; } @@ -67397,9 +67966,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_16$$12, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_17$$12); ZEPHIR_CONCAT_SVSVSV(&_17$$12, "Column '", &columnName, "' doesn't belong to the model or alias '", &columnDomain, "', when executing: ", &_16$$12); - ZEPHIR_CALL_METHOD(NULL, &_15$$12, "__construct", NULL, 31, &_17$$12); + ZEPHIR_CALL_METHOD(NULL, &_15$$12, "__construct", NULL, 29, &_17$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_15$$12, "phalcon/Mvc/Model/Query.zep", 2977); + zephir_throw_exception_debug(&_15$$12, "phalcon/Mvc/Model/Query.zep", 2979); ZEPHIR_MM_RESTORE(); return; } @@ -67411,7 +67980,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) ZEPHIR_INIT_VAR(&hasModel); ZVAL_BOOL(&hasModel, 0); zephir_read_property(&_18$$14, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_18$$14, 0, "phalcon/Mvc/Model/Query.zep", 3011); + zephir_is_iterable(&_18$$14, 0, "phalcon/Mvc/Model/Query.zep", 3013); if (Z_TYPE_P(&_18$$14) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_18$$14), _19$$14) { @@ -67427,9 +67996,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_24$$17, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_25$$17); ZEPHIR_CONCAT_SVSV(&_25$$17, "The column '", &columnName, "' is ambiguous, when preparing: ", &_24$$17); - ZEPHIR_CALL_METHOD(NULL, &_23$$17, "__construct", NULL, 31, &_25$$17); + ZEPHIR_CALL_METHOD(NULL, &_23$$17, "__construct", NULL, 29, &_25$$17); zephir_check_call_status(); - zephir_throw_exception_debug(&_23$$17, "phalcon/Mvc/Model/Query.zep", 3000); + zephir_throw_exception_debug(&_23$$17, "phalcon/Mvc/Model/Query.zep", 3002); ZEPHIR_MM_RESTORE(); return; } @@ -67457,9 +68026,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_29$$20, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_30$$20); ZEPHIR_CONCAT_SVSV(&_30$$20, "The column '", &columnName, "' is ambiguous, when preparing: ", &_29$$20); - ZEPHIR_CALL_METHOD(NULL, &_28$$20, "__construct", NULL, 31, &_30$$20); + ZEPHIR_CALL_METHOD(NULL, &_28$$20, "__construct", NULL, 29, &_30$$20); zephir_check_call_status(); - zephir_throw_exception_debug(&_28$$20, "phalcon/Mvc/Model/Query.zep", 3000); + zephir_throw_exception_debug(&_28$$20, "phalcon/Mvc/Model/Query.zep", 3002); ZEPHIR_MM_RESTORE(); return; } @@ -67476,16 +68045,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_32$$21, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_33$$21); ZEPHIR_CONCAT_SVSV(&_33$$21, "Column '", &columnName, "' doesn't belong to any of the selected models (1), when preparing: ", &_32$$21); - ZEPHIR_CALL_METHOD(NULL, &_31$$21, "__construct", NULL, 31, &_33$$21); + ZEPHIR_CALL_METHOD(NULL, &_31$$21, "__construct", NULL, 29, &_33$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_31$$21, "phalcon/Mvc/Model/Query.zep", 3014); + zephir_throw_exception_debug(&_31$$21, "phalcon/Mvc/Model/Query.zep", 3016); ZEPHIR_MM_RESTORE(); return; } zephir_read_property(&_34$$14, this_ptr, ZEND_STRL("models"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&models, &_34$$14); if (UNEXPECTED(Z_TYPE_P(&models) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The models list was not loaded correctly", "phalcon/Mvc/Model/Query.zep", 3025); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The models list was not loaded correctly", "phalcon/Mvc/Model/Query.zep", 3027); return; } ZEPHIR_INIT_VAR(&className); @@ -67497,9 +68066,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_36$$23, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_37$$23); ZEPHIR_CONCAT_SVSV(&_37$$23, "Can't obtain model's source from models list: '", &className, "', when preparing: ", &_36$$23); - ZEPHIR_CALL_METHOD(NULL, &_35$$23, "__construct", NULL, 31, &_37$$23); + ZEPHIR_CALL_METHOD(NULL, &_35$$23, "__construct", NULL, 29, &_37$$23); zephir_check_call_status(); - zephir_throw_exception_debug(&_35$$23, "phalcon/Mvc/Model/Query.zep", 3036); + zephir_throw_exception_debug(&_35$$23, "phalcon/Mvc/Model/Query.zep", 3038); ZEPHIR_MM_RESTORE(); return; } @@ -67518,9 +68087,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_39$$27, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_40$$27); ZEPHIR_CONCAT_SVSV(&_40$$27, "Column '", &columnName, "' doesn't belong to any of the selected models (3), when preparing: ", &_39$$27); - ZEPHIR_CALL_METHOD(NULL, &_38$$27, "__construct", NULL, 31, &_40$$27); + ZEPHIR_CALL_METHOD(NULL, &_38$$27, "__construct", NULL, 29, &_40$$27); zephir_check_call_status(); - zephir_throw_exception_debug(&_38$$27, "phalcon/Mvc/Model/Query.zep", 3055); + zephir_throw_exception_debug(&_38$$27, "phalcon/Mvc/Model/Query.zep", 3057); ZEPHIR_MM_RESTORE(); return; } @@ -67602,7 +68171,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getReadConnection) ZEPHIR_CALL_METHOD(&connection, model, "selectreadconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&connection) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectReadConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3099); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectReadConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3101); return; } RETURN_CCTOR(&connection); @@ -67669,10 +68238,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getRelatedRecords) zephir_array_fast_append(&_0, &_1); zephir_array_update_string(&selectIr, SL("columns"), &_0, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_VAR(&_4); - zephir_array_fetch_string(&_4, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3129); + zephir_array_fetch_string(&_4, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3131); zephir_array_update_string(&selectIr, SL("models"), &_4, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_4); - zephir_array_fetch_string(&_4, &intermediate, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3131); + zephir_array_fetch_string(&_4, &intermediate, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3133); zephir_array_update_string(&selectIr, SL("tables"), &_4, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_VAR(&whereConditions); if (zephir_array_isset_string_fetch(&whereConditions, &intermediate, SL("where"), 0)) { @@ -67684,17 +68253,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getRelatedRecords) } ZEPHIR_INIT_VAR(&query); object_init_ex(&query, phalcon_mvc_model_query_ce); - ZEPHIR_CALL_METHOD(NULL, &query, "__construct", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &query, "__construct", NULL, 464); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &query, "setdi", NULL, 0, &_5); + ZEPHIR_CALL_METHOD(NULL, &query, "setdi", NULL, 465, &_5); zephir_check_call_status(); ZVAL_LONG(&_6, 309); - ZEPHIR_CALL_METHOD(NULL, &query, "settype", NULL, 0, &_6); + ZEPHIR_CALL_METHOD(NULL, &query, "settype", NULL, 466, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &query, "setintermediate", NULL, 0, &selectIr); + ZEPHIR_CALL_METHOD(NULL, &query, "setintermediate", NULL, 467, &selectIr); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 0, &bindParams, &bindTypes); + ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 468, &bindParams, &bindTypes); zephir_check_call_status(); RETURN_MM(); } @@ -67757,7 +68326,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) ZEPHIR_OBS_VAR(&columnType); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columnType, &column, SL("type"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3171); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3173); return; } ZEPHIR_INIT_VAR(&sqlColumns); @@ -67766,7 +68335,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 0); if (ZEPHIR_IS_LONG(&columnType, 352)) { zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("models"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_0$$4, 0, "phalcon/Mvc/Model/Query.zep", 3201); + zephir_is_iterable(&_0$$4, 0, "phalcon/Mvc/Model/Query.zep", 3203); if (Z_TYPE_P(&_0$$4) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0$$4), _3$$4, _4$$4, _1$$4) { @@ -67783,15 +68352,15 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&sqlColumn, SL("type"), SL("object")); zephir_array_update_string(&sqlColumn, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("column"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_5$$5, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&_5$$5, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); zephir_array_update_string(&sqlColumn, SL("balias"), &_5$$5, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_7$$6, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3195); + zephir_array_fetch_string(&_7$$6, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3197); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_7$$6, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3198); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3200); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &_0$$4, "rewind", NULL, 0); @@ -67811,16 +68380,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&_8$$7, SL("type"), SL("object")); zephir_array_update_string(&_8$$7, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$7, SL("column"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_9$$7, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&_9$$7, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); zephir_array_update_string(&_8$$7, SL("balias"), &_9$$7, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&sqlColumn, &_8$$7); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_10$$8, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3195); + zephir_array_fetch_string(&_10$$8, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3197); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_10$$8, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3198); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3200); ZEPHIR_CALL_METHOD(NULL, &_0$$4, "next", NULL, 0); zephir_check_call_status(); } @@ -67830,14 +68399,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) RETURN_CTOR(&sqlColumns); } if (UNEXPECTED(!(zephir_array_isset_string(&column, SL("column"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3205); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3207); return; } if (ZEPHIR_IS_LONG(&columnType, 353)) { zephir_read_property(&_11$$10, this_ptr, ZEND_STRL("sqlAliases"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&sqlAliases, &_11$$10); ZEPHIR_OBS_VAR(&columnDomain); - zephir_array_fetch_string(&columnDomain, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3217); + zephir_array_fetch_string(&columnDomain, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3219); ZEPHIR_OBS_NVAR(&source); if (UNEXPECTED(!(zephir_array_isset_fetch(&source, &sqlAliases, &columnDomain, 0)))) { ZEPHIR_INIT_VAR(&_12$$11); @@ -67845,9 +68414,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_read_property(&_13$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$11); ZEPHIR_CONCAT_SVSV(&_14$$11, "Unknown model or alias '", &columnDomain, "' (2), when preparing: ", &_13$$11); - ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", NULL, 31, &_14$$11); + ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", NULL, 29, &_14$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 3222); + zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 3224); ZEPHIR_MM_RESTORE(); return; } @@ -67857,10 +68426,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_read_property(&_11$$10, this_ptr, ZEND_STRL("sqlAliasesModels"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&sqlAliasesModels, &_11$$10); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch(&modelName, &sqlAliasesModels, &columnDomain, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3236); + zephir_array_fetch(&modelName, &sqlAliasesModels, &columnDomain, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3238); if (Z_TYPE_P(&preparedAlias) != IS_STRING) { if (ZEPHIR_IS_EQUAL(&columnDomain, &modelName)) { - ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&preparedAlias, &columnDomain); @@ -67875,10 +68444,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) ZEPHIR_CPY_WRT(&sqlColumn, &_15$$10); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_16$$15, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3263); + zephir_array_fetch_string(&_16$$15, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3265); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_16$$15, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3266); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3268); RETURN_CTOR(&sqlColumns); } if (ZEPHIR_IS_LONG(&columnType, 354)) { @@ -67887,8 +68456,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&_17$$16, SL("type"), SL("scalar")); ZEPHIR_CPY_WRT(&sqlColumn, &_17$$16); ZEPHIR_OBS_VAR(&columnData); - zephir_array_fetch_string(&columnData, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3280); - ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "getexpression", NULL, 0, &columnData); + zephir_array_fetch_string(&columnData, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3282); + ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "getexpression", NULL, 455, &columnData); zephir_check_call_status(); ZEPHIR_OBS_VAR(&balias); if (zephir_array_isset_string_fetch(&balias, &sqlExprColumn, SL("balias"), 0)) { @@ -67897,20 +68466,20 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) } if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_18$$18, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3293); + zephir_array_fetch_string(&_18$$18, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3295); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_18$$18, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&sqlColumn, SL("column"), &sqlExprColumn, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3297); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3299); RETURN_CTOR(&sqlColumns); } ZEPHIR_INIT_VAR(&_19); object_init_ex(&_19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_20); ZEPHIR_CONCAT_SV(&_20, "Unknown type of column ", &columnType); - ZEPHIR_CALL_METHOD(NULL, &_19, "__construct", NULL, 31, &_20); + ZEPHIR_CALL_METHOD(NULL, &_19, "__construct", NULL, 29, &_20); zephir_check_call_status(); - zephir_throw_exception_debug(&_19, "phalcon/Mvc/Model/Query.zep", 3302); + zephir_throw_exception_debug(&_19, "phalcon/Mvc/Model/Query.zep", 3304); ZEPHIR_MM_RESTORE(); return; } @@ -68004,7 +68573,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_3$$3, SL("type"), 355); zephir_array_update_string(&_3$$3, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_3$$3, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 0, &_3$$3); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 456, &_3$$3); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("left"), &_2$$3, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_4$$3); @@ -68012,7 +68581,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_4$$3, SL("type"), SL("qualified")); zephir_array_update_string(&_4$$3, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$3, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 0, &_4$$3); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 456, &_4$$3); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("right"), &_2$$3, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_0$$3, &_1$$3); @@ -68020,7 +68589,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) } else { ZEPHIR_INIT_VAR(&sqlJoinPartialConditions); array_init(&sqlJoinPartialConditions); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3392); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3394); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _7$$4, _8$$4, _5$$4) { @@ -68039,9 +68608,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$6); ZEPHIR_CONCAT_SVSVSV(&_11$$6, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_10$$6); - ZEPHIR_CALL_METHOD(NULL, &_9$$6, "__construct", &_12, 31, &_11$$6); + ZEPHIR_CALL_METHOD(NULL, &_9$$6, "__construct", &_12, 29, &_11$$6); zephir_check_call_status(); - zephir_throw_exception_debug(&_9$$6, "phalcon/Mvc/Model/Query.zep", 3364); + zephir_throw_exception_debug(&_9$$6, "phalcon/Mvc/Model/Query.zep", 3366); ZEPHIR_MM_RESTORE(); return; } @@ -68054,7 +68623,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_15$$5, SL("type"), 355); zephir_array_update_string(&_15$$5, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$5, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 0, &_15$$5); + ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 456, &_15$$5); zephir_check_call_status(); zephir_array_update_string(&_13$$5, SL("left"), &_14$$5, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_16$$5); @@ -68062,10 +68631,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_16$$5, SL("type"), SL("qualified")); zephir_array_update_string(&_16$$5, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$5, SL("name"), &referencedField, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 0, &_16$$5); + ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 456, &_16$$5); zephir_check_call_status(); zephir_array_update_string(&_13$$5, SL("right"), &_14$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoinPartialConditions, &_13$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3389); + zephir_array_append(&sqlJoinPartialConditions, &_13$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3391); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0); @@ -68087,9 +68656,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) zephir_read_property(&_18$$8, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_19$$8); ZEPHIR_CONCAT_SVSVSV(&_19$$8, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_18$$8); - ZEPHIR_CALL_METHOD(NULL, &_17$$8, "__construct", &_12, 31, &_19$$8); + ZEPHIR_CALL_METHOD(NULL, &_17$$8, "__construct", &_12, 29, &_19$$8); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$8, "phalcon/Mvc/Model/Query.zep", 3364); + zephir_throw_exception_debug(&_17$$8, "phalcon/Mvc/Model/Query.zep", 3366); ZEPHIR_MM_RESTORE(); return; } @@ -68102,7 +68671,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_22$$7, SL("type"), 355); zephir_array_update_string(&_22$$7, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$7, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 0, &_22$$7); + ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 456, &_22$$7); zephir_check_call_status(); zephir_array_update_string(&_20$$7, SL("left"), &_21$$7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_23$$7); @@ -68110,10 +68679,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_23$$7, SL("type"), SL("qualified")); zephir_array_update_string(&_23$$7, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_23$$7, SL("name"), &referencedField, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 0, &_23$$7); + ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 456, &_23$$7); zephir_check_call_status(); zephir_array_update_string(&_20$$7, SL("right"), &_21$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoinPartialConditions, &_20$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3389); + zephir_array_append(&sqlJoinPartialConditions, &_20$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3391); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); } @@ -68158,7 +68727,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getTable) ZEPHIR_OBS_VAR(&modelName); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&modelName, &qualifiedName, SL("name"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3414); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3416); return; } ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &modelName); @@ -68242,7 +68811,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, getWriteConnection) ZEPHIR_CALL_METHOD(&connection, model, "selectwriteconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&connection) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectWriteConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3452); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectWriteConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3454); return; } RETURN_CCTOR(&connection); @@ -68300,12 +68869,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_CPY_WRT(&ast, &_0); ZEPHIR_OBS_VAR(&delete); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&delete, &ast, SL("delete"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3474); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3476); return; } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &delete, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3478); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3480); return; } ZEPHIR_INIT_VAR(&models); @@ -68329,16 +68898,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); - zephir_is_iterable(&deleteTables, 0, "phalcon/Mvc/Model/Query.zep", 3538); + zephir_is_iterable(&deleteTables, 0, "phalcon/Mvc/Model/Query.zep", 3540); if (Z_TYPE_P(&deleteTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&deleteTables), _1) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _1); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3502); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3504); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3503); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3505); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_3, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -68362,17 +68931,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3520); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3521); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3522); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3523); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3527); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3529); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3531); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3533); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -68387,9 +68956,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_CALL_METHOD(&table, &deleteTables, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3502); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3504); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3503); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3505); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -68412,17 +68981,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3520); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3521); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3522); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3523); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3527); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3529); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3531); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3533); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &deleteTables, "next", NULL, 0); zephir_check_call_status(); @@ -68440,13 +69009,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { ZVAL_BOOL(&_10$$17, 1); - ZEPHIR_CALL_METHOD(&_9$$17, this_ptr, "getexpression", NULL, 0, &where, &_10$$17); + ZEPHIR_CALL_METHOD(&_9$$17, this_ptr, "getexpression", NULL, 455, &where, &_10$$17); zephir_check_call_status(); zephir_array_update_string(&sqlDelete, SL("where"), &_9$$17, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_11$$18, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_11$$18, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlDelete, SL("limit"), &_11$$18, PH_COPY | PH_SEPARATE); } @@ -68506,23 +69075,23 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_0, this_ptr, ZEND_STRL("ast"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&ast, &_0); if (UNEXPECTED(!(zephir_array_isset_string(&ast, SL("qualifiedName"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3572); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3574); return; } if (UNEXPECTED(!(zephir_array_isset_string(&ast, SL("values"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3576); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3578); return; } ZEPHIR_OBS_VAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &ast, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3579); + zephir_array_fetch_string(&qualifiedName, &ast, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3581); if (UNEXPECTED(!(zephir_array_isset_string(&qualifiedName, SL("name"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3583); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3585); return; } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3587); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3589); ZEPHIR_CALL_METHOD(&model, &manager, "load", NULL, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -68539,8 +69108,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) notQuoting = 0; ZEPHIR_INIT_VAR(&exprValues); array_init(&exprValues); - zephir_array_fetch_string(&_2, &ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3600); - zephir_is_iterable(&_2, 0, "phalcon/Mvc/Model/Query.zep", 3608); + zephir_array_fetch_string(&_2, &ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3602); + zephir_is_iterable(&_2, 0, "phalcon/Mvc/Model/Query.zep", 3610); if (Z_TYPE_P(&_2) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_2), _3) { @@ -68549,17 +69118,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_INIT_NVAR(&_5$$7); zephir_create_array(&_5$$7, 2, 0); ZEPHIR_OBS_NVAR(&_6$$7); - zephir_array_fetch_string(&_6$$7, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3603); + zephir_array_fetch_string(&_6$$7, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3605); zephir_array_update_string(&_5$$7, SL("type"), &_6$$7, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_8$$7, 1); } else { ZVAL_BOOL(&_8$$7, 0); } - ZEPHIR_CALL_METHOD(&_7$$7, this_ptr, "getexpression", &_9, 0, &exprValue, &_8$$7); + ZEPHIR_CALL_METHOD(&_7$$7, this_ptr, "getexpression", &_9, 455, &exprValue, &_8$$7); zephir_check_call_status(); zephir_array_update_string(&_5$$7, SL("value"), &_7$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&exprValues, &_5$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3605); + zephir_array_append(&exprValues, &_5$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3607); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &_2, "rewind", NULL, 0); @@ -68575,17 +69144,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_INIT_NVAR(&_10$$8); zephir_create_array(&_10$$8, 2, 0); ZEPHIR_OBS_NVAR(&_11$$8); - zephir_array_fetch_string(&_11$$8, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3603); + zephir_array_fetch_string(&_11$$8, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3605); zephir_array_update_string(&_10$$8, SL("type"), &_11$$8, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_13$$8, 1); } else { ZVAL_BOOL(&_13$$8, 0); } - ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "getexpression", &_9, 0, &exprValue, &_13$$8); + ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "getexpression", &_9, 455, &exprValue, &_13$$8); zephir_check_call_status(); zephir_array_update_string(&_10$$8, SL("value"), &_12$$8, PH_COPY | PH_SEPARATE); - zephir_array_append(&exprValues, &_10$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3605); + zephir_array_append(&exprValues, &_10$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3607); ZEPHIR_CALL_METHOD(NULL, &_2, "next", NULL, 0); zephir_check_call_status(); } @@ -68601,14 +69170,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) if (zephir_array_isset_string_fetch(&fields, &ast, SL("fields"), 0)) { ZEPHIR_INIT_VAR(&sqlFields); array_init(&sqlFields); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3632); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3634); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _14$$9) { ZEPHIR_INIT_NVAR(&field); ZVAL_COPY(&field, _14$$9); ZEPHIR_OBS_NVAR(&name); - zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3619); + zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3621); ZEPHIR_CALL_METHOD(&_16$$10, &metaData, "hasattribute", &_17, 0, &model, &name); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_16$$10))) { @@ -68617,13 +69186,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_19$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_20$$11); ZEPHIR_CONCAT_SVSVSV(&_20$$11, "The model '", &modelName, "' doesn't have the attribute '", &name, "', when preparing: ", &_19$$11); - ZEPHIR_CALL_METHOD(NULL, &_18$$11, "__construct", &_21, 31, &_20$$11); + ZEPHIR_CALL_METHOD(NULL, &_18$$11, "__construct", &_21, 29, &_20$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_18$$11, "phalcon/Mvc/Model/Query.zep", 3625); + zephir_throw_exception_debug(&_18$$11, "phalcon/Mvc/Model/Query.zep", 3627); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3629); + zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3631); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0); @@ -68637,7 +69206,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); - zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3619); + zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3621); ZEPHIR_CALL_METHOD(&_22$$12, &metaData, "hasattribute", &_23, 0, &model, &name); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_22$$12))) { @@ -68646,13 +69215,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_25$$13, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_26$$13); ZEPHIR_CONCAT_SVSVSV(&_26$$13, "The model '", &modelName, "' doesn't have the attribute '", &name, "', when preparing: ", &_25$$13); - ZEPHIR_CALL_METHOD(NULL, &_24$$13, "__construct", &_21, 31, &_26$$13); + ZEPHIR_CALL_METHOD(NULL, &_24$$13, "__construct", &_21, 29, &_26$$13); zephir_check_call_status(); - zephir_throw_exception_debug(&_24$$13, "phalcon/Mvc/Model/Query.zep", 3625); + zephir_throw_exception_debug(&_24$$13, "phalcon/Mvc/Model/Query.zep", 3627); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3629); + zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3631); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); } @@ -68855,12 +69424,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &select, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3668); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3670); return; } ZEPHIR_OBS_VAR(&columns); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &select, SL("columns"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3672); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3674); return; } RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("nestingLevel"))); @@ -68901,26 +69470,26 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_1, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&metaData, &_1); if (UNEXPECTED(Z_TYPE_P(&manager) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A models-manager is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3739); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A models-manager is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3741); return; } if (UNEXPECTED(Z_TYPE_P(&metaData) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A meta-data is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3745); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A meta-data is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3747); return; } number = 0; ZEPHIR_INIT_VAR(&automaticJoins); array_init(&automaticJoins); - zephir_is_iterable(&selectedModels, 0, "phalcon/Mvc/Model/Query.zep", 3875); + zephir_is_iterable(&selectedModels, 0, "phalcon/Mvc/Model/Query.zep", 3877); if (Z_TYPE_P(&selectedModels) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectedModels), _2) { ZEPHIR_INIT_NVAR(&selectedModel); ZVAL_COPY(&selectedModel, _2); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3753); + zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3755); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3754); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3756); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_4, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); @@ -68943,9 +69512,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_6$$17, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$17); ZEPHIR_CONCAT_SVSV(&_7$$17, "Alias '", &alias, "' is used more than once, when preparing: ", &_6$$17); - ZEPHIR_CALL_METHOD(NULL, &_5$$17, "__construct", &_8, 31, &_7$$17); + ZEPHIR_CALL_METHOD(NULL, &_5$$17, "__construct", &_8, 29, &_7$$17); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$17, "phalcon/Mvc/Model/Query.zep", 3779); + zephir_throw_exception_debug(&_5$$17, "phalcon/Mvc/Model/Query.zep", 3781); ZEPHIR_MM_RESTORE(); return; } @@ -68954,7 +69523,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_zval(&sqlModelsAliases, &modelName, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&completeSource) == IS_ARRAY) { - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3791); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3793); } else { ZEPHIR_INIT_NVAR(&_9$$19); zephir_create_array(&_9$$19, 3, 0); @@ -68981,7 +69550,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } else { ZEPHIR_CPY_WRT(&withs, &with); } - zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3867); + zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3869); if (Z_TYPE_P(&withs) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&withs), _10$$21) { @@ -68993,7 +69562,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_13$$24, "AA", &_12$$24); ZEPHIR_CPY_WRT(&joinAlias, &_13$$24); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_14, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -69014,9 +69583,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_18$$27, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_19$$27); ZEPHIR_CONCAT_SVSVSV(&_19$$27, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_18$$27); - ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 31, &_19$$27); + ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 29, &_19$$27); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -69036,7 +69605,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_21$$24, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_21$$24, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_21$$24, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_21$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_21$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_22$$24); zephir_create_array(&_22$$24, 3, 0); add_assoc_long_ex(&_22$$24, SL("type"), 360); @@ -69050,7 +69619,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_23$$24, SL("type"), 355); zephir_array_update_string(&_23$$24, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$24, SL("alias"), &_23$$24, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_22$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_22$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; } ZEND_HASH_FOREACH_END(); } else { @@ -69070,7 +69639,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_25$$28, "AA", &_24$$28); ZEPHIR_CPY_WRT(&joinAlias, &_25$$28); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_26, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -69091,9 +69660,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_30$$31, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_31$$31); ZEPHIR_CONCAT_SVSVSV(&_31$$31, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_30$$31); - ZEPHIR_CALL_METHOD(NULL, &_29$$31, "__construct", &_8, 31, &_31$$31); + ZEPHIR_CALL_METHOD(NULL, &_29$$31, "__construct", &_8, 29, &_31$$31); zephir_check_call_status(); - zephir_throw_exception_debug(&_29$$31, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_29$$31, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -69113,7 +69682,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_33$$28, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_33$$28, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_33$$28, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_33$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_33$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_34$$28); zephir_create_array(&_34$$28, 3, 0); add_assoc_long_ex(&_34$$28, SL("type"), 360); @@ -69127,7 +69696,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_35$$28, SL("type"), 355); zephir_array_update_string(&_35$$28, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_34$$28, SL("alias"), &_35$$28, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_34$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_34$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; ZEPHIR_CALL_METHOD(NULL, &withs, "next", NULL, 0); zephir_check_call_status(); @@ -69135,8 +69704,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_INIT_NVAR(&withItem); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3869); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3870); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3871); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3872); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -69151,9 +69720,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CALL_METHOD(&selectedModel, &selectedModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3753); + zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3755); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3754); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3756); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_36, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); @@ -69177,9 +69746,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_39$$36, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_40$$36); ZEPHIR_CONCAT_SVSV(&_40$$36, "Alias '", &alias, "' is used more than once, when preparing: ", &_39$$36); - ZEPHIR_CALL_METHOD(NULL, &_38$$36, "__construct", &_8, 31, &_40$$36); + ZEPHIR_CALL_METHOD(NULL, &_38$$36, "__construct", &_8, 29, &_40$$36); zephir_check_call_status(); - zephir_throw_exception_debug(&_38$$36, "phalcon/Mvc/Model/Query.zep", 3779); + zephir_throw_exception_debug(&_38$$36, "phalcon/Mvc/Model/Query.zep", 3781); ZEPHIR_MM_RESTORE(); return; } @@ -69188,7 +69757,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_zval(&sqlModelsAliases, &modelName, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&completeSource) == IS_ARRAY) { - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3791); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3793); } else { ZEPHIR_INIT_NVAR(&_41$$38); zephir_create_array(&_41$$38, 3, 0); @@ -69216,7 +69785,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } else { ZEPHIR_CPY_WRT(&withs, &with); } - zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3867); + zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3869); if (Z_TYPE_P(&withs) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&withs), _43$$40) { @@ -69228,7 +69797,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_46$$43, "AA", &_45$$43); ZEPHIR_CPY_WRT(&joinAlias, &_46$$43); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_47, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -69249,9 +69818,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_51$$46, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_52$$46); ZEPHIR_CONCAT_SVSVSV(&_52$$46, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_51$$46); - ZEPHIR_CALL_METHOD(NULL, &_50$$46, "__construct", &_8, 31, &_52$$46); + ZEPHIR_CALL_METHOD(NULL, &_50$$46, "__construct", &_8, 29, &_52$$46); zephir_check_call_status(); - zephir_throw_exception_debug(&_50$$46, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_50$$46, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -69271,7 +69840,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_54$$43, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_54$$43, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_54$$43, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_54$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_54$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_55$$43); zephir_create_array(&_55$$43, 3, 0); add_assoc_long_ex(&_55$$43, SL("type"), 360); @@ -69285,7 +69854,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_56$$43, SL("type"), 355); zephir_array_update_string(&_56$$43, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_55$$43, SL("alias"), &_56$$43, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_55$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_55$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; } ZEND_HASH_FOREACH_END(); } else { @@ -69305,7 +69874,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_58$$47, "AA", &_57$$47); ZEPHIR_CPY_WRT(&joinAlias, &_58$$47); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_59, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -69326,9 +69895,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_63$$50, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_64$$50); ZEPHIR_CONCAT_SVSVSV(&_64$$50, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_63$$50); - ZEPHIR_CALL_METHOD(NULL, &_62$$50, "__construct", &_8, 31, &_64$$50); + ZEPHIR_CALL_METHOD(NULL, &_62$$50, "__construct", &_8, 29, &_64$$50); zephir_check_call_status(); - zephir_throw_exception_debug(&_62$$50, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_62$$50, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -69348,7 +69917,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_66$$47, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_66$$47, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_66$$47, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_66$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_66$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_67$$47); zephir_create_array(&_67$$47, 3, 0); add_assoc_long_ex(&_67$$47, SL("type"), 360); @@ -69362,7 +69931,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_68$$47, SL("type"), 355); zephir_array_update_string(&_68$$47, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_67$$47, SL("alias"), &_68$$47, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_67$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_67$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; ZEPHIR_CALL_METHOD(NULL, &withs, "next", NULL, 0); zephir_check_call_status(); @@ -69370,8 +69939,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_INIT_NVAR(&withItem); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3869); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3870); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3871); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3872); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &selectedModels, "next", NULL, 0); zephir_check_call_status(); @@ -69432,16 +70001,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_fast_array_merge(&_81$$55, &joins, &automaticJoins); zephir_array_update_string(&select, SL("joins"), &_81$$55, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&automaticJoins, &joins, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3906); + zephir_array_append(&automaticJoins, &joins, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3908); zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 0, &select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 470, &select); zephir_check_call_status(); } else { if (zephir_fast_count_int(&automaticJoins)) { zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 0, &select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 470, &select); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&sqlJoins); @@ -69451,15 +70020,15 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) position = 0; ZEPHIR_INIT_VAR(&sqlColumnAliases); array_init(&sqlColumnAliases); - zephir_is_iterable(&selectColumns, 0, "phalcon/Mvc/Model/Query.zep", 3957); + zephir_is_iterable(&selectColumns, 0, "phalcon/Mvc/Model/Query.zep", 3959); if (Z_TYPE_P(&selectColumns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectColumns), _82) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _82); - ZEPHIR_CALL_METHOD(&_84$$60, this_ptr, "getselectcolumn", &_85, 0, &column); + ZEPHIR_CALL_METHOD(&_84$$60, this_ptr, "getselectcolumn", &_85, 471, &column); zephir_check_call_status(); - zephir_is_iterable(&_84$$60, 0, "phalcon/Mvc/Model/Query.zep", 3955); + zephir_is_iterable(&_84$$60, 0, "phalcon/Mvc/Model/Query.zep", 3957); if (Z_TYPE_P(&_84$$60) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_84$$60), _86$$60) { @@ -69476,7 +70045,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_88$$65, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_88$$65, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_88$$65, "scalar")) { ZEPHIR_INIT_NVAR(&_89$$66); ZVAL_LONG(&_89$$66, position); @@ -69484,7 +70053,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_90$$66, "_", &_89$$66); zephir_array_update_zval(&sqlColumns, &_90$$66, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -69512,7 +70081,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_91$$72, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_91$$72, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_91$$72, "scalar")) { ZEPHIR_INIT_NVAR(&_92$$73); ZVAL_LONG(&_92$$73, position); @@ -69520,7 +70089,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_93$$73, "_", &_92$$73); zephir_array_update_zval(&sqlColumns, &_93$$73, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -69542,9 +70111,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_CALL_METHOD(&column, &selectColumns, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_94$$75, this_ptr, "getselectcolumn", &_85, 0, &column); + ZEPHIR_CALL_METHOD(&_94$$75, this_ptr, "getselectcolumn", &_85, 471, &column); zephir_check_call_status(); - zephir_is_iterable(&_94$$75, 0, "phalcon/Mvc/Model/Query.zep", 3955); + zephir_is_iterable(&_94$$75, 0, "phalcon/Mvc/Model/Query.zep", 3957); if (Z_TYPE_P(&_94$$75) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_94$$75), _95$$75) { @@ -69561,7 +70130,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_97$$80, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_97$$80, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_97$$80, "scalar")) { ZEPHIR_INIT_NVAR(&_98$$81); ZVAL_LONG(&_98$$81, position); @@ -69569,7 +70138,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_99$$81, "_", &_98$$81); zephir_array_update_zval(&sqlColumns, &_99$$81, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -69597,7 +70166,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_100$$87, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_100$$87, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_100$$87, "scalar")) { ZEPHIR_INIT_NVAR(&_101$$88); ZVAL_LONG(&_101$$88, position); @@ -69605,7 +70174,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_102$$88, "_", &_101$$88); zephir_array_update_zval(&sqlColumns, &_102$$88, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -69637,31 +70206,31 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, ast, SL("where"), 0)) { - ZEPHIR_CALL_METHOD(&_104$$92, this_ptr, "getexpression", NULL, 0, &where); + ZEPHIR_CALL_METHOD(&_104$$92, this_ptr, "getexpression", NULL, 455, &where); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("where"), &_104$$92, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&groupBy); if (zephir_array_isset_string_fetch(&groupBy, ast, SL("groupBy"), 0)) { - ZEPHIR_CALL_METHOD(&_105$$93, this_ptr, "getgroupclause", NULL, 0, &groupBy); + ZEPHIR_CALL_METHOD(&_105$$93, this_ptr, "getgroupclause", NULL, 472, &groupBy); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("group"), &_105$$93, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&having); if (zephir_array_isset_string_fetch(&having, ast, SL("having"), 0)) { - ZEPHIR_CALL_METHOD(&_106$$94, this_ptr, "getexpression", NULL, 0, &having); + ZEPHIR_CALL_METHOD(&_106$$94, this_ptr, "getexpression", NULL, 455, &having); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("having"), &_106$$94, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&order); if (zephir_array_isset_string_fetch(&order, ast, SL("orderBy"), 0)) { - ZEPHIR_CALL_METHOD(&_107$$95, this_ptr, "getorderclause", NULL, 0, &order); + ZEPHIR_CALL_METHOD(&_107$$95, this_ptr, "getorderclause", NULL, 473, &order); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("order"), &_107$$95, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_108$$96, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_108$$96, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("limit"), &_108$$96, PH_COPY | PH_SEPARATE); } @@ -69751,17 +70320,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CPY_WRT(&ast, &_0); ZEPHIR_OBS_VAR(&update); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&update, &ast, SL("update"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4034); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4036); return; } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &update, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4038); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4040); return; } ZEPHIR_OBS_VAR(&values); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&values, &update, SL("values"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4042); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4044); return; } ZEPHIR_INIT_VAR(&models); @@ -69785,16 +70354,16 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); - zephir_is_iterable(&updateTables, 0, "phalcon/Mvc/Model/Query.zep", 4108); + zephir_is_iterable(&updateTables, 0, "phalcon/Mvc/Model/Query.zep", 4110); if (Z_TYPE_P(&updateTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateTables), _1) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _1); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4066); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4068); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4067); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4069); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_3, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -69818,17 +70387,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4090); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4091); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4092); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4093); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4097); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4099); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4101); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4103); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -69843,9 +70412,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CALL_METHOD(&table, &updateTables, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4066); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4068); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4067); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4069); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -69868,17 +70437,17 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4090); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4091); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4092); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4093); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4097); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4099); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4101); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4103); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &updateTables, "next", NULL, 0); zephir_check_call_status(); @@ -69901,37 +70470,37 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CPY_WRT(&updateValues, &values); } notQuoting = 0; - zephir_is_iterable(&updateValues, 0, "phalcon/Mvc/Model/Query.zep", 4132); + zephir_is_iterable(&updateValues, 0, "phalcon/Mvc/Model/Query.zep", 4134); if (Z_TYPE_P(&updateValues) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateValues), _9) { ZEPHIR_INIT_NVAR(&updateValue); ZVAL_COPY(&updateValue, _9); - zephir_array_fetch_string(&_12$$20, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_fetch_string(&_12$$20, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4126); if (notQuoting) { ZVAL_BOOL(&_13$$20, 1); } else { ZVAL_BOOL(&_13$$20, 0); } - ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "getexpression", &_14, 0, &_12$$20, &_13$$20); + ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "getexpression", &_14, 455, &_12$$20, &_13$$20); zephir_check_call_status(); - zephir_array_append(&sqlFields, &_11$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_append(&sqlFields, &_11$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4126); ZEPHIR_OBS_NVAR(&exprColumn); - zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4125); + zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); ZEPHIR_INIT_NVAR(&_15$$20); zephir_create_array(&_15$$20, 2, 0); ZEPHIR_OBS_NVAR(&_16$$20); - zephir_array_fetch_string(&_16$$20, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); + zephir_array_fetch_string(&_16$$20, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4129); zephir_array_update_string(&_15$$20, SL("type"), &_16$$20, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_18$$20, 1); } else { ZVAL_BOOL(&_18$$20, 0); } - ZEPHIR_CALL_METHOD(&_17$$20, this_ptr, "getexpression", &_14, 0, &exprColumn, &_18$$20); + ZEPHIR_CALL_METHOD(&_17$$20, this_ptr, "getexpression", &_14, 455, &exprColumn, &_18$$20); zephir_check_call_status(); zephir_array_update_string(&_15$$20, SL("value"), &_17$$20, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlValues, &_15$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4129); + zephir_array_append(&sqlValues, &_15$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4131); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &updateValues, "rewind", NULL, 0); @@ -69944,31 +70513,31 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) } ZEPHIR_CALL_METHOD(&updateValue, &updateValues, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_20$$21, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_fetch_string(&_20$$21, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4126); if (notQuoting) { ZVAL_BOOL(&_21$$21, 1); } else { ZVAL_BOOL(&_21$$21, 0); } - ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "getexpression", &_14, 0, &_20$$21, &_21$$21); + ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "getexpression", &_14, 455, &_20$$21, &_21$$21); zephir_check_call_status(); - zephir_array_append(&sqlFields, &_19$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_append(&sqlFields, &_19$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4126); ZEPHIR_OBS_NVAR(&exprColumn); - zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4125); + zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); ZEPHIR_INIT_NVAR(&_22$$21); zephir_create_array(&_22$$21, 2, 0); ZEPHIR_OBS_NVAR(&_23$$21); - zephir_array_fetch_string(&_23$$21, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); + zephir_array_fetch_string(&_23$$21, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4129); zephir_array_update_string(&_22$$21, SL("type"), &_23$$21, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_25$$21, 1); } else { ZVAL_BOOL(&_25$$21, 0); } - ZEPHIR_CALL_METHOD(&_24$$21, this_ptr, "getexpression", &_14, 0, &exprColumn, &_25$$21); + ZEPHIR_CALL_METHOD(&_24$$21, this_ptr, "getexpression", &_14, 455, &exprColumn, &_25$$21); zephir_check_call_status(); zephir_array_update_string(&_22$$21, SL("value"), &_24$$21, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlValues, &_22$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4129); + zephir_array_append(&sqlValues, &_22$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4131); ZEPHIR_CALL_METHOD(NULL, &updateValues, "next", NULL, 0); zephir_check_call_status(); } @@ -69983,13 +70552,13 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { ZVAL_BOOL(&_27$$22, 1); - ZEPHIR_CALL_METHOD(&_26$$22, this_ptr, "getexpression", &_14, 0, &where, &_27$$22); + ZEPHIR_CALL_METHOD(&_26$$22, this_ptr, "getexpression", &_14, 455, &where, &_27$$22); zephir_check_call_status(); zephir_array_update_string(&sqlUpdate, SL("where"), &_26$$22, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_28$$23, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_28$$23, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlUpdate, SL("limit"), &_28$$23, PH_COPY | PH_SEPARATE); } @@ -70597,11 +71166,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset) static PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) { - zend_bool _5; - zval _4; + zend_bool _11, _4$$4; + zval _10, _7$$5; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, prefetchRecords = 0; - zval *result, result_sub, *cache = NULL, cache_sub, __$null, rowCount, rows, _2, _0$$3, _1$$3, _3$$5, _6$$8; + zval *result, result_sub, *cache = NULL, cache_sub, __$null, rowCount, rows, _8, _0$$3, _1$$3, _2$$4, _3$$4, _5$$4, _6$$5, _9$$6, _12$$9; zval *this_ptr = getThis(); ZVAL_UNDEF(&result_sub); @@ -70609,18 +71178,23 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) ZVAL_NULL(&__$null); ZVAL_UNDEF(&rowCount); ZVAL_UNDEF(&rows); - ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_8); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_6$$8); - ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_7$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(result) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) ZEND_PARSE_PARAMETERS_END(); #endif @@ -70644,37 +71218,60 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) } zephir_update_property_zval(this_ptr, ZEND_STRL("result"), result); if (Z_TYPE_P(cache) != IS_NULL) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$4, "is_a", NULL, 83, cache, &_2$$4); + zephir_check_call_status(); + _4$$4 = !ZEPHIR_IS_TRUE_IDENTICAL(&_3$$4); + if (_4$$4) { + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Psr\\SimpleCache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_5$$4, "is_a", NULL, 83, cache, &_2$$4); + zephir_check_call_status(); + _4$$4 = !ZEPHIR_IS_TRUE_IDENTICAL(&_5$$4); + } + if (UNEXPECTED(_4$$4)) { + ZEPHIR_INIT_VAR(&_6$$5); + object_init_ex(&_6$$5, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_7$$5); + ZEPHIR_CONCAT_SS(&_7$$5, "Cache service must be an object implementing ", "Phalcon\\Cache\\CacheInterface or Psr\\SimpleCache\\CacheInterface"); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 29, &_7$$5); + zephir_check_call_status(); + zephir_throw_exception_debug(&_6$$5, "phalcon/Mvc/Model/Resultset.zep", 165); + ZEPHIR_MM_RESTORE(); + return; + } zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), cache); } - ZVAL_LONG(&_2, 2); - ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, &_2); + ZVAL_LONG(&_8, 2); + ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, &_8); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&rowCount, result, "numrows", NULL, 0); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &rowCount); if (ZEPHIR_IS_LONG(&rowCount, 0)) { - ZEPHIR_INIT_VAR(&_3$$5); - array_init(&_3$$5); - zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_3$$5); + ZEPHIR_INIT_VAR(&_9$$6); + array_init(&_9$$6); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_9$$6); RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(&_4); - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "ZEPHIR_GLOBAL(orm).resultset_prefetch_records"); - prefetchRecords = zephir_get_intval_ex(&_4); - _5 = prefetchRecords > 0; - if (_5) { - _5 = ZEPHIR_LE_LONG(&rowCount, prefetchRecords); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_INIT_NVAR(&_10); + ZVAL_STRING(&_10, "ZEPHIR_GLOBAL(orm).resultset_prefetch_records"); + prefetchRecords = zephir_get_intval_ex(&_10); + _11 = prefetchRecords > 0; + if (_11) { + _11 = ZEPHIR_LE_LONG(&rowCount, prefetchRecords); } - if (_5) { + if (_11) { ZEPHIR_CALL_METHOD(&rows, result, "fetchall", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&rows) == IS_ARRAY) { zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &rows); } else { - ZEPHIR_INIT_VAR(&_6$$8); - array_init(&_6$$8); - zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_6$$8); + ZEPHIR_INIT_VAR(&_12$$9); + array_init(&_12$$9); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_12$$9); } } ZEPHIR_MM_RESTORE(); @@ -70729,7 +71326,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) ZVAL_NULL(&connection); result = 1; transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -70741,7 +71338,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) zephir_check_call_status(); if (transaction == 0) { if (UNEXPECTED(!((zephir_method_exists_ex(&record, ZEND_STRL("getwriteconnection")) == SUCCESS)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 228); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 239); return; } ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); @@ -70815,7 +71412,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -70840,7 +71437,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) zephir_check_call_status(); continue; } - zephir_array_append(&records, &processedRecord, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 322); + zephir_array_append(&records, &processedRecord, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 333); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); } @@ -70874,7 +71471,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) RETURN_MM_NULL(); } ZVAL_LONG(&_1, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_1); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -70909,7 +71506,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) RETURN_MM_NULL(); } ZVAL_LONG(&_0, (zephir_get_numberval(&count) - 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -70977,7 +71574,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, jsonSerialize) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -70994,9 +71591,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, jsonSerialize) if (_3$$3) { ZEPHIR_CALL_METHOD(&_4$$4, ¤t, "jsonserialize", NULL, 0); zephir_check_call_status(); - zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 447); + zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 458); } else { - zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 449); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 460); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); @@ -71039,7 +71636,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, next) zephir_read_property(&_0, this_ptr, ZEND_STRL("pointer"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1, (zephir_get_numberval(&_0) + 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -71048,7 +71645,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index, index_sub, _0; + zval index_sub, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -71067,10 +71665,10 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) zephir_read_property(&_0, this_ptr, ZEND_STRL("count"), PH_NOISY_CC | PH_READONLY); if (UNEXPECTED(ZEPHIR_GE(index, &_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the cursor", "phalcon/Mvc/Model/Resultset.zep", 487); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the cursor", "phalcon/Mvc/Model/Resultset.zep", 498); return; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, index); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, index); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -71118,7 +71716,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetSet) zephir_fetch_params_without_memory_grow(2, 0, &index, &value); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 514); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 525); return; } @@ -71139,7 +71737,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetUnset) zephir_fetch_params_without_memory_grow(1, 0, &offset); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 522); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 533); return; } @@ -71156,7 +71754,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, rewind) ZEPHIR_MM_GROW(); ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -71348,7 +71946,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) ZEPHIR_INIT_VAR(&connection); ZVAL_NULL(&connection); transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -71360,7 +71958,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) zephir_check_call_status(); if (transaction == 0) { if (UNEXPECTED(!((zephir_method_exists_ex(&record, ZEND_STRL("getwriteconnection")) == SUCCESS)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 639); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 650); return; } ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); @@ -71513,11 +72111,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, jsonSerialize) static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *index, index_sub, value; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval index_sub, _0, _1; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -71530,17 +72131,21 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) zephir_fetch_params(1, 1, 0, &index); - ZEPHIR_OBS_VAR(&value); - if (UNEXPECTED(!(zephir_fetch_property_zval(&value, this_ptr, index, PH_SILENT_CC)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/Mvc/Model/Row.zep", 46); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "offsetexists", NULL, 0, index); + zephir_check_call_status(); + if (!(zephir_is_true(&_0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/Mvc/Model/Row.zep", 42); return; } - RETURN_CCTOR(&value); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property_zval(&_1, this_ptr, index, PH_NOISY_CC); + RETURN_CCTOR(&_1); } static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) { - zval *index, index_sub; + zval index_sub; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -71560,7 +72165,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) { - zval *index, index_sub, *value, value_sub; + zval index_sub, value_sub; + zval *index, *value; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -71577,13 +72183,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) zephir_fetch_params_without_memory_grow(2, 0, &index, &value); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 70); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 66); return; } static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) { - zval *offset, offset_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); ZVAL_UNDEF(&offset_sub); @@ -71598,7 +72205,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) zephir_fetch_params_without_memory_grow(1, 0, &offset); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 80); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 76); return; } @@ -71670,7 +72277,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, toArray) ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 505, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 424, this_ptr); zephir_check_call_status(); RETURN_MM(); } @@ -71849,7 +72456,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Transaction, getConnection) zephir_read_property(&_0, this_ptr, ZEND_STRL("rollbackOnAbort"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_0)) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 0); + ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 478); zephir_check_call_status(); if (zephir_is_true(&_1$$3)) { ZEPHIR_INIT_VAR(&_2$$4); @@ -71968,7 +72575,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Transaction, rollback) ZEPHIR_INIT_VAR(&_3$$7); object_init_ex(&_3$$7, phalcon_mvc_model_transaction_failed_ce); zephir_read_property(&_4$$7, this_ptr, ZEND_STRL("rollbackRecord"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 0, &rollbackMessage, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 479, &rollbackMessage, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model/Transaction.zep", 215); ZEPHIR_MM_RESTORE(); @@ -73069,7 +73676,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getModels) } if (_1) { ZEPHIR_MAKE_REF(&models); - ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 0, &models); + ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 474, &models); ZEPHIR_UNREF(&models); zephir_check_call_status(); RETURN_MM(); @@ -73295,7 +73902,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) object_init_ex(&_4$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_5$$17); ZEPHIR_CONCAT_SVS(&_5$$17, "Column '", &firstPrimaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$17, "__construct", NULL, 31, &_5$$17); + ZEPHIR_CALL_METHOD(NULL, &_4$$17, "__construct", NULL, 29, &_5$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$17, "phalcon/Mvc/Model/Query/Builder.zep", 739); ZEPHIR_MM_RESTORE(); @@ -73309,9 +73916,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CONCAT_SVS(&_6$$19, "'", &conditions, "'"); ZEPHIR_CPY_WRT(&conditions, &_6$$19); } - ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$13, this_ptr, "autoescape", NULL, 0, &attributeField); + ZEPHIR_CALL_METHOD(&_8$$13, this_ptr, "autoescape", NULL, 475, &attributeField); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$13); ZEPHIR_CONCAT_VSVSV(&_9$$13, &_7$$13, ".", &_8$$13, " = ", &conditions); @@ -73358,7 +73965,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (Z_TYPE_P(&columnAlias) == IS_LONG) { zephir_array_append(&selectedColumns, &column, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 793); } else { - ZEPHIR_CALL_METHOD(&_14$$29, this_ptr, "autoescape", NULL, 0, &columnAlias); + ZEPHIR_CALL_METHOD(&_14$$29, this_ptr, "autoescape", NULL, 475, &columnAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_15$$29); ZEPHIR_CONCAT_VSV(&_15$$29, &column, " AS ", &_14$$29); @@ -73381,7 +73988,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (Z_TYPE_P(&columnAlias) == IS_LONG) { zephir_array_append(&selectedColumns, &column, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 793); } else { - ZEPHIR_CALL_METHOD(&_16$$32, this_ptr, "autoescape", NULL, 0, &columnAlias); + ZEPHIR_CALL_METHOD(&_16$$32, this_ptr, "autoescape", NULL, 475, &columnAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_17$$32); ZEPHIR_CONCAT_VSV(&_17$$32, &column, " AS ", &_16$$32); @@ -73417,11 +74024,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZVAL_COPY(&model, _19$$35); ZEPHIR_INIT_NVAR(&selectedColumn); if (Z_TYPE_P(&modelColumnAlias) == IS_LONG) { - ZEPHIR_CALL_METHOD(&_23$$37, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_23$$37, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_23$$37, ".*"); } else { - ZEPHIR_CALL_METHOD(&_24$$38, this_ptr, "autoescape", NULL, 0, &modelColumnAlias); + ZEPHIR_CALL_METHOD(&_24$$38, this_ptr, "autoescape", NULL, 475, &modelColumnAlias); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_24$$38, ".*"); } @@ -73442,11 +74049,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedColumn); if (Z_TYPE_P(&modelColumnAlias) == IS_LONG) { - ZEPHIR_CALL_METHOD(&_25$$40, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_25$$40, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_25$$40, ".*"); } else { - ZEPHIR_CALL_METHOD(&_26$$41, this_ptr, "autoescape", NULL, 0, &modelColumnAlias); + ZEPHIR_CALL_METHOD(&_26$$41, this_ptr, "autoescape", NULL, 475, &modelColumnAlias); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_26$$41, ".*"); } @@ -73461,7 +74068,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_fast_join_str(&_27$$35, SL(", "), &selectedColumns); zephir_concat_self(&phql, &_27$$35); } else { - ZEPHIR_CALL_METHOD(&_28$$42, this_ptr, "autoescape", NULL, 0, &models); + ZEPHIR_CALL_METHOD(&_28$$42, this_ptr, "autoescape", NULL, 475, &models); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_29$$42); ZEPHIR_CONCAT_VS(&_29$$42, &_28$$42, ".*"); @@ -73484,14 +74091,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&model); ZVAL_COPY(&model, _30$$43); if (Z_TYPE_P(&modelAlias) == IS_STRING) { - ZEPHIR_CALL_METHOD(&_34$$45, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_34$$45, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$45, this_ptr, "autoescape", NULL, 0, &modelAlias); + ZEPHIR_CALL_METHOD(&_35$$45, this_ptr, "autoescape", NULL, 475, &modelAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedModel); ZEPHIR_CONCAT_VSV(&selectedModel, &_34$$45, " AS ", &_35$$45); } else { - ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); } zephir_array_append(&selectedModels, &selectedModel, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 839); @@ -73510,14 +74117,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CALL_METHOD(&model, &models, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&modelAlias) == IS_STRING) { - ZEPHIR_CALL_METHOD(&_36$$48, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_36$$48, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_37$$48, this_ptr, "autoescape", NULL, 0, &modelAlias); + ZEPHIR_CALL_METHOD(&_37$$48, this_ptr, "autoescape", NULL, 475, &modelAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedModel); ZEPHIR_CONCAT_VSV(&selectedModel, &_36$$48, " AS ", &_37$$48); } else { - ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); } zephir_array_append(&selectedModels, &selectedModel, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 839); @@ -73533,7 +74140,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CONCAT_SV(&_39$$43, " FROM ", &_38$$43); zephir_concat_self(&phql, &_39$$43); } else { - ZEPHIR_CALL_METHOD(&_40$$50, this_ptr, "autoescape", NULL, 0, &models); + ZEPHIR_CALL_METHOD(&_40$$50, this_ptr, "autoescape", NULL, 475, &models); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_41$$50); ZEPHIR_CONCAT_SV(&_41$$50, " FROM ", &_40$$50); @@ -73557,20 +74164,20 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_OBS_NVAR(&joinType); zephir_array_fetch_long(&joinType, &join, 3, PH_NOISY, "phalcon/Mvc/Model/Query/Builder.zep", 872); if (zephir_is_true(&joinType)) { - ZEPHIR_CALL_METHOD(&_44$$53, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_44$$53, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$53); ZEPHIR_CONCAT_SVSV(&_45$$53, " ", &joinType, " JOIN ", &_44$$53); zephir_concat_self(&phql, &_45$$53); } else { - ZEPHIR_CALL_METHOD(&_46$$54, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_46$$54, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_47$$54); ZEPHIR_CONCAT_SV(&_47$$54, " JOIN ", &_46$$54); zephir_concat_self(&phql, &_47$$54); } if (zephir_is_true(&joinAlias)) { - ZEPHIR_CALL_METHOD(&_48$$55, this_ptr, "autoescape", NULL, 0, &joinAlias); + ZEPHIR_CALL_METHOD(&_48$$55, this_ptr, "autoescape", NULL, 475, &joinAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$55); ZEPHIR_CONCAT_SV(&_49$$55, " AS ", &_48$$55); @@ -73602,20 +74209,20 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_OBS_NVAR(&joinType); zephir_array_fetch_long(&joinType, &join, 3, PH_NOISY, "phalcon/Mvc/Model/Query/Builder.zep", 872); if (zephir_is_true(&joinType)) { - ZEPHIR_CALL_METHOD(&_51$$58, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_51$$58, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_52$$58); ZEPHIR_CONCAT_SVSV(&_52$$58, " ", &joinType, " JOIN ", &_51$$58); zephir_concat_self(&phql, &_52$$58); } else { - ZEPHIR_CALL_METHOD(&_53$$59, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_53$$59, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_54$$59); ZEPHIR_CONCAT_SV(&_54$$59, " JOIN ", &_53$$59); zephir_concat_self(&phql, &_54$$59); } if (zephir_is_true(&joinAlias)) { - ZEPHIR_CALL_METHOD(&_55$$60, this_ptr, "autoescape", NULL, 0, &joinAlias); + ZEPHIR_CALL_METHOD(&_55$$60, this_ptr, "autoescape", NULL, 475, &joinAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_56$$60); ZEPHIR_CONCAT_SV(&_56$$60, " AS ", &_55$$60); @@ -73650,7 +74257,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) { ZEPHIR_INIT_NVAR(&groupItem); ZVAL_COPY(&groupItem, _59$$64); - ZEPHIR_CALL_METHOD(&_61$$65, this_ptr, "autoescape", NULL, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_61$$65, this_ptr, "autoescape", NULL, 475, &groupItem); zephir_check_call_status(); zephir_array_append(&groupItems, &_61$$65, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 914); } ZEND_HASH_FOREACH_END(); @@ -73665,7 +74272,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) } ZEPHIR_CALL_METHOD(&groupItem, &group, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_62$$66, this_ptr, "autoescape", NULL, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_62$$66, this_ptr, "autoescape", NULL, 475, &groupItem); zephir_check_call_status(); zephir_array_append(&groupItems, &_62$$66, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 914); ZEPHIR_CALL_METHOD(NULL, &group, "next", NULL, 0); @@ -73708,7 +74315,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&itemExplode$$73); zephir_fast_explode_str(&itemExplode$$73, SL(" "), &orderItem, LONG_MAX); zephir_array_fetch_long(&_69$$73, &itemExplode$$73, 0, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); - ZEPHIR_CALL_METHOD(&_68$$73, this_ptr, "autoescape", NULL, 0, &_69$$73); + ZEPHIR_CALL_METHOD(&_68$$73, this_ptr, "autoescape", NULL, 475, &_69$$73); zephir_check_call_status(); zephir_array_fetch_long(&_70$$73, &itemExplode$$73, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); ZEPHIR_INIT_NVAR(&_71$$73); @@ -73716,7 +74323,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_array_append(&orderItems, &_71$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 953); continue; } - ZEPHIR_CALL_METHOD(&_72$$71, this_ptr, "autoescape", NULL, 0, &orderItem); + ZEPHIR_CALL_METHOD(&_72$$71, this_ptr, "autoescape", NULL, 475, &orderItem); zephir_check_call_status(); zephir_array_append(&orderItems, &_72$$71, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 958); } ZEND_HASH_FOREACH_END(); @@ -73739,7 +74346,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&itemExplode$$76); zephir_fast_explode_str(&itemExplode$$76, SL(" "), &orderItem, LONG_MAX); zephir_array_fetch_long(&_74$$76, &itemExplode$$76, 0, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); - ZEPHIR_CALL_METHOD(&_73$$76, this_ptr, "autoescape", NULL, 0, &_74$$76); + ZEPHIR_CALL_METHOD(&_73$$76, this_ptr, "autoescape", NULL, 475, &_74$$76); zephir_check_call_status(); zephir_array_fetch_long(&_75$$76, &itemExplode$$76, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); ZEPHIR_INIT_NVAR(&_76$$76); @@ -73747,7 +74354,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_array_append(&orderItems, &_76$$76, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 953); continue; } - ZEPHIR_CALL_METHOD(&_77$$74, this_ptr, "autoescape", NULL, 0, &orderItem); + ZEPHIR_CALL_METHOD(&_77$$74, this_ptr, "autoescape", NULL, 475, &orderItem); zephir_check_call_status(); zephir_array_append(&orderItems, &_77$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 958); ZEPHIR_CALL_METHOD(NULL, &order, "next", NULL, 0); @@ -73797,7 +74404,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (zephir_is_numeric(&number)) { zephir_concat_self_str(&phql, SL(" LIMIT :APL0:")); ZVAL_LONG(&_82$$86, 10); - ZEPHIR_CALL_FUNCTION(&_83$$86, "intval", NULL, 51, &number, &_82$$86); + ZEPHIR_CALL_FUNCTION(&_83$$86, "intval", NULL, 38, &number, &_82$$86); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_84$$86); ZVAL_STRING(&_84$$86, "APL0"); @@ -73814,7 +74421,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (_87$$86) { zephir_concat_self_str(&phql, SL(" OFFSET :APL1:")); ZVAL_LONG(&_88$$87, 10); - ZEPHIR_CALL_FUNCTION(&_89$$87, "intval", NULL, 51, &offset, &_88$$87); + ZEPHIR_CALL_FUNCTION(&_89$$87, "intval", NULL, 38, &offset, &_88$$87); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_90$$87); ZVAL_STRING(&_90$$87, "APL1"); @@ -73860,7 +74467,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getQuery) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 0); + ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 476); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&container, &_0); @@ -74345,7 +74952,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) ZVAL_LONG(&_0, limit); - ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 299, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 281, &_0); zephir_check_call_status(); limit = zephir_get_numberval(&_1); if (UNEXPECTED(limit == 0)) { @@ -74356,7 +74963,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) zephir_update_property_zval(this_ptr, ZEND_STRL("limit"), &_0); if (zephir_is_numeric(offset)) { ZVAL_LONG(&_2$$4, zephir_get_intval(offset)); - ZEPHIR_CALL_FUNCTION(&_3$$4, "abs", NULL, 299, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "abs", NULL, 281, &_2$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("offset"), &_3$$4); } @@ -75086,9 +75693,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionBetween) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1571); ZEPHIR_MM_RESTORE(); @@ -75205,9 +75812,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionIn) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1619); ZEPHIR_MM_RESTORE(); @@ -75363,9 +75970,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionNotBetween) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1673); ZEPHIR_MM_RESTORE(); @@ -75482,9 +76089,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionNotIn) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1720); ZEPHIR_MM_RESTORE(); @@ -85187,7 +85794,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'field' is required", "phalcon/Mvc/Model/Behavior/Timestampable.zep", 50); return; } - ZEPHIR_CALL_METHOD(×tamp, this_ptr, "gettimestamp", NULL, 0, &options); + ZEPHIR_CALL_METHOD(×tamp, this_ptr, "gettimestamp", NULL, 432, &options); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&field) == IS_ARRAY)) { zephir_is_iterable(&field, 0, "phalcon/Mvc/Model/Behavior/Timestampable.zep", 63); @@ -85251,7 +85858,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, getTimestamp) ZEPHIR_OBS_VAR(&format); if (zephir_array_isset_string_fetch(&format, &options, SL("format"), 0)) { - ZEPHIR_RETURN_CALL_FUNCTION("date", NULL, 0, &format); + ZEPHIR_RETURN_CALL_FUNCTION("date", NULL, 433, &format); zephir_check_call_status(); RETURN_MM(); } @@ -85608,7 +86215,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get) ZEPHIR_INIT_VAR(&_3$$4); ZVAL_STRING(&_3$$4, "rollbackPendent"); zephir_array_fast_append(&_2$$4, &_3$$4); - ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 0, &_2$$4); + ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 480, &_2$$4); zephir_check_call_status(); } if (1) { @@ -85735,9 +86342,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) } else { ZVAL_BOOL(&_7, 0); } - ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 0, &container, &_7, &_6); + ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 481, &container, &_7, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 482, this_ptr); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("transactions"), &transaction); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("number"))); @@ -86158,7 +86765,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct) Z_PARAM_ZVAL(columnTypes) Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OF_CLASS_OR_NULL(result, phalcon_db_resultinterface_ce) - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) ZEND_PARSE_PARAMETERS_END(); #endif @@ -86285,7 +86892,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) dirtyState = 0; zephir_read_property(&_1, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_1, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 267); + zephir_is_iterable(&_1, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 259); if (Z_TYPE_P(&_1) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1), _4, _5, _2) { @@ -86298,21 +86905,21 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _2); if (UNEXPECTED(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", 139); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 138); return; } ZEPHIR_OBS_NVAR(&type); - zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142); + zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 141); 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", 148); + zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 147); ZEPHIR_OBS_NVAR(&attributes); - zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); + zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148); ZEPHIR_OBS_NVAR(&columnMap); - zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150); + zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); ZEPHIR_INIT_NVAR(&rowModel); array_init(&rowModel); - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 167); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _6$$11) { @@ -86321,7 +86928,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_8$$12); ZEPHIR_CONCAT_SVSV(&_8$$12, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_8$$12, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_8$$12, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -86338,7 +86945,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_9$$13); ZEPHIR_CONCAT_SVSV(&_9$$13, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_9$$13, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_9$$13, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); @@ -86354,22 +86961,22 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } if (ZEPHIR_GLOBAL(orm).late_state_binding) { ZEPHIR_OBS_NVAR(&_10$$16); - zephir_array_fetch_string(&_10$$16, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178); + zephir_array_fetch_string(&_10$$16, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 175); if (zephir_instance_of_ev(&_10$$16, phalcon_mvc_model_ce)) { - zephir_array_fetch_string(&_11$$17, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179); + zephir_array_fetch_string(&_11$$17, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 176); ZEPHIR_INIT_NVAR(&modelName); zephir_get_class(&modelName, &_11$$17, 0); } else { ZEPHIR_INIT_NVAR(&modelName); ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - zephir_array_fetch_string(&_12$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185); + zephir_array_fetch_string(&_12$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 182); ZVAL_LONG(&_13$$16, dirtyState); _14$$16 = zephir_fetch_class(&modelName); ZEPHIR_CALL_CE_STATIC(&value, _14$$16, "cloneresultmap", NULL, 0, &_12$$16, &rowModel, &columnMap, &_13$$16, &keepSnapshots); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_16$$19, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199); + zephir_array_fetch_string(&_16$$19, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 194); ZVAL_LONG(&_17$$19, dirtyState); ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_16$$19, &rowModel, &columnMap, &_17$$19, &keepSnapshots); zephir_check_call_status(); @@ -86382,12 +86989,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } while(0); ZEPHIR_OBS_NVAR(&attribute); - zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223); + zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 218); } else { ZEPHIR_OBS_NVAR(&sqlAlias); if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231); + zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 224); } else { ZEPHIR_OBS_NVAR(&value); zephir_array_isset_fetch(&value, &row, &alias, 0); @@ -86429,21 +87036,21 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_CALL_METHOD(&column, &_1, "current", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(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", 139); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 138); return; } ZEPHIR_OBS_NVAR(&type); - zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142); + zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 141); 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", 148); + zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 147); ZEPHIR_OBS_NVAR(&attributes); - zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); + zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148); ZEPHIR_OBS_NVAR(&columnMap); - zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150); + zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); ZEPHIR_INIT_NVAR(&rowModel); array_init(&rowModel); - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 167); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _21$$31) { @@ -86452,7 +87059,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_23$$32); ZEPHIR_CONCAT_SVSV(&_23$$32, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_23$$32, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_23$$32, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -86469,7 +87076,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_24$$33); ZEPHIR_CONCAT_SVSV(&_24$$33, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_24$$33, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_24$$33, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); @@ -86485,22 +87092,22 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } if (ZEPHIR_GLOBAL(orm).late_state_binding) { ZEPHIR_OBS_NVAR(&_25$$36); - zephir_array_fetch_string(&_25$$36, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178); + zephir_array_fetch_string(&_25$$36, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 175); if (zephir_instance_of_ev(&_25$$36, phalcon_mvc_model_ce)) { - zephir_array_fetch_string(&_26$$37, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179); + zephir_array_fetch_string(&_26$$37, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 176); ZEPHIR_INIT_NVAR(&modelName); zephir_get_class(&modelName, &_26$$37, 0); } else { ZEPHIR_INIT_NVAR(&modelName); ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - zephir_array_fetch_string(&_27$$36, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185); + zephir_array_fetch_string(&_27$$36, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 182); ZVAL_LONG(&_28$$36, dirtyState); _29$$36 = zephir_fetch_class(&modelName); ZEPHIR_CALL_CE_STATIC(&value, _29$$36, "cloneresultmap", NULL, 0, &_27$$36, &rowModel, &columnMap, &_28$$36, &keepSnapshots); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_30$$39, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199); + zephir_array_fetch_string(&_30$$39, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 194); ZVAL_LONG(&_31$$39, dirtyState); ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_30$$39, &rowModel, &columnMap, &_31$$39, &keepSnapshots); zephir_check_call_status(); @@ -86513,12 +87120,12 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } while(0); ZEPHIR_OBS_NVAR(&attribute); - zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223); + zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 218); } else { ZEPHIR_OBS_NVAR(&sqlAlias); if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231); + zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 224); } else { ZEPHIR_OBS_NVAR(&value); zephir_array_isset_fetch(&value, &row, &alias, 0); @@ -86574,7 +87181,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -86582,9 +87189,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) if (!(zephir_is_true(&_0))) { break; } - ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 0); + ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 477); zephir_check_call_status(); - zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Complex.zep", 287); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Complex.zep", 279); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_3, 0); zephir_check_call_status(); } @@ -86627,8 +87234,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize) ZEPHIR_CPY_WRT(&hydrateMode, &_0); ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_1, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 316); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 307); return; } ZEPHIR_INIT_VAR(&_3); @@ -86707,8 +87314,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) } ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 361); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 351); return; } ZEPHIR_INIT_VAR(&_2); @@ -86730,20 +87337,138 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) zephir_check_call_status(); } if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 374); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 364); + return; + } + zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 367); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_5); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 368); + ZEPHIR_INIT_ZVAL_NREF(_7); + ZVAL_LONG(&_7, zephir_fast_count_int(&_6)); + zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_7); + zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 369); + zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_8); + zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 370); + zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), &_9); + zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 371); + zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_10); + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __serialize) +{ + zval records, cache, columnTypes, hydrateMode, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&columnTypes); + ZVAL_UNDEF(&hydrateMode); + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + ZEPHIR_CALL_METHOD(&records, this_ptr, "toarray", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&columnTypes, &_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&hydrateMode, &_0); + zephir_create_array(return_value, 4, 0); + zephir_array_update_string(return_value, SL("cache"), &cache, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("rows"), &records, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("columnTypes"), &columnTypes, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("hydrateMode"), &hydrateMode, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zephir_fcall_cache_entry *_0 = NULL; + zval *data_param = NULL, __$true, __$false, resultset, container, serializer, _1, _2, _5, _6, _7, _8, _9, _10, _3$$4, _4$$4; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&serializer); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + if (1) { + zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$false); + } + ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 408); + return; + } + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "serializer"); + ZEPHIR_CALL_METHOD(&_1, &container, "has", NULL, 0, &_2); + zephir_check_call_status(); + if (zephir_is_true(&_1)) { + ZEPHIR_INIT_VAR(&_4$$4); + ZVAL_STRING(&_4$$4, "serializer"); + ZEPHIR_CALL_METHOD(&_3$$4, &container, "getshared", NULL, 0, &_4$$4); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&serializer, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, &serializer, "unserialize", NULL, 0, &data); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&resultset, &serializer, "getdata", NULL, 0); + zephir_check_call_status(); + } else { + ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 16, &data); + zephir_check_call_status(); + } + if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 421); return; } - zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 377); + zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 424); zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_5); - zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 378); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 425); ZEPHIR_INIT_ZVAL_NREF(_7); ZVAL_LONG(&_7, zephir_fast_count_int(&_6)); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_7); - zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 379); + zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 426); zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_8); - zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 380); + zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 427); zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), &_9); - zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 381); + zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 428); zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_10); ZEPHIR_MM_RESTORE(); } @@ -86791,7 +87516,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) Z_PARAM_ZVAL(model) Z_PARAM_ZVAL(result) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) Z_PARAM_BOOL(keepSnapshots) ZEND_PARSE_PARAMETERS_END(); #endif @@ -86999,7 +87724,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) ZEPHIR_INIT_VAR(&renamedRecords); array_init(&renamedRecords); if (Z_TYPE_P(&records) == IS_ARRAY) { - zephir_is_iterable(&records, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 241); + zephir_is_iterable(&records, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 240); if (Z_TYPE_P(&records) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&records), _4$$7) { @@ -87007,7 +87732,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) ZVAL_COPY(&record, _4$$7); ZEPHIR_INIT_NVAR(&renamed); array_init(&renamed); - zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); if (Z_TYPE_P(&record) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _8$$8, _9$$8, _6$$8) { @@ -87025,9 +87750,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_10$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$10); ZEPHIR_CONCAT_SVS(&_11$$10, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$10, "__construct", &_12, 31, &_11$$10); + ZEPHIR_CALL_METHOD(NULL, &_10$$10, "__construct", &_12, 29, &_11$$10); zephir_check_call_status(); - zephir_throw_exception_debug(&_10$$10, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_10$$10, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -87038,9 +87763,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_13$$12, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_14$$12); ZEPHIR_CONCAT_SVS(&_14$$12, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_12, 31, &_14$$12); + ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_12, 29, &_14$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$12, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_13$$12, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -87066,9 +87791,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_15$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$14); ZEPHIR_CONCAT_SVS(&_16$$14, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_15$$14, "__construct", &_12, 31, &_16$$14); + ZEPHIR_CALL_METHOD(NULL, &_15$$14, "__construct", &_12, 29, &_16$$14); zephir_check_call_status(); - zephir_throw_exception_debug(&_15$$14, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_15$$14, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -87079,9 +87804,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_17$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$16); ZEPHIR_CONCAT_SVS(&_18$$16, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$16, "__construct", &_12, 31, &_18$$16); + ZEPHIR_CALL_METHOD(NULL, &_17$$16, "__construct", &_12, 29, &_18$$16); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$16, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_17$$16, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -87093,7 +87818,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &records, "rewind", NULL, 0); @@ -87108,7 +87833,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&renamed); array_init(&renamed); - zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); if (Z_TYPE_P(&record) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _21$$17, _22$$17, _19$$17) { @@ -87126,9 +87851,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_23$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_24$$19); ZEPHIR_CONCAT_SVS(&_24$$19, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_23$$19, "__construct", &_12, 31, &_24$$19); + ZEPHIR_CALL_METHOD(NULL, &_23$$19, "__construct", &_12, 29, &_24$$19); zephir_check_call_status(); - zephir_throw_exception_debug(&_23$$19, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_23$$19, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -87139,9 +87864,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_25$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_26$$21); ZEPHIR_CONCAT_SVS(&_26$$21, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_25$$21, "__construct", &_12, 31, &_26$$21); + ZEPHIR_CALL_METHOD(NULL, &_25$$21, "__construct", &_12, 29, &_26$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_25$$21, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_25$$21, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -87167,9 +87892,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_27$$23, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_28$$23); ZEPHIR_CONCAT_SVS(&_28$$23, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_27$$23, "__construct", &_12, 31, &_28$$23); + ZEPHIR_CALL_METHOD(NULL, &_27$$23, "__construct", &_12, 29, &_28$$23); zephir_check_call_status(); - zephir_throw_exception_debug(&_27$$23, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_27$$23, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -87180,9 +87905,9 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_29$$25, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_30$$25); ZEPHIR_CONCAT_SVS(&_30$$25, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_29$$25, "__construct", &_12, 31, &_30$$25); + ZEPHIR_CALL_METHOD(NULL, &_29$$25, "__construct", &_12, 29, &_30$$25); zephir_check_call_status(); - zephir_throw_exception_debug(&_29$$25, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_29$$25, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -87194,7 +87919,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); ZEPHIR_CALL_METHOD(NULL, &records, "next", NULL, 0); zephir_check_call_status(); } @@ -87230,8 +87955,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize) ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 262); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 260); return; } ZEPHIR_INIT_VAR(&data); @@ -87314,8 +88039,8 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 300); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 297); return; } ZEPHIR_INIT_VAR(&_2); @@ -87337,22 +88062,22 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) zephir_check_call_status(); } if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Simple.zep", 313); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Simple.zep", 310); return; } - zephir_array_fetch_string(&_5, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 316); + zephir_array_fetch_string(&_5, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 313); zephir_update_property_zval(this_ptr, ZEND_STRL("model"), &_5); - zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 317); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 314); zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_6); - zephir_array_fetch_string(&_7, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 318); + zephir_array_fetch_string(&_7, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 315); ZEPHIR_INIT_ZVAL_NREF(_8); ZVAL_LONG(&_8, zephir_fast_count_int(&_7)); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_8); - zephir_array_fetch_string(&_9, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 319); + zephir_array_fetch_string(&_9, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 316); zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_9); - zephir_array_fetch_string(&_10, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 320); + zephir_array_fetch_string(&_10, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 317); zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_10); - zephir_array_fetch_string(&_11, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 321); + zephir_array_fetch_string(&_11, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 318); zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_11); if (zephir_array_isset_string_fetch(&keepSnapshots, &resultset, SL("keepSnapshots"), 1)) { zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &keepSnapshots); @@ -87360,6 +88085,92 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) ZEPHIR_MM_RESTORE(); } +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __serialize) +{ + zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + + + ZEPHIR_MM_GROW(); + + zephir_create_array(return_value, 6, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("model"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("model"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("cache"), &_0, PH_COPY | PH_SEPARATE); + ZVAL_BOOL(&_2, 0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "toarray", NULL, 0, &_2); + zephir_check_call_status(); + zephir_array_update_string(return_value, SL("rows"), &_1, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("columnMap"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("hydrateMode"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("keepSnapshots"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("keepSnapshots"), &_0, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *data_param = NULL, keepSnapshots, _0, _1, _2, _3, _4, _5, _6; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&keepSnapshots); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + zephir_array_fetch_string(&_0, &data, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 341); + zephir_update_property_zval(this_ptr, ZEND_STRL("model"), &_0); + zephir_array_fetch_string(&_1, &data, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 342); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_1); + zephir_array_fetch_string(&_2, &data, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 343); + ZEPHIR_INIT_ZVAL_NREF(_3); + ZVAL_LONG(&_3, zephir_fast_count_int(&_2)); + zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_3); + zephir_array_fetch_string(&_4, &data, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 344); + zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_4); + zephir_array_fetch_string(&_5, &data, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 345); + zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_5); + zephir_array_fetch_string(&_6, &data, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 346); + zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_6); + if (zephir_array_isset_string_fetch(&keepSnapshots, &data, SL("keepSnapshots"), 1)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &keepSnapshots); + } + ZEPHIR_MM_RESTORE(); +} + @@ -87908,7 +88719,7 @@ static PHP_METHOD(Phalcon_Mvc_Model_MetaData_Stream, write) ZEPHIR_CONCAT_SVS(&_5$$3, ""); RETURN_MM(); @@ -92313,7 +93124,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileDo) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 591); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); @@ -92356,13 +93167,13 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileEcho) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 615); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); zephir_array_fetch_string(&_2, &expr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 623); if (ZEPHIR_IS_LONG(&_2, 350)) { @@ -92416,13 +93227,13 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileElseIf) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 662); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); @@ -92495,7 +93306,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$4); ZEPHIR_CONCAT_SVS(&_1$$4, "Template file ", &path, " does not exist"); - ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 0, &_1$$4); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 501, &_1$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 702); ZEPHIR_MM_RESTORE(); @@ -92508,7 +93319,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) object_init_ex(&_2$$5, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVS(&_3$$5, "Template file ", &path, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 0, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 501, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 714); ZEPHIR_MM_RESTORE(); @@ -92625,7 +93436,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) ZEPHIR_CONCAT_VV(&prefixLevel, &prefix, &level); ZEPHIR_OBS_VAR(&expr); zephir_array_fetch_string(&expr, &statement, SL("expr"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 780); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_OBS_VAR(&blockStatements); zephir_array_fetch_string(&blockStatements, &statement, SL("block_statements"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 787); @@ -92685,7 +93496,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) } else { ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlist", NULL, 0, &blockStatements, &_4); + ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlist", NULL, 502, &blockStatements, &_4); zephir_check_call_status(); ZEPHIR_OBS_VAR(&loopContext); zephir_read_property(&loopContext, this_ptr, ZEND_STRL("loopPointers"), PH_NOISY_CC); @@ -92736,7 +93547,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) } ZEPHIR_OBS_VAR(&ifExpr); if (zephir_array_isset_string_fetch(&ifExpr, &statement, SL("if_expr"), 0)) { - ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "expression", NULL, 0, &ifExpr); + ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "expression", NULL, 500, &ifExpr); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_17$$15); ZEPHIR_CONCAT_SVS(&_17$$15, "if (", &_16$$15, ") { ?>"); @@ -92864,13 +93675,13 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 942); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); zephir_array_fetch_string(&_4, &statement, SL("true_statements"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 948); if (extendsMode) { @@ -92878,7 +93689,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) } else { ZVAL_BOOL(&_5, 0); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "statementlist", NULL, 0, &_4, &_5); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "statementlist", NULL, 502, &_4, &_5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVSV(&_6, "", &_3); @@ -92890,7 +93701,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) } else { ZVAL_BOOL(&_8$$4, 0); } - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "statementlist", NULL, 0, &blockStatements, &_8$$4); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "statementlist", NULL, 502, &blockStatements, &_8$$4); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$4); ZEPHIR_CONCAT_SV(&_9$$4, "", &_7$$4); @@ -92960,14 +93771,14 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileInclude) RETURN_CCTOR(&compilation); } } - ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 0, &pathExpr); + ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 500, &pathExpr); zephir_check_call_status(); ZEPHIR_OBS_VAR(¶ms); if (!(zephir_array_isset_string_fetch(¶ms, &statement, SL("params"), 0))) { ZEPHIR_CONCAT_SVS(return_value, "partial(", &path, "); ?>"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 0, ¶ms); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 500, ¶ms); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "partial(", &path, ", ", &_3, "); ?>"); RETURN_MM(); @@ -93047,7 +93858,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) object_init_ex(&_1$$4, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SVS(&_2$$4, "Macro '", &name, "' is already defined"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 0, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 501, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1064); ZEPHIR_MM_RESTORE(); @@ -93098,7 +93909,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1); ZEPHIR_OBS_NVAR(&defaultValue); if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) { - ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "expression", &_15, 0, &defaultValue); + ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "expression", &_15, 500, &defaultValue); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$8); ZEPHIR_CONCAT_SVSVS(&_16$$8, "$", &variableName, " = ", &_14$$8, ";"); @@ -93141,7 +93952,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1); ZEPHIR_OBS_NVAR(&defaultValue); if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) { - ZEPHIR_CALL_METHOD(&_22$$11, this_ptr, "expression", &_15, 0, &defaultValue); + ZEPHIR_CALL_METHOD(&_22$$11, this_ptr, "expression", &_15, 500, &defaultValue); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_23$$11); ZEPHIR_CONCAT_SVSVS(&_23$$11, "$", &variableName, " = ", &_22$$11, ";"); @@ -93167,7 +93978,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) } else { ZVAL_BOOL(&_26$$13, 0); } - ZEPHIR_CALL_METHOD(&_25$$13, this_ptr, "statementlist", NULL, 0, &blockStatements, &_26$$13); + ZEPHIR_CALL_METHOD(&_25$$13, this_ptr, "statementlist", NULL, 502, &blockStatements, &_26$$13); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_27$$13); ZEPHIR_CONCAT_VS(&_27$$13, &_25$$13, ""); RETURN_MM(); @@ -93276,10 +94087,10 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) ZEPHIR_INIT_NVAR(&assignment); ZVAL_COPY(&assignment, _0); zephir_array_fetch_string(&_2$$4, &assignment, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1177); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 0, &_2$$4); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 500, &_2$$4); zephir_check_call_status(); zephir_array_fetch_string(&_4$$4, &assignment, SL("variable"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1184); - ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 0, &_4$$4); + ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 500, &_4$$4); zephir_check_call_status(); zephir_array_fetch_string(&_5$$4, &assignment, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1190); do { @@ -93326,10 +94137,10 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) ZEPHIR_CALL_METHOD(&assignment, &assignments, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_11$$10, &assignment, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1177); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 0, &_11$$10); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 500, &_11$$10); zephir_check_call_status(); zephir_array_fetch_string(&_12$$10, &assignment, SL("variable"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1184); - ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 0, &_12$$10); + ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 500, &_12$$10); zephir_check_call_status(); zephir_array_fetch_string(&_13$$10, &assignment, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1190); do { @@ -93473,13 +94284,13 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1256); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_INIT_VAR(&compilation); ZEPHIR_CONCAT_SVS(&compilation, ""); @@ -93490,14 +94301,14 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) } else { ZVAL_BOOL(&_3$$4, 0); } - ZEPHIR_CALL_METHOD(&lines, this_ptr, "statementlist", NULL, 0, &caseClauses, &_3$$4); + ZEPHIR_CALL_METHOD(&lines, this_ptr, "statementlist", NULL, 502, &caseClauses, &_3$$4); zephir_check_call_status(); if (zephir_fast_strlen_ev(&lines) != 0) { ZEPHIR_INIT_VAR(&_4$$5); ZVAL_STRING(&_4$$5, "/(*ANYCRLF)^\\h+|\\h+$|(\\h){2,}/mu"); ZEPHIR_INIT_VAR(&_5$$5); ZVAL_STRING(&_5$$5, ""); - ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 50, &_4$$5, &_5$$5, &lines); + ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 37, &_4$$5, &_5$$5, &lines); zephir_check_call_status(); ZEPHIR_CPY_WRT(&lines, &_6$$5); } @@ -93578,7 +94389,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) zephir_array_fast_append(&_1$$4, &expr); ZEPHIR_INIT_NVAR(&_2$$4); ZVAL_STRING(&_2$$4, "resolveExpression"); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_3, 0, &_2$$4, &_1$$4); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_3, 503, &_2$$4, &_1$$4); zephir_check_call_status(); if (Z_TYPE_P(&exprCode) == IS_STRING) { break; @@ -93595,7 +94406,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) ZEPHIR_INIT_NVAR(&singleExpr); ZVAL_COPY(&singleExpr, _4$$6); zephir_array_fetch_string(&_6$$7, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344); - ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 0, &_6$$7); + ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 500, &_6$$7); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) { @@ -93618,7 +94429,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) ZEPHIR_CALL_METHOD(&singleExpr, &expr, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_9$$10, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344); - ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 0, &_9$$10); + ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 500, &_9$$10); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) { @@ -93644,7 +94455,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } ZEPHIR_OBS_NVAR(&left); if (zephir_array_isset_string_fetch(&left, &expr, SL("left"), 0)) { - ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 0, &left); + ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 500, &left); zephir_check_call_status(); } if (ZEPHIR_IS_LONG(&type, 311)) { @@ -93655,13 +94466,13 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } if (ZEPHIR_IS_LONG(&type, 124)) { zephir_array_fetch_string(&_14$$16, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1391); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_15, 0, &_14$$16, &leftCode); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_15, 504, &_14$$16, &leftCode); zephir_check_call_status(); break; } ZEPHIR_OBS_NVAR(&right); if (zephir_array_isset_string_fetch(&right, &expr, SL("right"), 0)) { - ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 0, &right); + ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 500, &right); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(&exprCode); @@ -93837,7 +94648,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) if (ZEPHIR_IS_LONG(&type, 365)) { ZEPHIR_OBS_NVAR(&start); if (zephir_array_isset_string_fetch(&start, &expr, SL("start"), 0)) { - ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 0, &start); + ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 500, &start); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&startCode); @@ -93845,7 +94656,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } ZEPHIR_OBS_NVAR(&end); if (zephir_array_isset_string_fetch(&end, &expr, SL("end"), 0)) { - ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 0, &end); + ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 500, &end); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&endCode); @@ -93937,7 +94748,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } if (ZEPHIR_IS_LONG(&type, 366)) { zephir_array_fetch_string(&_23$$72, &expr, SL("ternary"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1625); - ZEPHIR_CALL_METHOD(&_22$$72, this_ptr, "expression", &_7, 0, &_23$$72); + ZEPHIR_CALL_METHOD(&_22$$72, this_ptr, "expression", &_7, 500, &_23$$72); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&exprCode); ZEPHIR_CONCAT_SVSVSVS(&exprCode, "(", &_22$$72, " ? ", &leftCode, " : ", &rightCode, ")"); @@ -93964,7 +94775,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) zephir_array_fetch_string(&_26$$76, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643); ZEPHIR_INIT_NVAR(&_27$$76); ZEPHIR_CONCAT_SVSVSV(&_27$$76, "Unknown expression ", &type, " in ", &_25$$76, " on line ", &_26$$76); - ZEPHIR_CALL_METHOD(NULL, &_24$$76, "__construct", &_28, 0, &_27$$76); + ZEPHIR_CALL_METHOD(NULL, &_24$$76, "__construct", &_28, 501, &_27$$76); zephir_check_call_status(); zephir_throw_exception_debug(&_24$$76, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643); ZEPHIR_MM_RESTORE(); @@ -94165,7 +94976,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) ZVAL_NULL(&funcArguments); ZEPHIR_OBS_NVAR(&funcArguments); if (zephir_array_isset_string_fetch(&funcArguments, &expr, SL("arguments"), 0)) { - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 0, &funcArguments); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 500, &funcArguments); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&arguments); @@ -94188,7 +94999,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_array_fast_append(&_1$$6, &funcArguments); ZEPHIR_INIT_VAR(&_2$$6); ZVAL_STRING(&_2$$6, "compileFunction"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 0, &_2$$6, &_1$$6); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 503, &_2$$6, &_1$$6); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_STRING) { RETURN_CCTOR(&code); @@ -94220,7 +95031,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_array_fetch_string(&_6$$9, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1775); ZEPHIR_INIT_VAR(&_7$$9); ZEPHIR_CONCAT_SVSVSV(&_7$$9, "Invalid definition for user function '", &name, "' in ", &_5$$9, " on line ", &_6$$9); - ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 0, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 501, &_7$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$9, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1775); ZEPHIR_MM_RESTORE(); @@ -94249,7 +95060,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_read_property(&_11$$17, this_ptr, ZEND_STRL("exprLevel"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&exprLevel, &_11$$17); if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlistorextends", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlistorextends", NULL, 505, &block); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&exprLevel, 1)) { ZEPHIR_CPY_WRT(&escapedCode, &code); @@ -94276,7 +95087,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) } ZEPHIR_INIT_VAR(&_12$$5); zephir_camelize(&_12$$5, &name, NULL ); - ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 104, &_12$$5); + ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 73, &_12$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&arrayHelpers); zephir_create_array(&arrayHelpers, 16, 0); @@ -94369,7 +95180,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) ZEPHIR_CONCAT_SVSVS(return_value, "$this->callMacro('", &name, "', [", &arguments, "])"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_21, this_ptr, "expression", NULL, 0, &nameExpr); + ZEPHIR_CALL_METHOD(&_21, this_ptr, "expression", NULL, 500, &nameExpr); zephir_check_call_status(); ZEPHIR_CONCAT_VSVS(return_value, &_21, "(", &arguments, ")"); RETURN_MM(); @@ -94640,28 +95451,28 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveTest) if (zephir_array_isset_string_fetch(&name, &testName, SL("value"), 0)) { if (ZEPHIR_IS_STRING(&name, "divisibleby")) { zephir_array_fetch_string(&_1$$12, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2155); - ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 0, &_1$$12); + ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 500, &_1$$12); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "(((", &left, ") % (", &_0$$12, ")) == 0)"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&name, "sameas")) { zephir_array_fetch_string(&_3$$13, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2162); - ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 0, &_3$$13); + ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 500, &_3$$13); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "(", &left, ") === (", &_2$$13, ")"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&name, "type")) { zephir_array_fetch_string(&_5$$14, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2169); - ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 0, &_5$$14); + ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 500, &_5$$14); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "gettype(", &left, ") === (", &_4$$14, ")"); RETURN_MM(); } } } - ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 0, &test); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 500, &test); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &left, " == ", &_6); RETURN_MM(); @@ -94863,7 +95674,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) } else { ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 0, &intermediate, &_0); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 502, &intermediate, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("extended"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&extended, &_1); @@ -94899,11 +95710,11 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) ZEPHIR_INIT_NVAR(&localBlock); array_init(&localBlock); } - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &localBlock); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &localBlock); zephir_check_call_status(); } else { if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &block); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&blockCompilation, &block); @@ -94944,11 +95755,11 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) ZEPHIR_INIT_NVAR(&localBlock); array_init(&localBlock); } - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &localBlock); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &localBlock); zephir_check_call_status(); } else { if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &block); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&blockCompilation, &block); @@ -95137,7 +95948,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_2$$5, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2389); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVSV(&_3$$5, "Unknown filter type in ", &_1$$5, " on line ", &_2$$5); - ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 0, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 501, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2389); ZEPHIR_MM_RESTORE(); @@ -95171,11 +95982,11 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_update_string(&_4$$7, SL("file"), &file, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$7, SL("line"), &line, PH_COPY | PH_SEPARATE); ZEPHIR_MAKE_REF(&funcArguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &funcArguments, &_4$$7); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &funcArguments, &_4$$7); ZEPHIR_UNREF(&funcArguments); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 0, &funcArguments); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 500, &funcArguments); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&arguments, &left); @@ -95190,7 +96001,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fast_append(&_7$$9, &funcArguments); ZEPHIR_INIT_VAR(&_8$$9); ZVAL_STRING(&_8$$9, "compileFilter"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 0, &_8$$9, &_7$$9); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 503, &_8$$9, &_7$$9); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_STRING) { RETURN_CCTOR(&code); @@ -95221,7 +96032,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_12$$11, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2483); ZEPHIR_INIT_VAR(&_13$$11); ZEPHIR_CONCAT_SVSVSV(&_13$$11, "Invalid definition for user filter '", &name, "' in ", &_11$$11, " on line ", &_12$$11); - ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", NULL, 0, &_13$$11); + ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", NULL, 501, &_13$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$11, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2483); ZEPHIR_MM_RESTORE(); @@ -95355,7 +96166,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_25, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2677); ZEPHIR_INIT_VAR(&_26); ZEPHIR_CONCAT_SVSVSV(&_26, "Unknown filter \"", &name, "\" in ", &_24, " on line ", &_25); - ZEPHIR_CALL_METHOD(NULL, &_23, "__construct", NULL, 0, &_26); + ZEPHIR_CALL_METHOD(NULL, &_23, "__construct", NULL, 501, &_26); zephir_check_call_status(); zephir_throw_exception_debug(&_23, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2677); ZEPHIR_MM_RESTORE(); @@ -95523,7 +96334,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_6$$7, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2725); ZEPHIR_INIT_NVAR(&_7$$7); ZEPHIR_CONCAT_SVSV(&_7$$7, "Invalid statement in ", &_5$$7, " on line ", &_6$$7); - ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_8, 0, &_7$$7, &statement); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_8, 501, &_7$$7, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$7, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2727); ZEPHIR_MM_RESTORE(); @@ -95535,7 +96346,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fast_append(&_9$$8, &statement); ZEPHIR_INIT_NVAR(&_10$$8); ZVAL_STRING(&_10$$8, "compileStatement"); - ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 0, &_10$$8, &_9$$8); + ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 503, &_10$$8, &_9$$8); zephir_check_call_status(); if (Z_TYPE_P(&tempCompilation) == IS_STRING) { zephir_concat_self(&compilation, &tempCompilation); @@ -95640,7 +96451,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) } else { ZVAL_BOOL(&_34$$24, 0); } - ZEPHIR_CALL_METHOD(&_33$$24, this_ptr, "statementlist", &_35, 0, &blockStatements, &_34$$24); + ZEPHIR_CALL_METHOD(&_33$$24, this_ptr, "statementlist", &_35, 502, &blockStatements, &_34$$24); zephir_check_call_status(); zephir_concat_self(&compilation, &_33$$24); } @@ -95750,7 +96561,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_58$$37, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_INIT_NVAR(&_59$$37); ZEPHIR_CONCAT_SVSVSV(&_59$$37, "Unknown statement ", &type, " in ", &_57$$37, " on line ", &_58$$37); - ZEPHIR_CALL_METHOD(NULL, &_56$$37, "__construct", &_8, 0, &_59$$37); + ZEPHIR_CALL_METHOD(NULL, &_56$$37, "__construct", &_8, 501, &_59$$37); zephir_check_call_status(); zephir_throw_exception_debug(&_56$$37, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_MM_RESTORE(); @@ -95780,7 +96591,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_62$$40, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2725); ZEPHIR_INIT_NVAR(&_63$$40); ZEPHIR_CONCAT_SVSV(&_63$$40, "Invalid statement in ", &_61$$40, " on line ", &_62$$40); - ZEPHIR_CALL_METHOD(NULL, &_60$$40, "__construct", &_8, 0, &_63$$40, &statement); + ZEPHIR_CALL_METHOD(NULL, &_60$$40, "__construct", &_8, 501, &_63$$40, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_60$$40, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2727); ZEPHIR_MM_RESTORE(); @@ -95792,7 +96603,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fast_append(&_64$$41, &statement); ZEPHIR_INIT_NVAR(&_65$$41); ZVAL_STRING(&_65$$41, "compileStatement"); - ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 0, &_65$$41, &_64$$41); + ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 503, &_65$$41, &_64$$41); zephir_check_call_status(); if (Z_TYPE_P(&tempCompilation) == IS_STRING) { zephir_concat_self(&compilation, &tempCompilation); @@ -95897,7 +96708,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) } else { ZVAL_BOOL(&_81$$57, 0); } - ZEPHIR_CALL_METHOD(&_80$$57, this_ptr, "statementlist", &_35, 0, &blockStatements, &_81$$57); + ZEPHIR_CALL_METHOD(&_80$$57, this_ptr, "statementlist", &_35, 502, &blockStatements, &_81$$57); zephir_check_call_status(); zephir_concat_self(&compilation, &_80$$57); } @@ -96007,7 +96818,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_96$$70, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_INIT_NVAR(&_97$$70); ZEPHIR_CONCAT_SVSVSV(&_97$$70, "Unknown statement ", &type, " in ", &_95$$70, " on line ", &_96$$70); - ZEPHIR_CALL_METHOD(NULL, &_94$$70, "__construct", &_8, 0, &_97$$70); + ZEPHIR_CALL_METHOD(NULL, &_94$$70, "__construct", &_8, 501, &_97$$70); zephir_check_call_status(); zephir_throw_exception_debug(&_94$$70, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_MM_RESTORE(); @@ -96094,7 +96905,7 @@ static PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementListOrExtends) ZEPHIR_INIT_NVAR(&statement); } if (isStatementList) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "statementlist", NULL, 0, statements); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "statementlist", NULL, 502, statements); zephir_check_call_status(); RETURN_MM(); } @@ -105974,7 +106785,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZVAL_STRING(&_1, "annotations"); ZEPHIR_CALL_METHOD(&annotationsService, &container, "getshared", NULL, 0, &_1); zephir_check_call_status(); - zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Router/Annotations.zep", 249); + zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Router/Annotations.zep", 250); if (Z_TYPE_P(&handlers) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _2) { @@ -105988,9 +106799,9 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (!(ZEPHIR_IS_EMPTY(&prefix))) { ZEPHIR_INIT_NVAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 124, &prefix); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 96, &prefix); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5$$6, &route, "getcompiledpattern", &_6, 0); + ZEPHIR_CALL_METHOD(&_5$$6, &route, "getcompiledpattern", &_6, 483); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "$#"); @@ -106025,6 +106836,14 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_OBS_NVAR(&moduleName); zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0); ZEPHIR_INIT_NVAR(&_11$$4); + if (Z_TYPE_P(&moduleName) != IS_NULL) { + ZEPHIR_CPY_WRT(&_11$$4, &moduleName); + } else { + ZEPHIR_INIT_NVAR(&_11$$4); + ZVAL_STRING(&_11$$4, ""); + } + ZEPHIR_CPY_WRT(&moduleName, &_11$$4); + ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_CONCAT_VV(&_11$$4, &controllerName, &controllerSuffix); zephir_get_strval(&sufixed, &_11$$4); if (Z_TYPE_P(&namespaceName) != IS_NULL) { @@ -106043,7 +106862,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&annotations) == IS_ARRAY) { - zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217); + zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 218); if (Z_TYPE_P(&annotations) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _14$$15) { @@ -106077,7 +106896,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&lowerControllerName); zephir_uncamelize(&lowerControllerName, &controllerName, NULL ); - zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243); + zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 244); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _19$$18, _20$$18, _17$$18) { @@ -106094,7 +106913,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_21$$19, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_21$$19, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_21$$19, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_21$$19) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_21$$19), _22$$19) { @@ -106140,7 +106959,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_25$$23, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_25$$23, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_25$$23, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_25$$23) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_25$$23), _26$$23) { @@ -106194,9 +107013,9 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (!(ZEPHIR_IS_EMPTY(&prefix))) { ZEPHIR_INIT_NVAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 124, &prefix); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 96, &prefix); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_28$$29, &route, "getcompiledpattern", &_6, 0); + ZEPHIR_CALL_METHOD(&_28$$29, &route, "getcompiledpattern", &_6, 483); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_29$$29); ZVAL_STRING(&_29$$29, "$#"); @@ -106231,6 +107050,14 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_OBS_NVAR(&moduleName); zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0); ZEPHIR_INIT_NVAR(&_33$$27); + if (Z_TYPE_P(&moduleName) != IS_NULL) { + ZEPHIR_CPY_WRT(&_33$$27, &moduleName); + } else { + ZEPHIR_INIT_NVAR(&_33$$27); + ZVAL_STRING(&_33$$27, ""); + } + ZEPHIR_CPY_WRT(&moduleName, &_33$$27); + ZEPHIR_INIT_NVAR(&_33$$27); ZEPHIR_CONCAT_VV(&_33$$27, &controllerName, &controllerSuffix); zephir_get_strval(&sufixed, &_33$$27); if (Z_TYPE_P(&namespaceName) != IS_NULL) { @@ -106249,7 +107076,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&annotations) == IS_ARRAY) { - zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217); + zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 218); if (Z_TYPE_P(&annotations) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _36$$38) { @@ -106283,7 +107110,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&lowerControllerName); zephir_uncamelize(&lowerControllerName, &controllerName, NULL ); - zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243); + zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 244); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _40$$41, _41$$41, _38$$41) { @@ -106300,7 +107127,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_42$$42, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_42$$42, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_42$$42, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_42$$42) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_42$$42), _43$$42) { @@ -106346,7 +107173,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_45$$46, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_45$$46, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_45$$46, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_45$$46) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_45$$46), _46$$46) { @@ -106515,7 +107342,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) zephir_read_property(&_2, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY); if (Z_TYPE_P(&_2) != IS_NULL) { zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_4$$6, "call_user_func", NULL, 199, &_3$$6, &proxyActionName); + ZEPHIR_CALL_FUNCTION(&_4$$6, "call_user_func", NULL, 180, &_3$$6, &proxyActionName); zephir_check_call_status(); ZEPHIR_CPY_WRT(&proxyActionName, &_4$$6); } @@ -106576,7 +107403,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5); zephir_check_call_status(); if (Z_TYPE_P(&converts) == IS_ARRAY) { - zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 372); + zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 373); if (Z_TYPE_P(&converts) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _11$$18, _12$$18, _9$$18) { @@ -106618,7 +107445,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5); zephir_check_call_status(); if (Z_TYPE_P(&converts) == IS_ARRAY) { - zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 383); + zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 384); if (Z_TYPE_P(&converts) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _17$$21, _18$$21, _15$$21) { @@ -106791,7 +107618,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionPreformatCallback) zephir_create_closure_ex(&_0$$4, NULL, phalcon_10__closure_ce, SL("__invoke")); zephir_update_property_zval(this_ptr, ZEND_STRL("actionPreformatCallback"), &_0$$4); } else { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/Mvc/Router/Annotations.zep", 462); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/Mvc/Router/Annotations.zep", 463); return; } ZEPHIR_MM_RESTORE(); @@ -107731,10 +108558,10 @@ static PHP_METHOD(Phalcon_Mvc_Router_Group, addRoute) zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_VV(&_2, &_1, &pattern); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 124, &_2, &mergedPaths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 96, &_2, &mergedPaths, httpMethods); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("routes"), &route); - ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 484, this_ptr); zephir_check_call_status(); RETURN_CCTOR(&route); } @@ -108426,7 +109253,7 @@ static PHP_METHOD(Phalcon_Mvc_Router_Route, getReversedPaths) ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 203, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 95, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -109454,17 +110281,18 @@ static PHP_METHOD(Phalcon_Mvc_Micro_Collection, addMap) ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(4, 4) + ZEND_PARSE_PARAMETERS_START(3, 4) Z_PARAM_ZVAL(method) Z_PARAM_STR(routePattern) Z_PARAM_ZVAL(handler) - Z_PARAM_STR(name) + Z_PARAM_OPTIONAL + Z_PARAM_STR_OR_NULL(name) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 0, &method, &routePattern_param, &handler, &name_param); + zephir_fetch_params(1, 3, 1, &method, &routePattern_param, &handler, &name_param); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string")); RETURN_MM_NULL(); @@ -109474,7 +110302,11 @@ static PHP_METHOD(Phalcon_Mvc_Micro_Collection, addMap) } else { ZEPHIR_INIT_VAR(&routePattern); } - zephir_get_strval(&name, name_param); + if (!name_param) { + ZEPHIR_INIT_VAR(&name); + } else { + zephir_get_strval(&name, name_param); + } ZEPHIR_INIT_VAR(&_0); @@ -109690,7 +110522,7 @@ static PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, callMethod) object_init_ex(&_1$$4, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SVS(&_2$$4, "Handler '", &definition, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/Micro/LazyLoader.zep", 55); ZEPHIR_MM_RESTORE(); @@ -109745,103 +110577,6 @@ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Micro_MiddlewareInterface, call); -ZEPHIR_INIT_CLASS(Phalcon_Container_Container) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Container, Container, phalcon, container_container, phalcon_container_container_method_entry, 0); - - zend_declare_property_null(phalcon_container_container_ce, SL("container"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_container_container_ce, 1, zephir_get_internal_ce(SL("psr\\container\\containerinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Container_Container, __construct) -{ - zval *container, container_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&container_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &container); - - - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container); -} - -static PHP_METHOD(Phalcon_Container_Container, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "getshared", NULL, 0, &name); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Container_Container, has) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &name); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - ZEPHIR_INIT_CLASS(Phalcon_Di_AbstractInjectionAware) { ZEPHIR_REGISTER_CLASS(Phalcon\\Di, AbstractInjectionAware, phalcon, di_abstractinjectionaware, phalcon_di_abstractinjectionaware_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); @@ -109974,7 +110709,7 @@ static PHP_METHOD(Phalcon_Di_Di, __call) ZVAL_LONG(&_0$$3, 3); ZEPHIR_INIT_VAR(&_1$$3); zephir_substr(&_1$$3, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 104, &_1$$3); + ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 73, &_1$$3); zephir_check_call_status(); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_2$$3, &possibleService)) { @@ -109989,7 +110724,7 @@ static PHP_METHOD(Phalcon_Di_Di, __call) ZVAL_LONG(&_3$$6, 3); ZEPHIR_INIT_VAR(&_4$$6); zephir_substr(&_4$$6, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_5$$6, "lcfirst", NULL, 104, &_4$$6); + ZEPHIR_CALL_FUNCTION(&_5$$6, "lcfirst", NULL, 73, &_4$$6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &_5$$6, &definition); zephir_check_call_status(); @@ -110000,9 +110735,9 @@ static PHP_METHOD(Phalcon_Di_Di, __call) object_init_ex(&_6, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVS(&_7, "Call to undefined method or service '", &method, "'"); - ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 31, &_7); + ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 29, &_7); zephir_check_call_status(); - zephir_throw_exception_debug(&_6, "phalcon/Di/Di.zep", 146); + zephir_throw_exception_debug(&_6, "phalcon/Di/Di.zep", 147); ZEPHIR_MM_RESTORE(); return; } @@ -110063,21 +110798,21 @@ static PHP_METHOD(Phalcon_Di_Di, attempt) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 105, definition, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 74, definition, &_2); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_1); zephir_read_property(&_3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 162); + zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 163); RETURN_CTOR(&_4); } static PHP_METHOD(Phalcon_Di_Di, get) { - zval _6$$5, _15$$17; + zval _6$$5, _15$$18; zend_bool _1$$3, _14$$11; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, eventsManager, isShared, instance, _0, _5, _2$$3, _3$$4, _4$$4, _7$$5, _8$$7, _9$$7, _10$$9, _12$$12, _16$$17; + zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, eventsManager, isShared, instance, _0, _5, _2$$3, _3$$4, _4$$4, _7$$5, _8$$7, _9$$7, _10$$9, _12$$12, _16$$18; zval name, _11$$9, _13$$12; zval *this_ptr = getThis(); @@ -110100,9 +110835,9 @@ static PHP_METHOD(Phalcon_Di_Di, get) ZVAL_UNDEF(&_9$$7); ZVAL_UNDEF(&_10$$9); ZVAL_UNDEF(&_12$$12); - ZVAL_UNDEF(&_16$$17); + ZVAL_UNDEF(&_16$$18); ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_15$$18); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -110144,7 +110879,7 @@ static PHP_METHOD(Phalcon_Di_Di, get) } if (_1$$3) { zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_4$$4, &_3$$4, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 180); + zephir_array_fetch(&_4$$4, &_3$$4, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 181); RETURN_CTOR(&_4$$4); } } @@ -110182,9 +110917,9 @@ static PHP_METHOD(Phalcon_Di_Di, get) object_init_ex(&_10$$9, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_11$$9); ZEPHIR_CONCAT_SVS(&_11$$9, "Service '", &name, "' cannot be resolved"); - ZEPHIR_CALL_METHOD(NULL, &_10$$9, "__construct", NULL, 31, &_11$$9); + ZEPHIR_CALL_METHOD(NULL, &_10$$9, "__construct", NULL, 29, &_11$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_10$$9, "phalcon/Di/Di.zep", 209); + zephir_throw_exception_debug(&_10$$9, "phalcon/Di/Di.zep", 210); ZEPHIR_MM_RESTORE(); return; } @@ -110198,9 +110933,9 @@ static PHP_METHOD(Phalcon_Di_Di, get) object_init_ex(&_12$$12, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_13$$12); ZEPHIR_CONCAT_SVS(&_13$$12, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", NULL, 31, &_13$$12); + ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", NULL, 29, &_13$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$12, "phalcon/Di/Di.zep", 224); + zephir_throw_exception_debug(&_12$$12, "phalcon/Di/Di.zep", 225); ZEPHIR_MM_RESTORE(); return; } @@ -110224,16 +110959,20 @@ static PHP_METHOD(Phalcon_Di_Di, get) ZEPHIR_CALL_METHOD(NULL, &instance, "setdi", NULL, 0, this_ptr); zephir_check_call_status(); } + if (zephir_instance_of_ev(&instance, phalcon_di_initializationawareinterface_ce)) { + ZEPHIR_CALL_METHOD(NULL, &instance, "initialize", NULL, 0); + zephir_check_call_status(); + } } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_15$$17); - zephir_create_array(&_15$$17, 3, 0); - zephir_array_update_string(&_15$$17, SL("name"), &name, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$17, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$17, SL("instance"), &instance, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(&_16$$17); - ZVAL_STRING(&_16$$17, "di:afterServiceResolve"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_16$$17, this_ptr, &_15$$17); + ZEPHIR_INIT_VAR(&_15$$18); + zephir_create_array(&_15$$18, 3, 0); + zephir_array_update_string(&_15$$18, SL("name"), &name, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_15$$18, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_15$$18, SL("instance"), &instance, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_16$$18); + ZVAL_STRING(&_16$$18, "di:afterServiceResolve"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_16$$18, this_ptr, &_15$$18); zephir_check_call_status(); } RETURN_CCTOR(&instance); @@ -110302,9 +111041,9 @@ static PHP_METHOD(Phalcon_Di_Di, getRaw) object_init_ex(&_1$$3, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 290); + zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 295); ZEPHIR_MM_RESTORE(); return; } @@ -110354,9 +111093,9 @@ static PHP_METHOD(Phalcon_Di_Di, getService) object_init_ex(&_1$$3, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 306); + zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 311); ZEPHIR_MM_RESTORE(); return; } @@ -110456,7 +111195,7 @@ static PHP_METHOD(Phalcon_Di_Di, loadFromConfig) ZEPHIR_CALL_METHOD(&services, config, "toarray", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&services, 0, "phalcon/Di/Di.zep", 356); + zephir_is_iterable(&services, 0, "phalcon/Di/Di.zep", 361); if (Z_TYPE_P(&services) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&services), _2, _3, _0) { @@ -110471,7 +111210,7 @@ static PHP_METHOD(Phalcon_Di_Di, loadFromConfig) _4$$3 = zephir_array_isset_string(&service, SL("shared")); if (_4$$3) { ZEPHIR_OBS_NVAR(&_5$$3); - zephir_array_fetch_string(&_5$$3, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 354); + zephir_array_fetch_string(&_5$$3, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 359); _4$$3 = zephir_is_true(&_5$$3); } ZVAL_BOOL(&_6$$3, _4$$3); @@ -110494,7 +111233,7 @@ static PHP_METHOD(Phalcon_Di_Di, loadFromConfig) _8$$4 = zephir_array_isset_string(&service, SL("shared")); if (_8$$4) { ZEPHIR_OBS_NVAR(&_9$$4); - zephir_array_fetch_string(&_9$$4, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 354); + zephir_array_fetch_string(&_9$$4, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 359); _8$$4 = zephir_is_true(&_9$$4); } ZVAL_BOOL(&_10$$4, _8$$4); @@ -110542,7 +111281,7 @@ static PHP_METHOD(Phalcon_Di_Di, loadFromPhp) ZEPHIR_INIT_VAR(&services); object_init_ex(&services, phalcon_config_adapter_php_ce); - ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 106, &filePath); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 75, &filePath); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); @@ -110591,7 +111330,7 @@ static PHP_METHOD(Phalcon_Di_Di, loadFromYaml) ZEPHIR_INIT_VAR(&services); object_init_ex(&services, phalcon_config_adapter_yaml_ce); - ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 107, &filePath, &callbacks); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 76, &filePath, &callbacks); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); @@ -110636,7 +111375,8 @@ static PHP_METHOD(Phalcon_Di_Di, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -110661,7 +111401,8 @@ static PHP_METHOD(Phalcon_Di_Di, offsetExists) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -110686,7 +111427,8 @@ static PHP_METHOD(Phalcon_Di_Di, offsetSet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *definition, definition_sub; + zval name_sub, definition_sub; + zval *name, *definition; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -110713,7 +111455,8 @@ static PHP_METHOD(Phalcon_Di_Di, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -110865,11 +111608,11 @@ static PHP_METHOD(Phalcon_Di_Di, set) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 105, definition, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 74, definition, &_1); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_0); zephir_read_property(&_2, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 547); + zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 552); RETURN_CTOR(&_3); } @@ -111125,7 +111868,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Annotations\\Adapter\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111142,7 +111885,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) zephir_array_fast_append(&_6, &_7); zephir_array_update_string(&_5, SL("arguments"), &_6, PH_COPY | PH_SEPARATE); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_5, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_5, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("assets"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111150,7 +111893,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Crypt"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("crypt"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111158,7 +111901,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Response\\Cookies"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("cookies"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111166,7 +111909,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Dispatcher"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111174,7 +111917,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Html\\Escaper"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111182,7 +111925,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Events\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111190,7 +111933,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Flash\\Direct"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flash"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111198,15 +111941,15 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Flash\\Session"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flashSession"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); object_init_ex(&_2, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(&_8, &filter, "newinstance", NULL, 120); + ZEPHIR_CALL_METHOD(&_8, &filter, "newinstance", NULL, 89); zephir_check_call_status(); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_8, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_8, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111214,7 +111957,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Support\\HelperFactory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("helper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111222,7 +111965,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111230,7 +111973,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111238,7 +111981,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Request"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("request"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111246,7 +111989,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Response"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("response"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111254,7 +111997,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Router"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111262,7 +112005,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Security"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111279,7 +112022,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) zephir_array_fast_append(&_7, &_9); zephir_array_update_string(&_6, SL("arguments"), &_7, PH_COPY | PH_SEPARATE); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_6, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_6, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("tag"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111287,7 +112030,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -111295,7 +112038,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Url"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("url"), &_2, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_1); @@ -111312,6 +112055,24 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) +ZEPHIR_INIT_CLASS(Phalcon_Di_InitializationAwareInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, InitializationAwareInterface, phalcon, di_initializationawareinterface, phalcon_di_initializationawareinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Di_InitializationAwareInterface, initialize); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Di_Injectable) { ZEPHIR_REGISTER_CLASS(Phalcon\\Di, Injectable, phalcon, di_injectable, phalcon_di_injectable_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); @@ -111736,7 +112497,7 @@ static PHP_METHOD(Phalcon_Di_Service, resolve) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 236, container, &definition, parameters); + ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 217, container, &definition, parameters); zephir_check_call_status(); } else { found = 0; @@ -111746,7 +112507,7 @@ static PHP_METHOD(Phalcon_Di_Service, resolve) if (UNEXPECTED(found == 0)) { ZEPHIR_INIT_VAR(&_5$$21); object_init_ex(&_5$$21, phalcon_di_exception_serviceresolutionexception_ce); - ZEPHIR_CALL_METHOD(NULL, &_5$$21, "__construct", NULL, 31); + ZEPHIR_CALL_METHOD(NULL, &_5$$21, "__construct", NULL, 29); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$21, "phalcon/Di/Service.zep", 205); ZEPHIR_MM_RESTORE(); @@ -112042,7 +112803,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) } else { ZEPHIR_OBS_VAR(&arguments); if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 0)) { - ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, &_0$$8); @@ -112080,7 +112841,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_5$$14, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_6$$14); ZEPHIR_CONCAT_SV(&_6$$14, "Method call must be an array on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_7, 31, &_6$$14); + ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_7, 29, &_6$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$14, "phalcon/Di/Service/Builder.zep", 103); ZEPHIR_MM_RESTORE(); @@ -112092,7 +112853,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_8$$15, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_9$$15); ZEPHIR_CONCAT_SV(&_9$$15, "The method name is required on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_8$$15, "__construct", &_7, 31, &_9$$15); + ZEPHIR_CALL_METHOD(NULL, &_8$$15, "__construct", &_7, 29, &_9$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$15, "phalcon/Di/Service/Builder.zep", 112); ZEPHIR_MM_RESTORE(); @@ -112110,7 +112871,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) zephir_cast_to_string(&_11$$17, &methodPosition); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SV(&_12$$17, "Call arguments must be an array on position ", &_11$$17); - ZEPHIR_CALL_METHOD(NULL, &_10$$17, "__construct", &_7, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_10$$17, "__construct", &_7, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$17, "phalcon/Di/Service/Builder.zep", 125); ZEPHIR_MM_RESTORE(); @@ -112118,7 +112879,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) } if (zephir_fast_count_int(&arguments)) { ZEPHIR_INIT_NVAR(&_13$$18); - ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_CALL_USER_FUNC_ARRAY(&_13$$18, &methodCall, &_14$$18); zephir_check_call_status(); @@ -112147,7 +112908,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_16$$20, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_17$$20); ZEPHIR_CONCAT_SV(&_17$$20, "Method call must be an array on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_16$$20, "__construct", &_7, 31, &_17$$20); + ZEPHIR_CALL_METHOD(NULL, &_16$$20, "__construct", &_7, 29, &_17$$20); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$20, "phalcon/Di/Service/Builder.zep", 103); ZEPHIR_MM_RESTORE(); @@ -112159,7 +112920,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_18$$21, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_19$$21); ZEPHIR_CONCAT_SV(&_19$$21, "The method name is required on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_18$$21, "__construct", &_7, 31, &_19$$21); + ZEPHIR_CALL_METHOD(NULL, &_18$$21, "__construct", &_7, 29, &_19$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$21, "phalcon/Di/Service/Builder.zep", 112); ZEPHIR_MM_RESTORE(); @@ -112178,7 +112939,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) zephir_cast_to_string(&_22$$23, &methodPosition); ZEPHIR_INIT_NVAR(&_23$$23); ZEPHIR_CONCAT_SV(&_23$$23, "Call arguments must be an array on position ", &_22$$23); - ZEPHIR_CALL_METHOD(NULL, &_21$$23, "__construct", &_7, 31, &_23$$23); + ZEPHIR_CALL_METHOD(NULL, &_21$$23, "__construct", &_7, 29, &_23$$23); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$23, "phalcon/Di/Service/Builder.zep", 125); ZEPHIR_MM_RESTORE(); @@ -112186,7 +112947,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) } if (zephir_fast_count_int(&arguments)) { ZEPHIR_INIT_NVAR(&_24$$24); - ZEPHIR_CALL_METHOD(&_25$$24, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_25$$24, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_CALL_USER_FUNC_ARRAY(&_24$$24, &methodCall, &_25$$24); zephir_check_call_status(); @@ -112230,7 +112991,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_31$$29, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_32$$29); ZEPHIR_CONCAT_SV(&_32$$29, "Property must be an array on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_31$$29, "__construct", &_7, 31, &_32$$29); + ZEPHIR_CALL_METHOD(NULL, &_31$$29, "__construct", &_7, 29, &_32$$29); zephir_check_call_status(); zephir_throw_exception_debug(&_31$$29, "phalcon/Di/Service/Builder.zep", 179); ZEPHIR_MM_RESTORE(); @@ -112242,7 +113003,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_33$$30, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_34$$30); ZEPHIR_CONCAT_SV(&_34$$30, "The property name is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_33$$30, "__construct", &_7, 31, &_34$$30); + ZEPHIR_CALL_METHOD(NULL, &_33$$30, "__construct", &_7, 29, &_34$$30); zephir_check_call_status(); zephir_throw_exception_debug(&_33$$30, "phalcon/Di/Service/Builder.zep", 188); ZEPHIR_MM_RESTORE(); @@ -112254,13 +113015,13 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_35$$31, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_36$$31); ZEPHIR_CONCAT_SV(&_36$$31, "The property value is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_35$$31, "__construct", &_7, 31, &_36$$31); + ZEPHIR_CALL_METHOD(NULL, &_35$$31, "__construct", &_7, 29, &_36$$31); zephir_check_call_status(); zephir_throw_exception_debug(&_35$$31, "phalcon/Di/Service/Builder.zep", 197); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_37$$28, this_ptr, "buildparameter", &_38, 238, container, &propertyPosition, &propertyValue); + ZEPHIR_CALL_METHOD(&_37$$28, this_ptr, "buildparameter", &_38, 219, container, &propertyPosition, &propertyValue); zephir_check_call_status(); zephir_update_property_zval_zval(&instance, &propertyName, &_37$$28); } ZEND_HASH_FOREACH_END(); @@ -112282,7 +113043,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_39$$33, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_40$$33); ZEPHIR_CONCAT_SV(&_40$$33, "Property must be an array on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_39$$33, "__construct", &_7, 31, &_40$$33); + ZEPHIR_CALL_METHOD(NULL, &_39$$33, "__construct", &_7, 29, &_40$$33); zephir_check_call_status(); zephir_throw_exception_debug(&_39$$33, "phalcon/Di/Service/Builder.zep", 179); ZEPHIR_MM_RESTORE(); @@ -112294,7 +113055,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_41$$34, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_42$$34); ZEPHIR_CONCAT_SV(&_42$$34, "The property name is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_7, 31, &_42$$34); + ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_7, 29, &_42$$34); zephir_check_call_status(); zephir_throw_exception_debug(&_41$$34, "phalcon/Di/Service/Builder.zep", 188); ZEPHIR_MM_RESTORE(); @@ -112306,13 +113067,13 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_43$$35, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_44$$35); ZEPHIR_CONCAT_SV(&_44$$35, "The property value is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_43$$35, "__construct", &_7, 31, &_44$$35); + ZEPHIR_CALL_METHOD(NULL, &_43$$35, "__construct", &_7, 29, &_44$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_43$$35, "phalcon/Di/Service/Builder.zep", 197); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_45$$32, this_ptr, "buildparameter", &_38, 238, container, &propertyPosition, &propertyValue); + ZEPHIR_CALL_METHOD(&_45$$32, this_ptr, "buildparameter", &_38, 219, container, &propertyPosition, &propertyValue); zephir_check_call_status(); zephir_update_property_zval_zval(&instance, &propertyName, &_45$$32); ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "next", NULL, 0); @@ -112379,7 +113140,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_1$$3, position); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Argument at position ", &_1$$3, " must have a type"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Di/Service/Builder.zep", 229); ZEPHIR_MM_RESTORE(); @@ -112395,7 +113156,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_4$$5, position); ZEPHIR_INIT_VAR(&_5$$5); ZEPHIR_CONCAT_SV(&_5$$5, "Service 'name' is required in parameter on position ", &_4$$5); - ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 31, &_5$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 29, &_5$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$5, "phalcon/Di/Service/Builder.zep", 242); ZEPHIR_MM_RESTORE(); @@ -112418,7 +113179,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_7$$8, position); ZEPHIR_INIT_VAR(&_8$$8); ZEPHIR_CONCAT_SV(&_8$$8, "Service 'value' is required in parameter on position ", &_7$$8); - ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 31, &_8$$8); + ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 29, &_8$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$8, "phalcon/Di/Service/Builder.zep", 260); ZEPHIR_MM_RESTORE(); @@ -112435,7 +113196,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_10$$10, position); ZEPHIR_INIT_VAR(&_11$$10); ZEPHIR_CONCAT_SV(&_11$$10, "Service 'className' is required in parameter on position ", &_10$$10); - ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 31, &_11$$10); + ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 29, &_11$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$10, "phalcon/Di/Service/Builder.zep", 273); ZEPHIR_MM_RESTORE(); @@ -112461,7 +113222,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_13$$13, position); ZEPHIR_INIT_VAR(&_14$$13); ZEPHIR_CONCAT_SV(&_14$$13, "Unknown service type in parameter on position ", &_13$$13); - ZEPHIR_CALL_METHOD(NULL, &_12$$13, "__construct", NULL, 31, &_14$$13); + ZEPHIR_CALL_METHOD(NULL, &_12$$13, "__construct", NULL, 29, &_14$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$13, "phalcon/Di/Service/Builder.zep", 301); ZEPHIR_MM_RESTORE(); @@ -112518,7 +113279,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameters) } ZEPHIR_INIT_NVAR(&argument); ZVAL_COPY(&argument, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "buildparameter", &_5, 238, container, &position, &argument); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "buildparameter", &_5, 219, container, &position, &argument); zephir_check_call_status(); zephir_array_append(&buildArguments, &_4$$3, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 320); } ZEND_HASH_FOREACH_END(); @@ -112535,7 +113296,7 @@ static PHP_METHOD(Phalcon_Di_Service_Builder, buildParameters) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "buildparameter", &_5, 238, container, &position, &argument); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "buildparameter", &_5, 219, container, &position, &argument); zephir_check_call_status(); zephir_array_append(&buildArguments, &_6$$4, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 320); ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0); @@ -112599,7 +113360,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Annotations\\Adapter\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112607,7 +113368,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Cli\\Dispatcher"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112615,7 +113376,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Html\\Escaper"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112623,15 +113384,15 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Events\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); object_init_ex(&_2, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(&_5, &filter, "newinstance", NULL, 120); + ZEPHIR_CALL_METHOD(&_5, &filter, "newinstance", NULL, 89); zephir_check_call_status(); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_5, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_5, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112639,7 +113400,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Support\\HelperFactory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("helper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112647,7 +113408,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112655,7 +113416,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112663,7 +113424,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Cli\\Router"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112671,7 +113432,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Security"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -112679,7 +113440,7 @@ static PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_1); @@ -112844,7 +113605,7 @@ static PHP_METHOD(Phalcon_Cli_Console, handle) object_init_ex(&_10$$12, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(&_11$$12); ZEPHIR_CONCAT_SVS(&_11$$12, "Module '", &moduleName, "' isn't registered in the console container"); - ZEPHIR_CALL_METHOD(NULL, &_10$$12, "__construct", NULL, 31, &_11$$12); + ZEPHIR_CALL_METHOD(NULL, &_10$$12, "__construct", NULL, 29, &_11$$12); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$12, "phalcon/Cli/Console.zep", 91); ZEPHIR_MM_RESTORE(); @@ -112868,7 +113629,7 @@ static PHP_METHOD(Phalcon_Cli_Console, handle) object_init_ex(&_12$$16, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(&_13$$16); ZEPHIR_CONCAT_SVS(&_13$$16, "Module definition path '", &path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_12$$16, "__construct", NULL, 31, &_13$$16); + ZEPHIR_CALL_METHOD(NULL, &_12$$16, "__construct", NULL, 29, &_13$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$16, "phalcon/Cli/Console.zep", 108); ZEPHIR_MM_RESTORE(); @@ -113051,7 +113812,7 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) } if (_0) { ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 23, &arguments); + ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 21, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); } @@ -113065,7 +113826,7 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_3$$5); ZVAL_STRING(&_3$$5, "--"); ZVAL_LONG(&_4$$5, 2); - ZEPHIR_CALL_FUNCTION(&_5$$5, "strncmp", &_6, 201, &arg, &_3$$5, &_4$$5); + ZEPHIR_CALL_FUNCTION(&_5$$5, "strncmp", &_6, 182, &arg, &_3$$5, &_4$$5); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_5$$5, 0)) { ZEPHIR_INIT_NVAR(&_7$$6); @@ -113097,7 +113858,7 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_18$$9); ZVAL_STRING(&_18$$9, "-"); ZVAL_LONG(&_19$$9, 1); - ZEPHIR_CALL_FUNCTION(&_20$$9, "strncmp", &_6, 201, &arg, &_18$$9, &_19$$9); + ZEPHIR_CALL_FUNCTION(&_20$$9, "strncmp", &_6, 182, &arg, &_18$$9, &_19$$9); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_20$$9, 0)) { ZVAL_LONG(&_21$$10, 1); @@ -113127,7 +113888,7 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_23$$14); ZVAL_STRING(&_23$$14, "--"); ZVAL_LONG(&_24$$14, 2); - ZEPHIR_CALL_FUNCTION(&_25$$14, "strncmp", &_6, 201, &arg, &_23$$14, &_24$$14); + ZEPHIR_CALL_FUNCTION(&_25$$14, "strncmp", &_6, 182, &arg, &_23$$14, &_24$$14); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_25$$14, 0)) { ZEPHIR_INIT_NVAR(&_26$$15); @@ -113159,7 +113920,7 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_37$$18); ZVAL_STRING(&_37$$18, "-"); ZVAL_LONG(&_38$$18, 1); - ZEPHIR_CALL_FUNCTION(&_39$$18, "strncmp", &_6, 201, &arg, &_37$$18, &_38$$18); + ZEPHIR_CALL_FUNCTION(&_39$$18, "strncmp", &_6, 182, &arg, &_37$$18, &_38$$18); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_39$$18, 0)) { ZVAL_LONG(&_40$$19, 1); @@ -113187,14 +113948,14 @@ static PHP_METHOD(Phalcon_Cli_Console, setArgument) } else { if (zephir_fast_count_int(&args)) { ZEPHIR_MAKE_REF(&args); - ZEPHIR_CALL_FUNCTION(&_45$$24, "array_shift", NULL, 23, &args); + ZEPHIR_CALL_FUNCTION(&_45$$24, "array_shift", NULL, 21, &args); ZEPHIR_UNREF(&args); zephir_check_call_status(); zephir_array_update_string(&handleArgs, SL("task"), &_45$$24, PH_COPY | PH_SEPARATE); } if (zephir_fast_count_int(&args)) { ZEPHIR_MAKE_REF(&args); - ZEPHIR_CALL_FUNCTION(&_46$$25, "array_shift", NULL, 23, &args); + ZEPHIR_CALL_FUNCTION(&_46$$25, "array_shift", NULL, 21, &args); ZEPHIR_UNREF(&args); zephir_check_call_status(); zephir_array_update_string(&handleArgs, SL("action"), &_46$$25, PH_COPY | PH_SEPARATE); @@ -113640,7 +114401,7 @@ static PHP_METHOD(Phalcon_Cli_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&exception); object_init_ex(&exception, phalcon_cli_dispatcher_exception_ce); ZVAL_LONG(&_0, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 31, &message, &_0); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 29, &message, &_0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "handleexception", NULL, 0, &exception); zephir_check_call_status(); @@ -113751,12 +114512,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router) zend_declare_property_null(phalcon_cli_router_ce, SL("action"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("defaultAction"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_cli_router_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_cli_router_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("defaultParams"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("defaultTask"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("matchedRoute"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("matches"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_cli_router_ce, SL("module"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_cli_router_ce, SL("module"), "", ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("params"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("routes"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_cli_router_ce, SL("task"), ZEND_ACC_PROTECTED); @@ -113809,7 +114570,7 @@ static PHP_METHOD(Phalcon_Cli_Router, __construct) add_assoc_long_ex(&_1$$3, SL("task"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+)[:delimiter]{0,1}$#"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 202, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 183, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/Cli/Router.zep", 120); ZEPHIR_INIT_NVAR(&_2$$3); @@ -113821,7 +114582,7 @@ static PHP_METHOD(Phalcon_Cli_Router, __construct) add_assoc_long_ex(&_3$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_4$$3); ZVAL_STRING(&_4$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+):delimiter([a-zA-Z0-9\\.\\_]+)(:delimiter.*)*$#"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 202, &_4$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 183, &_4$$3, &_3$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/Cli/Router.zep", 129); } @@ -113870,7 +114631,7 @@ static PHP_METHOD(Phalcon_Cli_Router, add) ZEPHIR_INIT_VAR(&route); object_init_ex(&route, phalcon_cli_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 202, &pattern, paths); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 183, &pattern, paths); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("routes"), &route); RETURN_CCTOR(&route); @@ -115506,7 +116267,7 @@ static PHP_METHOD(Phalcon_Cli_Router_Route, getReversedPaths) ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 203, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 95, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -116626,7 +117387,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, appendCondition) } zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_6, &_5, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 331); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_6); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_6); zephir_check_call_status(); zephir_read_property(&_7, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_8, &_7, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 333); @@ -118033,7 +118794,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Insert, getStatement) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 113); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 219); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 200); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildreturning", NULL, 0); zephir_check_call_status(); @@ -118341,7 +119102,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newDelete) object_init_ex(return_value, phalcon_datamapper_query_delete_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 220, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 201, connection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -118370,7 +119131,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newInsert) object_init_ex(return_value, phalcon_datamapper_query_insert_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 221, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 202, connection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -118443,7 +119204,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newUpdate) object_init_ex(return_value, phalcon_datamapper_query_update_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 222, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 203, connection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -118547,7 +119308,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, __call) object_init_ex(&_5, spl_ce_BadMethodCallException); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVS(&_6, "Unknown method: [", &method, "]"); - ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 103, &_6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 72, &_6); zephir_check_call_status(); zephir_throw_exception_debug(&_5, "phalcon/DataMapper/Query/Select.zep", 97); ZEPHIR_MM_RESTORE(); @@ -118728,12 +119489,12 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, appendJoin) } zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_4, &_3, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 172); - ZEPHIR_CALL_FUNCTION(&end, "array_key_last", NULL, 49, &_4); + ZEPHIR_CALL_FUNCTION(&end, "array_key_last", NULL, 36, &_4); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_6, &_5, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 173); zephir_array_fetch(&_7, &_6, &end, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 173); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_7); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_7); zephir_check_call_status(); zephir_read_property(&_8, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_9, &_8, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 175); @@ -119105,7 +119866,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, join) } zephir_read_property(&_19, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_20, &_19, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 330); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_20); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_20); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_21); ZEPHIR_CONCAT_VSVSV(&_21, &join, " ", &table, " ", &condition); @@ -119207,7 +119968,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, subSelect) object_init_ex(return_value, phalcon_datamapper_query_select_ce); zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 223, &_0, &_1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 204, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -119313,9 +120074,9 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, getCurrentStatement) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, this_ptr, "buildlimitearly", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 224); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 205); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildfrom", NULL, 225); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildfrom", NULL, 206); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZVAL_STRING(&_6, "WHERE"); @@ -119430,7 +120191,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, buildFrom) ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _4); ZEPHIR_MAKE_REF(&table); - ZEPHIR_CALL_FUNCTION(&_6$$4, "array_shift", &_7, 23, &table); + ZEPHIR_CALL_FUNCTION(&_6$$4, "array_shift", &_7, 21, &table); ZEPHIR_UNREF(&table); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "indent", &_9, 0, &table); @@ -119451,7 +120212,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Select, buildFrom) ZEPHIR_CALL_METHOD(&table, &_3, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&table); - ZEPHIR_CALL_FUNCTION(&_11$$5, "array_shift", &_7, 23, &table); + ZEPHIR_CALL_FUNCTION(&_11$$5, "array_shift", &_7, 21, &table); ZEPHIR_UNREF(&table); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "indent", &_9, 0, &table); @@ -119709,7 +120470,7 @@ static PHP_METHOD(Phalcon_DataMapper_Query_Update, getStatement) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Update.zep", 101); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 226); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 207); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, "WHERE"); @@ -120034,7 +120795,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Connection, __construct) zephir_array_fetch_long(&_2$$3, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Pdo/Connection.zep", 71); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVS(&_3$$3, "Driver not supported [", &_2$$3, "]"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 40, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 191, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/DataMapper/Pdo/Connection.zep", 72); ZEPHIR_MM_RESTORE(); @@ -120056,7 +120817,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Connection, __construct) if (Z_TYPE_P(profiler) == IS_NULL) { ZEPHIR_INIT_NVAR(profiler); object_init_ex(profiler, phalcon_datamapper_pdo_profiler_profiler_ce); - ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 214); + ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 195); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "setprofiler", NULL, 0, profiler); @@ -120603,7 +121364,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_ConnectionLocator, getConnection) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); if (ZEPHIR_IS_IDENTICAL(&_1, &requested)) { - ZEPHIR_CALL_FUNCTION(&requested, "array_rand", NULL, 215, &collection); + ZEPHIR_CALL_FUNCTION(&requested, "array_rand", NULL, 196, &collection); zephir_check_call_status(); } if (!(zephir_array_isset(&collection, &requested))) { @@ -120611,7 +121372,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_ConnectionLocator, getConnection) object_init_ex(&_2$$5, phalcon_datamapper_pdo_exception_connectionnotfound_ce); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVSV(&_3$$5, "Connection not found: ", &type, ":", &requested); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 31, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 29, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$5, "phalcon/DataMapper/Pdo/ConnectionLocator.zep", 210); ZEPHIR_MM_RESTORE(); @@ -120757,37 +121518,31 @@ ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Exception_Exception) ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Pdo\\Profiler, MemoryLogger, phalcon, datamapper_pdo_profiler_memorylogger, zephir_get_internal_ce(SL("psr\\log\\abstractlogger")), phalcon_datamapper_pdo_profiler_memorylogger_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\DataMapper\\Pdo\\Profiler, MemoryLogger, phalcon, datamapper_pdo_profiler_memorylogger, phalcon_datamapper_pdo_profiler_memorylogger_method_entry, 0); zend_declare_property_null(phalcon_datamapper_pdo_profiler_memorylogger_ce, SL("messages"), ZEND_ACC_PROTECTED); phalcon_datamapper_pdo_profiler_memorylogger_ce->create_object = zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_MemoryLogger; + zend_class_implements(phalcon_datamapper_pdo_profiler_memorylogger_ce, 1, phalcon_logger_loggerinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "messages"); -} - -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120795,7 +121550,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120804,25 +121560,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "emergency", NULL, 0, message, &context); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120830,7 +121589,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120839,25 +121599,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "alert", NULL, 0, message, &context); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120865,7 +121628,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120874,25 +121638,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "critical", NULL, 0, message, &context); + ZVAL_LONG(&_0, 7); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120900,7 +121667,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120909,25 +121677,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "error", NULL, 0, message, &context); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120935,7 +121706,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120944,25 +121716,96 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "warning", NULL, 0, message, &context); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *name_param = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + object_init_ex(return_value, phalcon_logger_adapter_noop_ce); + if (zephir_has_constructor(return_value)) { + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0); + zephir_check_call_status(); + } + + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters) +{ + zval *this_ptr = getThis(); + + + + array_init(return_value); + return; +} + +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel) +{ + zval *this_ptr = getThis(); + + + + RETURN_LONG(8); +} + +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "messages"); +} + +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName) +{ + zval *this_ptr = getThis(); + + + + RETURN_STRING("memory logger"); +} + +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -120970,7 +121813,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -120979,25 +121823,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "notice", NULL, 0, message, &context); + ZVAL_LONG(&_0, 6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -121005,7 +121852,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -121014,25 +121862,28 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "info", NULL, 0, message, &context); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -121040,7 +121891,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -121049,7 +121901,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "debug", NULL, 0, message, &context); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -121061,24 +121914,25 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context, replace; - zval *level, level_sub, *message, message_sub, *context_param = NULL, key, value, *_0, _1, _6, _4$$3, _5$$4; + zval message; + zval *level, level_sub, *message_param = NULL, *context_param = NULL, key, value, *_0, _1, _6, _4$$3, _5$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&key); ZVAL_UNDEF(&value); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_6); ZVAL_UNDEF(&_4$$3); ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&context); ZVAL_UNDEF(&replace); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_ZVAL(level) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -121086,7 +121940,8 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level, &message, &context_param); + zephir_fetch_params(1, 2, 1, &level, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -121097,7 +121952,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) ZEPHIR_INIT_VAR(&replace); array_init(&replace); - zephir_is_iterable(&context, 0, "phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep", 130); + zephir_is_iterable(&context, 0, "phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep", 172); if (Z_TYPE_P(&context) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&context), _2, _3, _0) { @@ -121135,7 +121990,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 5, message, &replace); + ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 5, &message, &replace); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("messages"), &_6); ZEPHIR_MM_RESTORE(); @@ -121194,17 +122049,18 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *logger = NULL, logger_sub, __$null, _0; + zval *logger = NULL, logger_sub, __$null, _0, _1; zval *this_ptr = getThis(); ZVAL_UNDEF(&logger_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(logger, zephir_get_internal_ce(SL("psr\\log\\loggerinterface"))) + Z_PARAM_OBJECT_OF_CLASS_OR_NULL(logger, phalcon_logger_loggerinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif @@ -121232,9 +122088,9 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, __construct) ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "{method} ({duration}s): {statement} {backtrace}"); zephir_update_property_zval(this_ptr, ZEND_STRL("logFormat"), &_0); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "debug"); - zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); + ZEPHIR_INIT_ZVAL_NREF(_1); + ZVAL_LONG(&_1, 7); + zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_1); zephir_update_property_zval(this_ptr, ZEND_STRL("logger"), logger); ZEPHIR_MM_RESTORE(); } @@ -121297,11 +122153,11 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, finish) if (UNEXPECTED(zephir_is_true(&_0))) { ZEPHIR_INIT_VAR(&ex); object_init_ex(&ex, phalcon_datamapper_pdo_exception_exception_ce); - ZEPHIR_CALL_METHOD(NULL, &ex, "__construct", NULL, 31); + ZEPHIR_CALL_METHOD(NULL, &ex, "__construct", NULL, 29); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&finish, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&finish, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, &ex, "gettraceasstring", NULL, 217); + ZEPHIR_CALL_METHOD(&_1$$3, &ex, "gettraceasstring", NULL, 198); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "backtrace"); @@ -121324,7 +122180,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, finish) ZEPHIR_INIT_NVAR(&_5$$3); ZVAL_STRING(&_5$$3, ""); } else { - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "encode", NULL, 218, &values); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "encode", NULL, 199, &values); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_9$$3); @@ -121489,7 +122345,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, start) ZEPHIR_INIT_VAR(&_1$$3); zephir_create_array(&_1$$3, 2, 0); zephir_array_update_string(&_1$$3, SL("method"), &method, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_2$$3, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&_2$$3, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("start"), &_2$$3, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("context"), &_1$$3); @@ -121541,16 +122397,16 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/DataMapper/Pdo/Profiler/Profiler.zep", 215); ZEPHIR_MM_RESTORE(); @@ -121669,7 +122525,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Connection_AbstractConnection, __call) ZEPHIR_CONCAT_SVSVS(&message, "Class '", &className, "' does not have a method '", name, "'"); ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, spl_ce_BadMethodCallException); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 103, &message); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 72, &message); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/DataMapper/Pdo/Connection/AbstractConnection.zep", 62); ZEPHIR_MM_RESTORE(); @@ -123246,7 +124102,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Connection_Decorated, __construct) if (Z_TYPE_P(profiler) == IS_NULL) { ZEPHIR_INIT_NVAR(profiler); object_init_ex(profiler, phalcon_datamapper_pdo_profiler_profiler_ce); - ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 214); + ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 195); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "setprofiler", NULL, 0, profiler); @@ -124242,7 +125098,7 @@ static PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) ZEPHIR_INIT_VAR(&_6); ZVAL_STRING(&_6, "count"); zephir_array_fast_append(&_5, &_6); - ZEPHIR_CALL_FUNCTION(&_7, "call_user_func", NULL, 199, &_5, ¶meters); + ZEPHIR_CALL_FUNCTION(&_7, "call_user_func", NULL, 180, &_5, ¶meters); zephir_check_call_status(); rowcount = zephir_get_intval(&_7); if (zephir_safe_mod_long_long(rowcount, limit) != 0) { @@ -124263,7 +125119,7 @@ static PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) ZEPHIR_INIT_VAR(&_11$$8); ZVAL_STRING(&_11$$8, "find"); zephir_array_fast_append(&_10$$8, &_11$$8); - ZEPHIR_CALL_FUNCTION(&_12$$8, "call_user_func", NULL, 199, &_10$$8, ¶meters); + ZEPHIR_CALL_FUNCTION(&_12$$8, "call_user_func", NULL, 180, &_10$$8, ¶meters); zephir_check_call_status(); ZEPHIR_CPY_WRT(&pageItems, &_12$$8); } @@ -124372,7 +125228,7 @@ static PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, paginate) } ZVAL_LONG(&_0, (show * ((pageNumber - 1)))); ZVAL_LONG(&_4, show); - ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 0, &items, &_0, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 498, &items, &_0, &_4); zephir_check_call_status(); ZEPHIR_CPY_WRT(&items, &_5); if (pageNumber < totalPages) { @@ -124473,7 +125329,7 @@ static PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct) object_init_ex(&_0$$5, phalcon_paginator_exception_ce); ZEPHIR_INIT_VAR(&_1$$5); ZEPHIR_CONCAT_SS(&_1$$5, "Parameter 'builder' must be an instance ", "of Phalcon\\Mvc\\Model\\Query\\Builder"); - ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 31, &_1$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 29, &_1$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$5, "phalcon/Paginator/Adapter/QueryBuilder.zep", 80); ZEPHIR_MM_RESTORE(); @@ -125008,30 +125864,30 @@ static PHP_METHOD(Phalcon_Http_Cookie, delete) ZEPHIR_INIT_VAR(&_8); ZVAL_STRING(&_8, "expires"); ZVAL_LONG(&_0, (zephir_get_numberval(&_3) - 691200)); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 349, &options, &_8, &_0); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 331, &options, &_8, &_0); zephir_check_call_status(); zephir_array_update_string(&options, SL("expires"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "domain"); - ZEPHIR_CALL_METHOD(&_9, this_ptr, "getarrval", NULL, 349, &options, &_8, &domain); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "getarrval", NULL, 331, &options, &_8, &domain); zephir_check_call_status(); zephir_array_update_string(&options, SL("domain"), &_9, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "path"); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 349, &options, &_8, &path); + ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 331, &options, &_8, &path); zephir_check_call_status(); zephir_array_update_string(&options, SL("path"), &_10, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "secure"); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 349, &options, &_8, &secure); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 331, &options, &_8, &secure); zephir_check_call_status(); zephir_array_update_string(&options, SL("secure"), &_11, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "httponly"); - ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 349, &options, &_8, &httpOnly); + ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 331, &options, &_8, &httpOnly); zephir_check_call_status(); zephir_array_update_string(&options, SL("httponly"), &_12, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 350, &name, &__$null, &options); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &__$null, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -125512,30 +126368,30 @@ static PHP_METHOD(Phalcon_Http_Cookie, send) } ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "expires"); - ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 349, &options, &_3, &expire); + ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 331, &options, &_3, &expire); zephir_check_call_status(); zephir_array_update_string(&options, SL("expires"), &_13, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "domain"); - ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 349, &options, &_3, &domain); + ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 331, &options, &_3, &domain); zephir_check_call_status(); zephir_array_update_string(&options, SL("domain"), &_14, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "path"); - ZEPHIR_CALL_METHOD(&_15, this_ptr, "getarrval", NULL, 349, &options, &_3, &path); + ZEPHIR_CALL_METHOD(&_15, this_ptr, "getarrval", NULL, 331, &options, &_3, &path); zephir_check_call_status(); zephir_array_update_string(&options, SL("path"), &_15, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "secure"); - ZEPHIR_CALL_METHOD(&_16, this_ptr, "getarrval", NULL, 349, &options, &_3, &secure); + ZEPHIR_CALL_METHOD(&_16, this_ptr, "getarrval", NULL, 331, &options, &_3, &secure); zephir_check_call_status(); zephir_array_update_string(&options, SL("secure"), &_16, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "httponly"); - ZEPHIR_CALL_METHOD(&_17, this_ptr, "getarrval", NULL, 349, &options, &_3, &httpOnly); + ZEPHIR_CALL_METHOD(&_17, this_ptr, "getarrval", NULL, 331, &options, &_3, &httpOnly); zephir_check_call_status(); zephir_array_update_string(&options, SL("httponly"), &_17, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 350, &name, &encryptValue, &options); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &encryptValue, &options); zephir_check_call_status(); RETURN_THIS(); } @@ -125877,16 +126733,16 @@ static PHP_METHOD(Phalcon_Http_Cookie, assertSignKeyIsLongEnough) } - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &signKey); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &signKey); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_LT_LONG(&length, 32))) { ZEPHIR_INIT_VAR(&_0$$3); object_init_ex(&_0$$3, phalcon_http_cookie_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "The cookie's key should be at least 32 characters long. Current length is %d."); - ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 140, &_1$$3, &length); + ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 112, &_1$$3, &length); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Cookie.zep", 649); ZEPHIR_MM_RESTORE(); @@ -126097,7 +126953,7 @@ static PHP_METHOD(Phalcon_Http_Request, get) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_REQUEST, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_REQUEST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126119,7 +126975,7 @@ static PHP_METHOD(Phalcon_Http_Request, getAcceptableContent) ZVAL_STRING(&_0, "HTTP_ACCEPT"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "accept"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126142,13 +126998,13 @@ static PHP_METHOD(Phalcon_Http_Request, getBasicAuth) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "PHP_AUTH_USER"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = !zephir_is_true(&_0); if (!(_2)) { ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "PHP_AUTH_PW"); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = !zephir_is_true(&_3); } @@ -126186,7 +127042,7 @@ static PHP_METHOD(Phalcon_Http_Request, getBestAccept) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "accept"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126208,7 +127064,7 @@ static PHP_METHOD(Phalcon_Http_Request, getBestCharset) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "charset"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126230,7 +127086,7 @@ static PHP_METHOD(Phalcon_Http_Request, getBestLanguage) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "language"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126303,7 +127159,7 @@ static PHP_METHOD(Phalcon_Http_Request, getClientAddress) ZEPHIR_INIT_VAR(&address); ZVAL_NULL(&address); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (trustForwardedHeader) { ZEPHIR_OBS_NVAR(&address); @@ -126346,7 +127202,7 @@ static PHP_METHOD(Phalcon_Http_Request, getClientCharsets) ZVAL_STRING(&_0, "HTTP_ACCEPT_CHARSET"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "charset"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -126364,7 +127220,7 @@ static PHP_METHOD(Phalcon_Http_Request, getContentType) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_string_fetch(&contentType, &server, SL("CONTENT_TYPE"), 1))) { RETURN_MM_NULL(); @@ -126399,7 +127255,7 @@ static PHP_METHOD(Phalcon_Http_Request, getDigestAuth) ZEPHIR_INIT_VAR(&auth); array_init(&auth); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&digest); if (zephir_array_isset_string_fetch(&digest, &server, SL("PHP_AUTH_DIGEST"), 0)) { @@ -126742,7 +127598,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeader) zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); zephir_fast_strtoupper(&name, &_2); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&value); if (zephir_array_isset_fetch(&value, &server, &name, 0)) { @@ -126822,7 +127678,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeaders) zephir_array_update_string(&contentHeaders, SL("CONTENT_TYPE"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&contentHeaders, SL("CONTENT_LENGTH"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&contentHeaders, SL("CONTENT_MD5"), &__$true, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); zephir_is_iterable(&server, 0, "phalcon/Http/Request.zep", 441); if (Z_TYPE_P(&server) == IS_ARRAY) { @@ -126848,7 +127704,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_9$$4, " "); zephir_fast_str_replace(&_5$$4, &_8$$4, &_9$$4, &_7$$4); zephir_fast_strtolower(&_4$$4, &_5$$4); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_4$$4); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_4$$4); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_INIT_NVAR(&_12$$4); @@ -126872,7 +127728,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_18$$5, " "); zephir_fast_str_replace(&_16$$5, &_17$$5, &_18$$5, &name); zephir_fast_strtolower(&_15$$5, &_16$$5); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_15$$5); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_15$$5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$5); ZEPHIR_INIT_NVAR(&_20$$5); @@ -126909,7 +127765,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_27$$7, " "); zephir_fast_str_replace(&_23$$7, &_26$$7, &_27$$7, &_25$$7); zephir_fast_strtolower(&_22$$7, &_23$$7); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_22$$7); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_22$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$7); ZEPHIR_INIT_NVAR(&_29$$7); @@ -126933,7 +127789,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_35$$8, " "); zephir_fast_str_replace(&_33$$8, &_34$$8, &_35$$8, &name); zephir_fast_strtolower(&_32$$8, &_33$$8); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_32$$8); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_32$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$8); ZEPHIR_INIT_NVAR(&_37$$8); @@ -127020,7 +127876,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHttpHost) ZVAL_STRING(&_5$$6, "/:[[:digit:]]+$/"); ZEPHIR_INIT_VAR(&_6$$6); ZVAL_STRING(&_6$$6, ""); - ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 50, &_5$$6, &_6$$6, &cleanHost); + ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 37, &_5$$6, &_6$$6, &cleanHost); zephir_check_call_status(); ZEPHIR_CPY_WRT(&cleanHost, &_7$$6); } @@ -127028,7 +127884,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHttpHost) ZVAL_STRING(&_8$$5, "/[a-z0-9-]+\\.?/"); ZEPHIR_INIT_VAR(&_9$$5); ZVAL_STRING(&_9$$5, ""); - ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 50, &_8$$5, &_9$$5, &cleanHost); + ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 37, &_8$$5, &_9$$5, &cleanHost); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11$$5); ZVAL_STRING(&_11$$5, ""); @@ -127037,7 +127893,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHttpHost) object_init_ex(&_12$$7, spl_ce_UnexpectedValueException); ZEPHIR_INIT_VAR(&_13$$7); ZEPHIR_CONCAT_SV(&_13$$7, "Invalid host ", &host); - ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 416, &_13$$7); + ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 338, &_13$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$7, "phalcon/Http/Request.zep", 525); ZEPHIR_MM_RESTORE(); @@ -127063,7 +127919,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHTTPReferer) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_string_fetch(&httpReferer, &server, SL("HTTP_REFERER"), 1))) { RETURN_MM_STRING(""); @@ -127126,7 +127982,7 @@ static PHP_METHOD(Phalcon_Http_Request, getLanguages) ZVAL_STRING(&_0, "HTTP_ACCEPT_LANGUAGE"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "language"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -127155,7 +128011,7 @@ static PHP_METHOD(Phalcon_Http_Request, getMethod) zephir_get_global(&_REQUEST, SL("_REQUEST")); ZEPHIR_INIT_VAR(&returnMethod); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&requestMethod); if (EXPECTED(zephir_array_isset_string_fetch(&requestMethod, &server, SL("REQUEST_METHOD"), 0))) { @@ -127169,7 +128025,7 @@ static PHP_METHOD(Phalcon_Http_Request, getMethod) if (ZEPHIR_IS_IDENTICAL(&_0, &returnMethod)) { ZEPHIR_INIT_VAR(&_1$$5); ZVAL_STRING(&_1$$5, "X-HTTP-METHOD-OVERRIDE"); - ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 417, &_1$$5); + ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 339, &_1$$5); zephir_check_call_status(); zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("httpMethodParameterOverride"), PH_NOISY_CC | PH_READONLY); if (!(ZEPHIR_IS_EMPTY(&overridedMethod))) { @@ -127226,7 +128082,7 @@ static PHP_METHOD(Phalcon_Http_Request, getPort) if (zephir_memnstr_str(&host, SL(":"), "phalcon/Http/Request.zep", 634)) { ZEPHIR_INIT_VAR(&_3$$4); ZVAL_STRING(&_3$$4, ":"); - ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 123, &host, &_3$$4); + ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 237, &host, &_3$$4); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&pos)) { ZVAL_LONG(&_4$$5, (zephir_get_numberval(&pos) + 1)); @@ -127323,7 +128179,7 @@ static PHP_METHOD(Phalcon_Http_Request, getPost) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_POST, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_POST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -127406,7 +128262,7 @@ static PHP_METHOD(Phalcon_Http_Request, getPut) if (_0$$3) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "json"); - ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 418, &contentType, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 340, &contentType, &_1$$3); zephir_check_call_status(); _0$$3 = !ZEPHIR_IS_FALSE(&_2$$3); } @@ -127424,7 +128280,7 @@ static PHP_METHOD(Phalcon_Http_Request, getPut) ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getrawbody", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&put); - ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 375, &_4$$6, &put); + ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 341, &_4$$6, &put); ZEPHIR_UNREF(&put); zephir_check_call_status(); } @@ -127440,7 +128296,7 @@ static PHP_METHOD(Phalcon_Http_Request, getPut) } else { ZVAL_BOOL(&_6, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &put, &name, filters, defaultValue, &_5, &_6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &put, &name, filters, defaultValue, &_5, &_6); zephir_check_call_status(); RETURN_MM(); } @@ -127520,7 +128376,7 @@ static PHP_METHOD(Phalcon_Http_Request, getQuery) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_GET, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_GET, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -127612,7 +128468,7 @@ static PHP_METHOD(Phalcon_Http_Request, getServer) } - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_fetch(&serverValue, &server, &name, 1))) { RETURN_MM_NULL(); @@ -127641,7 +128497,7 @@ static PHP_METHOD(Phalcon_Http_Request, getServerAddress) if (Z_TYPE_P(&serverAddr) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "localhost"); - ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 419, &_1$$3); + ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 342, &_1$$3); zephir_check_call_status(); RETURN_MM(); } @@ -127792,7 +128648,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) zephir_array_fetch_string(&_7$$5, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 861); zephir_array_fetch_string(&_8$$5, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 862); zephir_array_fetch_string(&_9$$5, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 863); - ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 420, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &prefix); + ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 343, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &prefix); zephir_check_call_status(); zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 890); if (Z_TYPE_P(&smoothInput) == IS_ARRAY) { @@ -127827,7 +128683,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_16$$8); object_init_ex(&_16$$8, phalcon_http_request_file_ce); zephir_array_fetch_string(&_17$$8, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_16$$8, "__construct", &_18, 421, &dataFile, &_17$$8); + ZEPHIR_CALL_METHOD(NULL, &_16$$8, "__construct", &_18, 344, &dataFile, &_17$$8); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_19$$8); zephir_array_fetch_string(&_19$$8, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -127836,7 +128692,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_20$$9); object_init_ex(&_20$$9, phalcon_http_request_file_ce); zephir_array_fetch_string(&_21$$9, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_20$$9, "__construct", &_18, 421, &dataFile, &_21$$9); + ZEPHIR_CALL_METHOD(NULL, &_20$$9, "__construct", &_18, 344, &dataFile, &_21$$9); zephir_check_call_status(); zephir_array_append(&files, &_20$$9, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -127881,7 +128737,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_26$$12); object_init_ex(&_26$$12, phalcon_http_request_file_ce); zephir_array_fetch_string(&_27$$12, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_18, 421, &dataFile, &_27$$12); + ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_18, 344, &dataFile, &_27$$12); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_28$$12); zephir_array_fetch_string(&_28$$12, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -127890,7 +128746,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_29$$13); object_init_ex(&_29$$13, phalcon_http_request_file_ce); zephir_array_fetch_string(&_30$$13, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_29$$13, "__construct", &_18, 421, &dataFile, &_30$$13); + ZEPHIR_CALL_METHOD(NULL, &_29$$13, "__construct", &_18, 344, &dataFile, &_30$$13); zephir_check_call_status(); zephir_array_append(&files, &_29$$13, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -127910,13 +128766,13 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) if (namedKeys == 1) { ZEPHIR_INIT_NVAR(&_33$$16); object_init_ex(&_33$$16, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_33$$16, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_33$$16, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_update_zval(&files, &prefix, &_33$$16, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(&_34$$17); object_init_ex(&_34$$17, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_34$$17, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_34$$17, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_append(&files, &_34$$17, PH_SEPARATE, "phalcon/Http/Request.zep", 895); } @@ -127944,7 +128800,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) zephir_array_fetch_string(&_38$$19, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 861); zephir_array_fetch_string(&_39$$19, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 862); zephir_array_fetch_string(&_40$$19, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 863); - ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 420, &_36$$19, &_37$$19, &_38$$19, &_39$$19, &_40$$19, &prefix); + ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 343, &_36$$19, &_37$$19, &_38$$19, &_39$$19, &_40$$19, &prefix); zephir_check_call_status(); zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 890); if (Z_TYPE_P(&smoothInput) == IS_ARRAY) { @@ -127980,7 +128836,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_47$$22); object_init_ex(&_47$$22, phalcon_http_request_file_ce); zephir_array_fetch_string(&_48$$22, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_47$$22, "__construct", &_18, 421, &dataFile, &_48$$22); + ZEPHIR_CALL_METHOD(NULL, &_47$$22, "__construct", &_18, 344, &dataFile, &_48$$22); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_49$$22); zephir_array_fetch_string(&_49$$22, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -127989,7 +128845,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_50$$23); object_init_ex(&_50$$23, phalcon_http_request_file_ce); zephir_array_fetch_string(&_51$$23, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_50$$23, "__construct", &_18, 421, &dataFile, &_51$$23); + ZEPHIR_CALL_METHOD(NULL, &_50$$23, "__construct", &_18, 344, &dataFile, &_51$$23); zephir_check_call_status(); zephir_array_append(&files, &_50$$23, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -128034,7 +128890,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_56$$26); object_init_ex(&_56$$26, phalcon_http_request_file_ce); zephir_array_fetch_string(&_57$$26, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_56$$26, "__construct", &_18, 421, &dataFile, &_57$$26); + ZEPHIR_CALL_METHOD(NULL, &_56$$26, "__construct", &_18, 344, &dataFile, &_57$$26); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_58$$26); zephir_array_fetch_string(&_58$$26, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -128043,7 +128899,7 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_59$$27); object_init_ex(&_59$$27, phalcon_http_request_file_ce); zephir_array_fetch_string(&_60$$27, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_59$$27, "__construct", &_18, 421, &dataFile, &_60$$27); + ZEPHIR_CALL_METHOD(NULL, &_59$$27, "__construct", &_18, 344, &dataFile, &_60$$27); zephir_check_call_status(); zephir_array_append(&files, &_59$$27, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -128063,13 +128919,13 @@ static PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) if (namedKeys == 1) { ZEPHIR_INIT_NVAR(&_63$$30); object_init_ex(&_63$$30, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_63$$30, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_63$$30, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_update_zval(&files, &prefix, &_63$$30, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(&_64$$31); object_init_ex(&_64$$31, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_64$$31, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_64$$31, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_append(&files, &_64$$31, PH_SEPARATE, "phalcon/Http/Request.zep", 895); } @@ -128256,13 +129112,13 @@ static PHP_METHOD(Phalcon_Http_Request, hasHeader) zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); zephir_fast_strtoupper(&name, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 413, &name); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &name); zephir_check_call_status(); _4 = zephir_is_true(&_3); if (!(_4)) { ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SV(&_6, "HTTP_", &name); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "hasserver", NULL, 413, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "hasserver", NULL, 335, &_6); zephir_check_call_status(); _4 = zephir_is_true(&_5); } @@ -128404,7 +129260,7 @@ static PHP_METHOD(Phalcon_Http_Request, hasServer) } - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); RETURN_MM_BOOL(zephir_array_isset(&server, &name)); } @@ -128426,7 +129282,7 @@ static PHP_METHOD(Phalcon_Http_Request, isAjax) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "HTTP_X_REQUESTED_WITH"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = zephir_is_true(&_0); if (_2) { @@ -128451,7 +129307,7 @@ static PHP_METHOD(Phalcon_Http_Request, isConnect) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "CONNECT")); } @@ -128468,7 +129324,7 @@ static PHP_METHOD(Phalcon_Http_Request, isDelete) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "DELETE")); } @@ -128485,7 +129341,7 @@ static PHP_METHOD(Phalcon_Http_Request, isGet) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "GET")); } @@ -128502,7 +129358,7 @@ static PHP_METHOD(Phalcon_Http_Request, isHead) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "HEAD")); } @@ -128546,7 +129402,7 @@ static PHP_METHOD(Phalcon_Http_Request, isMethod) } - ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); if (Z_TYPE_P(methods) == IS_STRING) { _0$$3 = strict; @@ -128560,7 +129416,7 @@ static PHP_METHOD(Phalcon_Http_Request, isMethod) object_init_ex(&_2$$4, phalcon_http_request_exception_ce); ZEPHIR_INIT_VAR(&_3$$4); ZEPHIR_CONCAT_SV(&_3$$4, "Invalid HTTP method: ", methods); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 31, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 29, &_3$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$4, "phalcon/Http/Request.zep", 1075); ZEPHIR_MM_RESTORE(); @@ -128580,7 +129436,7 @@ static PHP_METHOD(Phalcon_Http_Request, isMethod) } else { ZVAL_BOOL(&_7$$6, 0); } - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "ismethod", &_8, 423, &method, &_7$$6); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "ismethod", &_8, 346, &method, &_7$$6); zephir_check_call_status(); if (zephir_is_true(&_6$$6)) { RETURN_MM_BOOL(1); @@ -128602,7 +129458,7 @@ static PHP_METHOD(Phalcon_Http_Request, isMethod) } else { ZVAL_BOOL(&_10$$8, 0); } - ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "ismethod", &_8, 423, &method, &_10$$8); + ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "ismethod", &_8, 346, &method, &_10$$8); zephir_check_call_status(); if (zephir_is_true(&_9$$8)) { RETURN_MM_BOOL(1); @@ -128633,7 +129489,7 @@ static PHP_METHOD(Phalcon_Http_Request, isOptions) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "OPTIONS")); } @@ -128650,7 +129506,7 @@ static PHP_METHOD(Phalcon_Http_Request, isPatch) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PATCH")); } @@ -128667,7 +129523,7 @@ static PHP_METHOD(Phalcon_Http_Request, isPost) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "POST")); } @@ -128684,7 +129540,7 @@ static PHP_METHOD(Phalcon_Http_Request, isPut) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PUT")); } @@ -128701,7 +129557,7 @@ static PHP_METHOD(Phalcon_Http_Request, isPurge) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PURGE")); } @@ -128748,7 +129604,7 @@ static PHP_METHOD(Phalcon_Http_Request, isSoap) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "HTTP_SOAPACTION"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); @@ -128773,7 +129629,7 @@ static PHP_METHOD(Phalcon_Http_Request, isTrace) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "TRACE")); } @@ -128876,7 +129732,7 @@ static PHP_METHOD(Phalcon_Http_Request, numFiles) } else { ZVAL_BOOL(&_4$$8, 0); } - ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "hasfilehelper", &_5, 424, &error, &_4$$8); + ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "hasfilehelper", &_5, 347, &error, &_4$$8); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_3$$8); } @@ -128910,7 +129766,7 @@ static PHP_METHOD(Phalcon_Http_Request, numFiles) } else { ZVAL_BOOL(&_8$$13, 0); } - ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "hasfilehelper", &_5, 424, &error, &_8$$13); + ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "hasfilehelper", &_5, 347, &error, &_8$$13); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_7$$13); } @@ -128994,13 +129850,13 @@ static PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_0$$3, phalcon_http_request_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_SVS(&_1$$3, "Filters have not been defined for '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Request.zep", 1259); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 425); + ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 348); zephir_check_call_status(); zephir_is_iterable(&filters, 0, "phalcon/Http/Request.zep", 1272); if (Z_TYPE_P(&filters) == IS_ARRAY) { @@ -129015,7 +129871,7 @@ static PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_6$$5, phalcon_http_request_exception_ce); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVS(&_7$$5, "Sanitizer '", &sanitizer, "' does not exist in the filter locator"); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 29, &_7$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$5, "phalcon/Http/Request.zep", 1268); ZEPHIR_MM_RESTORE(); @@ -129040,7 +129896,7 @@ static PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_10$$7, phalcon_http_request_exception_ce); ZEPHIR_INIT_NVAR(&_11$$7); ZEPHIR_CONCAT_SVS(&_11$$7, "Sanitizer '", &sanitizer, "' does not exist in the filter locator"); - ZEPHIR_CALL_METHOD(NULL, &_10$$7, "__construct", NULL, 31, &_11$$7); + ZEPHIR_CALL_METHOD(NULL, &_10$$7, "__construct", NULL, 29, &_11$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$7, "phalcon/Http/Request.zep", 1268); ZEPHIR_MM_RESTORE(); @@ -129327,7 +130183,7 @@ static PHP_METHOD(Phalcon_Http_Request, getHelper) RETURN_MM(); } if (Z_TYPE_P(filters) != IS_NULL) { - ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 425); + ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 348); zephir_check_call_status(); if (noRecursive) { ZVAL_BOOL(&_3$$6, 1); @@ -129396,7 +130252,7 @@ static PHP_METHOD(Phalcon_Http_Request, hasFileHelper) } else { ZVAL_BOOL(&_4$$7, 0); } - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "hasfilehelper", &_5, 424, &value, &_4$$7); + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "hasfilehelper", &_5, 347, &value, &_4$$7); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_3$$7); } @@ -129427,7 +130283,7 @@ static PHP_METHOD(Phalcon_Http_Request, hasFileHelper) } else { ZVAL_BOOL(&_8$$11, 0); } - ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "hasfilehelper", &_5, 424, &value, &_8$$11); + ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "hasfilehelper", &_5, 347, &value, &_8$$11); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_7$$11); } @@ -129543,7 +130399,7 @@ static PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_1, "/,\\s*/"); ZVAL_LONG(&_2, -1); ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_FUNCTION(&parts, "preg_split", NULL, 98, &_1, &_0, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&parts, "preg_split", NULL, 67, &_1, &_0, &_2, &_3); zephir_check_call_status(); zephir_is_iterable(&parts, 0, "phalcon/Http/Request.zep", 1430); if (Z_TYPE_P(&parts) == IS_ARRAY) { @@ -129559,7 +130415,7 @@ static PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_7$$3, "/\\s*;\\s*/"); ZVAL_LONG(&_8$$3, -1); ZVAL_LONG(&_9$$3, 1); - ZEPHIR_CALL_FUNCTION(&_10$$3, "preg_split", NULL, 98, &_7$$3, &_6$$3, &_8$$3, &_9$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "preg_split", NULL, 67, &_7$$3, &_6$$3, &_8$$3, &_9$$3); zephir_check_call_status(); zephir_is_iterable(&_10$$3, 0, "phalcon/Http/Request.zep", 1427); if (Z_TYPE_P(&_10$$3) == IS_ARRAY) { @@ -129657,7 +130513,7 @@ static PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_30$$14, "/\\s*;\\s*/"); ZVAL_LONG(&_31$$14, -1); ZVAL_LONG(&_32$$14, 1); - ZEPHIR_CALL_FUNCTION(&_33$$14, "preg_split", NULL, 98, &_30$$14, &_29$$14, &_31$$14, &_32$$14); + ZEPHIR_CALL_FUNCTION(&_33$$14, "preg_split", NULL, 67, &_30$$14, &_29$$14, &_31$$14, &_32$$14); zephir_check_call_status(); zephir_is_iterable(&_33$$14, 0, "phalcon/Http/Request.zep", 1427); if (Z_TYPE_P(&_33$$14) == IS_ARRAY) { @@ -129807,7 +130663,7 @@ static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); ZEPHIR_CPY_WRT(&container, &_0); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (Z_TYPE_P(&container) == IS_OBJECT) { ZEPHIR_INIT_VAR(&_2$$3); @@ -129843,13 +130699,13 @@ static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) } ZEPHIR_INIT_VAR(&_9); ZVAL_STRING(&_9, "PHP_AUTH_USER"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_9); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_9); zephir_check_call_status(); _10 = zephir_is_true(&_0); if (_10) { ZEPHIR_INIT_NVAR(&_9); ZVAL_STRING(&_9, "PHP_AUTH_PW"); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "hasserver", NULL, 413, &_9); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "hasserver", NULL, 335, &_9); zephir_check_call_status(); _10 = zephir_is_true(&_11); } @@ -129867,11 +130723,11 @@ static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) } else { ZEPHIR_INIT_VAR(&_16$$8); ZVAL_STRING(&_16$$8, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_15$$8, this_ptr, "hasserver", NULL, 413, &_16$$8); + ZEPHIR_CALL_METHOD(&_15$$8, this_ptr, "hasserver", NULL, 335, &_16$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$8); ZVAL_STRING(&_16$$8, "REDIRECT_HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_17$$8, this_ptr, "hasserver", NULL, 413, &_16$$8); + ZEPHIR_CALL_METHOD(&_17$$8, this_ptr, "hasserver", NULL, 335, &_16$$8); zephir_check_call_status(); if (zephir_is_true(&_15$$8)) { ZEPHIR_INIT_VAR(&_18$$9); @@ -129887,29 +130743,29 @@ static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) if (zephir_is_true(&authHeader)) { ZEPHIR_INIT_VAR(&_20$$11); ZVAL_STRING(&_20$$11, "basic "); - ZEPHIR_CALL_FUNCTION(&_21$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_21$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "digest "); - ZEPHIR_CALL_FUNCTION(&_22$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_22$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); _23$$11 = ZEPHIR_IS_LONG_IDENTICAL(&_22$$11, 0); if (_23$$11) { ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "PHP_AUTH_DIGEST"); - ZEPHIR_CALL_METHOD(&_24$$11, this_ptr, "hasserver", NULL, 413, &_20$$11); + ZEPHIR_CALL_METHOD(&_24$$11, this_ptr, "hasserver", NULL, 335, &_20$$11); zephir_check_call_status(); _23$$11 = !zephir_is_true(&_24$$11); } ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "bearer "); - ZEPHIR_CALL_FUNCTION(&_25$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_25$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_21$$11, 0)) { ZVAL_LONG(&_26$$12, 6); ZEPHIR_INIT_VAR(&_27$$12); zephir_substr(&_27$$12, &authHeader, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_28$$12, "base64_decode", NULL, 244, &_27$$12); + ZEPHIR_CALL_FUNCTION(&_28$$12, "base64_decode", NULL, 225, &_27$$12); zephir_check_call_status(); ZEPHIR_INIT_VAR(&exploded); zephir_fast_explode_str(&exploded, SL(":"), &_28$$12, 2 ); @@ -129933,7 +130789,7 @@ static PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) zephir_array_fetch_string(&_32$$17, &headers, SL("Php-Auth-Pw"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1502); ZEPHIR_INIT_VAR(&_33$$17); ZEPHIR_CONCAT_VSV(&_33$$17, &_31$$17, ":", &_32$$17); - ZEPHIR_CALL_FUNCTION(&_34$$17, "base64_encode", NULL, 245, &_33$$17); + ZEPHIR_CALL_FUNCTION(&_34$$17, "base64_encode", NULL, 226, &_33$$17); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_35$$17); ZEPHIR_CONCAT_SV(&_35$$17, "Basic ", &_34$$17); @@ -130069,7 +130925,7 @@ static PHP_METHOD(Phalcon_Http_Request, smoothFiles) zephir_array_fetch(&_8$$5, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1554); zephir_array_fetch(&_9$$5, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1555); zephir_array_fetch(&_10$$5, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1556); - ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 420, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &_10$$5, &p); + ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 343, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &_10$$5, &p); zephir_check_call_status(); zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1563); if (Z_TYPE_P(&parentFiles) == IS_ARRAY) { @@ -130138,7 +130994,7 @@ static PHP_METHOD(Phalcon_Http_Request, smoothFiles) zephir_array_fetch(&_18$$10, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1554); zephir_array_fetch(&_19$$10, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1555); zephir_array_fetch(&_20$$10, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1556); - ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 420, &_16$$10, &_17$$10, &_18$$10, &_19$$10, &_20$$10, &p); + ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 343, &_16$$10, &_17$$10, &_18$$10, &_19$$10, &_20$$10, &p); zephir_check_call_status(); zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1563); if (Z_TYPE_P(&parentFiles) == IS_ARRAY) { @@ -130699,7 +131555,7 @@ static PHP_METHOD(Phalcon_Http_Response, redirect) if (_0$$5) { ZEPHIR_INIT_VAR(&_1$$5); ZVAL_STRING(&_1$$5, "://"); - ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 427, location, &_1$$5); + ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 351, location, &_1$$5); zephir_check_call_status(); _0$$5 = zephir_is_true(&_2$$5); } @@ -130851,7 +131707,7 @@ static PHP_METHOD(Phalcon_Http_Response, send) _3$$5 = ((zephir_fast_strlen_ev(&file)) ? 1 : 0); } if (_3$$5) { - ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 428, &file); + ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 352, &file); zephir_check_call_status(); } } @@ -131276,16 +132132,16 @@ static PHP_METHOD(Phalcon_Http_Response, setFileToSend) ZEPHIR_INIT_VAR(&basePathEncoding); ZVAL_STRING(&basePathEncoding, "ASCII"); if (Z_TYPE_P(attachmentName) != IS_STRING) { - ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 429, &filePath); + ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 353, &filePath); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&basePath, attachmentName); } if (zephir_is_true(attachment)) { if ((zephir_function_exists_ex(ZEND_STRL("mb_detect_encoding")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 430); + ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 354); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 341, &basePath, &_0$$6, &__$true); + ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 323, &basePath, &_0$$6, &__$true); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_1$$5); @@ -131301,7 +132157,7 @@ static PHP_METHOD(Phalcon_Http_Response, setFileToSend) ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5); zephir_check_call_status(); if (!ZEPHIR_IS_STRING(&basePathEncoding, "ASCII")) { - ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 345, &basePath); + ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 327, &basePath); zephir_check_call_status(); ZEPHIR_CPY_WRT(&basePath, &_2$$7); ZEPHIR_INIT_VAR(&_3$$7); @@ -131313,7 +132169,7 @@ static PHP_METHOD(Phalcon_Http_Response, setFileToSend) } else { ZEPHIR_INIT_VAR(&_5$$8); ZVAL_STRING(&_5$$8, "\15\17\\\""); - ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 229, &basePath, &_5$$8); + ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 210, &basePath, &_5$$8); zephir_check_call_status(); ZEPHIR_CPY_WRT(&basePath, &_6$$8); ZEPHIR_INIT_VAR(&_7$$8); @@ -131471,7 +132327,7 @@ static PHP_METHOD(Phalcon_Http_Response, setJsonContent) zephir_check_call_status(); ZVAL_LONG(&_2, jsonOptions); ZVAL_LONG(&_3, depth); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 431, content, &_2, &_3); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 355, content, &_2, &_3); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &_1); zephir_check_call_status(); @@ -131622,7 +132478,7 @@ static PHP_METHOD(Phalcon_Http_Response, setStatusCode) if (_6$$3) { ZEPHIR_INIT_NVAR(&_7$$3); ZVAL_STRING(&_7$$3, "HTTP/"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 427, &key, &_7$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 351, &key, &_7$$3); zephir_check_call_status(); _6$$3 = zephir_is_true(&_8$$3); } @@ -131649,7 +132505,7 @@ static PHP_METHOD(Phalcon_Http_Response, setStatusCode) if (_11$$5) { ZEPHIR_INIT_NVAR(&_12$$5); ZVAL_STRING(&_12$$5, "HTTP/"); - ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 427, &key, &_12$$5); + ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 351, &key, &_12$$5); zephir_check_call_status(); _11$$5 = zephir_is_true(&_13$$5); } @@ -131870,7 +132726,7 @@ static PHP_METHOD(Phalcon_Http_Response, getBasename) ZVAL_STRING(&_2, "/"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "@"); - ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 432, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 356, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@"); @@ -131886,13 +132742,13 @@ static PHP_METHOD(Phalcon_Http_Response, getBasename) if (zephir_is_true(suffix)) { ZEPHIR_INIT_VAR(&_6$$3); ZVAL_STRING(&_6$$3, "@"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 432, suffix, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 356, suffix, &_6$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$3); ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@"); ZEPHIR_INIT_NVAR(&_6$$3); ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 50, &_8$$3, &_6$$3, &filename); + ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 37, &_8$$3, &_6$$3, &filename); zephir_check_call_status(); ZEPHIR_CPY_WRT(&filename, &_9$$3); } @@ -131943,16 +132799,16 @@ static PHP_METHOD(Phalcon_Http_Response, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Http/Response.zep", 885); ZEPHIR_MM_RESTORE(); @@ -132033,1053 +132889,565 @@ ZEPHIR_DOC_METHOD(Phalcon_Http_ResponseInterface, sendHeaders); -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractCommon) +ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, AbstractCommon, phalcon, http_message_abstractcommon, phalcon_http_message_abstractcommon_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, RequestMethodInterface, phalcon, http_message_requestmethodinterface, NULL); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_CONNECT"), "CONNECT"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_DELETE"), "DELETE"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_GET"), "GET"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_HEAD"), "HEAD"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_OPTIONS"), "OPTIONS"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PATCH"), "PATCH"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_POST"), "POST"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PURGE"), "PURGE"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PUT"), "PUT"); + + zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_TRACE"), "TRACE"); return SUCCESS; } -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, cloneInstance) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval property; - zval *element, element_sub, *property_param = NULL, newInstance; - zval *this_ptr = getThis(); - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&property); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(element) - Z_PARAM_STR(property) - ZEND_PARSE_PARAMETERS_END(); + + +#ifdef HAVE_CONFIG_H #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &element, &property_param); - zephir_get_strval(&property, property_param); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_update_property_zval_zval(&newInstance, &property, element); - RETURN_CCTOR(&newInstance); -} -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, checkStringParameter) +ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface) { - zval *element, element_sub; - zval *this_ptr = getThis(); + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, ResponseStatusCodeInterface, phalcon, http_message_responsestatuscodeinterface, NULL); - ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONTINUE"), 100); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SWITCHING_PROTOCOLS"), 101); - zephir_fetch_params_without_memory_grow(1, 0, &element); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROCESSING"), 102); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EARLY_HINTS"), 103); - if (Z_TYPE_P(element) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_http_message_exception_invalidargumentexception_ce, "Method requires a string argument", "phalcon/Http/Message/AbstractCommon.zep", 52); - return; - } -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_OK"), 200); -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, processWith) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval property; - zval *element, element_sub, *property_param = NULL; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CREATED"), 201); - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&property); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(element) - Z_PARAM_STR(property) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ACCEPTED"), 202); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NON_AUTHORITATIVE_INFORMATION"), 203); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &element, &property_param); - zephir_get_strval(&property, property_param); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_CONTENT"), 204); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESET_CONTENT"), 205); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, element); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, element, &property); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PARTIAL_CONTENT"), 206); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTI_STATUS"), 207); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ALREADY_REPORTED"), 208); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_USED"), 226); -#ifdef HAVE_CONFIG_H -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTIPLE_CHOICES"), 300); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MOVED_PERMANENTLY"), 301); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FOUND"), 302); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SEE_OTHER"), 303); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_MODIFIED"), 304); -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractMessage) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, AbstractMessage, phalcon, http_message_abstractmessage, phalcon_http_message_abstractcommon_ce, phalcon_http_message_abstractmessage_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_USE_PROXY"), 305); - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("body"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("headers"), ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_abstractmessage_ce, SL("protocolVersion"), "1.1", ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("uri"), ZEND_ACC_PROTECTED); - return SUCCESS; -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESERVED"), 306); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getBody) -{ - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TEMPORARY_REDIRECT"), 307); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PERMANENT_REDIRECT"), 308); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_REQUEST"), 400); - RETURN_MEMBER(getThis(), "body"); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAUTHORIZED"), 401); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getProtocolVersion) -{ - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYMENT_REQUIRED"), 402); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FORBIDDEN"), 403); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_FOUND"), 404); - RETURN_MEMBER(getThis(), "protocolVersion"); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_NOT_ALLOWED"), 405); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUri) -{ - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_ACCEPTABLE"), 406); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROXY_AUTHENTICATION_REQUIRED"), 407); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_TIMEOUT"), 408); - RETURN_MEMBER(getThis(), "uri"); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONFLICT"), 409); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeader) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name = NULL, name_sub, _1, _2; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GONE"), 410); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LENGTH_REQUIRED"), 411); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_FAILED"), 412); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - ZEPHIR_SEPARATE_PARAM(name); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYLOAD_TOO_LARGE"), 413); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_URI_TOO_LONG"), 414); - zephir_cast_to_string(&_0, name); - ZEPHIR_CPY_WRT(name, &_0); - zephir_read_property(&_1, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_RETURN_CALL_METHOD(&_1, "get", NULL, 0, name, &_2); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNSUPPORTED_MEDIA_TYPE"), 415); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderLine) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, header, _0; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RANGE_NOT_SATISFIABLE"), 416); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EXPECTATION_FAILED"), 417); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_A_TEAPOT"), 418); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MISDIRECTED_REQUEST"), 421); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNPROCESSABLE_ENTITY"), 422); - ZEPHIR_CALL_METHOD(&header, this_ptr, "getheader", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ","); - zephir_fast_join(return_value, &_0, &header); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOCKED"), 423); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaders) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FAILED_DEPENDENCY"), 424); - ZVAL_UNDEF(&_0); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_EARLY"), 425); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UPGRADE_REQUIRED"), 426); - ZEPHIR_MM_GROW(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_REQUIRED"), 428); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_MANY_REQUESTS"), 429); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, hasHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _0; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE"), 431); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAVAILABLE_FOR_LEGAL_REASONS"), 451); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INTERNAL_SERVER_ERROR"), 500); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_IMPLEMENTED"), 501); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_GATEWAY"), 502); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, name); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SERVICE_UNAVAILABLE"), 503); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withAddedHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value = NULL, value_sub, existing, headers, _0, _1, _2, _3, _4; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GATEWAY_TIMEOUT"), 504); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&existing); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VERSION_NOT_SUPPORTED"), 505); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VARIANT_ALSO_NEGOTIATES"), 506); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INSUFFICIENT_STORAGE"), 507); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - ZEPHIR_SEPARATE_PARAM(value); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOOP_DETECTED"), 508); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_EXTENDED"), 510); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", NULL, 35, name); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_CALL_METHOD(&existing, &headers, "get", NULL, 0, name, &_2); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getheadervalue", NULL, 36, value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, &_3); - ZEPHIR_INIT_VAR(&_4); - zephir_fast_array_merge(&_4, &existing, value); - ZEPHIR_CPY_WRT(value, &_4); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_4); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_AUTHENTICATION_REQUIRED"), 511); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withBody) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *body, body_sub, newBody, _0; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_THIS_IS_FINE"), 218); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&newBody); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(body, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAGE_EXPIRED"), 419); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_FAILURE"), 420); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &body); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOGIN_TIMEOUT"), 440); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_RESPONSE"), 444); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "w+b"); - ZEPHIR_CALL_METHOD(&newBody, this_ptr, "processbody", NULL, 37, body, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "body"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &newBody, &_0); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RETRY_WITH"), 449); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value = NULL, value_sub, headers, _0, _1, _2, _3; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS"), 450); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_TOO_LARGE"), 494); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_ERROR"), 495); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - ZEPHIR_SEPARATE_PARAM(value); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_REQUIRED"), 496); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT"), 497); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", NULL, 35, name); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getheadervalue", NULL, 36, value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, &_2); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_3); - zephir_check_call_status(); - RETURN_MM(); -} + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_TOKEN_ESRI"), 498); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withProtocolVersion) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *version, version_sub, _0; - zval *this_ptr = getThis(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CLIENT_CLOSED_REQUEST"), 499); - ZVAL_UNDEF(&version_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(version) - ZEND_PARSE_PARAMETERS_END(); -#endif + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BANDWIDTH_LIMIT_EXCEEDED"), 509); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNKNOWN_ERROR"), 520); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &version); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_WEB_SERVER_IS_DOWN"), 521); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONNECTION_TIMEOUT"), 522); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processprotocol", NULL, 38, version); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "protocolVersion"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, version, &_0); - zephir_check_call_status(); - RETURN_MM(); + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_IS_UNREACHABLE"), 523); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TIMEOUT_OCCURRED"), 524); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_HANDSHAKE_FAILED"), 525); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_SSL_CERTIFICATE"), 526); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RAILGUN_ERROR"), 527); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_DNS_ERROR"), 530); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_READ_TIMEOUT_ERROR"), 598); + + zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_CONNECT_TIMEOUT_ERROR"), 599); + + return SUCCESS; } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withoutHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, headers, _0, _1, _2; - zval *this_ptr = getThis(); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); + + +#ifdef HAVE_CONFIG_H #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_CALL_METHOD(NULL, &headers, "remove", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_2); - zephir_check_call_status(); - RETURN_MM(); -} -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderHost) +ZEPHIR_INIT_CLASS(Phalcon_Http_Request_Exception) { - zend_bool _2, _4; - zval header, _11$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, collection_sub, data, host, hostArray, _0, _1, _3, _5, _6, _7, _8$$3, _10$$3, _12$$3, _9$$4; - zval *this_ptr = getThis(); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Request, Exception, phalcon, http_request_exception, zend_ce_exception, NULL, 0); - ZVAL_UNDEF(&collection_sub); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&hostArray); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_10$$3); - ZVAL_UNDEF(&_12$$3); - ZVAL_UNDEF(&_9$$4); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&_11$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &collection); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "host"); - ZEPHIR_CALL_METHOD(&_0, collection, "has", NULL, 0, &_1); - zephir_check_call_status(); - _2 = zephir_is_true(&_0); - if (_2) { - ZEPHIR_OBS_VAR(&_3); - zephir_read_property(&_3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC); - _2 = !(ZEPHIR_IS_EMPTY(&_3)); - } - _4 = _2; - if (_4) { - zephir_read_property(&_5, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_6, &_5, "gethost", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_7); - ZVAL_STRING(&_7, ""); - _4 = !ZEPHIR_IS_IDENTICAL(&_7, &_6); - } - if (UNEXPECTED(_4)) { - zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "geturihost", NULL, 39, &_8$$3); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&hostArray, &host); - if (UNEXPECTED(Z_TYPE_P(&host) != IS_ARRAY)) { - ZEPHIR_INIT_VAR(&_9$$4); - zephir_create_array(&_9$$4, 1, 0); - zephir_array_fast_append(&_9$$4, &host); - ZEPHIR_CPY_WRT(&hostArray, &_9$$4); - } - ZEPHIR_INIT_VAR(&_10$$3); - ZVAL_STRING(&_10$$3, "host"); - ZEPHIR_CALL_METHOD(NULL, collection, "remove", NULL, 0, &_10$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&data, collection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&header); - array_init(&header); - zephir_array_update_string(&header, SL("Host"), &hostArray, PH_COPY | PH_SEPARATE); - zephir_get_arrval(&_11$$3, &data); - ZEPHIR_INIT_VAR(&_12$$3); - zephir_add_function(&_12$$3, &header, &_11$$3); - ZEPHIR_CPY_WRT(&header, &_12$$3); - ZEPHIR_CALL_METHOD(NULL, collection, "clear", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, collection, "init", NULL, 0, &header); - zephir_check_call_status(); - } - RETVAL_ZVAL(collection, 1, 0); - RETURN_MM(); -} -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderName) +ZEPHIR_INIT_CLASS(Phalcon_Http_Request_File) { - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _1, _2, _3, _4, _5$$3, _6$$3; - zval *this_ptr = getThis(); + ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Request, File, phalcon, http_request_file, phalcon_http_request_file_method_entry, 0); - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif + zend_declare_property_null(phalcon_http_request_file_ce, SL("error"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("extension"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("key"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("name"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("realType"), ZEND_ACC_PROTECTED); + zend_declare_property_long(phalcon_http_request_file_ce, SL("size"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("tmp"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_request_file_ce, SL("type"), ZEND_ACC_PROTECTED); + zend_class_implements(phalcon_http_request_file_ce, 1, phalcon_http_request_fileinterface_ce); + return SUCCESS; +} +static PHP_METHOD(Phalcon_Http_Request_File, getError) +{ + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - _0 = Z_TYPE_P(name) != IS_STRING; - if (!(_0)) { - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "/^[a-zA-Z0-9'`#$%&*+.^_|~!-]+$/"); - ZEPHIR_INIT_VAR(&_3); - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "/^[a-zA-Z0-9'`#$%&*+.^_|~!-]+$/"); - zephir_preg_match(&_3, &_4, name, &_1, 0, 0 , 0 ); - _0 = !zephir_is_true(&_3); - } - if (UNEXPECTED(_0)) { - ZEPHIR_INIT_VAR(&_5$$3); - object_init_ex(&_5$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_6$$3); - ZEPHIR_CONCAT_SV(&_6$$3, "Invalid header name ", name); - ZEPHIR_CALL_METHOD(NULL, &_5$$3, "__construct", NULL, 40, &_6$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$3, "phalcon/Http/Message/AbstractMessage.zep", 333); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_MM_RESTORE(); + RETURN_MEMBER(getThis(), "error"); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderValue) +static PHP_METHOD(Phalcon_Http_Request_File, getExtension) { - zval _1; - zend_bool _0, _6; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *value = NULL, value_sub, _2, _3, _4, _5, _7, _8, _9, _10; zval *this_ptr = getThis(); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &value); - ZEPHIR_SEPARATE_PARAM(value); + RETURN_MEMBER(getThis(), "extension"); +} +static PHP_METHOD(Phalcon_Http_Request_File, getKey) +{ + zval *this_ptr = getThis(); - _0 = Z_TYPE_P(value) != IS_STRING; - if (_0) { - _0 = 1 != zephir_is_numeric(value); - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid header value", "phalcon/Http/Message/AbstractMessage.zep", 385); - return; - } - zephir_cast_to_string(&_1, value); - ZEPHIR_CPY_WRT(value, &_1); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "#(?:(?:(?= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(values) + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ARRAY(file) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &values); + zephir_fetch_params(1, 1, 1, &file_param, &key); + ZEPHIR_OBS_COPY_OR_DUP(&file, file_param); + if (!key) { + key = &key_sub; + key = &__$null; + } - ZEPHIR_CPY_WRT(&valueArray, values); - if (UNEXPECTED(Z_TYPE_P(values) != IS_ARRAY)) { + ZEPHIR_OBS_VAR(&name); + if (zephir_array_isset_string_fetch(&name, &file, SL("name"), 0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); ZEPHIR_INIT_VAR(&_0$$3); - zephir_create_array(&_0$$3, 1, 0); - zephir_array_fast_append(&_0$$3, values); - ZEPHIR_CPY_WRT(&valueArray, &_0$$3); - } - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&valueArray))) { - ZEPHIR_INIT_VAR(&_1$$4); - object_init_ex(&_1$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_2$$4); - ZEPHIR_CONCAT_SS(&_2$$4, "Invalid header value: must be a string or ", "array of strings; cannot be an empty array"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 40, &_2$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Http/Message/AbstractMessage.zep", 412); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_INIT_VAR(&valueData); - array_init(&valueData); - zephir_is_iterable(&valueArray, 0, "phalcon/Http/Message/AbstractMessage.zep", 422); - if (Z_TYPE_P(&valueArray) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&valueArray), _3) - { - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadervalue", &_5, 41, &value); - zephir_check_call_status(); - zephir_cast_to_string(&_6$$5, &value); - zephir_array_append(&valueData, &_6$$5, PH_SEPARATE, "phalcon/Http/Message/AbstractMessage.zep", 419); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &valueArray, "rewind", NULL, 0); + ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION"); + ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 113, &_0$$3); zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4, &valueArray, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4)) { - break; - } - ZEPHIR_CALL_METHOD(&value, &valueArray, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadervalue", &_5, 41, &value); - zephir_check_call_status(); - zephir_cast_to_string(&_7$$6, &value); - zephir_array_append(&valueData, &_7$$6, PH_SEPARATE, "phalcon/Http/Message/AbstractMessage.zep", 419); - ZEPHIR_CALL_METHOD(NULL, &valueArray, "next", NULL, 0); + if (zephir_is_true(&_1$$3)) { + ZVAL_LONG(&_2$$4, 4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 85, &name, &_2$$4); zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("extension"), &_3$$4); } } - ZEPHIR_INIT_NVAR(&value); - RETURN_CCTOR(&valueData); + ZEPHIR_INIT_VAR(&_5); + ZVAL_STRING(&_5, "tmp_name"); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 349, &file, &_5); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("tmp"), &_4); + ZEPHIR_INIT_NVAR(&_5); + ZVAL_STRING(&_5, "size"); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 349, &file, &_5); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_6); + ZEPHIR_INIT_NVAR(&_5); + ZVAL_STRING(&_5, "type"); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 349, &file, &_5); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7); + ZEPHIR_INIT_NVAR(&_5); + ZVAL_STRING(&_5, "error"); + ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 349, &file, &_5); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_8); + if (zephir_is_true(key)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("key"), key); + } + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Http_Request_File, getName) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "name"); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUriHost) +static PHP_METHOD(Phalcon_Http_Request_File, getRealType) { + zval finfo, mime, _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub, host, _0, _1$$3, _2$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&host); + ZVAL_UNDEF(&finfo); + ZVAL_UNDEF(&mime); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(uri, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))) - ZEND_PARSE_PARAMETERS_END(); -#endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uri); - - ZEPHIR_CALL_METHOD(&host, uri, "gethost", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, uri, "getport", NULL, 0); + ZVAL_LONG(&_0, 16); + ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 307, &_0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&_1$$3, uri, "getport", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2$$3); - ZEPHIR_CONCAT_SV(&_2$$3, ":", &_1$$3); - zephir_concat_self(&host, &_2$$3); + if (ZEPHIR_IS_FALSE_IDENTICAL(&finfo)) { + RETURN_MM_STRING(""); } - RETURN_CCTOR(&host); + zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 308, &finfo, &_0); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 309, &finfo); + zephir_check_call_status(); + RETURN_CCTOR(&mime); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection) +static PHP_METHOD(Phalcon_Http_Request_File, getSize) { - zval _5$$3, _9$$4; - zend_string *_3; - zend_ulong _2; + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "size"); +} + +static PHP_METHOD(Phalcon_Http_Request_File, getTempName) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "tmp"); +} + +static PHP_METHOD(Phalcon_Http_Request_File, getType) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "type"); +} + +static PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile) +{ + zend_bool _0; + zval tmp, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *headers_param = NULL, collection, name, value, *_0, _1, _6$$3, _10$$4; - zval headers; zval *this_ptr = getThis(); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&value); + ZVAL_UNDEF(&tmp); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_10$$4); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_9$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &headers_param); - zephir_get_arrval(&headers, headers_param); - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(&tmp, this_ptr, "gettempname", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&headers, 0, "phalcon/Http/Message/AbstractMessage.zep", 466); - if (Z_TYPE_P(&headers) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&headers), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&name); - if (_3 != NULL) { - ZVAL_STR_COPY(&name, _3); - } else { - ZVAL_LONG(&name, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", &_4, 35, &name); - zephir_check_call_status(); - zephir_cast_to_string(&_5$$3, &name); - ZEPHIR_CPY_WRT(&name, &_5$$3); - ZEPHIR_CALL_METHOD(&_6$$3, this_ptr, "getheadervalue", &_7, 36, &value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&value, &_6$$3); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_8, 42, &name, &value); - zephir_check_call_status(); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &headers, "rewind", NULL, 0); + _0 = Z_TYPE_P(&tmp) == IS_STRING; + if (_0) { + ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 19, &tmp); zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &headers, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&name, &headers, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &headers, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", &_4, 35, &name); - zephir_check_call_status(); - zephir_cast_to_string(&_9$$4, &name); - ZEPHIR_CPY_WRT(&name, &_9$$4); - ZEPHIR_CALL_METHOD(&_10$$4, this_ptr, "getheadervalue", &_7, 36, &value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&value, &_10$$4); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_8, 42, &name, &value); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &headers, "next", NULL, 0); - zephir_check_call_status(); - } + _0 = zephir_is_true(&_1); } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&name); - RETURN_CCTOR(&collection); + RETURN_MM_BOOL(_0); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processBody) +static PHP_METHOD(Phalcon_Http_Request_File, moveTo) { - zend_bool _0, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *body = NULL, body_sub, *mode_param = NULL; + zval *destination_param = NULL, _0; + zval destination; zval *this_ptr = getThis(); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&destination); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(body) - Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(destination) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &body, &mode_param); - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "r+b"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); + zephir_fetch_params(1, 1, 0, &destination_param); + if (UNEXPECTED(Z_TYPE_P(destination_param) != IS_STRING && Z_TYPE_P(destination_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be of the type string")); RETURN_MM_NULL(); } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); + if (EXPECTED(Z_TYPE_P(destination_param) == IS_STRING)) { + zephir_get_strval(&destination, destination_param); } else { - ZEPHIR_INIT_VAR(&mode); - } + ZEPHIR_INIT_VAR(&destination); } - _0 = Z_TYPE_P(body) == IS_OBJECT; - if (_0) { - _0 = zephir_is_instance_of(body, SL("Psr\\Http\\Message\\StreamInterface")); - } - if (UNEXPECTED(_0)) { - RETVAL_ZVAL(body, 1, 0); - RETURN_MM(); - } - _1 = Z_TYPE_P(body) != IS_STRING; - if (_1) { - _1 = Z_TYPE_P(body) != IS_RESOURCE; - } - if (UNEXPECTED(_1)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream passed as a parameter", "phalcon/Http/Message/AbstractMessage.zep", 486); - return; - } - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, body, &mode); + zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 350, &_0, &destination); zephir_check_call_status(); RETURN_MM(); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processHeaders) +static PHP_METHOD(Phalcon_Http_Request_File, getArrVal) { - zend_bool _1$$4; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *headers, headers_sub, collection, _0$$3; + zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; + zval collection; zval *this_ptr = getThis(); - ZVAL_UNDEF(&headers_sub); ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(headers) + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_ARRAY(collection) + Z_PARAM_ZVAL(index) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &headers); + zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); + ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } - if (EXPECTED(Z_TYPE_P(headers) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&collection, this_ptr, "populateheadercollection", NULL, 44, headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "checkheaderhost", NULL, 45, &collection); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&collection, &_0$$3); - } else { - _1$$4 = Z_TYPE_P(headers) == IS_OBJECT; - if (_1$$4) { - _1$$4 = zephir_instance_of_ev(headers, phalcon_support_collection_collectioninterface_ce); - } - if (UNEXPECTED(!(_1$$4))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Headers needs to be either an array or instance of Phalcon\\Support\\Collection", "phalcon/Http/Message/AbstractMessage.zep", 506); - return; - } - ZEPHIR_CPY_WRT(&collection, headers); + if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); } - RETURN_CCTOR(&collection); + RETURN_CTOR(&value); } -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processProtocol) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *protocol = NULL, protocol_sub, protocols, _1$$4, _2$$4; - zval *this_ptr = getThis(); - ZVAL_UNDEF(&protocol_sub); - ZVAL_UNDEF(&protocols); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(protocol) - ZEND_PARSE_PARAMETERS_END(); + + +#ifdef HAVE_CONFIG_H #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &protocol); - if (!protocol) { - protocol = &protocol_sub; - ZEPHIR_INIT_VAR(protocol); - ZVAL_STRING(protocol, ""); - } - ZEPHIR_INIT_VAR(&protocols); - zephir_create_array(&protocols, 4, 0); - add_assoc_long_ex(&protocols, SL("1.0"), 1); - add_assoc_long_ex(&protocols, SL("1.1"), 1); - add_assoc_long_ex(&protocols, SL("2.0"), 1); - add_assoc_long_ex(&protocols, SL("3.0"), 1); - _0 = ZEPHIR_IS_EMPTY(protocol); - if (!(_0)) { - _0 = Z_TYPE_P(protocol) != IS_STRING; - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid protocol value", "phalcon/Http/Message/AbstractMessage.zep", 534); - return; - } - if (UNEXPECTED(!(zephir_array_isset(&protocols, protocol)))) { - ZEPHIR_INIT_VAR(&_1$$4); - object_init_ex(&_1$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_2$$4); - ZEPHIR_CONCAT_SV(&_2$$4, "Unsupported protocol ", protocol); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 40, &_2$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Http/Message/AbstractMessage.zep", 540); - ZEPHIR_MM_RESTORE(); - return; - } - RETVAL_ZVAL(protocol, 1, 0); - RETURN_MM(); + +ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Request, FileInterface, phalcon, http_request_fileinterface, phalcon_http_request_fileinterface_method_entry); + + return SUCCESS; } +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getError); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getName); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getRealType); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getSize); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getTempName); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getType); +ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, moveTo); @@ -133090,6725 +133458,186 @@ static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processProtocol) -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractRequest) +ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_CookieInterface) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, AbstractRequest, phalcon, http_message_abstractrequest, phalcon_http_message_abstractmessage_ce, phalcon_http_message_abstractrequest_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Cookie, CookieInterface, phalcon, http_cookie_cookieinterface, phalcon_http_cookie_cookieinterface_method_entry); - zend_declare_property_string(phalcon_http_message_abstractrequest_ce, SL("method"), "GET", ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_abstractrequest_ce, SL("requestTarget"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_abstractrequest_ce, SL("uri"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_abstractrequest_ce, 1, phalcon_http_message_requestmethodinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getMethod) -{ - zval *this_ptr = getThis(); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, delete); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getDomain); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getExpiration); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getHttpOnly); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getName); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getOptions); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getPath); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getSecure); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getValue); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, isUsingEncryption); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, send); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setDomain); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setExpiration); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setHttpOnly); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setOptions); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setPath); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setSecure); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setValue); +ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, useEncryption); - RETURN_MEMBER(getThis(), "method"); -} +#ifdef HAVE_CONFIG_H +#endif -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getUri) -{ - zval *this_ptr = getThis(); - RETURN_MEMBER(getThis(), "uri"); -} -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getRequestTarget) +ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception) { - zval requestTarget, _0, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Cookie, Exception, phalcon, http_cookie_exception, zend_ce_exception, NULL, 0); - ZVAL_UNDEF(&requestTarget); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); + return SUCCESS; +} - ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("requestTarget"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&requestTarget, &_0); - if (UNEXPECTED(Z_TYPE_P(&requestTarget) == IS_NULL)) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&requestTarget, &_1$$3, "getpath", NULL, 0); - zephir_check_call_status(); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "getquery", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!(ZEPHIR_IS_EMPTY(&_3$$3)))) { - zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_5$$4, &_4$$4, "getquery", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_6$$4); - ZEPHIR_CONCAT_SV(&_6$$4, "?", &_5$$4); - zephir_concat_self(&requestTarget, &_6$$4); - } - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&requestTarget))) { - ZEPHIR_INIT_NVAR(&requestTarget); - ZVAL_STRING(&requestTarget, "/"); - } - } - RETURN_CCTOR(&requestTarget); + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Cookies) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Cookies, phalcon, http_response_cookies, phalcon_di_abstractinjectionaware_ce, phalcon_http_response_cookies_method_entry, 0); + + zend_declare_property_null(phalcon_http_response_cookies_ce, SL("cookies"), ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("registered"), 0, ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_http_response_cookies_ce, SL("signKey"), ZEND_ACC_PROTECTED); + zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("useEncryption"), 1, ZEND_ACC_PROTECTED); + phalcon_http_response_cookies_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Cookies; + + zend_class_implements(phalcon_http_response_cookies_ce, 1, phalcon_http_response_cookiesinterface_ce); + return SUCCESS; } -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withMethod) +static PHP_METHOD(Phalcon_Http_Response_Cookies, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method, method_sub, _0; + zval signKey; + zval *useEncryption_param = NULL, *signKey_param = NULL, __$true, __$false; + zend_bool useEncryption; zval *this_ptr = getThis(); - ZVAL_UNDEF(&method_sub); - ZVAL_UNDEF(&_0); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&signKey); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(method) + ZEND_PARSE_PARAMETERS_START(0, 2) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(useEncryption) + Z_PARAM_STR_OR_NULL(signKey) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &method); + zephir_fetch_params(1, 0, 2, &useEncryption_param, &signKey_param); + if (!useEncryption_param) { + useEncryption = 1; + } else { + useEncryption = zephir_get_boolval(useEncryption_param); + } + if (!signKey_param) { + ZEPHIR_INIT_VAR(&signKey); + } else { + zephir_get_strval(&signKey, signKey_param); + } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processmethod", NULL, 113, method); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "method"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, method, &_0); + if (useEncryption) { + zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false); + } + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, &signKey); zephir_check_call_status(); - RETURN_MM(); + ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withRequestTarget) +static PHP_METHOD(Phalcon_Http_Response_Cookies, delete) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *requestTarget, requestTarget_sub, _0, _1, _2, _3, _4; + zval *name_param = NULL, cookie, _0; + zval name; zval *this_ptr = getThis(); - ZVAL_UNDEF(&requestTarget_sub); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&cookie); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(requestTarget) + Z_PARAM_STR(name) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &requestTarget); + zephir_fetch_params(1, 1, 0, &name_param); + if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { + zephir_get_strval(&name, name_param); + } else { + ZEPHIR_INIT_VAR(&name); + } - ZEPHIR_INIT_VAR(&_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "/\\s/"); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "/\\s/"); - zephir_preg_match(&_2, &_3, requestTarget, &_0, 0, 0 , 0 ); - if (UNEXPECTED(zephir_is_true(&_2))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid request target: cannot contain whitespace", "phalcon/Http/Message/AbstractRequest.zep", 131); - return; + ZEPHIR_OBS_VAR(&cookie); + zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) { + RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "requestTarget"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, requestTarget, &_4); + ZEPHIR_CALL_METHOD(NULL, &cookie, "delete", NULL, 0); zephir_check_call_status(); - RETURN_MM(); + RETURN_MM_BOOL(1); } -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withUri) +static PHP_METHOD(Phalcon_Http_Response_Cookies, get) { - double _0; + zval _3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub, *preserveHost = NULL, preserveHost_sub, __$false, headers, newInstance, _1, _2, _3, _4$$3; + zval *name_param = NULL, container, encryption, cookie, _0, _1, _2, _4, _5, _6$$5; + zval name; zval *this_ptr = getThis(); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&preserveHost_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&encryption); + ZVAL_UNDEF(&cookie); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6$$5); ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_OBJECT_OF_CLASS(uri, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(preserveHost) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &uri, &preserveHost); - if (!preserveHost) { - preserveHost = &preserveHost_sub; - ZEPHIR_CPY_WRT(preserveHost, &__$false); - } else { - ZEPHIR_SEPARATE_PARAM(preserveHost); - } - - - _0 = zephir_get_boolval(preserveHost); - ZEPHIR_INIT_NVAR(preserveHost); - ZVAL_BOOL(preserveHost, _0); - zephir_read_property(&_1, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_2); - if (zephir_clone(&_2, &_1) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "uri"); - ZEPHIR_CALL_METHOD(&newInstance, this_ptr, "cloneinstance", NULL, 21, uri, &_3); - zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(preserveHost))) { - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "checkheaderhost", NULL, 45, &headers); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&headers, &_4$$3); - zephir_update_property_zval(&newInstance, ZEND_STRL("headers"), &headers); - } - RETURN_CCTOR(&newInstance); -} - -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processMethod) -{ - zend_bool _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method = NULL, method_sub, methods, _2$$3, _3$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method_sub); - ZVAL_UNDEF(&methods); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(method) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &method); - if (!method) { - method = &method_sub; - ZEPHIR_INIT_VAR(method); - ZVAL_STRING(method, ""); - } - - - ZEPHIR_INIT_VAR(&methods); - zephir_create_array(&methods, 10, 0); - add_assoc_long_ex(&methods, SL("CONNECT"), 1); - add_assoc_long_ex(&methods, SL("DELETE"), 1); - add_assoc_long_ex(&methods, SL("GET"), 1); - add_assoc_long_ex(&methods, SL("HEAD"), 1); - add_assoc_long_ex(&methods, SL("OPTIONS"), 1); - add_assoc_long_ex(&methods, SL("PATCH"), 1); - add_assoc_long_ex(&methods, SL("POST"), 1); - add_assoc_long_ex(&methods, SL("PURGE"), 1); - add_assoc_long_ex(&methods, SL("PUT"), 1); - add_assoc_long_ex(&methods, SL("TRACE"), 1); - _0 = !(ZEPHIR_IS_EMPTY(method)); - if (_0) { - _0 = Z_TYPE_P(method) == IS_STRING; - } - _1 = _0; - if (_1) { - _1 = zephir_array_isset(&methods, method); - } - if (UNEXPECTED(!(_1))) { - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_CONCAT_SV(&_3$$3, "Invalid or unsupported method ", method); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 40, &_3$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$3, "phalcon/Http/Message/AbstractRequest.zep", 216); - ZEPHIR_MM_RESTORE(); - return; - } - RETVAL_ZVAL(method, 1, 0); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processUri) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uri); - - - _0 = Z_TYPE_P(uri) == IS_OBJECT; - if (_0) { - _0 = zephir_is_instance_of(uri, SL("Psr\\Http\\Message\\UriInterface")); - } - if (UNEXPECTED(_0)) { - RETVAL_ZVAL(uri, 1, 0); - RETURN_MM(); - } - if (EXPECTED(Z_TYPE_P(uri) == IS_STRING)) { - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114, uri); - zephir_check_call_status(); - RETURN_MM(); - } - if (Z_TYPE_P(uri) == IS_NULL) { - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uri passed as a parameter", "phalcon/Http/Message/AbstractRequest.zep", 245); - return; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Request) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Request, phalcon, http_message_request, phalcon_http_message_abstractrequest_ce, phalcon_http_message_request_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_request_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\requestinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Request, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *uri = NULL, uri_sub, *body = NULL, body_sub, *headers = NULL, headers_sub, __$null, _0, _1, _2, _3, _4, _5; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 4) - Z_PARAM_OPTIONAL - Z_PARAM_STR(method) - Z_PARAM_ZVAL_OR_NULL(uri) - Z_PARAM_ZVAL(body) - Z_PARAM_ZVAL(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 4, &method_param, &uri, &body, &headers); - if (!method_param) { - ZEPHIR_INIT_VAR(&method); - ZVAL_STRING(&method, "GET"); - } else { - zephir_get_strval(&method, method_param); - } - if (!uri) { - uri = &uri_sub; - uri = &__$null; - } - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } else { - ZEPHIR_SEPARATE_PARAM(body); - } - if (!headers) { - headers = &headers_sub; - ZEPHIR_INIT_VAR(headers); - array_init(headers); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://input"); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, body))) { - ZEPHIR_INIT_NVAR(body); - object_init_ex(body, phalcon_http_message_stream_input_ce); - ZEPHIR_CALL_METHOD(NULL, body, "__construct", NULL, 351); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processuri", NULL, 352, uri); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processheaders", NULL, 353, headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "processmethod", NULL, 113, &method); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("method"), &_3); - ZEPHIR_INIT_VAR(&_5); - ZVAL_STRING(&_5, "w+b"); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "processbody", NULL, 37, body, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_4); - ZEPHIR_MM_RESTORE(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, RequestFactory, phalcon, http_message_requestfactory, phalcon_http_message_requestfactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_requestfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\requestfactoryinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_RequestFactory, createRequest) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *uri, uri_sub; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_STR(method) - Z_PARAM_ZVAL(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &method_param, &uri); - if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(&method, method_param); - } else { - ZEPHIR_INIT_VAR(&method); - } - - - object_init_ex(return_value, phalcon_http_message_request_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 354, &method, uri); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface) -{ - ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, RequestMethodInterface, phalcon, http_message_requestmethodinterface, NULL); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_CONNECT"), "CONNECT"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_DELETE"), "DELETE"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_GET"), "GET"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_HEAD"), "HEAD"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_OPTIONS"), "OPTIONS"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PATCH"), "PATCH"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_POST"), "POST"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PURGE"), "PURGE"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_PUT"), "PUT"); - - zephir_declare_class_constant_string(phalcon_http_message_requestmethodinterface_ce, SL("METHOD_TRACE"), "TRACE"); - - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Response) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Response, phalcon, http_message_response, phalcon_http_message_abstractmessage_ce, phalcon_http_message_response_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_declare_property_string(phalcon_http_message_response_ce, SL("reasonPhrase"), "", ZEND_ACC_PROTECTED); - zend_declare_property_long(phalcon_http_message_response_ce, SL("statusCode"), 200, ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_response_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\responseinterface"))); - zend_class_implements(phalcon_http_message_response_ce, 1, phalcon_http_message_responsestatuscodeinterface_ce); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Response, getReasonPhrase) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "reasonPhrase"); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, getStatusCode) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "statusCode"); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval headers; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *body = NULL, body_sub, *code_param = NULL, *headers_param = NULL, _0, _1, _2, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&headers); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 3) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(body) - Z_PARAM_LONG(code) - Z_PARAM_ARRAY(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &body, &code_param, &headers_param); - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } - if (!code_param) { - code = 200; - } else { - code = zephir_get_intval(code_param); - } - if (!headers_param) { - ZEPHIR_INIT_VAR(&headers); - array_init(&headers); - } else { - zephir_get_arrval(&headers, headers_param); - } - - - ZVAL_LONG(&_0, code); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcode", NULL, 355, &_0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processheaders", NULL, 353, &headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_1); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "w+b"); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processbody", NULL, 37, body, &_3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_2); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, withStatus) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *code, code_sub, *reasonPhrase = NULL, reasonPhrase_sub, newInstance; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); - ZVAL_UNDEF(&reasonPhrase_sub); - ZVAL_UNDEF(&newInstance); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(code) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(reasonPhrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &code, &reasonPhrase); - if (!reasonPhrase) { - reasonPhrase = &reasonPhrase_sub; - ZEPHIR_INIT_VAR(reasonPhrase); - ZVAL_STRING(reasonPhrase, ""); - } - - - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CALL_METHOD(NULL, &newInstance, "processcode", NULL, 0, code, reasonPhrase); - zephir_check_call_status(); - RETURN_CCTOR(&newInstance); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, getPhrases) -{ - zval *this_ptr = getThis(); - - - - zephir_create_array(return_value, 89, 0); - add_index_stringl(return_value, 100, SL("Continue")); - add_index_stringl(return_value, 101, SL("Switching Protocols")); - add_index_stringl(return_value, 102, SL("Processing")); - add_index_stringl(return_value, 103, SL("Early Hints")); - add_index_stringl(return_value, 200, SL("OK")); - add_index_stringl(return_value, 201, SL("Created")); - add_index_stringl(return_value, 202, SL("Accepted")); - add_index_stringl(return_value, 203, SL("Non-Authoritative Information")); - add_index_stringl(return_value, 204, SL("No Content")); - add_index_stringl(return_value, 205, SL("Reset Content")); - add_index_stringl(return_value, 206, SL("Partial Content")); - add_index_stringl(return_value, 207, SL("Multi-status")); - add_index_stringl(return_value, 208, SL("Already Reported")); - add_index_stringl(return_value, 226, SL("IM Used")); - add_index_stringl(return_value, 300, SL("Multiple Choices")); - add_index_stringl(return_value, 301, SL("Moved Permanently")); - add_index_stringl(return_value, 302, SL("Found")); - add_index_stringl(return_value, 303, SL("See Other")); - add_index_stringl(return_value, 304, SL("Not Modified")); - add_index_stringl(return_value, 305, SL("Use Proxy")); - add_index_stringl(return_value, 306, SL("Switch Proxy")); - add_index_stringl(return_value, 307, SL("Temporary Redirect")); - add_index_stringl(return_value, 308, SL("Permanent Redirect")); - add_index_stringl(return_value, 400, SL("Bad Request")); - add_index_stringl(return_value, 401, SL("Unauthorized")); - add_index_stringl(return_value, 402, SL("Payment Required")); - add_index_stringl(return_value, 403, SL("Forbidden")); - add_index_stringl(return_value, 404, SL("Not Found")); - add_index_stringl(return_value, 405, SL("Method Not Allowed")); - add_index_stringl(return_value, 406, SL("Not Acceptable")); - add_index_stringl(return_value, 407, SL("Proxy Authentication Required")); - add_index_stringl(return_value, 408, SL("Request Time-out")); - add_index_stringl(return_value, 409, SL("Conflict")); - add_index_stringl(return_value, 410, SL("Gone")); - add_index_stringl(return_value, 411, SL("Length Required")); - add_index_stringl(return_value, 412, SL("Precondition Failed")); - add_index_stringl(return_value, 413, SL("Request Entity Too Large")); - add_index_stringl(return_value, 414, SL("Request-URI Too Large")); - add_index_stringl(return_value, 415, SL("Unsupported Media Type")); - add_index_stringl(return_value, 416, SL("Requested range not satisfiable")); - add_index_stringl(return_value, 417, SL("Expectation Failed")); - add_index_stringl(return_value, 418, SL("I'm a teapot")); - add_index_stringl(return_value, 421, SL("Misdirected Request")); - add_index_stringl(return_value, 422, SL("Unprocessable Entity")); - add_index_stringl(return_value, 423, SL("Locked")); - add_index_stringl(return_value, 424, SL("Failed Dependency")); - add_index_stringl(return_value, 425, SL("Unordered Collection")); - add_index_stringl(return_value, 426, SL("Upgrade Required")); - add_index_stringl(return_value, 428, SL("Precondition Required")); - add_index_stringl(return_value, 429, SL("Too Many Requests")); - add_index_stringl(return_value, 431, SL("Request Header Fields Too Large")); - add_index_stringl(return_value, 451, SL("Unavailable For Legal Reasons")); - add_index_stringl(return_value, 500, SL("Internal Server Error")); - add_index_stringl(return_value, 501, SL("Not Implemented")); - add_index_stringl(return_value, 502, SL("Bad Gateway")); - add_index_stringl(return_value, 503, SL("Service Unavailable")); - add_index_stringl(return_value, 504, SL("Gateway Time-out")); - add_index_stringl(return_value, 505, SL("HTTP Version not supported")); - add_index_stringl(return_value, 506, SL("Variant Also Negotiates")); - add_index_stringl(return_value, 507, SL("Insufficient Storage")); - add_index_stringl(return_value, 508, SL("Loop Detected")); - add_index_stringl(return_value, 510, SL("Not Extended")); - add_index_stringl(return_value, 511, SL("Network Authentication Required")); - add_index_stringl(return_value, 218, SL("This is fine")); - add_index_stringl(return_value, 419, SL("Page Expired")); - add_index_stringl(return_value, 420, SL("Method Failure")); - add_index_stringl(return_value, 440, SL("Login Time-out")); - add_index_stringl(return_value, 444, SL("No Response")); - add_index_stringl(return_value, 449, SL("Retry With")); - add_index_stringl(return_value, 450, SL("Blocked by Windows Parental Controls (Microsoft)")); - add_index_stringl(return_value, 494, SL("Request header too large")); - add_index_stringl(return_value, 495, SL("SSL Certificate Error")); - add_index_stringl(return_value, 496, SL("SSL Certificate Required")); - add_index_stringl(return_value, 497, SL("HTTP Request Sent to HTTPS Port")); - add_index_stringl(return_value, 498, SL("Invalid Token (Esri)")); - add_index_stringl(return_value, 499, SL("Client Closed Request")); - add_index_stringl(return_value, 509, SL("Bandwidth Limit Exceeded")); - add_index_stringl(return_value, 520, SL("Unknown Error")); - add_index_stringl(return_value, 521, SL("Web Server Is Down")); - add_index_stringl(return_value, 522, SL("Connection Timed Out")); - add_index_stringl(return_value, 523, SL("Origin Is Unreachable")); - add_index_stringl(return_value, 524, SL("A Timeout Occurred")); - add_index_stringl(return_value, 525, SL("SSL Handshake Failed")); - add_index_stringl(return_value, 526, SL("Invalid SSL Certificate")); - add_index_stringl(return_value, 527, SL("Railgun Error")); - add_index_stringl(return_value, 530, SL("Origin DNS Error")); - add_index_stringl(return_value, 598, SL("Network read timeout error")); - add_index_stringl(return_value, 599, SL("Network Connect Timeout Error")); - return; -} - -static PHP_METHOD(Phalcon_Http_Message_Response, processCode) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS, _0; - zval *code = NULL, code_sub, *phrase = NULL, phrase_sub, phrases, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); - ZVAL_UNDEF(&phrase_sub); - ZVAL_UNDEF(&phrases); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(code) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(phrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &code, &phrase); - ZEPHIR_SEPARATE_PARAM(code); - if (!phrase) { - phrase = &phrase_sub; - ZEPHIR_INIT_VAR(phrase); - ZVAL_STRING(phrase, ""); - } else { - ZEPHIR_SEPARATE_PARAM(phrase); - } - - - ZEPHIR_CALL_METHOD(&phrases, this_ptr, "getphrases", NULL, 356); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcodetype", NULL, 357, code); - zephir_check_call_status(); - _0 = zephir_get_intval(code); - ZEPHIR_INIT_NVAR(code); - ZVAL_LONG(code, _0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcodevalue", NULL, 358, code); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(phrase) != IS_STRING)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid response reason", "phalcon/Http/Message/Response.zep", 225); - return; - } - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - _2 = ZEPHIR_IS_IDENTICAL(&_1, phrase); - if (_2) { - _2 = zephir_array_isset(&phrases, code); - } - if (EXPECTED(_2)) { - ZEPHIR_OBS_NVAR(phrase); - zephir_array_fetch(phrase, &phrases, code, PH_NOISY, "phalcon/Http/Message/Response.zep", 229); - } - zephir_update_property_zval(this_ptr, ZEND_STRL("statusCode"), code); - zephir_update_property_zval(this_ptr, ZEND_STRL("reasonPhrase"), phrase); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, checkCodeType) -{ - zend_bool _0; - zval *code, code_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(code) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &code); - - - _0 = Z_TYPE_P(code) != IS_LONG; - if (_0) { - _0 = Z_TYPE_P(code) != IS_STRING; - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid status code; it must be an integer or string", "phalcon/Http/Message/Response.zep", 246); - return; - } -} - -static PHP_METHOD(Phalcon_Http_Message_Response, checkCodeValue) -{ - zval _6$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *code_param = NULL, _0, _1, _2, _3, _4$$3, _5$$3; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(code) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &code_param); - code = zephir_get_intval(code_param); - - - ZVAL_LONG(&_1, code); - ZVAL_LONG(&_2, 100); - ZVAL_LONG(&_3, 599); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isbetween", NULL, 359, &_1, &_2, &_3); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_INIT_VAR(&_4$$3); - object_init_ex(&_4$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_5$$3); - ZVAL_LONG(&_5$$3, code); - ZEPHIR_INIT_VAR(&_6$$3); - ZEPHIR_CONCAT_SVS(&_6$$3, "Invalid status code '", &_5$$3, "', (allowed values 100-599)"); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$3, "phalcon/Http/Message/Response.zep", 260); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Response, isBetween) -{ - zend_bool _0; - zval *value_param = NULL, *from_param = NULL, *to_param = NULL; - zend_long value, from, to; - zval *this_ptr = getThis(); - -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_LONG(value) - Z_PARAM_LONG(from) - Z_PARAM_LONG(to) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(3, 0, &value_param, &from_param, &to_param); - value = zephir_get_intval(value_param); - from = zephir_get_intval(from_param); - to = zephir_get_intval(to_param); - - - _0 = value >= from; - if (_0) { - _0 = value <= to; - } - RETURN_BOOL(_0); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, ResponseFactory, phalcon, http_message_responsefactory, phalcon_http_message_responsefactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_responsefactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\responsefactoryinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_ResponseFactory, createResponse) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval reasonPhrase; - zval *code_param = NULL, *reasonPhrase_param = NULL, _0, _1; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&reasonPhrase); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(code) - Z_PARAM_STR(reasonPhrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &code_param, &reasonPhrase_param); - if (!code_param) { - code = 200; - } else { - code = zephir_get_intval(code_param); - } - if (!reasonPhrase_param) { - ZEPHIR_INIT_VAR(&reasonPhrase); - ZVAL_STRING(&reasonPhrase, ""); - } else { - zephir_get_strval(&reasonPhrase, reasonPhrase_param); - } - - - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, phalcon_http_message_response_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 360); - zephir_check_call_status(); - ZVAL_LONG(&_1, code); - ZEPHIR_RETURN_CALL_METHOD(&_0, "withstatus", NULL, 361, &_1, &reasonPhrase); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface) -{ - ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Message, ResponseStatusCodeInterface, phalcon, http_message_responsestatuscodeinterface, NULL); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONTINUE"), 100); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SWITCHING_PROTOCOLS"), 101); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROCESSING"), 102); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EARLY_HINTS"), 103); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_OK"), 200); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CREATED"), 201); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ACCEPTED"), 202); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NON_AUTHORITATIVE_INFORMATION"), 203); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_CONTENT"), 204); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESET_CONTENT"), 205); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PARTIAL_CONTENT"), 206); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTI_STATUS"), 207); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ALREADY_REPORTED"), 208); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_USED"), 226); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MULTIPLE_CHOICES"), 300); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MOVED_PERMANENTLY"), 301); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FOUND"), 302); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SEE_OTHER"), 303); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_MODIFIED"), 304); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_USE_PROXY"), 305); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RESERVED"), 306); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TEMPORARY_REDIRECT"), 307); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PERMANENT_REDIRECT"), 308); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_REQUEST"), 400); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAUTHORIZED"), 401); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYMENT_REQUIRED"), 402); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FORBIDDEN"), 403); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_FOUND"), 404); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_NOT_ALLOWED"), 405); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_ACCEPTABLE"), 406); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PROXY_AUTHENTICATION_REQUIRED"), 407); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_TIMEOUT"), 408); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONFLICT"), 409); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GONE"), 410); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LENGTH_REQUIRED"), 411); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_FAILED"), 412); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAYLOAD_TOO_LARGE"), 413); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_URI_TOO_LONG"), 414); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNSUPPORTED_MEDIA_TYPE"), 415); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RANGE_NOT_SATISFIABLE"), 416); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_EXPECTATION_FAILED"), 417); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_IM_A_TEAPOT"), 418); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_MISDIRECTED_REQUEST"), 421); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNPROCESSABLE_ENTITY"), 422); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOCKED"), 423); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_FAILED_DEPENDENCY"), 424); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_EARLY"), 425); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UPGRADE_REQUIRED"), 426); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PRECONDITION_REQUIRED"), 428); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TOO_MANY_REQUESTS"), 429); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE"), 431); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNAVAILABLE_FOR_LEGAL_REASONS"), 451); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INTERNAL_SERVER_ERROR"), 500); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_IMPLEMENTED"), 501); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BAD_GATEWAY"), 502); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SERVICE_UNAVAILABLE"), 503); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_GATEWAY_TIMEOUT"), 504); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VERSION_NOT_SUPPORTED"), 505); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_VARIANT_ALSO_NEGOTIATES"), 506); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INSUFFICIENT_STORAGE"), 507); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOOP_DETECTED"), 508); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NOT_EXTENDED"), 510); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_AUTHENTICATION_REQUIRED"), 511); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_THIS_IS_FINE"), 218); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_PAGE_EXPIRED"), 419); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_METHOD_FAILURE"), 420); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_LOGIN_TIMEOUT"), 440); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NO_RESPONSE"), 444); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RETRY_WITH"), 449); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS"), 450); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_REQUEST_HEADER_TOO_LARGE"), 494); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_ERROR"), 495); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_CERTIFICATE_REQUIRED"), 496); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT"), 497); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_TOKEN_ESRI"), 498); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CLIENT_CLOSED_REQUEST"), 499); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_BANDWIDTH_LIMIT_EXCEEDED"), 509); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_UNKNOWN_ERROR"), 520); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_WEB_SERVER_IS_DOWN"), 521); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_CONNECTION_TIMEOUT"), 522); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_IS_UNREACHABLE"), 523); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_TIMEOUT_OCCURRED"), 524); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_SSL_HANDSHAKE_FAILED"), 525); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_INVALID_SSL_CERTIFICATE"), 526); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_RAILGUN_ERROR"), 527); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_ORIGIN_DNS_ERROR"), 530); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_READ_TIMEOUT_ERROR"), 598); - - zephir_declare_class_constant_long(phalcon_http_message_responsestatuscodeinterface_ce, SL("STATUS_NETWORK_CONNECT_TIMEOUT_ERROR"), 599); - - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequest) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, ServerRequest, phalcon, http_message_serverrequest, phalcon_http_message_abstractrequest_ce, phalcon_http_message_serverrequest_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("attributes"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("cookieParams"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("parsedBody"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("queryParams"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("serverParams"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("uploadedFiles"), ZEND_ACC_PROTECTED); - phalcon_http_message_serverrequest_ce->create_object = zephir_init_properties_Phalcon_Http_Message_ServerRequest; - - zend_class_implements(phalcon_http_message_serverrequest_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\serverrequestinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getCookieParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "cookieParams"); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getParsedBody) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "parsedBody"); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getQueryParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "queryParams"); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getServerParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "serverParams"); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getUploadedFiles) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "uploadedFiles"); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval serverParams, cookies, queryParams, uploadFiles; - zval *method_param = NULL, *uri = NULL, uri_sub, *serverParams_param = NULL, *body = NULL, body_sub, *headers = NULL, headers_sub, *cookies_param = NULL, *queryParams_param = NULL, *uploadFiles_param = NULL, *parsedBody = NULL, parsedBody_sub, *protocol_param = NULL, __$null, _0, _1, _2, _3, _4, _5, _6; - zval method, protocol; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&parsedBody_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&serverParams); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&queryParams); - ZVAL_UNDEF(&uploadFiles); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 10) - Z_PARAM_OPTIONAL - Z_PARAM_STR(method) - Z_PARAM_ZVAL_OR_NULL(uri) - Z_PARAM_ARRAY(serverParams) - Z_PARAM_ZVAL(body) - Z_PARAM_ZVAL(headers) - Z_PARAM_ARRAY(cookies) - Z_PARAM_ARRAY(queryParams) - Z_PARAM_ARRAY(uploadFiles) - Z_PARAM_ZVAL_OR_NULL(parsedBody) - Z_PARAM_STR(protocol) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 10, &method_param, &uri, &serverParams_param, &body, &headers, &cookies_param, &queryParams_param, &uploadFiles_param, &parsedBody, &protocol_param); - if (!method_param) { - ZEPHIR_INIT_VAR(&method); - ZVAL_STRING(&method, "GET"); - } else { - zephir_get_strval(&method, method_param); - } - if (!uri) { - uri = &uri_sub; - uri = &__$null; - } - if (!serverParams_param) { - ZEPHIR_INIT_VAR(&serverParams); - array_init(&serverParams); - } else { - zephir_get_arrval(&serverParams, serverParams_param); - } - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://input"); - } else { - ZEPHIR_SEPARATE_PARAM(body); - } - if (!headers) { - headers = &headers_sub; - ZEPHIR_INIT_VAR(headers); - array_init(headers); - } - if (!cookies_param) { - ZEPHIR_INIT_VAR(&cookies); - array_init(&cookies); - } else { - zephir_get_arrval(&cookies, cookies_param); - } - if (!queryParams_param) { - ZEPHIR_INIT_VAR(&queryParams); - array_init(&queryParams); - } else { - zephir_get_arrval(&queryParams, queryParams_param); - } - if (!uploadFiles_param) { - ZEPHIR_INIT_VAR(&uploadFiles); - array_init(&uploadFiles); - } else { - zephir_get_arrval(&uploadFiles, uploadFiles_param); - } - if (!parsedBody) { - parsedBody = &parsedBody_sub; - parsedBody = &__$null; - } - if (!protocol_param) { - ZEPHIR_INIT_VAR(&protocol); - ZVAL_STRING(&protocol, "1.1"); - } else { - zephir_get_strval(&protocol, protocol_param); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://input"); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, body))) { - ZEPHIR_INIT_NVAR(body); - object_init_ex(body, phalcon_http_message_stream_input_ce); - ZEPHIR_CALL_METHOD(NULL, body, "__construct", NULL, 351); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", NULL, 362, &uploadFiles); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processprotocol", NULL, 38, &protocol); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("protocolVersion"), &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processmethod", NULL, 113, &method); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("method"), &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "processheaders", NULL, 353, headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_3); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "processuri", NULL, 352, uri); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &_4); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "w+b"); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "processbody", NULL, 37, body, &_6); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_5); - zephir_update_property_zval(this_ptr, ZEND_STRL("uploadedFiles"), &uploadFiles); - zephir_update_property_zval(this_ptr, ZEND_STRL("parsedBody"), parsedBody); - zephir_update_property_zval(this_ptr, ZEND_STRL("serverParams"), &serverParams); - zephir_update_property_zval(this_ptr, ZEND_STRL("cookieParams"), &cookies); - zephir_update_property_zval(this_ptr, ZEND_STRL("queryParams"), &queryParams); - ZEPHIR_INIT_NVAR(&_6); - object_init_ex(&_6, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_6); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &name, &defaultValue); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, name, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttributes) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value, value_sub, attributes, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&attributes); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&attributes, &_1); - ZEPHIR_CALL_METHOD(NULL, &attributes, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "attributes"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &attributes, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withCookieParams) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cookies_param = NULL, _0; - zval cookies; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(cookies) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cookies_param); - zephir_get_arrval(&cookies, cookies_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "cookieParams"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &cookies, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withParsedBody) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "parsedBody"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, data, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withQueryParams) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query_param = NULL, _0; - zval query; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query_param); - zephir_get_arrval(&query, query_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "queryParams"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &query, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withUploadedFiles) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uploadedFiles_param = NULL, _0; - zval uploadedFiles; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uploadedFiles); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(uploadedFiles) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uploadedFiles_param); - zephir_get_arrval(&uploadedFiles, uploadedFiles_param); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", NULL, 362, &uploadedFiles); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "uploadedFiles"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &uploadedFiles, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withoutAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, attributes, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&attributes); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&attributes, &_1); - ZEPHIR_CALL_METHOD(NULL, &attributes, "remove", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "attributes"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &attributes, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, checkUploadedFiles) -{ - zend_bool _3$$5, _4$$9; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_2 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *files_param = NULL, file, *_0, _1; - zval files; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &files_param); - zephir_get_arrval(&files, files_param); - - - zephir_is_iterable(&files, 0, "phalcon/Http/Message/ServerRequest.zep", 354); - if (Z_TYPE_P(&files) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&files), _0) - { - ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", &_2, 362, &file); - zephir_check_call_status(); - } else { - _3$$5 = Z_TYPE_P(&file) == IS_OBJECT; - if (_3$$5) { - _3$$5 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(!(_3$$5))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uploaded file", "phalcon/Http/Message/ServerRequest.zep", 350); - return; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &files, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", &_2, 362, &file); - zephir_check_call_status(); - } else { - _4$$9 = Z_TYPE_P(&file) == IS_OBJECT; - if (_4$$9) { - _4$$9 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(!(_4$$9))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uploaded file", "phalcon/Http/Message/ServerRequest.zep", 350); - return; - } - } - ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&file); - ZEPHIR_MM_RESTORE(); -} - -zend_object *zephir_init_properties_Phalcon_Http_Message_ServerRequest(zend_class_entry *class_type) -{ - zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_7$$6); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("uploadedFiles"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("uploadedFiles"), &_1$$3); - } - zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("serverParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("serverParams"), &_3$$4); - } - zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("queryParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_4) == IS_NULL) { - ZEPHIR_INIT_VAR(&_5$$5); - array_init(&_5$$5); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("queryParams"), &_5$$5); - } - zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("cookieParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_6) == IS_NULL) { - ZEPHIR_INIT_VAR(&_7$$6); - array_init(&_7$$6); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cookieParams"), &_7$$6); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequestFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, ServerRequestFactory, phalcon, http_message_serverrequestfactory, phalcon_http_message_serverrequestfactory_method_entry, 0); - - zend_class_implements(phalcon_http_message_serverrequestfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\serverrequestfactoryinterface"))); - zend_class_implements(phalcon_http_message_serverrequestfactory_ce, 1, phalcon_http_message_requestmethodinterface_ce); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createServerRequest) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval serverParams; - zval *method_param = NULL, *uri, uri_sub, *serverParams_param = NULL; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&serverParams); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_STR(method) - Z_PARAM_ZVAL(uri) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(serverParams) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &method_param, &uri, &serverParams_param); - zephir_get_strval(&method, method_param); - if (!serverParams_param) { - ZEPHIR_INIT_VAR(&serverParams); - array_init(&serverParams); - } else { - zephir_get_arrval(&serverParams, serverParams_param); - } - - - object_init_ex(return_value, phalcon_http_message_serverrequest_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 363, &method, uri, &serverParams); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, load) -{ - zend_bool _7; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server_param = NULL, *get_param = NULL, *post_param = NULL, *cookies_param = NULL, *files_param = NULL, _COOKIE, _FILES, _GET, _POST, _SERVER, cookiesCollection, filesCollection, headers, method, protocol, serverCollection, _0, _1, _2, _3, _4, _5, _6, _8, _11, _12, _13, _14, _9$$8, _10$$8; - zval server, get, post, cookies, files, globalCookies, globalFiles, globalGet, globalPost, globalServer; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server); - ZVAL_UNDEF(&get); - ZVAL_UNDEF(&post); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&globalCookies); - ZVAL_UNDEF(&globalFiles); - ZVAL_UNDEF(&globalGet); - ZVAL_UNDEF(&globalPost); - ZVAL_UNDEF(&globalServer); - ZVAL_UNDEF(&_COOKIE); - ZVAL_UNDEF(&_FILES); - ZVAL_UNDEF(&_GET); - ZVAL_UNDEF(&_POST); - ZVAL_UNDEF(&_SERVER); - ZVAL_UNDEF(&cookiesCollection); - ZVAL_UNDEF(&filesCollection); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&serverCollection); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_13); - ZVAL_UNDEF(&_14); - ZVAL_UNDEF(&_9$$8); - ZVAL_UNDEF(&_10$$8); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 5) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY_OR_NULL(server) - Z_PARAM_ARRAY_OR_NULL(get) - Z_PARAM_ARRAY_OR_NULL(post) - Z_PARAM_ARRAY_OR_NULL(cookies) - Z_PARAM_ARRAY_OR_NULL(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SL("_SERVER")); - zephir_get_global(&_POST, SL("_POST")); - zephir_get_global(&_GET, SL("_GET")); - zephir_get_global(&_FILES, SL("_FILES")); - zephir_get_global(&_COOKIE, SL("_COOKIE")); - zephir_fetch_params(1, 0, 5, &server_param, &get_param, &post_param, &cookies_param, &files_param); - if (!server_param) { - ZEPHIR_INIT_VAR(&server); - } else { - zephir_get_arrval(&server, server_param); - } - if (!get_param) { - ZEPHIR_INIT_VAR(&get); - } else { - zephir_get_arrval(&get, get_param); - } - if (!post_param) { - ZEPHIR_INIT_VAR(&post); - } else { - zephir_get_arrval(&post, post_param); - } - if (!cookies_param) { - ZEPHIR_INIT_VAR(&cookies); - } else { - zephir_get_arrval(&cookies, cookies_param); - } - if (!files_param) { - ZEPHIR_INIT_VAR(&files); - } else { - zephir_get_arrval(&files, files_param); - } - - - ZEPHIR_INIT_VAR(&globalCookies); - array_init(&globalCookies); - ZEPHIR_INIT_VAR(&globalFiles); - array_init(&globalFiles); - ZEPHIR_INIT_VAR(&globalGet); - array_init(&globalGet); - ZEPHIR_INIT_VAR(&globalPost); - array_init(&globalPost); - ZEPHIR_INIT_VAR(&globalServer); - array_init(&globalServer); - if (!(ZEPHIR_IS_EMPTY(&_COOKIE))) { - ZEPHIR_CPY_WRT(&globalCookies, &_COOKIE); - } - if (!(ZEPHIR_IS_EMPTY(&_FILES))) { - ZEPHIR_CPY_WRT(&globalFiles, &_FILES); - } - if (!(ZEPHIR_IS_EMPTY(&_GET))) { - ZEPHIR_CPY_WRT(&globalGet, &_GET); - } - if (!(ZEPHIR_IS_EMPTY(&_POST))) { - ZEPHIR_CPY_WRT(&globalPost, &_POST); - } - if (!(ZEPHIR_IS_EMPTY(&_SERVER))) { - ZEPHIR_CPY_WRT(&globalServer, &_SERVER); - } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checknullarray", NULL, 364, &server, &globalServer); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&server, &_0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checknullarray", NULL, 364, &files, &globalFiles); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&files, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checknullarray", NULL, 364, &cookies, &globalCookies); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&cookies, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "checknullarray", NULL, 364, &get, &globalGet); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&get, &_3); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "checknullarray", NULL, 364, &post, &globalPost); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&post, &_4); - ZEPHIR_CALL_METHOD(&serverCollection, this_ptr, "parseserver", NULL, 365, &server); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_5); - ZVAL_STRING(&_5, "REQUEST_METHOD"); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "GET"); - ZEPHIR_CALL_METHOD(&method, &serverCollection, "get", NULL, 0, &_5, &_6); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&protocol, this_ptr, "parseprotocol", NULL, 366, &serverCollection); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "parseheaders", NULL, 367, &serverCollection); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&filesCollection, this_ptr, "parseuploadedfiles", NULL, 368, &files); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&cookiesCollection, &cookies); - _7 = ZEPHIR_IS_EMPTY(&cookies); - if (_7) { - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "cookie"); - ZEPHIR_CALL_METHOD(&_8, &headers, "has", NULL, 0, &_5); - zephir_check_call_status(); - _7 = zephir_is_true(&_8); - } - if (UNEXPECTED(_7)) { - ZEPHIR_INIT_VAR(&_10$$8); - ZVAL_STRING(&_10$$8, "cookie"); - ZEPHIR_CALL_METHOD(&_9$$8, &headers, "get", NULL, 0, &_10$$8); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&cookiesCollection, this_ptr, "parsecookieheader", NULL, 369, &_9$$8); - zephir_check_call_status(); - } - object_init_ex(return_value, phalcon_http_message_serverrequest_ce); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "parseuri", NULL, 370, &serverCollection, &headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_12, &serverCollection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13, &headers, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_14, &filesCollection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "php://input"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 363, &method, &_11, &_12, &_5, &_13, &cookiesCollection, &get, &_14, &post, &protocol); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeaders) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - - - ZEPHIR_MM_GROW(); - - if (EXPECTED((zephir_function_exists_ex(ZEND_STRL("apache_request_headers")) == SUCCESS))) { - ZEPHIR_RETURN_CALL_FUNCTION("apache_request_headers", NULL, 371); - zephir_check_call_status(); - RETURN_MM(); - } - RETURN_MM_BOOL(0); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost) -{ - zval defaults; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, __$null, host, port, _0, _1, _2, _4, _3$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&port); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&defaults); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&defaults); - zephir_create_array(&defaults, 2, 0); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - zephir_array_fast_append(&defaults, &_0); - zephir_array_fast_append(&defaults, &__$null); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "host"); - ZVAL_BOOL(&_2, 0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getheader", NULL, 372, headers, &_0, &_2); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_1))) { - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "host"); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getheader", NULL, 372, headers, &_3$$3); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "calculateurihostfromheader", NULL, 373, &host); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_NAME"); - ZEPHIR_CALL_METHOD(&_4, server, "has", NULL, 0, &_0); - zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(&_4))) { - RETURN_CTOR(&defaults); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_NAME"); - ZEPHIR_CALL_METHOD(&host, server, "get", NULL, 0, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_PORT"); - ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&port, server, "get", NULL, 0, &_0, &_2); - zephir_check_call_status(); - zephir_create_array(return_value, 2, 0); - zephir_array_fast_append(return_value, &host); - zephir_array_fast_append(return_value, &port); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *host_param = NULL, matches, port, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3; - zval host; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&matches); - ZVAL_UNDEF(&port); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(host) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &host_param); - zephir_get_strval(&host, host_param); - - - ZEPHIR_INIT_VAR(&port); - ZVAL_NULL(&port); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "|:(\\d+)$|"); - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "|:(\\d+)$|"); - zephir_preg_match(&_1, &_2, &host, &matches, 0, 0 , 0 ); - if (UNEXPECTED(zephir_is_true(&_1))) { - zephir_array_fetch_long(&_3$$3, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 199); - ZVAL_LONG(&_4$$3, 0); - ZVAL_LONG(&_5$$3, (-1 * ((zephir_fast_strlen_ev(&_3$$3) + 1)))); - ZEPHIR_INIT_VAR(&_6$$3); - zephir_substr(&_6$$3, &host, 0 , zephir_get_intval(&_5$$3), 0); - zephir_get_strval(&host, &_6$$3); - ZEPHIR_OBS_VAR(&_7$$3); - zephir_array_fetch_long(&_7$$3, &matches, 1, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 200); - ZEPHIR_INIT_NVAR(&port); - ZVAL_LONG(&port, zephir_get_intval(&_7$$3)); - } - zephir_create_array(return_value, 2, 0); - zephir_array_fast_append(return_value, &host); - zephir_array_fast_append(return_value, &port); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath) -{ - zend_bool _4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, iisRewrite, origPathInfo, requestUri, unencodedUrl, _0, _1, _2, _3, _5$$4, _6$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&iisRewrite); - ZVAL_UNDEF(&origPathInfo); - ZVAL_UNDEF(&requestUri); - ZVAL_UNDEF(&unencodedUrl); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "IIS_WasUrlRewritten"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&iisRewrite, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "UNENCODED_URL"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_METHOD(&unencodedUrl, server, "get", NULL, 0, &_0, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "1"); - _4 = ZEPHIR_IS_IDENTICAL(&_3, &iisRewrite); - if (_4) { - _4 = !(ZEPHIR_IS_EMPTY(&unencodedUrl)); - } - if (UNEXPECTED(_4)) { - RETURN_CCTOR(&unencodedUrl); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "REQUEST_URI"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&requestUri, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&requestUri) != IS_NULL)) { - ZEPHIR_INIT_VAR(&_5$$4); - ZVAL_STRING(&_5$$4, "#^[^/:]+://[^/]+#"); - ZEPHIR_INIT_VAR(&_6$$4); - ZVAL_STRING(&_6$$4, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_5$$4, &_6$$4, &requestUri); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "ORIG_PATH_INFO"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&origPathInfo, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&origPathInfo))) { - RETURN_MM_STRING("/"); - } - RETURN_CCTOR(&origPathInfo); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "QUERY_STRING"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_METHOD(&_0, server, "get", NULL, 0, &_1, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "?"); - zephir_fast_trim(return_value, &_0, &_1, ZEPHIR_TRIM_LEFT); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme) -{ - double _7$$3; - zend_bool _9; - zval scheme, _5$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, header, isHttps, _0, _1, _8, _10, _2$$3, _3$$3, _4$$3, _6$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&isHttps); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&_5$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&scheme); - ZVAL_STRING(&scheme, "https"); - ZEPHIR_INIT_VAR(&isHttps); - ZVAL_BOOL(&isHttps, 1); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "HTTPS"); - ZEPHIR_CALL_METHOD(&_0, server, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "HTTPS"); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, "on"); - ZEPHIR_CALL_METHOD(&_2$$3, server, "get", NULL, 0, &_3$$3, &_4$$3); - zephir_check_call_status(); - zephir_cast_to_string(&_5$$3, &_2$$3); - ZEPHIR_CPY_WRT(&isHttps, &_5$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_fast_strtolower(&_3$$3, &isHttps); - ZEPHIR_INIT_VAR(&_6$$3); - ZVAL_STRING(&_6$$3, "off"); - _7$$3 = !ZEPHIR_IS_IDENTICAL(&_6$$3, &_3$$3); - ZEPHIR_INIT_NVAR(&isHttps); - ZVAL_BOOL(&isHttps, _7$$3); - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "x-forwarded-proto"); - ZEPHIR_INIT_VAR(&_8); - ZVAL_STRING(&_8, "https"); - ZEPHIR_CALL_METHOD(&header, this_ptr, "getheader", NULL, 372, headers, &_1, &_8); - zephir_check_call_status(); - _9 = !zephir_is_true(&isHttps); - if (!(_9)) { - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "https"); - _9 = !ZEPHIR_IS_IDENTICAL(&_10, &header); - } - if (UNEXPECTED(_9)) { - ZEPHIR_INIT_NVAR(&scheme); - ZVAL_STRING(&scheme, "http"); - } - RETURN_CTOR(&scheme); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, checkNullArray) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval super; - zval *source, source_sub, *super_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&source_sub); - ZVAL_UNDEF(&super); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(source) - Z_PARAM_ARRAY(super) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &source, &super_param); - zephir_get_arrval(&super, super_param); - - - if (UNEXPECTED(ZEPHIR_IS_EMPTY(source))) { - RETURN_CTOR(&super); - } - RETVAL_ZVAL(source, 1, 0); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile) -{ - zval _3$$3; - zend_bool _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, name, type, _4, _5, _6, _2$$3; - zval file; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(file) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &file_param); - zephir_get_arrval(&file, file_param); - - - _0 = !(zephir_array_isset_string(&file, SL("tmp_name"))); - if (!(_0)) { - _0 = !(zephir_array_isset_string(&file, SL("size"))); - } - _1 = _0; - if (!(_1)) { - _1 = !(zephir_array_isset_string(&file, SL("error"))); - } - if (UNEXPECTED(_1)) { - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_CONCAT_SS(&_3$$3, "The file array must contain tmp_name, size and error; ", "one or more are missing"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 40, &_3$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$3, "phalcon/Http/Message/ServerRequestFactory.zep", 318); - ZEPHIR_MM_RESTORE(); - return; - } - if (zephir_array_isset_string(&file, SL("name"))) { - ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, &file, SL("name"), PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 321); - } else { - ZEPHIR_INIT_NVAR(&name); - ZVAL_NULL(&name); - } - if (zephir_array_isset_string(&file, SL("type"))) { - ZEPHIR_OBS_VAR(&type); - zephir_array_fetch_string(&type, &file, SL("type"), PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 322); - } else { - ZEPHIR_INIT_NVAR(&type); - ZVAL_NULL(&type); - } - object_init_ex(return_value, phalcon_http_message_uploadedfile_ce); - zephir_array_fetch_string(&_4, &file, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 325); - zephir_array_fetch_string(&_5, &file, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 326); - zephir_array_fetch_string(&_6, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 327); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 374, &_4, &_5, &_6, &name, &type); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval name; - zval *headers, headers_sub, *name_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&name); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &headers, &name_param, &defaultValue); - zephir_get_strval(&name, name_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&value, headers, "get", NULL, 0, &name, defaultValue); - zephir_check_call_status(); - if (Z_TYPE_P(&value) == IS_ARRAY) { - ZEPHIR_INIT_VAR(&_0$$3); - zephir_fast_join_str(&_0$$3, SL(","), &value); - ZEPHIR_CPY_WRT(&value, &_0$$3); - } - RETURN_CCTOR(&value); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cookieHeader_param = NULL, cookies, _1; - zval cookieHeader; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cookieHeader); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(cookieHeader) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cookieHeader_param); - zephir_get_strval(&cookieHeader, cookieHeader_param); - - - ZEPHIR_INIT_VAR(&cookies); - array_init(&cookies); - ZEPHIR_INIT_VAR(&_0); - zephir_create_array(&_0, 3, 0); - add_assoc_stringl_ex(&_0, SL("&"), SL("%26")); - add_assoc_stringl_ex(&_0, SL("+"), SL("%2B")); - add_assoc_stringl_ex(&_0, SL(";"), SL("&")); - ZEPHIR_CALL_FUNCTION(&_1, "strtr", NULL, 5, &cookieHeader, &_0); - zephir_check_call_status(); - ZEPHIR_MAKE_REF(&cookies); - ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 375, &_1, &cookies); - ZEPHIR_UNREF(&cookies); - zephir_check_call_status(); - RETURN_CCTOR(&cookies); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseHeaders) -{ - zend_string *_3; - zend_ulong _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_10 = NULL, *_18 = NULL, *_30 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, headers, key, name, serverArray, value, *_0, _1, _4$$3, _5$$4, _6$$4, _11$$4, _12$$4, _19$$4, _20$$4, _7$$5, _8$$5, _9$$5, _13$$7, _14$$7, _15$$7, _16$$7, _17$$7, _21$$8, _22$$8, _23$$8, _24$$9, _25$$10, _26$$10, _31$$10, _32$$10, _38$$10, _39$$10, _27$$11, _28$$11, _29$$11, _33$$13, _34$$13, _35$$13, _36$$13, _37$$13, _40$$14, _41$$14, _42$$14; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&serverArray); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_11$$4); - ZVAL_UNDEF(&_12$$4); - ZVAL_UNDEF(&_19$$4); - ZVAL_UNDEF(&_20$$4); - ZVAL_UNDEF(&_7$$5); - ZVAL_UNDEF(&_8$$5); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_13$$7); - ZVAL_UNDEF(&_14$$7); - ZVAL_UNDEF(&_15$$7); - ZVAL_UNDEF(&_16$$7); - ZVAL_UNDEF(&_17$$7); - ZVAL_UNDEF(&_21$$8); - ZVAL_UNDEF(&_22$$8); - ZVAL_UNDEF(&_23$$8); - ZVAL_UNDEF(&_24$$9); - ZVAL_UNDEF(&_25$$10); - ZVAL_UNDEF(&_26$$10); - ZVAL_UNDEF(&_31$$10); - ZVAL_UNDEF(&_32$$10); - ZVAL_UNDEF(&_38$$10); - ZVAL_UNDEF(&_39$$10); - ZVAL_UNDEF(&_27$$11); - ZVAL_UNDEF(&_28$$11); - ZVAL_UNDEF(&_29$$11); - ZVAL_UNDEF(&_33$$13); - ZVAL_UNDEF(&_34$$13); - ZVAL_UNDEF(&_35$$13); - ZVAL_UNDEF(&_36$$13); - ZVAL_UNDEF(&_37$$13); - ZVAL_UNDEF(&_40$$14); - ZVAL_UNDEF(&_41$$14); - ZVAL_UNDEF(&_42$$14); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&headers); - object_init_ex(&headers, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 24); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&serverArray, server, "toarray", NULL, 0); - zephir_check_call_status(); - zephir_is_iterable(&serverArray, 0, "phalcon/Http/Message/ServerRequestFactory.zep", 437); - if (Z_TYPE_P(&serverArray) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&serverArray), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, ""); - if (EXPECTED(!ZEPHIR_IS_IDENTICAL(&_4$$3, &value))) { - ZEPHIR_INIT_NVAR(&_5$$4); - ZVAL_STRING(&_5$$4, "REDIRECT_"); - ZEPHIR_INIT_NVAR(&_6$$4); - zephir_fast_strpos(&_6$$4, &key, &_5$$4, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_6$$4, 0))) { - ZVAL_LONG(&_7$$5, 9); - ZEPHIR_INIT_NVAR(&_8$$5); - zephir_substr(&_8$$5, &key, 9 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CPY_WRT(&key, &_8$$5); - ZEPHIR_CALL_METHOD(&_9$$5, server, "has", &_10, 0, &key); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_9$$5))) { - continue; - } - } - ZEPHIR_INIT_NVAR(&_11$$4); - ZVAL_STRING(&_11$$4, "HTTP_"); - ZEPHIR_INIT_NVAR(&_12$$4); - zephir_fast_strpos(&_12$$4, &key, &_11$$4, 0 ); - if (EXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_12$$4, 0))) { - ZEPHIR_INIT_NVAR(&_13$$7); - ZVAL_LONG(&_14$$7, 5); - ZEPHIR_INIT_NVAR(&_15$$7); - zephir_substr(&_15$$7, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_13$$7, &_15$$7); - ZEPHIR_INIT_NVAR(&_16$$7); - ZVAL_STRING(&_16$$7, "_"); - ZEPHIR_INIT_NVAR(&_17$$7); - ZVAL_STRING(&_17$$7, "-"); - ZEPHIR_INIT_NVAR(&name); - zephir_fast_str_replace(&name, &_16$$7, &_17$$7, &_13$$7); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - ZEPHIR_INIT_NVAR(&_19$$4); - ZVAL_STRING(&_19$$4, "CONTENT_"); - ZEPHIR_INIT_NVAR(&_20$$4); - zephir_fast_strpos(&_20$$4, &key, &_19$$4, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_20$$4, 0))) { - ZEPHIR_INIT_NVAR(&_21$$8); - ZVAL_LONG(&_22$$8, 8); - ZEPHIR_INIT_NVAR(&_23$$8); - zephir_substr(&_23$$8, &key, 8 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_21$$8, &_23$$8); - ZEPHIR_INIT_NVAR(&name); - ZEPHIR_CONCAT_SV(&name, "content-", &_21$$8); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &serverArray, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &serverArray, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &serverArray, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &serverArray, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_24$$9); - ZVAL_STRING(&_24$$9, ""); - if (EXPECTED(!ZEPHIR_IS_IDENTICAL(&_24$$9, &value))) { - ZEPHIR_INIT_NVAR(&_25$$10); - ZVAL_STRING(&_25$$10, "REDIRECT_"); - ZEPHIR_INIT_NVAR(&_26$$10); - zephir_fast_strpos(&_26$$10, &key, &_25$$10, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_26$$10, 0))) { - ZVAL_LONG(&_27$$11, 9); - ZEPHIR_INIT_NVAR(&_28$$11); - zephir_substr(&_28$$11, &key, 9 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CPY_WRT(&key, &_28$$11); - ZEPHIR_CALL_METHOD(&_29$$11, server, "has", &_30, 0, &key); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_29$$11))) { - continue; - } - } - ZEPHIR_INIT_NVAR(&_31$$10); - ZVAL_STRING(&_31$$10, "HTTP_"); - ZEPHIR_INIT_NVAR(&_32$$10); - zephir_fast_strpos(&_32$$10, &key, &_31$$10, 0 ); - if (EXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_32$$10, 0))) { - ZEPHIR_INIT_NVAR(&_33$$13); - ZVAL_LONG(&_34$$13, 5); - ZEPHIR_INIT_NVAR(&_35$$13); - zephir_substr(&_35$$13, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_33$$13, &_35$$13); - ZEPHIR_INIT_NVAR(&_36$$13); - ZVAL_STRING(&_36$$13, "_"); - ZEPHIR_INIT_NVAR(&_37$$13); - ZVAL_STRING(&_37$$13, "-"); - ZEPHIR_INIT_NVAR(&name); - zephir_fast_str_replace(&name, &_36$$13, &_37$$13, &_33$$13); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - ZEPHIR_INIT_NVAR(&_38$$10); - ZVAL_STRING(&_38$$10, "CONTENT_"); - ZEPHIR_INIT_NVAR(&_39$$10); - zephir_fast_strpos(&_39$$10, &key, &_38$$10, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_39$$10, 0))) { - ZEPHIR_INIT_NVAR(&_40$$14); - ZVAL_LONG(&_41$$14, 8); - ZEPHIR_INIT_NVAR(&_42$$14); - zephir_substr(&_42$$14, &key, 8 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_40$$14, &_42$$14); - ZEPHIR_INIT_NVAR(&name); - ZEPHIR_CONCAT_SV(&name, "content-", &_40$$14); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - } - ZEPHIR_CALL_METHOD(NULL, &serverArray, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&key); - RETURN_CCTOR(&headers); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseProtocol) -{ - zval _4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, localProtocol, protocol, protocols, _0, _1, _2, _3, _5, _6, _9, _10, _7$$4, _8$$4, _11$$5, _12$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&localProtocol); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&protocols); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_7$$4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_11$$5); - ZVAL_UNDEF(&_12$$5); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "SERVER_PROTOCOL"); - ZEPHIR_CALL_METHOD(&_0, server, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - RETURN_MM_STRING("1.1"); - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "SERVER_PROTOCOL"); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "HTTP/1.1"); - ZEPHIR_CALL_METHOD(&_2, server, "get", NULL, 0, &_1, &_3); - zephir_check_call_status(); - zephir_cast_to_string(&_4, &_2); - ZEPHIR_CPY_WRT(&protocol, &_4); - ZEPHIR_INIT_VAR(&localProtocol); - zephir_fast_strtolower(&localProtocol, &protocol); - ZEPHIR_INIT_VAR(&protocols); - zephir_create_array(&protocols, 4, 0); - add_assoc_long_ex(&protocols, SL("1.0"), 1); - add_assoc_long_ex(&protocols, SL("1.1"), 1); - add_assoc_long_ex(&protocols, SL("2.0"), 1); - add_assoc_long_ex(&protocols, SL("3.0"), 1); - ZVAL_LONG(&_5, 0); - ZVAL_LONG(&_6, 5); - ZEPHIR_INIT_NVAR(&_1); - zephir_substr(&_1, &localProtocol, 0 , 5 , 0); - if (!ZEPHIR_IS_STRING_IDENTICAL(&_1, "http/")) { - ZEPHIR_INIT_VAR(&_7$$4); - object_init_ex(&_7$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_8$$4); - ZEPHIR_CONCAT_SV(&_8$$4, "Incorrect protocol value ", &protocol); - ZEPHIR_CALL_METHOD(NULL, &_7$$4, "__construct", NULL, 40, &_8$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_7$$4, "phalcon/Http/Message/ServerRequestFactory.zep", 467); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_INIT_NVAR(&_3); - ZEPHIR_INIT_VAR(&_9); - ZVAL_STRING(&_9, "http/"); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, ""); - zephir_fast_str_replace(&_3, &_9, &_10, &localProtocol); - ZEPHIR_CPY_WRT(&localProtocol, &_3); - if (UNEXPECTED(!(zephir_array_isset(&protocols, &localProtocol)))) { - ZEPHIR_INIT_VAR(&_11$$5); - object_init_ex(&_11$$5, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_12$$5); - ZEPHIR_CONCAT_SV(&_12$$5, "Unsupported protocol ", &protocol); - ZEPHIR_CALL_METHOD(NULL, &_11$$5, "__construct", NULL, 40, &_12$$5); - zephir_check_call_status(); - zephir_throw_exception_debug(&_11$$5, "phalcon/Http/Message/ServerRequestFactory.zep", 475); - ZEPHIR_MM_RESTORE(); - return; - } - RETURN_CCTOR(&localProtocol); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseServer) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server_param = NULL, collection, headers, headersCollection, _0, _1, _3$$3, _4$$3, _5$$4, _6$$4; - zval server; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&headersCollection); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(server) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server_param); - zephir_get_arrval(&server, server_param); - - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24, &server); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_0, &collection, "has", NULL, 376, &_1); - zephir_check_call_status(); - _2 = !zephir_is_true(&_0); - if (_2) { - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&headers); - } - if (UNEXPECTED(_2)) { - ZEPHIR_INIT_VAR(&headersCollection); - object_init_ex(&headersCollection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &headersCollection, "__construct", NULL, 24, &headers); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, "Authorization"); - ZEPHIR_CALL_METHOD(&_3$$3, &headersCollection, "has", NULL, 376, &_4$$3); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_3$$3))) { - ZEPHIR_INIT_VAR(&_6$$4); - ZVAL_STRING(&_6$$4, "Authorization"); - ZEPHIR_CALL_METHOD(&_5$$4, &headersCollection, "get", NULL, 377, &_6$$4); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_6$$4); - ZVAL_STRING(&_6$$4, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", NULL, 42, &_6$$4, &_5$$4); - zephir_check_call_status(); - } - } - RETURN_CCTOR(&collection); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles) -{ - zend_bool _5$$3, _7$$3, _13$$7, _14$$7; - zval _4$$3, _12$$7; - zend_string *_3; - zend_ulong _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_10 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *files_param = NULL, collection, data, key, file, *_0, _1, _8$$5, _11$$6, _15$$9, _16$$10; - zval files; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_8$$5); - ZVAL_UNDEF(&_11$$6); - ZVAL_UNDEF(&_15$$9); - ZVAL_UNDEF(&_16$$10); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_12$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &files_param); - zephir_get_arrval(&files, files_param); - - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_is_iterable(&files, 0, "phalcon/Http/Message/ServerRequestFactory.zep", 558); - if (Z_TYPE_P(&files) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&files), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - zephir_cast_to_string(&_4$$3, &key); - ZEPHIR_CPY_WRT(&key, &_4$$3); - _5$$3 = Z_TYPE_P(&file) == IS_OBJECT; - if (_5$$3) { - _5$$3 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(_5$$3)) { - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &file); - zephir_check_call_status(); - continue; - } - _7$$3 = Z_TYPE_P(&file) == IS_ARRAY; - if (_7$$3) { - _7$$3 = zephir_array_isset_string(&file, SL("tmp_name")); - } - if (EXPECTED(_7$$3)) { - ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "createuploadedfile", &_9, 378, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_8$$5); - zephir_check_call_status(); - continue; - } - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&data, this_ptr, "parseuploadedfiles", &_10, 368, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$6, &data, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_11$$6); - zephir_check_call_status(); - continue; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &files, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &files, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0); - zephir_check_call_status(); - zephir_cast_to_string(&_12$$7, &key); - ZEPHIR_CPY_WRT(&key, &_12$$7); - _13$$7 = Z_TYPE_P(&file) == IS_OBJECT; - if (_13$$7) { - _13$$7 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(_13$$7)) { - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &file); - zephir_check_call_status(); - continue; - } - _14$$7 = Z_TYPE_P(&file) == IS_ARRAY; - if (_14$$7) { - _14$$7 = zephir_array_isset_string(&file, SL("tmp_name")); - } - if (EXPECTED(_14$$7)) { - ZEPHIR_CALL_METHOD(&_15$$9, this_ptr, "createuploadedfile", &_9, 378, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_15$$9); - zephir_check_call_status(); - continue; - } - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&data, this_ptr, "parseuploadedfiles", &_10, 368, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$10, &data, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_16$$10); - zephir_check_call_status(); - continue; - } - ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&file); - ZEPHIR_INIT_NVAR(&key); - RETURN_CCTOR(&collection); -} - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUri) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, path, query, scheme, split, uri, _0, _1, _7, _8, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _9$$5, _10$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&split); - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_10$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&uri); - object_init_ex(&uri, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, &uri, "__construct", NULL, 114); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&scheme, this_ptr, "calculateurischeme", NULL, 379, server, headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, &uri, "withscheme", NULL, 380, &scheme); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - ZEPHIR_CALL_METHOD(&split, this_ptr, "calculateurihost", NULL, 381, server, headers); - zephir_check_call_status(); - ZEPHIR_OBS_VAR(&_1); - zephir_array_fetch_long(&_1, &split, 0, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 585); - if (EXPECTED(!(ZEPHIR_IS_EMPTY(&_1)))) { - zephir_array_fetch_long(&_3$$3, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 586); - ZEPHIR_CALL_METHOD(&_2$$3, &uri, "withhost", NULL, 382, &_3$$3); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_2$$3); - ZEPHIR_OBS_VAR(&_4$$3); - zephir_array_fetch_long(&_4$$3, &split, 1, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 587); - if (UNEXPECTED(!(ZEPHIR_IS_EMPTY(&_4$$3)))) { - zephir_array_fetch_long(&_6$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 588); - ZEPHIR_CALL_METHOD(&_5$$4, &uri, "withport", NULL, 383, &_6$$4); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_5$$4); - } - } - ZEPHIR_CALL_METHOD(&path, this_ptr, "calculateuripath", NULL, 384, server); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&split); - zephir_fast_explode_str(&split, SL("#"), &path, LONG_MAX); - zephir_array_fetch_long(&_7, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 597); - ZEPHIR_INIT_NVAR(&path); - zephir_fast_explode_str(&path, SL("?"), &_7, LONG_MAX); - zephir_array_fetch_long(&_8, &path, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 598); - ZEPHIR_CALL_METHOD(&_0, &uri, "withpath", NULL, 385, &_8); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - if (UNEXPECTED(zephir_fast_count_int(&split) > 1)) { - zephir_array_fetch_long(&_10$$5, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 601); - ZEPHIR_CALL_METHOD(&_9$$5, &uri, "withfragment", NULL, 386, &_10$$5); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_9$$5); - } - ZEPHIR_CALL_METHOD(&query, this_ptr, "calculateuriquery", NULL, 387, server); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, &uri, "withquery", NULL, 388, &query); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - RETURN_CCTOR(&uri); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, Stream, phalcon, http_message_stream, phalcon_http_message_stream_method_entry, 0); - - zend_declare_property_null(phalcon_http_message_stream_ce, SL("handle"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_stream_ce, SL("stream"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_stream_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *stream, stream_sub, *mode_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &stream, &mode_param); - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "rb"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstream", NULL, 0, stream, &mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, __destruct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "close", NULL, 0); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, __toString) -{ - zval _0$$3, _1$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$4); - - - ZEPHIR_MM_GROW(); - - - /* try_start_1: */ - - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "isreadable", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - if (UNEXPECTED(zephir_is_true(&_0$$3))) { - ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "isseekable", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - if (UNEXPECTED(zephir_is_true(&_1$$4))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcontents", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - RETURN_MM(); - } - - try_end_1: - - zend_clear_exception(); - RETURN_MM_STRING(""); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, close) -{ - zval handle, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (EXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&handle, this_ptr, "detach", NULL, 0); - zephir_check_call_status(); - zephir_fclose(&handle); - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, detach) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval __$null, handle, _0; - zval *this_ptr = getThis(); - - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&handle, &_0); - zephir_update_property_zval(this_ptr, ZEND_STRL("handle"), &__$null); - RETURN_CCTOR(&handle); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, eof) -{ - zval _0, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - RETURN_BOOL(zephir_feof(&_1$$3)); - } - RETURN_BOOL(1); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, getContents) -{ - zval data, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkreadable", NULL, 78); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&data, "stream_get_contents", NULL, 79, &_0); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&data))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not read from the file/stream", "phalcon/Http/Message/Stream.zep", 139); - return; - } - RETURN_CCTOR(&data); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, getMetadata) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, __$null, metadata, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&metadata); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &key); - if (!key) { - key = &key_sub; - key = &__$null; - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { - RETURN_MM_NULL(); - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&metadata, "stream_get_meta_data", NULL, 80, &_1); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(key) == IS_NULL)) { - RETURN_CCTOR(&metadata); - } - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getarrval", NULL, 81, &metadata, key, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, getSize) -{ - zval stats, _0, _1$$3, _2$$4, _3$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stats); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (EXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&stats, "fstat", NULL, 82, &_1$$3); - zephir_check_call_status(); - if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&stats))) { - ZEPHIR_INIT_VAR(&_2$$4); - ZVAL_STRING(&_2$$4, "size"); - ZVAL_NULL(&_3$$4); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getarrval", NULL, 81, &stats, &_2$$4, &_3$$4); - zephir_check_call_status(); - RETURN_MM(); - } - } - RETURN_MM_NULL(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, isReadable) -{ - zval _2; - zval mode, _0, _1, _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "mode"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - zephir_cast_to_string(&_2, &_0); - ZEPHIR_CPY_WRT(&mode, &_2); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "r+"); - ZEPHIR_CALL_FUNCTION(&_3, "strpbrk", NULL, 83, &mode, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, isSeekable) -{ - zval _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "seekable"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(&_0)); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, isWritable) -{ - zval _2; - zval mode, _0, _1, _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "mode"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - zephir_cast_to_string(&_2, &_0); - ZEPHIR_CPY_WRT(&mode, &_2); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "xwca+"); - ZEPHIR_CALL_FUNCTION(&_3, "strpbrk", NULL, 83, &mode, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, read) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *length, length_sub, data, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&length_sub); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &length); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkreadable", NULL, 78); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&data, "fread", NULL, 84, &_0, length); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&data))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not read from the file/stream", "phalcon/Http/Message/Stream.zep", 239); - return; - } - RETURN_CCTOR(&data); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, rewind) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 0, &_0); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, seek) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *offset, offset_sub, *whence = NULL, whence_sub, seeker, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&offset_sub); - ZVAL_UNDEF(&whence_sub); - ZVAL_UNDEF(&seeker); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(offset) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(whence) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &offset, &whence); - if (!whence) { - whence = &whence_sub; - ZEPHIR_INIT_VAR(whence); - ZVAL_LONG(whence, 0); - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkseekable", NULL, 85); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&seeker, "fseek", NULL, 86, &_0, offset, whence); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&seeker, 0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not seek on the file pointer", "phalcon/Http/Message/Stream.zep", 272); - return; - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, setStream) -{ - zend_bool _7, _8; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *stream, stream_sub, *mode_param = NULL, __$false, handle, version, _9, _10, _0$$3, _1$$3, _2$$3, _3$$4, _4$$4, _5$$5, _6$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&version); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &stream, &mode_param); - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "rb"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - ZEPHIR_CPY_WRT(&handle, stream); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - if (EXPECTED(Z_TYPE_P(stream) == IS_STRING)) { - ZEPHIR_INIT_VAR(&_0$$3); - ZVAL_STRING(&_0$$3, "8.0"); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, ">="); - ZEPHIR_CALL_FUNCTION(&_2$$3, "version_compare", NULL, 88, &version, &_0$$3, &_1$$3); - zephir_check_call_status(); - if (zephir_is_true(&_2$$3)) { - ZEPHIR_INIT_VAR(&_3$$4); - ZEPHIR_INIT_NVAR(&_3$$4); - zephir_create_closure_ex(&_3$$4, NULL, phalcon_0__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$4, &_4$$4); - zephir_check_call_status(); - } else { - ZEPHIR_INIT_VAR(&_5$$5); - ZEPHIR_INIT_NVAR(&_5$$5); - zephir_create_closure_ex(&_5$$5, NULL, phalcon_1__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$5, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$5, &_6$$5); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, stream, &mode); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); - zephir_check_call_status(); - } - _7 = ZEPHIR_GLOBAL(warning).enable; - if (!(_7)) { - _7 = Z_TYPE_P(&handle) != IS_RESOURCE; - } - _8 = _7; - if (!(_8)) { - ZEPHIR_CALL_FUNCTION(&_9, "get_resource_type", NULL, 92, &handle); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "stream"); - _8 = !ZEPHIR_IS_IDENTICAL(&_10, &_9); - } - if (UNEXPECTED(_8)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The stream provided is not valid (string/resource) or could not be opened.", "phalcon/Http/Message/Stream.zep", 320); - return; - } - zephir_update_property_zval(this_ptr, ZEND_STRL("handle"), &handle); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), stream); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, tell) -{ - zval position, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&position); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&position, "ftell", NULL, 93, &_0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&position) != IS_LONG)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_ce_exception, "Could not retrieve the pointer position", "phalcon/Http/Message/Stream.zep", 341); - return; - } - RETURN_CCTOR(&position); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, write) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, bytes, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&bytes); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkwritable", NULL, 94); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&bytes); - zephir_fwrite(&bytes, &_0, data); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&bytes))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not write to the file/stream", "phalcon/Http/Message/Stream.zep", 364); - return; - } - RETURN_CCTOR(&bytes); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, checkHandle) -{ - zval _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(spl_ce_RuntimeException, "A valid resource is required.", "phalcon/Http/Message/Stream.zep", 376); - return; - } -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, checkReadable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isreadable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not readable.", "phalcon/Http/Message/Stream.zep", 386); - return; - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, checkSeekable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isseekable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not seekable.", "phalcon/Http/Message/Stream.zep", 396); - return; - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, checkWritable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "iswritable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not writable.", "phalcon/Http/Message/Stream.zep", 406); - return; - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream, getArrVal) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; - zval collection; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ARRAY(collection) - Z_PARAM_ZVAL(index) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); - ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - RETURN_CTOR(&value); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_StreamFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, StreamFactory, phalcon, http_message_streamfactory, phalcon_http_message_streamfactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_streamfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\streamfactoryinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStream) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content_param = NULL, handle, _0, _1; - zval content; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(content) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &content_param); - if (!content_param) { - ZEPHIR_INIT_VAR(&content); - ZVAL_STRING(&content, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(&content, content_param); - } else { - ZEPHIR_INIT_VAR(&content); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://temp"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "r+b"); - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&handle))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Cannot write to file.", "phalcon/Http/Message/StreamFactory.zep", 41); - return; - } - zephir_fwrite(NULL, &handle, &content); - ZEPHIR_CALL_FUNCTION(NULL, "rewind", NULL, 389, &handle); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createstreamfromresource", NULL, 390, &handle); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filename_param = NULL, *mode_param = NULL; - zval filename, mode; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&filename); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(filename) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &filename_param, &mode_param); - if (UNEXPECTED(Z_TYPE_P(filename_param) != IS_STRING && Z_TYPE_P(filename_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filename' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(filename_param) == IS_STRING)) { - zephir_get_strval(&filename, filename_param); - } else { - ZEPHIR_INIT_VAR(&filename); - } - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "r+b"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, &filename, &mode); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromResource) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *phpResource, phpResource_sub, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&phpResource_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(phpResource) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &phpResource); - - - _0 = Z_TYPE_P(phpResource) != IS_RESOURCE; - if (!(_0)) { - ZEPHIR_CALL_FUNCTION(&_1, "get_resource_type", NULL, 92, phpResource); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "stream"); - _0 = !ZEPHIR_IS_IDENTICAL(&_2, &_1); - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream provided", "phalcon/Http/Message/StreamFactory.zep", 79); - return; - } - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, phpResource); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFile) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UploadedFile, phalcon, http_message_uploadedfile, phalcon_http_message_uploadedfile_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_declare_property_bool(phalcon_http_message_uploadedfile_ce, SL("alreadyMoved"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("clientFilename"), ZEND_ACC_PRIVATE); - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("clientMediaType"), ZEND_ACC_PRIVATE); - zend_declare_property_long(phalcon_http_message_uploadedfile_ce, SL("error"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_string(phalcon_http_message_uploadedfile_ce, SL("fileName"), "", ZEND_ACC_PRIVATE); - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("size"), ZEND_ACC_PRIVATE); - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("stream"), ZEND_ACC_PRIVATE); - zend_class_implements(phalcon_http_message_uploadedfile_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uploadedfileinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientFilename) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "clientFilename"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientMediaType) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "clientMediaType"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getError) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "error"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getSize) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "size"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval clientFilename, clientMediaType; - zend_long size, error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *size_param = NULL, *error_param = NULL, *clientFilename_param = NULL, *clientMediaType_param = NULL, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&clientFilename); - ZVAL_UNDEF(&clientMediaType); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 5) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(size, is_null_true) - Z_PARAM_LONG(error) - Z_PARAM_STR_OR_NULL(clientFilename) - Z_PARAM_STR_OR_NULL(clientMediaType) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 4, &stream, &size_param, &error_param, &clientFilename_param, &clientMediaType_param); - if (!size_param) { - size = 0; - } else { - size = zephir_get_intval(size_param); - } - if (!error_param) { - error = 0; - } else { - error = zephir_get_intval(error_param); - } - if (!clientFilename_param) { - ZEPHIR_INIT_VAR(&clientFilename); - } else { - zephir_get_strval(&clientFilename, clientFilename_param); - } - if (!clientMediaType_param) { - ZEPHIR_INIT_VAR(&clientMediaType); - } else { - zephir_get_strval(&clientMediaType, clientMediaType_param); - } - - - ZVAL_LONG(&_0, error); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstream", NULL, 391, stream, &_0); - zephir_check_call_status(); - ZVAL_LONG(&_0, error); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkerror", NULL, 392, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(&_0, size); - zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_0); - zephir_update_property_zval(this_ptr, ZEND_STRL("clientFilename"), &clientFilename); - zephir_update_property_zval(this_ptr, ZEND_STRL("clientMediaType"), &clientMediaType); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getStream) -{ - zval _0, _4, _5, _1$$3, _2$$3, _3$$3, _6$$5, _7$$5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&_7$$5); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_0, 0))) { - ZEPHIR_INIT_VAR(&_1$$3); - object_init_ex(&_1$$3, phalcon_http_message_exception_invalidargumentexception_ce); - zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "geterrordescription", NULL, 393, &_3$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 40, &_2$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Http/Message/UploadedFile.zep", 156); - ZEPHIR_MM_RESTORE(); - return; - } - zephir_read_property(&_4, this_ptr, ZEND_STRL("alreadyMoved"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_4))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "The file has already been moved to the target location", "phalcon/Http/Message/UploadedFile.zep", 162); - return; - } - ZEPHIR_OBS_VAR(&_5); - zephir_read_property(&_5, this_ptr, ZEND_STRL("stream"), PH_NOISY_CC); - if (UNEXPECTED(!(zephir_is_instance_of(&_5, SL("Psr\\Http\\Message\\StreamInterface"))))) { - ZEPHIR_INIT_VAR(&_6$$5); - object_init_ex(&_6$$5, phalcon_http_message_stream_ce); - zephir_read_property(&_7$$5, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 43, &_7$$5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), &_6$$5); - } - RETURN_MM_MEMBER(getThis(), "stream"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, moveTo) -{ - zend_bool _5, _6, _9, _13, _15, _16; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *targetPath, targetPath_sub, __$true, __$false, sapi, _0, _1, _7, _8, _10, _11, _12, _14, _2$$4, _3$$4, _4$$4, _17$$7, _18$$7; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&targetPath_sub); - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&sapi); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_14); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_17$$7); - ZVAL_UNDEF(&_18$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(targetPath) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &targetPath); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("alreadyMoved"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "File has already been moved", "phalcon/Http/Message/UploadedFile.zep", 211); - return; - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_1, 0))) { - ZEPHIR_INIT_VAR(&_2$$4); - object_init_ex(&_2$$4, phalcon_http_message_exception_invalidargumentexception_ce); - zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "geterrordescription", NULL, 393, &_4$$4); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 40, &_3$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$4, "phalcon/Http/Message/UploadedFile.zep", 217); - ZEPHIR_MM_RESTORE(); - return; - } - _5 = Z_TYPE_P(targetPath) == IS_STRING; - if (_5) { - _5 = !(ZEPHIR_IS_EMPTY(targetPath)); - } - _6 = _5; - if (_6) { - ZEPHIR_CALL_FUNCTION(&_7, "dirname", NULL, 394, targetPath); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8, "is_dir", NULL, 155, &_7); - zephir_check_call_status(); - _6 = zephir_is_true(&_8); - } - _9 = _6; - if (_9) { - ZEPHIR_CALL_FUNCTION(&_10, "dirname", NULL, 394, targetPath); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_11, "is_writable", NULL, 395, &_10); - zephir_check_call_status(); - _9 = zephir_is_true(&_11); - } - if (UNEXPECTED(!(_9))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Target folder is empty string, not a folder or not writable", "phalcon/Http/Message/UploadedFile.zep", 229); - return; - } - ZEPHIR_INIT_VAR(&_12); - ZVAL_STRING(&_12, "PHP_SAPI"); - ZEPHIR_CALL_FUNCTION(&sapi, "constant", NULL, 142, &_12); - zephir_check_call_status(); - _13 = ZEPHIR_IS_EMPTY(&sapi); - if (!(_13)) { - ZEPHIR_OBS_VAR(&_14); - zephir_read_property(&_14, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC); - _13 = !(ZEPHIR_IS_EMPTY(&_14)); - } - _15 = _13; - if (!(_15)) { - _15 = zephir_start_with_str(&sapi, SL("cli")); - } - _16 = _15; - if (!(_16)) { - _16 = zephir_start_with_str(&sapi, SL("phpdbg")); - } - if (UNEXPECTED(_16)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "storefile", NULL, 396, targetPath); - zephir_check_call_status(); - } else { - zephir_read_property(&_17$$7, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_18$$7, "move_uploaded_file", NULL, 397, &_17$$7, targetPath); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_18$$7)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "The file cannot be moved to the target folder", "phalcon/Http/Message/UploadedFile.zep", 243); - return; - } - } - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("alreadyMoved"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("alreadyMoved"), &__$false); - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkError) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *error_param = NULL, _0, _1, _2, _3; - zend_long error, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &error_param); - error = zephir_get_intval(error_param); - - - ZVAL_LONG(&_1, error); - ZVAL_LONG(&_2, 0); - ZVAL_LONG(&_3, 8); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isbetween", NULL, 398, &_1, &_2, &_3); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid error. Must be one of the UPLOAD_ERR_* constants", "phalcon/Http/Message/UploadedFile.zep", 260); - return; - } - ZEPHIR_INIT_ZVAL_NREF(_1); - ZVAL_LONG(&_1, error); - zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_1); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkStream) -{ - zend_bool _0$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *error_param = NULL, _1$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_1$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &stream, &error_param); - error = zephir_get_intval(error_param); - - - if (UNEXPECTED(0 == error)) { - do { - _0$$3 = 1; - if (_0$$3 == (Z_TYPE_P(stream) == IS_STRING)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("fileName"), stream); - break; - } - if (_0$$3 == (Z_TYPE_P(stream) == IS_RESOURCE)) { - ZEPHIR_INIT_VAR(&_1$$5); - object_init_ex(&_1$$5, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 43, stream); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), &_1$$5); - break; - } - if (_0$$3 == (zephir_is_instance_of(stream, SL("Psr\\Http\\Message\\StreamInterface")))) { - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), stream); - break; - } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream or file passed", "phalcon/Http/Message/UploadedFile.zep", 286); - return; - } while(0); - - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getErrorDescription) -{ - zval errors; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *error_param = NULL, _0$$3; - zend_long error; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&errors); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &error_param); - error = zephir_get_intval(error_param); - - - ZEPHIR_INIT_VAR(&errors); - zephir_create_array(&errors, 8, 0); - add_index_stringl(&errors, 0, SL("There is no error, the file uploaded with success.")); - add_index_stringl(&errors, 1, SL("The uploaded file exceeds the upload_max_filesize directive in php.ini.")); - add_index_stringl(&errors, 2, SL("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.")); - add_index_stringl(&errors, 3, SL("The uploaded file was only partially uploaded.")); - add_index_stringl(&errors, 4, SL("No file was uploaded.")); - add_index_stringl(&errors, 6, SL("Missing a temporary folder.")); - add_index_stringl(&errors, 7, SL("Failed to write file to disk.")); - add_index_stringl(&errors, 8, SL("A PHP extension stopped the file upload.")); - if (EXPECTED((1 == zephir_array_isset_long(&errors, error)))) { - zephir_array_fetch_long(&_0$$3, &errors, error, PH_NOISY | PH_READONLY, "phalcon/Http/Message/UploadedFile.zep", 314); - RETURN_CTOR(&_0$$3); - } - RETURN_MM_STRING("Unknown upload error"); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, storeFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *targetPath_param = NULL, data, handle, stream, _0, _1, _2$$4; - zval targetPath; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&targetPath); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&stream); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(targetPath) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &targetPath_param); - zephir_get_strval(&targetPath, targetPath_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "w+b"); - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, &targetPath, &_0); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&handle))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Cannot write to file.", "phalcon/Http/Message/UploadedFile.zep", 331); - return; - } - ZEPHIR_CALL_METHOD(&stream, this_ptr, "getstream", NULL, 399); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &stream, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &stream, "eof", NULL, 0); - zephir_check_call_status(); - if (!(!ZEPHIR_IS_TRUE_IDENTICAL(&_1))) { - break; - } - ZVAL_LONG(&_2$$4, 2048); - ZEPHIR_CALL_METHOD(&data, &stream, "read", &_3, 0, &_2$$4); - zephir_check_call_status(); - zephir_fwrite(NULL, &handle, &data); - } - zephir_fclose(&handle); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, isBetween) -{ - zend_bool _0; - zval *value_param = NULL, *from_param = NULL, *to_param = NULL; - zend_long value, from, to; - zval *this_ptr = getThis(); - -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_LONG(value) - Z_PARAM_LONG(from) - Z_PARAM_LONG(to) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(3, 0, &value_param, &from_param, &to_param); - value = zephir_get_intval(value_param); - from = zephir_get_intval(from_param); - to = zephir_get_intval(to_param); - - - _0 = value >= from; - if (_0) { - _0 = value <= to; - } - RETURN_BOOL(_0); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFileFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UploadedFileFactory, phalcon, http_message_uploadedfilefactory, phalcon_http_message_uploadedfilefactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_uploadedfilefactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uploadedfilefactoryinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval clientFilename, clientMediaType; - zend_long size, error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *size_param = NULL, *error_param = NULL, *clientFilename_param = NULL, *clientMediaType_param = NULL, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&clientFilename); - ZVAL_UNDEF(&clientMediaType); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 5) - Z_PARAM_OBJECT_OF_CLASS(stream, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(size, is_null_true) - Z_PARAM_LONG(error) - Z_PARAM_STR_OR_NULL(clientFilename) - Z_PARAM_STR_OR_NULL(clientMediaType) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 4, &stream, &size_param, &error_param, &clientFilename_param, &clientMediaType_param); - if (!size_param) { - size = 0; - } else { - size = zephir_get_intval(size_param); - } - if (!error_param) { - error = 0; - } else { - error = zephir_get_intval(error_param); - } - if (!clientFilename_param) { - ZEPHIR_INIT_VAR(&clientFilename); - } else { - zephir_get_strval(&clientFilename, clientFilename_param); - } - if (!clientMediaType_param) { - ZEPHIR_INIT_VAR(&clientMediaType); - } else { - zephir_get_strval(&clientMediaType, clientMediaType_param); - } - - - object_init_ex(return_value, phalcon_http_message_uploadedfile_ce); - ZVAL_LONG(&_0, size); - ZVAL_LONG(&_1, error); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 374, stream, &_0, &_1, &clientFilename, &clientMediaType); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Uri) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Uri, phalcon, http_message_uri, phalcon_http_message_abstractcommon_ce, phalcon_http_message_uri_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_declare_property_string(phalcon_http_message_uri_ce, SL("fragment"), "", ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("host"), "", ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("pass"), "", ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("path"), "", ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_message_uri_ce, SL("port"), ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("query"), "", ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("scheme"), "https", ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_http_message_uri_ce, SL("user"), "", ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_uri_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getFragment) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "fragment"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getHost) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "host"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getPath) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "path"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getPort) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "port"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getQuery) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "query"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getScheme) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "scheme"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, urlParts, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3, _13$$3, _14$$3, _15$$3, _16$$3, _17$$3, _18$$3, _19$$3; - zval uri; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&urlParts); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$3); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_9$$3); - ZVAL_UNDEF(&_10$$3); - ZVAL_UNDEF(&_11$$3); - ZVAL_UNDEF(&_12$$3); - ZVAL_UNDEF(&_13$$3); - ZVAL_UNDEF(&_14$$3); - ZVAL_UNDEF(&_15$$3); - ZVAL_UNDEF(&_16$$3); - ZVAL_UNDEF(&_17$$3); - ZVAL_UNDEF(&_18$$3); - ZVAL_UNDEF(&_19$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &uri_param); - if (!uri_param) { - ZEPHIR_INIT_VAR(&uri); - ZVAL_STRING(&uri, ""); - } else { - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(&uri, uri_param); - } else { - ZEPHIR_INIT_VAR(&uri); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_0, &uri))) { - ZEPHIR_CALL_FUNCTION(&urlParts, "parse_url", NULL, 125, &uri); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&urlParts))) { - ZEPHIR_INIT_NVAR(&urlParts); - array_init(&urlParts); - } - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "fragment"); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, ""); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_3$$3, &_4$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "filterfragment", NULL, 401, &_2$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("fragment"), &_1$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "host"); - ZEPHIR_INIT_VAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - zephir_fast_strtolower(&_3$$3, &_5$$3); - zephir_update_property_zval(this_ptr, ZEND_STRL("host"), &_3$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "pass"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_7$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8$$3, "rawurlencode", NULL, 345, &_7$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("pass"), &_8$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "path"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_10$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$3, this_ptr, "filterpath", NULL, 402, &_10$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_9$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "port"); - ZVAL_NULL(&_13$$3); - ZEPHIR_CALL_METHOD(&_12$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_13$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$3, this_ptr, "filterport", NULL, 403, &_12$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("port"), &_11$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "query"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_15$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_14$$3, this_ptr, "filterquery", NULL, 404, &_15$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("query"), &_14$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "scheme"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_17$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$3, this_ptr, "filterscheme", NULL, 405, &_17$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("scheme"), &_16$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "user"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_18$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_19$$3, "rawurlencode", NULL, 345, &_18$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("user"), &_19$$3); - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, __toString) -{ - zend_bool _2, _3; - zval authority, path, uri, _0, _1, _4, _6, _7, _8, _9, _10, _11, _12, _13, _5$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&authority); - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_13); - ZVAL_UNDEF(&_5$$3); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&authority, this_ptr, "getauthority", NULL, 406); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&path, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - _2 = !ZEPHIR_IS_IDENTICAL(&_1, &path); - if (_2) { - _2 = 1 != zephir_start_with_str(&path, SL("/")); - } - _3 = _2; - if (_3) { - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, ""); - _3 = !ZEPHIR_IS_IDENTICAL(&_4, &authority); - } - if (UNEXPECTED(_3)) { - ZEPHIR_INIT_VAR(&_5$$3); - ZEPHIR_CONCAT_SV(&_5$$3, "/", &path); - ZEPHIR_CPY_WRT(&path, &_5$$3); - } - zephir_read_property(&_0, this_ptr, ZEND_STRL("scheme"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_7); - ZVAL_STRING(&_7, ""); - ZEPHIR_INIT_VAR(&_8); - ZVAL_STRING(&_8, ":"); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "checkvalue", NULL, 407, &_0, &_7, &_8); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "//"); - ZEPHIR_CALL_METHOD(&_9, this_ptr, "checkvalue", NULL, 407, &authority, &_7); - zephir_check_call_status(); - zephir_read_property(&_11, this_ptr, ZEND_STRL("query"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "?"); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "checkvalue", NULL, 407, &_11, &_7); - zephir_check_call_status(); - zephir_read_property(&_13, this_ptr, ZEND_STRL("fragment"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "#"); - ZEPHIR_CALL_METHOD(&_12, this_ptr, "checkvalue", NULL, 407, &_13, &_7); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&uri); - ZEPHIR_CONCAT_VVVVV(&uri, &_6, &_9, &path, &_10, &_12); - RETURN_CCTOR(&uri); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getAuthority) -{ - zval authority, userInfo, _0, _1, _2, _4, _3$$4, _5$$5, _6$$5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&authority); - ZVAL_UNDEF(&userInfo); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$5); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("host"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_1, &_0))) { - RETURN_MM_STRING(""); - } - ZEPHIR_OBS_VAR(&authority); - zephir_read_property(&authority, this_ptr, ZEND_STRL("host"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&userInfo, this_ptr, "getuserinfo", NULL, 408); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_2, &userInfo))) { - ZEPHIR_INIT_VAR(&_3$$4); - ZEPHIR_CONCAT_VSV(&_3$$4, &userInfo, "@", &authority); - ZEPHIR_CPY_WRT(&authority, &_3$$4); - } - zephir_read_property(&_4, this_ptr, ZEND_STRL("port"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_4) != IS_NULL)) { - zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("port"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_6$$5); - ZEPHIR_CONCAT_SV(&_6$$5, ":", &_5$$5); - zephir_concat_self(&authority, &_6$$5); - } - RETURN_CCTOR(&authority); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getUserInfo) -{ - zval _0, _1$$3, _2$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("pass"), PH_NOISY_CC); - if (UNEXPECTED(1 != ZEPHIR_IS_EMPTY(&_0))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("user"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("pass"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CONCAT_VSV(return_value, &_1$$3, ":", &_2$$3); - RETURN_MM(); - } - RETURN_MM_MEMBER(getThis(), "user"); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withFragment) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fragment = NULL, fragment_sub, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&fragment_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(fragment) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &fragment); - ZEPHIR_SEPARATE_PARAM(fragment); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, fragment); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "filterfragment", NULL, 401, fragment); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(fragment, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "fragment"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, fragment, &_1); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withPath) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path = NULL, path_sub, _0, _1, _3, _4, _5, _6; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&path_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(path) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &path); - ZEPHIR_SEPARATE_PARAM(path); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, path); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "?"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, path, &_0, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); - if (!(_2)) { - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "#"); - ZEPHIR_INIT_VAR(&_4); - zephir_fast_strpos(&_4, path, &_3, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4); - } - if (UNEXPECTED(_2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Path cannot contain a query string or fragment", "phalcon/Http/Message/Uri.zep", 288); - return; - } - ZEPHIR_CALL_METHOD(&_5, this_ptr, "filterpath", NULL, 402, path); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(path, &_5); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "path"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, path, &_6); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withPort) -{ - zend_bool _1$$3, _2$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *port = NULL, port_sub, _0$$3, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&port_sub); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(port) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &port); - ZEPHIR_SEPARATE_PARAM(port); - - - if (UNEXPECTED(Z_TYPE_P(port) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "filterport", NULL, 403, port); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(port, &_0$$3); - _1$$3 = Z_TYPE_P(port) != IS_NULL; - if (_1$$3) { - _2$$3 = ZEPHIR_LT_LONG(port, 1); - if (!(_2$$3)) { - _2$$3 = ZEPHIR_GT_LONG(port, 65535); - } - _1$$3 = _2$$3; - } - if (UNEXPECTED(_1$$3)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Method expects valid port (1-65535)", "phalcon/Http/Message/Uri.zep", 321); - return; - } - } - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "port"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, port, &_3); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withQuery) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query = NULL, query_sub, _0, _1, _2, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query); - ZEPHIR_SEPARATE_PARAM(query); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, query); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "#"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, query, &_0, 0 ); - if (UNEXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&_1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Query cannot contain a query fragment", "phalcon/Http/Message/Uri.zep", 351); - return; - } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "filterquery", NULL, 404, query); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(query, &_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "query"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, query, &_3); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withScheme) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *scheme = NULL, scheme_sub, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&scheme_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(scheme) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &scheme); - ZEPHIR_SEPARATE_PARAM(scheme); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, scheme); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "filterscheme", NULL, 405, scheme); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(scheme, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "scheme"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processwith", NULL, 409, scheme, &_1); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withUserInfo) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *user = NULL, user_sub, *password = NULL, password_sub, __$null, newInstance, _0, _2, _1$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&user_sub); - ZVAL_UNDEF(&password_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(user) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(password) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &user, &password); - ZEPHIR_SEPARATE_PARAM(user); - if (!password) { - password = &password_sub; - ZEPHIR_CPY_WRT(password, &__$null); - } else { - ZEPHIR_SEPARATE_PARAM(password); - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, user); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(password) != IS_NULL)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, user); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_0, "rawurlencode", NULL, 345, user); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(user, &_0); - if (UNEXPECTED(Z_TYPE_P(password) != IS_NULL)) { - ZEPHIR_CALL_FUNCTION(&_1$$4, "rawurlencode", NULL, 345, password); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(password, &_1$$4); - } - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "user"); - ZEPHIR_CALL_METHOD(&newInstance, this_ptr, "cloneinstance", NULL, 21, user, &_2); - zephir_check_call_status(); - zephir_update_property_zval(&newInstance, ZEND_STRL("pass"), password); - RETURN_CCTOR(&newInstance); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, withHost) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *host, host_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&host_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(host) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &host); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "host"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processwith", NULL, 409, host, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, checkValue) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *value_param = NULL, *prefix_param = NULL, *suffix_param = NULL, _0; - zval value, prefix, suffix, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&prefix); - ZVAL_UNDEF(&suffix); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_STR(value) - Z_PARAM_OPTIONAL - Z_PARAM_STR(prefix) - Z_PARAM_STR(suffix) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 2, &value_param, &prefix_param, &suffix_param); - if (UNEXPECTED(Z_TYPE_P(value_param) != IS_STRING && Z_TYPE_P(value_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'value' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(value_param) == IS_STRING)) { - zephir_get_strval(&value, value_param); - } else { - ZEPHIR_INIT_VAR(&value); - } - if (!prefix_param) { - ZEPHIR_INIT_VAR(&prefix); - ZVAL_STRING(&prefix, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(&prefix, prefix_param); - } else { - ZEPHIR_INIT_VAR(&prefix); - } - } - if (!suffix_param) { - ZEPHIR_INIT_VAR(&suffix); - ZVAL_STRING(&suffix, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(suffix_param) != IS_STRING && Z_TYPE_P(suffix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'suffix' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(suffix_param) == IS_STRING)) { - zephir_get_strval(&suffix, suffix_param); - } else { - ZEPHIR_INIT_VAR(&suffix); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_0, &value))) { - ZEPHIR_INIT_VAR(&_1$$3); - ZEPHIR_CONCAT_VVV(&_1$$3, &prefix, &value, &suffix); - ZEPHIR_CPY_WRT(&value, &_1$$3); - } - RETURN_CTOR(&value); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, filterFragment) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fragment_param = NULL; - zval fragment; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&fragment); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(fragment) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &fragment_param); - if (UNEXPECTED(Z_TYPE_P(fragment_param) != IS_STRING && Z_TYPE_P(fragment_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'fragment' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(fragment_param) == IS_STRING)) { - zephir_get_strval(&fragment, fragment_param); - } else { - ZEPHIR_INIT_VAR(&fragment); - } - - - ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 345, &fragment); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, filterPath) -{ - zend_string *_5; - zend_ulong _4; - zend_bool _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_7 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, element, key, parts, _0, *_2, _3, _9, _10, _6$$4, _8$$5; - zval path; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&element); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&parts); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_8$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(path) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &path_param); - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(&path, path_param); - } else { - ZEPHIR_INIT_VAR(&path); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - _1 = ZEPHIR_IS_IDENTICAL(&_0, &path); - if (!(_1)) { - _1 = 1 != zephir_start_with_str(&path, SL("/")); - } - if (UNEXPECTED(_1)) { - RETURN_CTOR(&path); - } - ZEPHIR_INIT_VAR(&parts); - zephir_fast_explode_str(&parts, SL("/"), &path, LONG_MAX); - zephir_is_iterable(&parts, 1, "phalcon/Http/Message/Uri.zep", 522); - if (Z_TYPE_P(&parts) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _4, _5, _2) - { - ZEPHIR_INIT_NVAR(&key); - if (_5 != NULL) { - ZVAL_STR_COPY(&key, _5); - } else { - ZVAL_LONG(&key, _4); - } - ZEPHIR_INIT_NVAR(&element); - ZVAL_COPY(&element, _2); - ZEPHIR_CALL_FUNCTION(&_6$$4, "rawurlencode", &_7, 345, &element); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &key, &_6$$4, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_3, &parts, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_3)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &parts, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&element, &parts, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8$$5, "rawurlencode", &_7, 345, &element); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &key, &_8$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&element); - ZEPHIR_INIT_NVAR(&key); - ZEPHIR_INIT_NVAR(&path); - zephir_fast_join_str(&path, SL("/"), &parts); - ZEPHIR_INIT_VAR(&_9); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "/"); - zephir_fast_trim(&_9, &path, &_10, ZEPHIR_TRIM_LEFT); - ZEPHIR_CONCAT_SV(return_value, "/", &_9); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, filterPort) -{ - zend_long _0$$3; - zval ports; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *port = NULL, port_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&port_sub); - ZVAL_UNDEF(&ports); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(port) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &port); - ZEPHIR_SEPARATE_PARAM(port); - - - ZEPHIR_INIT_VAR(&ports); - zephir_create_array(&ports, 2, 0); - add_index_long(&ports, 80, 1); - add_index_long(&ports, 443, 1); - if (UNEXPECTED(Z_TYPE_P(port) != IS_NULL)) { - _0$$3 = zephir_get_intval(port); - ZEPHIR_INIT_NVAR(port); - ZVAL_LONG(port, _0$$3); - if (UNEXPECTED(zephir_array_isset(&ports, port))) { - ZEPHIR_INIT_NVAR(port); - ZVAL_NULL(port); - } - } - RETVAL_ZVAL(port, 1, 0); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, filterQuery) -{ - zend_string *_6; - zend_ulong _5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query_param = NULL, index, part, parts, split, _0, _1, _2, *_3, _4, _8$$4, _12$$4, _13$$4, _14$$4, _15$$4, _16$$4, _9$$5, _10$$5, _17$$6, _20$$6, _21$$6, _22$$6, _23$$6, _24$$6, _18$$7, _19$$7; - zval query; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&index); - ZVAL_UNDEF(&part); - ZVAL_UNDEF(&parts); - ZVAL_UNDEF(&split); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_12$$4); - ZVAL_UNDEF(&_13$$4); - ZVAL_UNDEF(&_14$$4); - ZVAL_UNDEF(&_15$$4); - ZVAL_UNDEF(&_16$$4); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_10$$5); - ZVAL_UNDEF(&_17$$6); - ZVAL_UNDEF(&_20$$6); - ZVAL_UNDEF(&_21$$6); - ZVAL_UNDEF(&_22$$6); - ZVAL_UNDEF(&_23$$6); - ZVAL_UNDEF(&_24$$6); - ZVAL_UNDEF(&_18$$7); - ZVAL_UNDEF(&_19$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query_param); - zephir_get_strval(&query, query_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, &query))) { - RETURN_MM_STRING(""); - } - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "?"); - zephir_fast_trim(&_1, &query, &_2, ZEPHIR_TRIM_LEFT); - zephir_get_strval(&query, &_1); - ZEPHIR_INIT_VAR(&parts); - zephir_fast_explode_str(&parts, SL("&"), &query, LONG_MAX); - zephir_is_iterable(&parts, 1, "phalcon/Http/Message/Uri.zep", 595); - if (Z_TYPE_P(&parts) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _5, _6, _3) - { - ZEPHIR_INIT_NVAR(&index); - if (_6 != NULL) { - ZVAL_STR_COPY(&index, _6); - } else { - ZVAL_LONG(&index, _5); - } - ZEPHIR_INIT_NVAR(&part); - ZVAL_COPY(&part, _3); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitqueryvalue", &_7, 410, &part); - zephir_check_call_status(); - zephir_array_fetch_long(&_8$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 587); - if (UNEXPECTED(Z_TYPE_P(&_8$$4) == IS_NULL)) { - zephir_array_fetch_long(&_9$$5, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 588); - ZEPHIR_CALL_FUNCTION(&_10$$5, "rawurlencode", &_11, 345, &_9$$5); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &index, &_10$$5, PH_COPY | PH_SEPARATE); - continue; - } - zephir_array_fetch_long(&_12$$4, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_13$$4, "rawurlencode", &_11, 345, &_12$$4); - zephir_check_call_status(); - zephir_array_fetch_long(&_14$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_15$$4, "rawurlencode", &_11, 345, &_14$$4); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_16$$4); - ZEPHIR_CONCAT_VSV(&_16$$4, &_13$$4, "=", &_15$$4); - zephir_array_update_zval(&parts, &index, &_16$$4, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4, &parts, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4)) { - break; - } - ZEPHIR_CALL_METHOD(&index, &parts, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&part, &parts, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitqueryvalue", &_7, 410, &part); - zephir_check_call_status(); - zephir_array_fetch_long(&_17$$6, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 587); - if (UNEXPECTED(Z_TYPE_P(&_17$$6) == IS_NULL)) { - zephir_array_fetch_long(&_18$$7, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 588); - ZEPHIR_CALL_FUNCTION(&_19$$7, "rawurlencode", &_11, 345, &_18$$7); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &index, &_19$$7, PH_COPY | PH_SEPARATE); - continue; - } - zephir_array_fetch_long(&_20$$6, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_21$$6, "rawurlencode", &_11, 345, &_20$$6); - zephir_check_call_status(); - zephir_array_fetch_long(&_22$$6, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_23$$6, "rawurlencode", &_11, 345, &_22$$6); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_24$$6); - ZEPHIR_CONCAT_VSV(&_24$$6, &_21$$6, "=", &_23$$6); - zephir_array_update_zval(&parts, &index, &_24$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&part); - ZEPHIR_INIT_NVAR(&index); - zephir_fast_join_str(return_value, SL("&"), &parts); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, filterScheme) -{ - zval schemes; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *scheme_param = NULL, filtered, _0, _1, _2, _3, _4$$4, _5$$4, _6$$4, _7$$4; - zval scheme; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&filtered); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_7$$4); - ZVAL_UNDEF(&schemes); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(scheme) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &scheme_param); - if (UNEXPECTED(Z_TYPE_P(scheme_param) != IS_STRING && Z_TYPE_P(scheme_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'scheme' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(scheme_param) == IS_STRING)) { - zephir_get_strval(&scheme, scheme_param); - } else { - ZEPHIR_INIT_VAR(&scheme); - } - - - ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, &scheme); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "#:(//)?$#"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_FUNCTION(&filtered, "preg_replace", NULL, 50, &_1, &_2, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&schemes); - zephir_create_array(&schemes, 2, 0); - add_assoc_long_ex(&schemes, SL("http"), 1); - add_assoc_long_ex(&schemes, SL("https"), 1); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_3, &filtered))) { - RETURN_MM_STRING(""); - } - if (UNEXPECTED(!(zephir_array_isset(&schemes, &filtered)))) { - ZEPHIR_INIT_VAR(&_4$$4); - object_init_ex(&_4$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_VAR(&_6$$4); - zephir_array_keys(&_6$$4, &schemes); - zephir_fast_join_str(&_5$$4, SL(", "), &_6$$4); - ZEPHIR_INIT_VAR(&_7$$4); - ZEPHIR_CONCAT_SVSSVS(&_7$$4, "Unsupported scheme [", &filtered, "]. ", "Scheme must be one of [", &_5$$4, "]"); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 40, &_7$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$4, "phalcon/Http/Message/Uri.zep", 625); - ZEPHIR_MM_RESTORE(); - return; - } - RETURN_CTOR(&scheme); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, splitQueryValue) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *element_param = NULL, __$null, data; - zval element; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&data); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &element_param); - zephir_get_strval(&element, element_param); - - - ZEPHIR_INIT_VAR(&data); - zephir_fast_explode_str(&data, SL("="), &element, 2 ); - if (UNEXPECTED(!(zephir_array_isset_long(&data, 1)))) { - zephir_array_append(&data, &__$null, PH_SEPARATE, "phalcon/Http/Message/Uri.zep", 642); - } - RETURN_CCTOR(&data); -} - -static PHP_METHOD(Phalcon_Http_Message_Uri, getArrVal) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; - zval collection; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ARRAY(collection) - Z_PARAM_ZVAL(index) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); - ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - RETURN_CTOR(&value); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UriFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UriFactory, phalcon, http_message_urifactory, phalcon_http_message_urifactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_urifactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\urifactoryinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_UriFactory, createUri) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL; - zval uri; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &uri_param); - if (!uri_param) { - ZEPHIR_INIT_VAR(&uri); - ZVAL_STRING(&uri, ""); - } else { - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(&uri, uri_param); - } else { - ZEPHIR_INIT_VAR(&uri); - } - } - - - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114, &uri); - zephir_check_call_status(); - RETURN_MM(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Exception_InvalidArgumentException) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Exception, InvalidArgumentException, phalcon, http_message_exception_invalidargumentexception, spl_ce_InvalidArgumentException, NULL, 0); - - zend_class_implements(phalcon_http_message_exception_invalidargumentexception_ce, 1, zend_ce_throwable); - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Input) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Input, phalcon, http_message_stream_input, phalcon_http_message_stream_ce, phalcon_http_message_stream_input_method_entry, 0); - - zend_declare_property_string(phalcon_http_message_stream_input_ce, SL("data"), "", ZEND_ACC_PRIVATE); - zend_declare_property_bool(phalcon_http_message_stream_input_ce, SL("eof"), 0, ZEND_ACC_PRIVATE); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, __construct) -{ - zval _1, _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://input"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "rb"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_input_ce, getThis(), "__construct", &_0, 0, &_1, &_2); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, __toString) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "getcontents", NULL, 0); - zephir_check_call_status(); - RETURN_MM_MEMBER(getThis(), "data"); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, getContents) -{ - zend_bool _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *length_param = NULL, __$true, __$false, data, _0, _1, _2, _4; - zend_long length, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &length_param); - if (!length_param) { - length = -1; - } else { - length = zephir_get_intval(length_param); - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZVAL_LONG(&_2, length); - ZEPHIR_CALL_FUNCTION(&data, "stream_get_contents", NULL, 79, &_1, &_2); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); - _3 = -1 == length; - if (!(_3)) { - ZEPHIR_CALL_METHOD(&_4, this_ptr, "eof", NULL, 0); - zephir_check_call_status(); - _3 = zephir_is_true(&_4); - } - if (UNEXPECTED(_3)) { - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$false); - } - } - RETURN_MM_MEMBER(getThis(), "data"); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, isWritable) -{ - zval *this_ptr = getThis(); - - - - RETURN_BOOL(0); -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, read) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *length, length_sub, __$true, __$false, data, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&length_sub); - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &length); - - - ZEPHIR_CALL_PARENT(&data, phalcon_http_message_stream_input_ce, getThis(), "read", &_0, 0, length); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_1))) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); - } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "eof", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_2))) { - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$false); - } - } - RETURN_CCTOR(&data); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Memory) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Memory, phalcon, http_message_stream_memory, phalcon_http_message_stream_ce, phalcon_http_message_stream_memory_method_entry, 0); - - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Memory, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *mode = NULL, mode_sub, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode_sub); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &mode); - if (!mode) { - mode = &mode_sub; - ZEPHIR_INIT_VAR(mode); - ZVAL_STRING(mode, "rb"); - } - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://memory"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_memory_ce, getThis(), "__construct", &_0, 0, &_1, mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Temp) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Temp, phalcon, http_message_stream_temp, phalcon_http_message_stream_ce, phalcon_http_message_stream_temp_method_entry, 0); - - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Message_Stream_Temp, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *mode = NULL, mode_sub, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode_sub); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &mode); - if (!mode) { - mode = &mode_sub; - ZEPHIR_INIT_VAR(mode); - ZVAL_STRING(mode, "rb"); - } - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://temp"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_temp_ce, getThis(), "__construct", &_0, 0, &_1, mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Request_Exception) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Request, Exception, phalcon, http_request_exception, zend_ce_exception, NULL, 0); - - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Request_File) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Request, File, phalcon, http_request_file, phalcon_http_request_file_method_entry, 0); - - zend_declare_property_null(phalcon_http_request_file_ce, SL("error"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("extension"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("key"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("name"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("realType"), ZEND_ACC_PROTECTED); - zend_declare_property_long(phalcon_http_request_file_ce, SL("size"), 0, ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("tmp"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_request_file_ce, SL("type"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_request_file_ce, 1, phalcon_http_request_fileinterface_ce); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Request_File, getError) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "error"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getExtension) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "extension"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getKey) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "key"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *key = NULL, key_sub, __$null, name, _4, _5, _6, _7, _8, _0$$3, _1$$3, _2$$4, _3$$4; - zval file; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&key_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ARRAY(file) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &file_param, &key); - ZEPHIR_OBS_COPY_OR_DUP(&file, file_param); - if (!key) { - key = &key_sub; - key = &__$null; - } - - - ZEPHIR_OBS_VAR(&name); - if (zephir_array_isset_string_fetch(&name, &file, SL("name"), 0)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); - ZEPHIR_INIT_VAR(&_0$$3); - ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION"); - ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 141, &_0$$3); - zephir_check_call_status(); - if (zephir_is_true(&_1$$3)) { - ZVAL_LONG(&_2$$4, 4); - ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 116, &name, &_2$$4); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("extension"), &_3$$4); - } - } - ZEPHIR_INIT_VAR(&_5); - ZVAL_STRING(&_5, "tmp_name"); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 426, &file, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("tmp"), &_4); - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "size"); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 426, &file, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_6); - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "type"); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 426, &file, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7); - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "error"); - ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 426, &file, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_8); - if (zephir_is_true(key)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("key"), key); - } - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getName) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "name"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getRealType) -{ - zval finfo, mime, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&finfo); - ZVAL_UNDEF(&mime); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZVAL_LONG(&_0, 16); - ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 325, &_0); - zephir_check_call_status(); - if (Z_TYPE_P(&finfo) != IS_RESOURCE) { - RETURN_MM_STRING(""); - } - zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 326, &finfo, &_0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 327, &finfo); - zephir_check_call_status(); - RETURN_CCTOR(&mime); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getSize) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "size"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getTempName) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "tmp"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getType) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "type"); -} - -static PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile) -{ - zend_bool _0; - zval tmp, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&tmp); - ZVAL_UNDEF(&_1); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&tmp, this_ptr, "gettempname", NULL, 0); - zephir_check_call_status(); - _0 = Z_TYPE_P(&tmp) == IS_STRING; - if (_0) { - ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 19, &tmp); - zephir_check_call_status(); - _0 = zephir_is_true(&_1); - } - RETURN_MM_BOOL(_0); -} - -static PHP_METHOD(Phalcon_Http_Request_File, moveTo) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *destination_param = NULL, _0; - zval destination; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&destination); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(destination) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &destination_param); - if (UNEXPECTED(Z_TYPE_P(destination_param) != IS_STRING && Z_TYPE_P(destination_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(destination_param) == IS_STRING)) { - zephir_get_strval(&destination, destination_param); - } else { - ZEPHIR_INIT_VAR(&destination); - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 397, &_0, &destination); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Http_Request_File, getArrVal) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; - zval collection; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ARRAY(collection) - Z_PARAM_ZVAL(index) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); - ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - RETURN_CTOR(&value); -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface) -{ - ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Request, FileInterface, phalcon, http_request_fileinterface, phalcon_http_request_fileinterface_method_entry); - - return SUCCESS; -} - -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getError); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getName); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getRealType); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getSize); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getTempName); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, getType); -ZEPHIR_DOC_METHOD(Phalcon_Http_Request_FileInterface, moveTo); - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_CookieInterface) -{ - ZEPHIR_REGISTER_INTERFACE(Phalcon\\Http\\Cookie, CookieInterface, phalcon, http_cookie_cookieinterface, phalcon_http_cookie_cookieinterface_method_entry); - - return SUCCESS; -} - -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, delete); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getDomain); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getExpiration); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getHttpOnly); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getName); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getOptions); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getPath); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getSecure); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, getValue); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, isUsingEncryption); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, send); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setDomain); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setExpiration); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setHttpOnly); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setOptions); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setPath); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setSecure); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, setValue); -ZEPHIR_DOC_METHOD(Phalcon_Http_Cookie_CookieInterface, useEncryption); - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Cookie, Exception, phalcon, http_cookie_exception, zend_ce_exception, NULL, 0); - - return SUCCESS; -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Cookies) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Response, Cookies, phalcon, http_response_cookies, phalcon_di_abstractinjectionaware_ce, phalcon_http_response_cookies_method_entry, 0); - - zend_declare_property_null(phalcon_http_response_cookies_ce, SL("cookies"), ZEND_ACC_PROTECTED); - zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("isSent"), 0, ZEND_ACC_PROTECTED); - zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("registered"), 0, ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_http_response_cookies_ce, SL("signKey"), ZEND_ACC_PROTECTED); - zend_declare_property_bool(phalcon_http_response_cookies_ce, SL("useEncryption"), 1, ZEND_ACC_PROTECTED); - phalcon_http_response_cookies_ce->create_object = zephir_init_properties_Phalcon_Http_Response_Cookies; - - zend_class_implements(phalcon_http_response_cookies_ce, 1, phalcon_http_response_cookiesinterface_ce); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Response_Cookies, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval signKey; - zval *useEncryption_param = NULL, *signKey_param = NULL, __$true, __$false; - zend_bool useEncryption; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&signKey); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_BOOL(useEncryption) - Z_PARAM_STR_OR_NULL(signKey) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &useEncryption_param, &signKey_param); - if (!useEncryption_param) { - useEncryption = 1; - } else { - useEncryption = zephir_get_boolval(useEncryption_param); - } - if (!signKey_param) { - ZEPHIR_INIT_VAR(&signKey); - } else { - zephir_get_strval(&signKey, signKey_param); - } - - - if (useEncryption) { - zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("useEncryption"), &__$false); - } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, &signKey); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Http_Response_Cookies, delete) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, cookie, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&cookie); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - } - - - ZEPHIR_OBS_VAR(&cookie); - zephir_read_property(&_0, this_ptr, ZEND_STRL("cookies"), PH_NOISY_CC | PH_READONLY); - if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0))) { - RETURN_MM_BOOL(0); - } - ZEPHIR_CALL_METHOD(NULL, &cookie, "delete", NULL, 0); - zephir_check_call_status(); - RETURN_MM_BOOL(1); -} - -static PHP_METHOD(Phalcon_Http_Response_Cookies, get) -{ - zval _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, container, encryption, cookie, _0, _1, _2, _4, _5, _6$$5; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&container); - ZVAL_UNDEF(&encryption); - ZVAL_UNDEF(&cookie); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) ZEND_PARSE_PARAMETERS_END(); #endif @@ -139962,7 +133791,7 @@ static PHP_METHOD(Phalcon_Http_Response_Cookies, send) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 433); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 357); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0); if (!(_1)) { @@ -140501,7 +134330,7 @@ static PHP_METHOD(Phalcon_Http_Response_Headers, send) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 433); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 357); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0); if (!(_1)) { @@ -140527,7 +134356,7 @@ static PHP_METHOD(Phalcon_Http_Response_Headers, send) if (Z_TYPE_P(&value) != IS_NULL) { ZEPHIR_INIT_NVAR(&_8$$5); ZEPHIR_CONCAT_VSV(&_8$$5, &header, ": ", &value); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_8$$5, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_8$$5, &__$true); zephir_check_call_status(); } else { _10$$6 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99); @@ -140539,12 +134368,12 @@ static PHP_METHOD(Phalcon_Http_Response_Headers, send) _10$$6 = ZEPHIR_IS_STRING(&_13$$6, "HTTP/"); } if (_10$$6) { - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &header, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &header, &__$true); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_14$$8); ZEPHIR_CONCAT_VS(&_14$$8, &header, ": "); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_14$$8, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_14$$8, &__$true); zephir_check_call_status(); } } @@ -140565,7 +134394,7 @@ static PHP_METHOD(Phalcon_Http_Response_Headers, send) if (Z_TYPE_P(&value) != IS_NULL) { ZEPHIR_INIT_NVAR(&_15$$10); ZEPHIR_CONCAT_VSV(&_15$$10, &header, ": ", &value); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_15$$10, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_15$$10, &__$true); zephir_check_call_status(); } else { _16$$11 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99); @@ -140577,12 +134406,12 @@ static PHP_METHOD(Phalcon_Http_Response_Headers, send) _16$$11 = ZEPHIR_IS_STRING(&_19$$11, "HTTP/"); } if (_16$$11) { - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &header, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &header, &__$true); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_20$$13); ZEPHIR_CONCAT_VS(&_20$$13, &header, ": "); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_20$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_20$$13, &__$true); zephir_check_call_status(); } } @@ -140720,50 +134549,6 @@ ZEPHIR_DOC_METHOD(Phalcon_Http_Response_HeadersInterface, setRaw); -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractMiddleware) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Server, AbstractMiddleware, phalcon, http_server_abstractmiddleware, phalcon_http_server_abstractmiddleware_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_class_implements(phalcon_http_server_abstractmiddleware_ce, 1, zephir_get_internal_ce(SL("psr\\http\\server\\middlewareinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Server_AbstractMiddleware, process) -{ -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractRequestHandler) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Server, AbstractRequestHandler, phalcon, http_server_abstractrequesthandler, phalcon_http_server_abstractrequesthandler_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_class_implements(phalcon_http_server_abstractrequesthandler_ce, 1, zephir_get_internal_ce(SL("psr\\http\\server\\requesthandlerinterface"))); - return SUCCESS; -} - -static PHP_METHOD(Phalcon_Http_Server_AbstractRequestHandler, handle) -{ -} - - - - -#ifdef HAVE_CONFIG_H -#endif - - - - - ZEPHIR_INIT_CLASS(Phalcon_Autoload_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Autoload, Exception, phalcon, autoload_exception, zend_ce_exception, NULL, 0); @@ -140836,7 +134621,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, __construct) ZVAL_STRING(&_0, "sha256"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "php"); - ZEPHIR_CALL_FUNCTION(&_2, "hash", NULL, 99, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "hash", NULL, 68, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "php"); @@ -140903,7 +134688,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, addDirectory) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &directory); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &directory); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("directories"), &_1, &directory); RETURN_THIS(); @@ -140935,7 +134720,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, addExtension) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &extension); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &extension); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("extensions"), &_1, &extension); RETURN_THIS(); @@ -140967,7 +134752,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, addFile) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &file); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &file); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("files"), &_1, &file); RETURN_THIS(); @@ -141029,7 +134814,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, addNamespace) ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_VV(&_1, &_0, &nsSeparator); ZEPHIR_CPY_WRT(&nsName, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdirectories", NULL, 190, directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdirectories", NULL, 171, directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(directories, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY); @@ -141054,7 +134839,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, addNamespace) } ZEPHIR_INIT_VAR(&_7); zephir_fast_array_merge(&_7, &source, &target); - ZEPHIR_CALL_FUNCTION(&_2, "array_unique", NULL, 191, &_7); + ZEPHIR_CALL_FUNCTION(&_2, "array_unique", NULL, 172, &_7); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("namespaces"), &nsName, &_2); RETURN_THIS(); @@ -141098,40 +134883,40 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoload) zephir_update_property_zval(this_ptr, ZEND_STRL("debug"), &_0); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SV(&_1, "Loading: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "loader:beforeCheckClass"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "autoloadcheckclasses", NULL, 193, &className); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "autoloadcheckclasses", NULL, 174, &className); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_3)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, "Class: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "autoloadchecknamespaces", NULL, 194, &className); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "autoloadchecknamespaces", NULL, 175, &className); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_5)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SV(&_6, "Namespace: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_6); zephir_check_call_status(); zephir_read_property(&_8, this_ptr, ZEND_STRL("directories"), PH_NOISY_CC | PH_READONLY); ZVAL_BOOL(&_9, 1); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "autoloadcheckdirectories", NULL, 195, &_8, &className, &_9); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "autoloadcheckdirectories", NULL, 176, &_8, &className, &_9); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_10); ZEPHIR_CONCAT_SV(&_10, "Directories: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_10); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_10); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "loader:afterCheckClass"); @@ -141332,7 +135117,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, register) ZVAL_STRING(&_2$$3, "autoload"); zephir_array_fast_append(&_1$$3, &_2$$3); ZVAL_BOOL(&_3$$3, (prepend ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 196, &_1$$3, &__$true, &_3$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 177, &_1$$3, &__$true, &_3$$3); zephir_check_call_status(); if (1) { zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true); @@ -141466,7 +135251,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, setDirectories) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 197, &directories, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 178, &directories, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -141516,7 +135301,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, setExtensions) ZVAL_STRING(&_1$$3, "sha256"); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "php"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "hash", NULL, 99, &_1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "hash", NULL, 68, &_1$$3, &_2$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, "php"); @@ -141634,7 +135419,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, setFiles) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 197, &files, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 178, &files, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -141698,7 +135483,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, setNamespaces) } ZEPHIR_INIT_NVAR(&directories); ZVAL_COPY(&directories, _1); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkdirectories", &_6, 190, &directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkdirectories", &_6, 171, &directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(&directories, &_5$$4); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories); @@ -141717,7 +135502,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, setNamespaces) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&directories, &namespaces, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "checkdirectories", &_6, 190, &directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "checkdirectories", &_6, 171, &directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(&directories, &_8$$5); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories); @@ -141756,7 +135541,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, unregister) ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "autoload"); zephir_array_fast_append(&_1$$3, &_2$$3); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 198, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 179, &_1$$3); zephir_check_call_status(); if (0) { zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true); @@ -141795,7 +135580,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, requireFile) zephir_read_property(&_0, this_ptr, ZEND_STRL("fileCheckingCallback"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_1, "call_user_func", NULL, 199, &_0, &file); + ZEPHIR_CALL_FUNCTION(&_1, "call_user_func", NULL, 180, &_0, &file); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); @@ -141804,7 +135589,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, requireFile) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SV(&_3$$3, "Require: ", &file); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_3$$3); zephir_check_call_status(); if (zephir_require_once_zval(&file) == FAILURE) { RETURN_MM_NULL(); @@ -141813,7 +135598,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, requireFile) } ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, "Require: 404: ", &file); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_4); zephir_check_call_status(); RETURN_MM_BOOL(0); } @@ -141962,7 +135747,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckClasses) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SV(&_3$$3, "Class: load: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_3$$3); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -142067,7 +135852,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_11$$6); ZEPHIR_CONCAT_SV(&_11$$6, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_11$$6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_11$$6); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -142097,7 +135882,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_15$$9); ZEPHIR_CONCAT_SV(&_15$$9, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_15$$9); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_15$$9); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -142142,7 +135927,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_21$$13); ZEPHIR_CONCAT_SV(&_21$$13, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_21$$13); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_21$$13); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -142172,7 +135957,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_24$$16); ZEPHIR_CONCAT_SV(&_24$$16, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_24$$16); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_24$$16); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -142261,13 +136046,13 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckNamespaces) ZVAL_LONG(&_7$$3, zephir_fast_strlen_ev(&prefix)); ZEPHIR_INIT_NVAR(&fileName); zephir_substr(&fileName, &className, zephir_get_intval(&_7$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "autoloadcheckdirectories", &_9, 195, &directories, &fileName); + ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "autoloadcheckdirectories", &_9, 176, &directories, &fileName); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$3)) { zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$5); ZEPHIR_CONCAT_SVSV(&_11$$5, "Namespace: ", &prefix, " - ", &_10$$5); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_11$$5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_11$$5); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -142296,13 +136081,13 @@ static PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckNamespaces) ZVAL_LONG(&_15$$6, zephir_fast_strlen_ev(&prefix)); ZEPHIR_INIT_NVAR(&fileName); zephir_substr(&fileName, &className, zephir_get_intval(&_15$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_16$$6, this_ptr, "autoloadcheckdirectories", &_9, 195, &directories, &fileName); + ZEPHIR_CALL_METHOD(&_16$$6, this_ptr, "autoloadcheckdirectories", &_9, 176, &directories, &fileName); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_16$$6)) { zephir_read_property(&_17$$8, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_18$$8); ZEPHIR_CONCAT_SVSV(&_18$$8, "Namespace: ", &prefix, " - ", &_17$$8); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_18$$8); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_18$$8); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -142384,7 +136169,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, checkDirectories) ZEPHIR_CPY_WRT(&directory, &_5$$5); ZEPHIR_INIT_NVAR(&_6$$5); ZVAL_STRING(&_6$$5, "sha256"); - ZEPHIR_CALL_FUNCTION(&_7$$5, "hash", &_8, 99, &_6$$5, &directory); + ZEPHIR_CALL_FUNCTION(&_7$$5, "hash", &_8, 68, &_6$$5, &directory); zephir_check_call_status(); zephir_array_update_zval(&results, &_7$$5, &directory, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -142406,7 +136191,7 @@ static PHP_METHOD(Phalcon_Autoload_Loader, checkDirectories) ZEPHIR_CPY_WRT(&directory, &_10$$6); ZEPHIR_INIT_NVAR(&_11$$6); ZVAL_STRING(&_11$$6, "sha256"); - ZEPHIR_CALL_FUNCTION(&_12$$6, "hash", &_8, 99, &_11$$6, &directory); + ZEPHIR_CALL_FUNCTION(&_12$$6, "hash", &_8, 68, &_11$$6, &directory); zephir_check_call_status(); zephir_array_update_zval(&results, &_12$$6, &directory, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, directories, "next", NULL, 0); @@ -142857,7 +136642,7 @@ static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, dispatch) } break; } - ZEPHIR_CALL_FUNCTION(&handlerHash, "spl_object_hash", &_35, 108, &handler); + ZEPHIR_CALL_FUNCTION(&handlerHash, "spl_object_hash", &_35, 77, &handler); zephir_check_call_status(); zephir_read_property(&_36$$10, this_ptr, ZEND_STRL("handlerHashes"), PH_NOISY_CC | PH_READONLY); isNewHandler = !((zephir_array_isset(&_36$$10, &handlerHash))); @@ -143440,7 +137225,7 @@ static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getActiveMethod) zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "tocamelcase", NULL, 0, &_3$$3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&activeMethodName, "lcfirst", NULL, 104, &_2$$3); + ZEPHIR_CALL_FUNCTION(&activeMethodName, "lcfirst", NULL, 73, &_2$$3); zephir_check_call_status(); ZEPHIR_OBS_VAR(&_4$$3); zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC); @@ -144082,11 +137867,11 @@ static PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, toCamelCase) if (!(zephir_array_isset_fetch(&camelCaseInput, &_0, &input, 0))) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "/[_-]+/"); - ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_split", NULL, 98, &_1$$3, &input); + ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_split", NULL, 67, &_1$$3, &input); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, "ucfirst"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "array_map", NULL, 97, &_1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "array_map", NULL, 66, &_1$$3, &_2$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&camelCaseInput); zephir_fast_join_str(&camelCaseInput, SL(""), &_3$$3); @@ -144225,6 +138010,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Bag) zend_declare_property_null(phalcon_session_bag_ce, SL("container"), ZEND_ACC_PRIVATE); zend_declare_property_null(phalcon_session_bag_ce, SL("name"), ZEND_ACC_PRIVATE); zend_declare_property_null(phalcon_session_bag_ce, SL("session"), ZEND_ACC_PRIVATE); + zend_class_implements(phalcon_session_bag_ce, 1, phalcon_session_baginterface_ce); zend_class_implements(phalcon_session_bag_ce, 1, phalcon_di_injectionawareinterface_ce); return SUCCESS; } @@ -144233,66 +138019,36 @@ static PHP_METHOD(Phalcon_Session_Bag, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *container = NULL, container_sub, __$null, data, session, _0, _1, _2; zval name; + zval *session, session_sub, *name_param = NULL, data, _0, _1; zval *this_ptr = getThis(); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&container_sub); - ZVAL_NULL(&__$null); + ZVAL_UNDEF(&session_sub); ZVAL_UNDEF(&data); - ZVAL_UNDEF(&session); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&name); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_OBJECT_OF_CLASS(session, phalcon_session_managerinterface_ce) Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &name_param, &container); - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - } - if (!container) { - container = &container_sub; - container = &__$null; - } + zephir_fetch_params(1, 2, 0, &session, &name_param); + zephir_get_strval(&name, name_param); + zephir_update_property_zval(this_ptr, ZEND_STRL("session"), session); zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); - if (UNEXPECTED(Z_TYPE_P(container) == IS_NULL)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/Session/Bag.zep", 62); - return; - } - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "session"); - ZEPHIR_CALL_METHOD(&_0, container, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/Session/Bag.zep", 68); - return; - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "session"); - ZEPHIR_CALL_METHOD(&session, container, "getshared", NULL, 0, &_1); + ZEPHIR_CALL_METHOD(&_0, session, "getdi", NULL, 0); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container); - zephir_update_property_zval(this_ptr, ZEND_STRL("session"), &session); - zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&data, &session, "get", NULL, 0, &_2); + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &_0); + zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, session, "get", NULL, 0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_INIT_NVAR(&data); @@ -144340,14 +138096,13 @@ static PHP_METHOD(Phalcon_Session_Bag, init) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *data_param = NULL, _1, _2, _3; + zval *data_param = NULL, _1, _2; zval data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) @@ -144371,8 +138126,7 @@ static PHP_METHOD(Phalcon_Session_Bag, init) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &_3); + ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -144497,6 +138251,33 @@ static PHP_METHOD(Phalcon_Session_Bag, setDI) +ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Session, BagInterface, phalcon, session_baginterface, phalcon_session_baginterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __get); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __isset); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __set); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __unset); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, init); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, get); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, set); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, has); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, remove); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, clear); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Session_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Session, Exception, phalcon, session_exception, zend_ce_exception, NULL, 0); @@ -144718,7 +138499,7 @@ static PHP_METHOD(Phalcon_Session_Manager, get) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool remove; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, uniqueKey, value, _0; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, value, uniqueKey, _0; zval key; zval *this_ptr = getThis(); @@ -144726,8 +138507,8 @@ static PHP_METHOD(Phalcon_Session_Manager, get) ZVAL_UNDEF(&defaultValue_sub); ZVAL_UNDEF(&_SESSION); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&uniqueKey); ZVAL_UNDEF(&value); + ZVAL_UNDEF(&uniqueKey); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -144868,38 +138649,36 @@ static PHP_METHOD(Phalcon_Session_Manager, getOptions) static PHP_METHOD(Phalcon_Session_Manager, regenerateId) { - zend_bool delete = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *deleteOldSession = NULL, deleteOldSession_sub, __$true, _0, _1$$3; + zval *deleteOldSession_param = NULL, _0, _1$$3; + zend_bool deleteOldSession; zval *this_ptr = getThis(); - ZVAL_UNDEF(&deleteOldSession_sub); - ZVAL_BOOL(&__$true, 1); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(deleteOldSession) + Z_PARAM_BOOL(deleteOldSession) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &deleteOldSession); - if (!deleteOldSession) { - deleteOldSession = &deleteOldSession_sub; - deleteOldSession = &__$true; + zephir_fetch_params(1, 0, 1, &deleteOldSession_param); + if (!deleteOldSession_param) { + deleteOldSession = 1; + } else { + deleteOldSession = zephir_get_boolval(deleteOldSession_param); } - delete = zephir_get_boolval(deleteOldSession); ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZVAL_BOOL(&_1$$3, (delete ? 1 : 0)); + ZVAL_BOOL(&_1$$3, (deleteOldSession ? 1 : 0)); ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 0, &_1$$3); zephir_check_call_status(); } @@ -144910,14 +138689,14 @@ static PHP_METHOD(Phalcon_Session_Manager, remove) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, _SESSION, _0, uniqueKey; + zval *key_param = NULL, _SESSION, uniqueKey, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&_SESSION); - ZVAL_UNDEF(&_0); ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -144934,12 +138713,11 @@ static PHP_METHOD(Phalcon_Session_Manager, remove) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { - RETURN_MM_NULL(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); - zephir_check_call_status(); - zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -144973,12 +138751,11 @@ static PHP_METHOD(Phalcon_Session_Manager, set) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { - RETURN_MM_NULL(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_update_zval(&_SESSION, &uniqueKey, value, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); - zephir_check_call_status(); - zephir_array_update_zval(&_SESSION, &uniqueKey, value, PH_COPY | PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -145007,41 +138784,41 @@ static PHP_METHOD(Phalcon_Session_Manager, setId) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id_param = NULL, _0, _1$$3; - zval id, _2$$3; + zval *sessionId_param = NULL, _0, _1$$3; + zval sessionId, _2$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id); + ZVAL_UNDEF(&sessionId); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(id) + Z_PARAM_STR(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id_param); - zephir_get_strval(&id, id_param); + zephir_fetch_params(1, 1, 0, &sessionId_param); + zephir_get_strval(&sessionId, sessionId_param); ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { ZEPHIR_INIT_VAR(&_1$$3); - object_init_ex(&_1$$3, spl_ce_RuntimeException); + object_init_ex(&_1$$3, phalcon_session_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SS(&_2$$3, "The session has already been started. ", "To change the id, use regenerateId()"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 254); + zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 271); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &id); + ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &sessionId); zephir_check_call_status(); RETURN_THIS(); } @@ -145075,8 +138852,8 @@ static PHP_METHOD(Phalcon_Session_Manager, setName) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 277); + if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 294); return; } ZEPHIR_INIT_VAR(&_1); @@ -145087,7 +138864,7 @@ static PHP_METHOD(Phalcon_Session_Manager, setName) ZVAL_STRING(&_4, "/^[\\p{L}\\p{N}_-]+$/u"); zephir_preg_match(&_3, &_4, &name, &_1, 0, 0 , 0 ); if (UNEXPECTED(!zephir_is_true(&_3))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "The name contains non alphanum characters", "phalcon/Session/Manager.zep", 283); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The name contains non alphanum characters", "phalcon/Session/Manager.zep", 300); return; } zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); @@ -145162,7 +138939,7 @@ static PHP_METHOD(Phalcon_Session_Manager, start) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_FUNCTION(&_1, "headers_sent", NULL, 433); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "phpheaderssent", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { RETURN_MM_BOOL(0); @@ -145170,7 +138947,7 @@ static PHP_METHOD(Phalcon_Session_Manager, start) ZEPHIR_OBS_VAR(&_2); zephir_read_property(&_2, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC); if (UNEXPECTED(!(zephir_is_instance_of(&_2, SL("SessionHandlerInterface"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session adapter is not valid", "phalcon/Session/Manager.zep", 327); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session adapter is not valid", "phalcon/Session/Manager.zep", 344); return; } ZEPHIR_OBS_VAR(&value); @@ -145220,17 +138997,32 @@ static PHP_METHOD(Phalcon_Session_Manager, status) RETURN_MM_LONG(1); } +static PHP_METHOD(Phalcon_Session_Manager, phpHeadersSent) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_FUNCTION("headers_sent", NULL, 357); + zephir_check_call_status(); + RETURN_MM(); +} + static PHP_METHOD(Phalcon_Session_Manager, getUniqueKey) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *key_param = NULL, uniqueId, _0, _1$$3; + zval *key_param = NULL, prefix, _0, _1; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); - ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&prefix); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -145244,15 +139036,18 @@ static PHP_METHOD(Phalcon_Session_Manager, getUniqueKey) zephir_get_strval(&key, key_param); - zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&uniqueId, &_0); - if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CONCAT_VSV(return_value, &_1$$3, "#", &key); - RETURN_MM(); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC); + if (1 != ZEPHIR_IS_EMPTY(&_0)) { + zephir_read_property(&_1, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefix); + ZEPHIR_CONCAT_VS(&prefix, &_1, "#"); } else { - RETURN_CTOR(&key); + ZEPHIR_INIT_NVAR(&prefix); + ZVAL_STRING(&prefix, ""); } + ZEPHIR_CONCAT_VV(return_value, &prefix, &key); + RETURN_MM(); } static PHP_METHOD(Phalcon_Session_Manager, getArrVal) @@ -145395,35 +139190,35 @@ static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy) zend_bool _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, _1, _2, _3$$3; + zval *sessionId, sessionId_sub, _1, _2, _3$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); - _0 = !(ZEPHIR_IS_EMPTY(id)); + _0 = !(ZEPHIR_IS_EMPTY(sessionId)); if (_0) { zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, sessionId); zephir_check_call_status(); _0 = zephir_is_true(&_2); } if (_0) { zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_3$$3, "delete", NULL, 0, id); + ZEPHIR_RETURN_CALL_METHOD(&_3$$3, "delete", NULL, 0, sessionId); zephir_check_call_status(); RETURN_MM(); } @@ -145432,19 +139227,20 @@ static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy) static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, gc) { - zval *maxlifetime, maxlifetime_sub; + zval *maxlifetime_param = NULL; + zend_long maxlifetime; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime); + zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); RETURN_BOOL(1); @@ -145454,27 +139250,27 @@ static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, read) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, data, _0, _1; + zval *sessionId, sessionId_sub, data, _0, _1; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, id); + ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); if (Z_TYPE_P(&data) == IS_NULL) { @@ -145511,27 +139307,27 @@ static PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, write) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, *data, data_sub, _0; + zval *sessionId, sessionId_sub, *data, data_sub, _0; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &id, &data); + zephir_fetch_params(1, 2, 0, &sessionId, &data); zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, id, data); + ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, sessionId, data); zephir_check_call_status(); RETURN_MM(); } @@ -145714,19 +139510,19 @@ static PHP_METHOD(Phalcon_Session_Adapter_Noop, close) static PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy) { - zval *id, id_sub; + zval *sessionId, sessionId_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &id); + zephir_fetch_params_without_memory_grow(1, 0, &sessionId); RETURN_BOOL(1); @@ -145734,19 +139530,20 @@ static PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy) static PHP_METHOD(Phalcon_Session_Adapter_Noop, gc) { - zval *maxlifetime, maxlifetime_sub; + zval *maxlifetime_param = NULL; + zend_long maxlifetime; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime); + zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); RETURN_BOOL(1); @@ -145754,19 +139551,19 @@ static PHP_METHOD(Phalcon_Session_Adapter_Noop, gc) static PHP_METHOD(Phalcon_Session_Adapter_Noop, read) { - zval *id, id_sub; + zval *sessionId, sessionId_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &id); + zephir_fetch_params_without_memory_grow(1, 0, &sessionId); RETURN_STRING(""); @@ -145796,21 +139593,21 @@ static PHP_METHOD(Phalcon_Session_Adapter_Noop, open) static PHP_METHOD(Phalcon_Session_Adapter_Noop, write) { - zval *id, id_sub, *data, data_sub; + zval *sessionId, sessionId_sub, *data, data_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(2, 0, &id, &data); + zephir_fetch_params_without_memory_grow(2, 0, &sessionId, &data); RETURN_BOOL(1); @@ -145959,15 +139756,16 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval options, *options_param = NULL, path, _1, _3, _6, _2$$3, _4$$4, _5$$4; + zval *options_param = NULL, path, _1, _2, _3, _6, _4$$4, _5$$4; + zval options; zval *this_ptr = getThis(); ZVAL_UNDEF(&options); ZVAL_UNDEF(&path); ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_5$$4); #if PHP_VERSION_ID >= 80000 @@ -145991,29 +139789,32 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct) ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_stream_ce, getThis(), "__construct", &_0, 0, &options); zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&options, &_1); - ZEPHIR_OBS_VAR(&path); - if (!(zephir_array_isset_string_fetch(&path, &options, SL("savePath"), 0))) { - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, "session.save_path"); - ZEPHIR_CALL_FUNCTION(&path, "ini_get", NULL, 0, &_2$$3); - zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "session.save_path"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "phpiniget", NULL, 0, &_2); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "savePath"); + ZEPHIR_CALL_METHOD(&path, this_ptr, "getarrval", NULL, 0, &options, &_2, &_1); + zephir_check_call_status(); + if (UNEXPECTED(1 == ZEPHIR_IS_EMPTY(&path))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session save path cannot be empty", "phalcon/Session/Adapter/Stream.zep", 67); + return; } - ZEPHIR_CALL_FUNCTION(&_3, "is_writable", NULL, 395, &path); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "phpiswritable", NULL, 0, &path); zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(&_3))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3))) { ZEPHIR_INIT_VAR(&_4$$4); object_init_ex(&_4$$4, phalcon_session_exception_ce); ZEPHIR_INIT_VAR(&_5$$4); ZEPHIR_CONCAT_SVS(&_5$$4, "The session save path [", &path, "] is not writable"); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 31, &_5$$4); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 29, &_5$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$4, "phalcon/Session/Adapter/Stream.zep", 67); + zephir_throw_exception_debug(&_4$$4, "phalcon/Session/Adapter/Stream.zep", 71); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_6, this_ptr, "getdirseparator", NULL, 0, &path); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "getdirseparator", NULL, 508, &path); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_6); ZEPHIR_MM_RESTORE(); @@ -146024,10 +139825,10 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy) zend_bool _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, file, _0, _1, _3; + zval *sessionId, sessionId_sub, file, _0, _1, _3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&file); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); @@ -146035,28 +139836,28 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&file); ZEPHIR_CONCAT_VV(&file, &_0, &_1); _2 = (zephir_file_exists(&file) == SUCCESS); if (_2) { - ZEPHIR_CALL_FUNCTION(&_3, "is_file", NULL, 0, &file); + ZEPHIR_CALL_FUNCTION(&_3, "is_file", NULL, 509, &file); zephir_check_call_status(); _2 = zephir_is_true(&_3); } if (_2) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 118, &file); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -146067,11 +139868,10 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) zend_bool _6$$3, _9$$3, _12$$5, _14$$5; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *maxlifetime, maxlifetime_sub, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5; + zval *maxlifetime_param = NULL, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5; + zend_long maxlifetime, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); ZVAL_UNDEF(&file); ZVAL_UNDEF(&pattern); ZVAL_UNDEF(&time); @@ -146087,13 +139887,14 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &maxlifetime); + zephir_fetch_params(1, 1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); @@ -146103,20 +139904,20 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) ZEPHIR_INIT_VAR(&_2); zephir_time(&_2); ZEPHIR_INIT_VAR(&time); - zephir_sub_function(&time, &_2, maxlifetime); - ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 0, &pattern); + ZVAL_LONG(&time, (zephir_get_numberval(&_2) - maxlifetime)); + ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 510, &pattern); zephir_check_call_status(); - zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 104); + zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 111); if (Z_TYPE_P(&_3) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4) { ZEPHIR_INIT_NVAR(&file); ZVAL_COPY(&file, _4); - _6$$3 = (zephir_file_exists(&file) == SUCCESS); + _6$$3 = 1 == (zephir_file_exists(&file) == SUCCESS); if (_6$$3) { - ZEPHIR_CALL_FUNCTION(&_7$$3, "is_file", &_8, 0, &file); + ZEPHIR_CALL_FUNCTION(&_7$$3, "is_file", &_8, 509, &file); zephir_check_call_status(); - _6$$3 = zephir_is_true(&_7$$3); + _6$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_7$$3); } _9$$3 = _6$$3; if (_9$$3) { @@ -146125,7 +139926,7 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) _9$$3 = ZEPHIR_LT(&_10$$3, &time); } if (_9$$3) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 118, &file); zephir_check_call_status(); } } ZEND_HASH_FOREACH_END(); @@ -146140,11 +139941,11 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) } ZEPHIR_CALL_METHOD(&file, &_3, "current", NULL, 0); zephir_check_call_status(); - _12$$5 = (zephir_file_exists(&file) == SUCCESS); + _12$$5 = 1 == (zephir_file_exists(&file) == SUCCESS); if (_12$$5) { - ZEPHIR_CALL_FUNCTION(&_13$$5, "is_file", &_8, 0, &file); + ZEPHIR_CALL_FUNCTION(&_13$$5, "is_file", &_8, 509, &file); zephir_check_call_status(); - _12$$5 = zephir_is_true(&_13$$5); + _12$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_13$$5); } _14$$5 = _12$$5; if (_14$$5) { @@ -146153,7 +139954,7 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) _14$$5 = ZEPHIR_LT(&_15$$5, &time); } if (_14$$5) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 118, &file); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0); @@ -146190,48 +139991,51 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, read) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, data, name, pointer, _0, _1, _2$$3, _3$$3, _4$$3; + zval *sessionId, sessionId_sub, data, name, pointer, _0, _1, _2, _3$$3, _4$$3, _5$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data); ZVAL_UNDEF(&name); ZVAL_UNDEF(&pointer); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3$$3); ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); ZEPHIR_CONCAT_VV(&name, &_0, &_1); ZEPHIR_INIT_VAR(&data); ZVAL_STRING(&data, ""); - if ((zephir_file_exists(&name) == SUCCESS)) { - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, "r"); - ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 90, &name, &_2$$3); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileexists", NULL, 0, &name); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_2)) { + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "r"); + ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &name, &_3$$3); zephir_check_call_status(); - ZVAL_LONG(&_3$$3, 1); - ZEPHIR_CALL_FUNCTION(&_4$$3, "flock", NULL, 154, &pointer, &_3$$3); + ZVAL_LONG(&_4$$3, 1); + ZEPHIR_CALL_FUNCTION(&_5$$3, "flock", NULL, 126, &pointer, &_4$$3); zephir_check_call_status(); - if (zephir_is_true(&_4$$3)) { - ZEPHIR_INIT_NVAR(&data); - zephir_file_get_contents(&data, &name); + if (zephir_is_true(&_5$$3)) { + ZEPHIR_CALL_METHOD(&data, this_ptr, "phpfilegetcontents", NULL, 0, &name); + zephir_check_call_status(); } zephir_fclose(&pointer); if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) { @@ -146245,10 +140049,10 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, write) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, *data, data_sub, name, _0, _1, _2, _3; + zval *sessionId, sessionId_sub, *data, data_sub, name, _0, _1, _2, _3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&name); ZVAL_UNDEF(&_0); @@ -146258,25 +140062,88 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, write) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &id, &data); + zephir_fetch_params(1, 2, 0, &sessionId, &data); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); ZEPHIR_CONCAT_VV(&name, &_0, &_1); - ZVAL_LONG(&_2, 2); - ZEPHIR_CALL_FUNCTION(&_3, "file_put_contents", NULL, 157, &name, data, &_2); + ZVAL_LONG(&_3, 2); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &name, data, &_3); zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2)); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, getArrVal) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval cast; + zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null, value; + zval collection; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&cast); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_ARRAY(collection) + Z_PARAM_ZVAL(index) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + Z_PARAM_STR_OR_NULL(cast) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &collection_param, &index, &defaultValue, &cast_param); + ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + if (!cast_param) { + ZEPHIR_INIT_VAR(&cast); + } else { + if (UNEXPECTED(Z_TYPE_P(cast_param) != IS_STRING && Z_TYPE_P(cast_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cast' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(cast_param) == IS_STRING)) { + zephir_get_strval(&cast, cast_param); + } else { + ZEPHIR_INIT_VAR(&cast); + } + } + + + ZEPHIR_OBS_VAR(&value); + if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + if (UNEXPECTED(zephir_is_true(&cast))) { + ZEPHIR_MAKE_REF(&value); + ZEPHIR_CALL_FUNCTION(NULL, "settype", NULL, 12, &value, &cast); + ZEPHIR_UNREF(&value); + zephir_check_call_status(); + } + RETURN_CCTOR(&value); } static PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator) @@ -146318,6 +140185,184 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator) RETURN_MM(); } +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS)); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileGetContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + zephir_file_get_contents(return_value, &filename); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFilePutContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long flags, ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_STR(filename) + Z_PARAM_ZVAL(data) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(flags) + Z_PARAM_ZVAL_OR_NULL(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context); + zephir_get_strval(&filename, filename_param); + if (!flags_param) { + flags = 0; + } else { + flags = zephir_get_intval(flags_param); + } + if (!context) { + context = &context_sub; + context = &__$null; + } + + + ZVAL_LONG(&_0, flags); + ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 133, &filename, data, &_0, context); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFopen) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *mode_param = NULL; + zval filename, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&mode); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(filename) + Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &filename_param, &mode_param); + zephir_get_strval(&filename, filename_param); + zephir_get_strval(&mode, mode_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIniGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *varname_param = NULL; + zval varname; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&varname); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(varname) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &varname_param); + zephir_get_strval(&varname, varname_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("ini_get", NULL, 511, &varname); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("is_writable", NULL, 0, &filename); + zephir_check_call_status(); + RETURN_MM(); +} + @@ -146884,7 +140929,8 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetExists) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -146899,7 +140945,6 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetExists) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -146914,7 +140959,8 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetGet) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -146929,7 +140975,6 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetGet) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -146944,7 +140989,8 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetSet) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub, *value, value_sub; + zval element_sub, value_sub; + zval *element = NULL, *value; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -146961,7 +141007,6 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetSet) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &element, &value); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -146976,7 +141021,8 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetUnset) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -146991,7 +141037,6 @@ static PHP_METHOD(Phalcon_Support_Collection, offsetUnset) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -147149,32 +141194,71 @@ static PHP_METHOD(Phalcon_Support_Collection, toJson) static PHP_METHOD(Phalcon_Support_Collection, unserialize) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serialized = NULL, serialized_sub, data; + zval *serialized_param = NULL, data; + zval serialized; zval *this_ptr = getThis(); - ZVAL_UNDEF(&serialized_sub); + ZVAL_UNDEF(&serialized); ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(serialized) + Z_PARAM_STR(serialized) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &serialized); - ZEPHIR_SEPARATE_PARAM(serialized); + zephir_fetch_params(1, 1, 0, &serialized_param); + zephir_get_strval(&serialized, serialized_param); + + + ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 16, &serialized); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &data); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Support_Collection, __serialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); - zephir_cast_to_string(&_0, serialized); - ZEPHIR_CPY_WRT(serialized, &_0); - ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 16, serialized); + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "toarray", NULL, 0); zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Support_Collection, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *data_param = NULL; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -147573,7 +141657,7 @@ static PHP_METHOD(Phalcon_Support_Debug, listenLowSeverity) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "onUncaughtLowSeverity"); zephir_array_fast_append(&_0, &_1); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); zephir_create_array(&_2, 2, 0); @@ -147615,7 +141699,7 @@ static PHP_METHOD(Phalcon_Support_Debug, onUncaughtException) ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 0); zephir_check_call_status(); if (ZEPHIR_GT_LONG(&obLevel, 0)) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 0); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 486); zephir_check_call_status(); } zephir_read_static_property_ce(&_0, phalcon_support_debug_ce, SL("isActive"), PH_NOISY_CC | PH_READONLY); @@ -148721,7 +142805,7 @@ static PHP_METHOD(Phalcon_Support_Debug, showTraceItem) } else { ZEPHIR_INIT_VAR(&classReflection); object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 172, &className); + ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 151, &className); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 0); zephir_check_call_status(); @@ -148754,7 +142838,7 @@ static PHP_METHOD(Phalcon_Support_Debug, showTraceItem) if ((zephir_function_exists(&functionName) == SUCCESS)) { ZEPHIR_INIT_VAR(&functionReflection); object_init_ex(&functionReflection, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 166, &functionName); + ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 145, &functionName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 0); zephir_check_call_status(); @@ -149642,7 +143726,8 @@ static PHP_METHOD(Phalcon_Support_Registry, offsetGet) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *element, element_sub; + zval element_sub; + zval *element; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -149931,10 +144016,10 @@ static PHP_METHOD(Phalcon_Support_Version, getVersion) ZVAL_LONG(&_0, 0); zephir_array_fast_append(return_value, &_0); ZEPHIR_INIT_NVAR(&_0); - ZVAL_LONG(&_0, 2); + ZVAL_LONG(&_0, 3); zephir_array_fast_append(return_value, &_0); ZEPHIR_INIT_NVAR(&_0); - ZVAL_LONG(&_0, 3); + ZVAL_LONG(&_0, 1); zephir_array_fast_append(return_value, &_0); RETURN_MM(); } @@ -150064,11 +144149,11 @@ static PHP_METHOD(Phalcon_Support_Version, getId) zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 161); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 140, &_0, &medium); + ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 112, &_0, &medium); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 140, &_0, &minor); + ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 112, &_0, &minor); zephir_check_call_status(); ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber); RETURN_MM(); @@ -150319,7 +144404,7 @@ static PHP_METHOD(Phalcon_Support_Helper_File_Basename, __invoke) ZVAL_STRING(&_2, "/"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "@"); - ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 432, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 356, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@"); @@ -150335,13 +144420,13 @@ static PHP_METHOD(Phalcon_Support_Helper_File_Basename, __invoke) if (1 != ZEPHIR_IS_EMPTY(&suffix)) { ZEPHIR_INIT_VAR(&_6$$3); ZVAL_STRING(&_6$$3, "@"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 432, &suffix, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 356, &suffix, &_6$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$3); ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@"); ZEPHIR_INIT_NVAR(&_6$$3); ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 50, &_8$$3, &_6$$3, &fileName); + ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 37, &_8$$3, &_6$$3, &fileName); zephir_check_call_status(); ZEPHIR_CPY_WRT(&fileName, &_9$$3); } @@ -150455,12 +144540,12 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_Blacklist, __invoke) ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_17__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_0, NULL, phalcon_13__closure_ce, SL("__invoke")); ZEPHIR_CALL_METHOD(&blackListed, this_ptr, "tofilter", NULL, 0, &blackList, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 203, &blackListed); + ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 95, &blackListed); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 487, &collection, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 94, &collection, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -150626,7 +144711,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_First, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); ZEPHIR_MAKE_REF(&filtered); - ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 0, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 474, &filtered); ZEPHIR_UNREF(&filtered); zephir_check_call_status(); RETURN_MM(); @@ -151154,7 +145239,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_Group, processCallable) ZEPHIR_CALL_METHOD(&_0, this_ptr, "iscallable", NULL, 0, method); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_CALL_FUNCTION(&key, "call_user_func", NULL, 199, method, element); + ZEPHIR_CALL_FUNCTION(&key, "call_user_func", NULL, 180, method, element); zephir_check_call_status(); zephir_array_update_multi(&output, element, SL("za"), 2, &key); } @@ -151338,7 +145423,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_IsUnique, __invoke) zephir_get_arrval(&collection, collection_param); - ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 191, &collection); + ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 172, &collection); zephir_check_call_status(); RETURN_MM_BOOL(zephir_fast_count_int(&collection) == zephir_fast_count_int(&_0)); } @@ -151394,7 +145479,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_Last, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); ZEPHIR_MAKE_REF(&filtered); - ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 338, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 320, &filtered); ZEPHIR_UNREF(&filtered); zephir_check_call_status(); RETURN_MM(); @@ -151450,7 +145535,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_LastKey, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_key_last", NULL, 49, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("array_key_last", NULL, 36, &filtered); zephir_check_call_status(); RETURN_MM(); } @@ -151923,7 +146008,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_SliceLeft, __invoke) ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, elements); - ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 0, &collection, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 498, &collection, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -151976,7 +146061,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_SliceRight, __invoke) ZVAL_LONG(&_0, elements); - ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 0, &collection, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 498, &collection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -152215,10 +146300,10 @@ static PHP_METHOD(Phalcon_Support_Helper_Arr_Whitelist, __invoke) ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_18__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_0, NULL, phalcon_14__closure_ce, SL("__invoke")); ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &whiteList, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 203, &filtered); + ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 95, &filtered); zephir_check_call_status(); ZEPHIR_RETURN_CALL_FUNCTION("array_intersect_key", NULL, 2, &collection, &_1); zephir_check_call_status(); @@ -152344,16 +146429,16 @@ static PHP_METHOD(Phalcon_Support_Helper_Json_Decode, __invoke) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0)) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Support/Helper/Json/Decode.zep", 45); ZEPHIR_MM_RESTORE(); @@ -152430,12 +146515,12 @@ static PHP_METHOD(Phalcon_Support_Helper_Json_Encode, __invoke) ZVAL_LONG(&_2, depth); ZEPHIR_INIT_NVAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_1) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0)) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, zephir_get_internal_ce(SL("jsonexception"))); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZVAL_LONG(&_6$$3, 5); ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 0, &_5$$3, &_6$$3); @@ -152811,7 +146896,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Camelize, __invoke) ZEPHIR_CALL_PARENT(&result, phalcon_support_helper_str_camelize_ce, getThis(), "__invoke", &_0, 0, &text, &delimiters); zephir_check_call_status(); if (lowerFirst == 1) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "lcfirst", NULL, 104, &result); + ZEPHIR_CALL_FUNCTION(&_1$$3, "lcfirst", NULL, 73, &result); zephir_check_call_status(); ZEPHIR_CPY_WRT(&result, &_1$$3); } @@ -152867,19 +146952,19 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Concat, __invoke) return; } ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&delimiter, "reset", NULL, 0, &arguments); + ZEPHIR_CALL_FUNCTION(&delimiter, "reset", NULL, 474, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(&_1, "array_slice", NULL, 0, &arguments, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "array_slice", NULL, 498, &arguments, &_0); zephir_check_call_status(); ZEPHIR_CPY_WRT(&arguments, &_1); ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&first, "reset", NULL, 0, &arguments); + ZEPHIR_CALL_FUNCTION(&first, "reset", NULL, 474, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&last, "end", NULL, 338, &arguments); + ZEPHIR_CALL_FUNCTION(&last, "end", NULL, 320, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZEPHIR_INIT_VAR(&prefix); @@ -153044,7 +147129,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Decapitalize, __invoke) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 242, &text, &_0); + ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 223, &text, &_0); zephir_check_call_status(); if (upperRest) { ZEPHIR_CALL_METHOD(&suffix, this_ptr, "toupper", NULL, 0, &substr, &encoding); @@ -153054,7 +147139,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Decapitalize, __invoke) } ZVAL_LONG(&_0, 0); ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_FUNCTION(&_3, "mb_substr", NULL, 242, &text, &_0, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "mb_substr", NULL, 223, &text, &_0, &_2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "tolower", NULL, 0, &_3, &encoding); zephir_check_call_status(); @@ -153192,16 +147277,16 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_DirFromFile, __invoke) ZVAL_LONG(&_0, 8); - ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, -2); - ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 242, &name, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 223, &name, &_0, &_1); zephir_check_call_status(); if (!zephir_is_true(&start)) { ZVAL_LONG(&_2$$3, 0); ZVAL_LONG(&_3$$3, 1); - ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 242, &name, &_2$$3, &_3$$3); + ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 223, &name, &_2$$3, &_3$$3); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_4); @@ -153369,9 +147454,9 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 432, &leftDelimiter); + ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 356, &leftDelimiter); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 432, &rightDelimiter); + ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 356, &rightDelimiter); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SVSVVSVS(&_4, "/", &ldS, "([^", &ldS, &rdS, "]+)", &rdS, "/"); @@ -153401,16 +147486,16 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_INIT_NVAR(&words); zephir_fast_explode(&words, &separator, &_9$$6, LONG_MAX); ZEPHIR_OBS_NVAR(&word); - ZEPHIR_CALL_FUNCTION(&_10$$6, "array_rand", &_11, 215, &words); + ZEPHIR_CALL_FUNCTION(&_10$$6, "array_rand", &_11, 196, &words); zephir_check_call_status(); zephir_array_fetch(&word, &words, &_10$$6, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62); zephir_array_fetch_long(&_12$$6, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63); - ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 432, &_12$$6, &separator); + ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 356, &_12$$6, &separator); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$6); ZEPHIR_CONCAT_SVS(&_13$$6, "/", &sub, "/"); ZVAL_LONG(&_14$$6, 1); - ZEPHIR_CALL_FUNCTION(&_15$$6, "preg_replace", &_16, 50, &_13$$6, &word, &text, &_14$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "preg_replace", &_16, 37, &_13$$6, &word, &text, &_14$$6); zephir_check_call_status(); zephir_get_strval(&text, &_15$$6); } ZEND_HASH_FOREACH_END(); @@ -153436,16 +147521,16 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_INIT_NVAR(&words); zephir_fast_explode(&words, &separator, &_18$$8, LONG_MAX); ZEPHIR_OBS_NVAR(&word); - ZEPHIR_CALL_FUNCTION(&_19$$8, "array_rand", &_11, 215, &words); + ZEPHIR_CALL_FUNCTION(&_19$$8, "array_rand", &_11, 196, &words); zephir_check_call_status(); zephir_array_fetch(&word, &words, &_19$$8, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62); zephir_array_fetch_long(&_20$$8, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63); - ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 432, &_20$$8, &separator); + ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 356, &_20$$8, &separator); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_21$$8); ZEPHIR_CONCAT_SVS(&_21$$8, "/", &sub, "/"); ZVAL_LONG(&_22$$8, 1); - ZEPHIR_CALL_FUNCTION(&_23$$8, "preg_replace", &_16, 50, &_21$$8, &word, &text, &_22$$8); + ZEPHIR_CALL_FUNCTION(&_23$$8, "preg_replace", &_16, 37, &_21$$8, &word, &text, &_22$$8); zephir_check_call_status(); zephir_get_strval(&text, &_23$$8); ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0); @@ -153706,7 +147791,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, __invoke) ZVAL_STRING(&_4, "/[^a-zA-Z0-9\\/_|+ -]/"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ""); - ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 50, &_4, &_5, &text); + ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 37, &_4, &_5, &text); zephir_check_call_status(); if (lowercase) { ZEPHIR_INIT_VAR(&_6$$5); @@ -153715,7 +147800,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, __invoke) } ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "/[\\/_|+ -]+/"); - ZEPHIR_CALL_FUNCTION(&_7, "preg_replace", NULL, 50, &_4, &separator, &friendly); + ZEPHIR_CALL_FUNCTION(&_7, "preg_replace", NULL, 37, &_4, &separator, &friendly); zephir_check_call_status(); ZEPHIR_CPY_WRT(&friendly, &_7); zephir_fast_trim(return_value, &friendly, &separator, ZEPHIR_TRIM_BOTH); @@ -153950,7 +148035,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Humanize, __invoke) ZVAL_STRING(&_1, "#[_-]+#"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, " "); - ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &_1, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 37, &_1, &_2, &_0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); if (Z_TYPE_P(&result) == IS_NULL) { @@ -154004,7 +148089,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Includes, __invoke) zephir_get_strval(&needle, needle_param); - ZEPHIR_CALL_FUNCTION(&_0, "mb_strpos", NULL, 0, &haystack, &needle); + ZEPHIR_CALL_FUNCTION(&_0, "mb_strpos", NULL, 82, &haystack, &needle); zephir_check_call_status(); RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0)); } @@ -154506,7 +148591,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Len, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 250, &text, &encoding); + ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 229, &text, &encoding); zephir_check_call_status(); RETURN_MM(); } @@ -154618,8 +148703,8 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, __invoke) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_2__closure_ce, SL("__invoke")); - ZEPHIR_CALL_FUNCTION(&output, "array_map", NULL, 97, &_0, &exploded); + zephir_create_closure_ex(&_0, NULL, phalcon_0__closure_ce, SL("__invoke")); + ZEPHIR_CALL_FUNCTION(&output, "array_map", NULL, 66, &_0, &exploded); zephir_check_call_status(); zephir_fast_join_str(return_value, SL(""), &output); RETURN_MM(); @@ -154715,7 +148800,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, processArray) ZEPHIR_CONCAT_SVS(&_10, "/[", &delimiters, "]+/"); ZVAL_LONG(&_11, -1); ZVAL_LONG(&_12, (2 | 1)); - ZEPHIR_CALL_FUNCTION(&result, "preg_split", NULL, 98, &_10, &text, &_11, &_12); + ZEPHIR_CALL_FUNCTION(&result, "preg_split", NULL, 67, &_10, &text, &_11, &_12); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_13); if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) { @@ -154876,61 +148961,61 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_Random, __invoke) ZVAL_STRING(&_3, "a"); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "z"); - ZEPHIR_CALL_FUNCTION(&_5, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "A"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "Z"); - ZEPHIR_CALL_FUNCTION(&_6, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_6, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); zephir_fast_array_merge(&_2, &_5, &_6); zephir_array_update_long(&pools, 1, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZEPHIR_INIT_NVAR(&_2); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_9, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_9, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "a"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "f"); - ZEPHIR_CALL_FUNCTION(&_10, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_10, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); zephir_fast_array_merge(&_2, &_9, &_10); zephir_array_update_long(&pools, 2, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); zephir_array_update_long(&pools, 3, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 1); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); zephir_array_update_long(&pools, 4, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "2345679ACDEFHJKLMNPRSTUVWXYZ"); - ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 115, &_2); + ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 84, &_2); zephir_check_call_status(); zephir_array_update_long(&pools, 5, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "a"); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "z"); - ZEPHIR_CALL_FUNCTION(&_12, "range", NULL, 331, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_12, "range", NULL, 313, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "A"); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Z"); - ZEPHIR_CALL_FUNCTION(&_13, "range", NULL, 331, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_13, "range", NULL, 313, &_2, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_14, "array_merge", NULL, 348, &_11, &_12, &_13); + ZEPHIR_CALL_FUNCTION(&_14, "array_merge", NULL, 330, &_11, &_12, &_13); zephir_check_call_status(); zephir_array_update_long(&pools, 0, &_14, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); zephir_array_fetch_long(&_15, &pools, type, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Random.zep", 66); @@ -154994,7 +149079,7 @@ static PHP_METHOD(Phalcon_Support_Helper_Str_ReduceSlashes, __invoke) ZVAL_STRING(&_0, "#(?= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, &data); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); +} + static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable) { zend_bool _0, _1; @@ -157113,44 +151245,60 @@ static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable) zephir_fetch_params_without_memory_grow(1, 0, &data); - _0 = ZEPHIR_IS_EMPTY(data); + _0 = Z_TYPE_P(data) == IS_NULL; if (!(_0)) { - _0 = ((Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE) == 1); + _0 = 1 == (Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE); } _1 = _0; if (!(_1)) { - _1 = zephir_is_numeric(data); + _1 = 1 == zephir_is_numeric(data); } RETURN_BOOL(!(_1)); } -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData) +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __serialize) { + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - RETURN_MEMBER(getThis(), "data"); + ZEPHIR_MM_GROW(); + + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_ARRAY) { + RETURN_MM_MEMBER(getThis(), "data"); + } + array_init(return_value); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData) +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize) { - zval *data, data_sub; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *data_param = NULL; + zval data; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&data); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + Z_PARAM_ARRAY(data) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &data); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); + ZEPHIR_MM_RESTORE(); } @@ -157186,11 +151334,11 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize) ZEPHIR_OBS_VAR(&_0); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC); if (Z_TYPE_P(&_0) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the serializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 32); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the serializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 27); return; } zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -157199,11 +151347,16 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; + zval data_sub, __$true, __$false, result, _0, _1; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -157216,16 +151369,65 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize) zephir_fetch_params(1, 1, 0, &data); - if (Z_TYPE_P(data) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 50); + ZEPHIR_INIT_VAR(&_0); + zephir_gettype(&_0, data); + if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "string")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 47); return; } - ZEPHIR_CALL_FUNCTION(&_0, "base64_decode", NULL, 244, data); + ZVAL_BOOL(&_1, 1); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpbase64decode", NULL, 0, data, &_1); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0); + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); ZEPHIR_MM_RESTORE(); } +static PHP_METHOD(Phalcon_Storage_Serializer_Base64, phpBase64Decode) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zend_bool strict; + zval *input_param = NULL, *strict_param = NULL, _0; + zval input; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&input); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(input) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(strict) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &input_param, &strict_param); + zephir_get_strval(&input, input_param); + if (!strict_param) { + strict = 0; + } else { + strict = zephir_get_boolval(strict_param); + } + + + ZVAL_BOOL(&_0, (strict ? 1 : 0)); + ZEPHIR_RETURN_CALL_FUNCTION("base64_decode", NULL, 225, &input, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + @@ -157245,11 +151447,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary) static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize) { - zval _0, _1, _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval __$true, __$false, result, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); @@ -157264,30 +151469,42 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize) RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 0, &_2); + ZEPHIR_CALL_METHOD(&result, this_ptr, "doserialize", NULL, 0, &_2); zephir_check_call_status(); - RETURN_MM(); + if (UNEXPECTED(Z_TYPE_P(&result) == IS_NULL)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + RETURN_CCTOR(&result); } static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize) { + zend_bool _8$$4; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4; + zval data_sub, __$false, __$true, result, version, _0, _1$$4, _2$$4, _3$$4, _4$$5, _5$$5, _6$$6, _7$$6; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&version); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$6); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -157300,39 +151517,130 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize) zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "8.0"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ">="); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 88, &version, &_0, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_create_closure_ex(&_3$$3, NULL, phalcon_11__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$3, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$3, &_4$$3); - zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); } else { - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_NVAR(&_5$$4); - zephir_create_closure_ex(&_5$$4, NULL, phalcon_12__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$4, &_6$$4); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "8.0"); + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, ">="); + ZEPHIR_CALL_FUNCTION(&_3$$4, "version_compare", NULL, 128, &version, &_1$$4, &_2$$4); + zephir_check_call_status(); + if (zephir_is_true(&_3$$4)) { + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_INIT_NVAR(&_4$$5); + zephir_create_closure_ex(&_4$$5, NULL, phalcon_3__closure_ce, SL("__invoke")); + ZVAL_LONG(&_5$$5, 2); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_4$$5, &_5$$5); + zephir_check_call_status(); + } else { + ZEPHIR_INIT_VAR(&_6$$6); + ZEPHIR_INIT_NVAR(&_6$$6); + zephir_create_closure_ex(&_6$$6, NULL, phalcon_4__closure_ce, SL("__invoke")); + ZVAL_LONG(&_7$$6, 2); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_6$$6, &_7$$6); + zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(&result, this_ptr, "dounserialize", NULL, 0, data); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); + zephir_check_call_status(); + _8$$4 = ZEPHIR_GLOBAL(warning).enable; + if (!(_8$$4)) { + _8$$4 = ZEPHIR_IS_FALSE_IDENTICAL(&result); + } + if (UNEXPECTED(_8$$4)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); } - ZEPHIR_CALL_FUNCTION(&_7, "igbinary_unserialize", NULL, 0, data); + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 135, value); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doSerialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpigbinaryserialize", NULL, 0, value); zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_unserialize", NULL, 136, value); + zephir_check_call_status(); + RETURN_MM(); } @@ -157385,16 +151693,16 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize) object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SS(&_4$$3, "Data for the JSON serializer cannot be of type 'object' ", "without implementing 'JsonSerializable'"); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_4$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 34); + zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 29); ZEPHIR_MM_RESTORE(); return; } zephir_read_property(&_6, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_5, this_ptr, "isserializable", NULL, 0, &_6); zephir_check_call_status(); - if (!(zephir_is_true(&_5))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5)) { RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_7, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); @@ -157407,11 +151715,13 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; + zval data_sub, _0, _1$$4; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -157424,9 +151734,15 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize) zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdecode", NULL, 0, data); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + } else { + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getdecode", NULL, 0, data); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_1$$4); + } ZEPHIR_MM_RESTORE(); } @@ -157493,18 +151809,18 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, getDecode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$3, "phalcon/Storage/Serializer/Json.zep", 73); + zephir_throw_exception_debug(&_4$$3, "phalcon/Storage/Serializer/Json.zep", 71); ZEPHIR_MM_RESTORE(); return; } @@ -157555,18 +151871,18 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, getEncode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 95); + zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 92); ZEPHIR_MM_RESTORE(); return; } @@ -157583,103 +151899,114 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, getEncode) +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedIgbinary) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedIgbinary, phalcon, storage_serializer_memcachedigbinary, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedJson) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedJson, phalcon, storage_serializer_memcachedjson, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedPhp) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedPhp, phalcon, storage_serializer_memcachedphp, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_msgpack_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_igbinary_ce, phalcon_storage_serializer_msgpack_method_entry, 0); return SUCCESS; } -static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize) +static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doSerialize) { - zval _0, _1, _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub, _0; zval *this_ptr = getThis(); + ZVAL_UNDEF(&value_sub); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); - zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1); - zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_2); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); } -static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize) +static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doUnserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4; + zval *value, value_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&version); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&value_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); + zephir_fetch_params(1, 1, 0, &value); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "8.0"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ">="); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 88, &version, &_0, &_1); - zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_create_closure_ex(&_3$$3, NULL, phalcon_13__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$3, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$3, &_4$$3); - zephir_check_call_status(); - } else { - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_NVAR(&_5$$4); - zephir_create_closure_ex(&_5$$4, NULL, phalcon_14__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$4, &_6$$4); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_7, "msgpack_unpack", NULL, 0, data); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_unpack", NULL, 0, value); zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } @@ -157710,7 +152037,8 @@ static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize) static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize) { - zval *data, data_sub; + zval data_sub; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); @@ -157762,7 +152090,7 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize) zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); @@ -157773,12 +152101,26 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize) static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize) { + zend_bool _8; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub; + zval data_sub, __$false, __$true, result, version, _0, _1, _2, _3, _4$$4, _5$$4, _6$$5, _7$$5; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -157791,115 +152133,177 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize) zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processserializable", NULL, 0, data); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + RETURN_MM_NULL(); + } + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processnotserializable", NULL, 0, data); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "8.0"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, ">="); + ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 128, &version, &_1, &_2); zephir_check_call_status(); + if (zephir_is_true(&_3)) { + ZEPHIR_INIT_VAR(&_4$$4); + ZEPHIR_INIT_NVAR(&_4$$4); + zephir_create_closure_ex(&_4$$4, NULL, phalcon_11__closure_ce, SL("__invoke")); + ZVAL_LONG(&_5$$4, 8); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_4$$4, &_5$$4); + zephir_check_call_status(); + } else { + ZEPHIR_INIT_VAR(&_6$$5); + ZEPHIR_INIT_NVAR(&_6$$5); + zephir_create_closure_ex(&_6$$5, NULL, phalcon_12__closure_ce, SL("__invoke")); + ZVAL_LONG(&_7$$5, 8); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_6$$5, &_7$$5); + zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpunserialize", NULL, 0, data); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); + zephir_check_call_status(); + _8 = ZEPHIR_GLOBAL(warning).enable; + if (!(_8)) { + _8 = ZEPHIR_IS_FALSE_IDENTICAL(&result); + } + if (UNEXPECTED(_8)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Storage_Serializer_Php, processSerializable) +static PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1$$3, _2$$3, _3$$3, _8$$3, _4$$5, _5$$5, _6$$6, _7$$6; + zval options; + zval *data_param = NULL, *options_param = NULL; + zval data; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&version); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$6); - ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(data) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); + zephir_fetch_params(1, 1, 1, &data_param, &options_param); + zephir_get_strval(&data, data_param); + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); + } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); + ZEPHIR_RETURN_CALL_FUNCTION("unserialize", NULL, 16, &data, &options); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - if (Z_TYPE_P(data) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Php.zep", 54); - return; - } - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, "8.0"); - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, ">="); - ZEPHIR_CALL_FUNCTION(&_3$$3, "version_compare", NULL, 88, &version, &_1$$3, &_2$$3); - zephir_check_call_status(); - if (zephir_is_true(&_3$$3)) { - ZEPHIR_INIT_VAR(&_4$$5); - ZEPHIR_INIT_NVAR(&_4$$5); - zephir_create_closure_ex(&_4$$5, NULL, phalcon_15__closure_ce, SL("__invoke")); - ZVAL_LONG(&_5$$5, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_4$$5, &_5$$5); - zephir_check_call_status(); - } else { - ZEPHIR_INIT_VAR(&_6$$6); - ZEPHIR_INIT_NVAR(&_6$$6); - zephir_create_closure_ex(&_6$$6, NULL, phalcon_16__closure_ce, SL("__invoke")); - ZVAL_LONG(&_7$$6, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_6$$6, &_7$$6); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_8$$3, "unserialize", NULL, 16, data); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_8$$3); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); - } - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Storage_Serializer_Php, processNotSerializable) + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary) { - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; - zval *this_ptr = getThis(); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisIgbinary, phalcon, storage_serializer_redisigbinary, phalcon_storage_serializer_none_ce, NULL, 0); - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); - } - ZEPHIR_MM_RESTORE(); + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisJson, phalcon, storage_serializer_redisjson, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisMsgpack, phalcon, storage_serializer_redismsgpack, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisNone, phalcon, storage_serializer_redisnone, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisPhp, phalcon, storage_serializer_redisphp, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; } @@ -158044,6 +152448,47 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, delete) static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, get) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + ZEPHIR_CALL_METHOD(&content, this_ptr, "doget", NULL, 0, &key); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); + zephir_check_call_status(); + RETURN_MM(); } static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter) @@ -158109,6 +152554,36 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer) ZEPHIR_MM_RESTORE(); } +static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys) { zval results; @@ -158162,14 +152637,14 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys) ZEPHIR_CPY_WRT(&_1, keys); } ZEPHIR_CPY_WRT(keys, &_1); - zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 236); + zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 257); if (Z_TYPE_P(keys) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _2) { ZEPHIR_INIT_NVAR(&key); ZVAL_COPY(&key, _2); if (zephir_start_with(&key, &pattern, NULL)) { - zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 232); + zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 253); } } ZEND_HASH_FOREACH_END(); } else { @@ -158184,7 +152659,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys) ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); zephir_check_call_status(); if (zephir_start_with(&key, &pattern, NULL)) { - zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 232); + zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 253); } ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); zephir_check_call_status(); @@ -158248,9 +152723,8 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData) ZEPHIR_SEPARATE_PARAM(content); - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC); - if (1 != ZEPHIR_IS_EMPTY(&_0)) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) != IS_NULL) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_1$$3, "setdata", NULL, 0, content); zephir_check_call_status(); @@ -158313,15 +152787,17 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content = NULL, content_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$4, _2$$4; + zval *content = NULL, content_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$3, _2$$3, _3$$3, _4$$3; zval *this_ptr = getThis(); ZVAL_UNDEF(&content_sub); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -158341,18 +152817,20 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData) } - if (!(zephir_is_true(content))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC); - if (1 != ZEPHIR_IS_EMPTY(&_0)) { - zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "unserialize", NULL, 0, content); + zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) != IS_NULL) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "unserialize", NULL, 0, content); zephir_check_call_status(); - zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(content, &_2$$4, "getdata", NULL, 0); + zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "issuccess", NULL, 0); + zephir_check_call_status(); + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3))) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(content, &_4$$3, "getdata", NULL, 0); zephir_check_call_status(); } RETVAL_ZVAL(content, 1, 0); @@ -158591,9 +153069,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear) zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&pattern); ZEPHIR_CONCAT_SVS(&pattern, "/^", &_0, "/"); - ZEPHIR_INIT_NVAR(&apc); - object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator"))); - ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern); + ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern); zephir_check_call_status(); result = 1; if (Z_TYPE_P(&apc) != IS_OBJECT) { @@ -158605,10 +153081,10 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear) { ZEPHIR_ITERATOR_COPY(&item, _1); } - zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 63); - ZEPHIR_CALL_FUNCTION(&_3$$4, "apcu_delete", &_4, 126, &_2$$4); + zephir_array_fetch_string(&_3$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 63); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "phpapcudelete", &_4, 0, &_3$$4); zephir_check_call_status(); - if (!(zephir_is_true(&_3$$4))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_2$$4)) { result = 0; } } @@ -158658,7 +153134,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 127, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcudec", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -158667,12 +153143,13 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, _0; + zval *key_param = NULL, _0, _1; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -158694,60 +153171,11 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 126, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&content, "apcu_fetch", NULL, 128, &_0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpapcudelete", NULL, 0, &_1); zephir_check_call_status(); - RETURN_MM(); + RETURN_MM_BOOL(zephir_get_boolval(&_0)); } static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys) @@ -158799,9 +153227,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys) zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&pattern); ZEPHIR_CONCAT_SVVS(&pattern, "/^", &_0, &prefix, "/"); - ZEPHIR_INIT_NVAR(&apc); - object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator"))); - ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern); + ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern); zephir_check_call_status(); ZEPHIR_INIT_VAR(&results); array_init(&results); @@ -158814,8 +153240,8 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys) { ZEPHIR_ITERATOR_COPY(&item, _1); } - zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 134); - zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 134); + zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 117); + zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 117); } zend_iterator_dtor(_1); RETURN_CTOR(&results); @@ -158856,7 +153282,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_exists", NULL, 129, &_0); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcuexists", NULL, 0, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { @@ -158909,7 +153335,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 130, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcuinc", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -158975,7 +153401,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3, this_ptr, "getttl", NULL, 0, ttl); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_store", NULL, 131, &_1, &_2, &_3); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { @@ -159026,10 +153452,10 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_store", NULL, 131, &_0, &_1); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); - if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { + if ((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE)) { ZEPHIR_CPY_WRT(&_2, &result); } else { ZVAL_BOOL(&_2, 0); @@ -159037,6 +153463,287 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever) RETURN_CCTOR(&_2); } +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcufetch", NULL, 0, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDec) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long step, ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *step_param = NULL, *success = NULL, success_sub, *ttl_param = NULL, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(step) + Z_PARAM_ZVAL_OR_NULL(success) + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 3, &key, &step_param, &success, &ttl_param); + if (!step_param) { + step = 1; + } else { + step = zephir_get_intval(step_param); + } + if (!success) { + success = &success_sub; + success = &__$null; + } + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, step); + ZVAL_LONG(&_1, ttl); + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 98, key, &_0, success, &_1); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDelete) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key); + + + ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 99, key); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key); + + + ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 100, key); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuInc) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long step, ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *step_param = NULL, *success = NULL, success_sub, *ttl_param = NULL, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(step) + Z_PARAM_ZVAL_OR_NULL(success) + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 3, &key, &step_param, &success, &ttl_param); + if (!step_param) { + step = 1; + } else { + step = zephir_get_intval(step_param); + } + if (!success) { + success = &success_sub; + success = &__$null; + } + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, step); + ZVAL_LONG(&_1, ttl); + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 101, key, &_0, success, &_1); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuFetch) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *success = NULL, success_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(success) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key, &success); + if (!success) { + success = &success_sub; + success = &__$null; + } + + + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 102, key, success); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuIterator) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *pattern_param = NULL; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(pattern) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &pattern_param); + zephir_get_strval(&pattern, pattern_param); + + + object_init_ex(return_value, zephir_get_internal_ce(SL("apcuiterator"))); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &pattern); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuStore) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *payload, payload_sub, *ttl_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&payload_sub); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_ZVAL(key) + Z_PARAM_ZVAL(payload) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &key, &payload, &ttl_param); + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, ttl); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 103, key, payload, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + @@ -159210,55 +153917,6 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete) RETURN_MM(); } -static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_1, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -159353,14 +154011,14 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter) ZEPHIR_INIT_NVAR(&_7$$4); zephir_fast_array_merge(&_7$$4, &failover, &client); ZEPHIR_CPY_WRT(&client, &_7$$4); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "setoptions", NULL, 132, &connection, &client); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "setoptions", NULL, 104, &connection, &client); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10$$4, &_9$$4, "setservers", NULL, 133, &connection, &servers); + ZEPHIR_CALL_METHOD(&_10$$4, &_9$$4, "setservers", NULL, 105, &connection, &servers); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_10$$4, "setsasl", NULL, 134, &connection, &saslUser, &saslPass); + ZEPHIR_CALL_METHOD(NULL, &_10$$4, "setsasl", NULL, 106, &connection, &saslUser, &saslPass); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 135, &connection); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 107, &connection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection); } @@ -159640,7 +154298,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setOptions) ZEPHIR_CALL_METHOD(&_0, connection, "setoptions", NULL, 0, &client); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 266); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 253); return; } RETURN_THIS(); @@ -159709,9 +154367,9 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer) ZEPHIR_INIT_VAR(&map); zephir_create_array(&map, 3, 0); - add_assoc_long_ex(&map, SL("php"), 1); - add_assoc_long_ex(&map, SL("json"), 3); - add_assoc_long_ex(&map, SL("igbinary"), 2); + add_assoc_long_ex(&map, SL("memcached_igbinary"), 2); + add_assoc_long_ex(&map, SL("memcached_json"), 3); + add_assoc_long_ex(&map, SL("memcached_php"), 1); zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&serializer); zephir_fast_strtolower(&serializer, &_0); @@ -159720,7 +154378,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer) ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, ""); zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_1$$3); - zephir_array_fetch(&_2$$3, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Libmemcached.zep", 312); + zephir_array_fetch(&_2$$3, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Libmemcached.zep", 299); ZVAL_LONG(&_3$$3, -1003); ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_3$$3, &_2$$3); zephir_check_call_status(); @@ -159758,7 +154416,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setServers) ZEPHIR_CALL_METHOD(&_0, connection, "addservers", NULL, 0, &servers); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 330); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 317); return; } RETURN_THIS(); @@ -159843,231 +154501,17 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *value_param = NULL, current, prefixedKey, result, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(¤t); - ZVAL_UNDEF(&prefixedKey); - ZVAL_UNDEF(&result); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &value_param); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!value_param) { - value = 1; - } else { - value = zephir_get_intval(value_param); - } - - - ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!(zephir_array_isset_fetch(¤t, &_0, &prefixedKey, 1)))) { - RETURN_MM_BOOL(0); - } - ZEPHIR_INIT_VAR(&result); - ZVAL_LONG(&result, (zephir_get_intval(¤t) - value)); - zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &result); - RETURN_CCTOR(&result); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete) -{ - zend_bool exists = 0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, prefixedKey, _0, _1; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&prefixedKey); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key_param); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - - - ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - exists = zephir_array_isset(&_0, &prefixedKey); - zephir_unset_property_array(this_ptr, ZEND_STRL("data"), &prefixedKey); - zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - zephir_array_unset(&_1, &prefixedKey, PH_SEPARATE); - RETURN_MM_BOOL(exists); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, prefixedKey, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&prefixedKey); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - zephir_get_strval(&key, key_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_OBS_VAR(&content); - zephir_array_fetch(&content, &_0, &prefixedKey, PH_NOISY, "phalcon/Storage/Adapter/Memory.zep", 112); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, _0, _1; - zval prefix; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&prefix); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(prefix) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &prefix_param); - if (!prefix_param) { - ZEPHIR_INIT_VAR(&prefix); - ZVAL_STRING(&prefix, ""); - } else { - zephir_get_strval(&prefix, prefix_param); - } - - - ZEPHIR_INIT_VAR(&_0); - zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - zephir_array_keys(&_0, &_1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_0, &prefix); - zephir_check_call_status(); - RETURN_MM(); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, prefixedKey, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&prefixedKey); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key_param); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - - - ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - RETURN_MM_BOOL(zephir_array_isset(&_0, &prefixedKey)); -} - -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *value_param = NULL, current, prefixedKey, result, _0; + zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&newValue); ZVAL_UNDEF(&prefixedKey); ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -160099,12 +154543,196 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment) ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!(zephir_array_isset_fetch(¤t, &_0, &prefixedKey, 1)))) { - RETURN_MM_BOOL(0); + ZEPHIR_INIT_VAR(&result); + ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey)); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 72); + ZEPHIR_INIT_VAR(&newValue); + ZVAL_LONG(&newValue, (zephir_get_intval(¤t) - value)); + ZEPHIR_CPY_WRT(&result, &newValue); + zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue); + } + RETURN_CCTOR(&result); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, exists, prefixedKey, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&exists); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { + zephir_get_strval(&key, key_param); + } else { + ZEPHIR_INIT_VAR(&key); + } + + + ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&exists); + ZVAL_BOOL(&exists, zephir_array_key_exists(&_0, &prefixedKey)); + zephir_unset_property_array(this_ptr, ZEND_STRL("data"), &prefixedKey); + zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1, &prefixedKey, PH_SEPARATE); + RETURN_CCTOR(&exists); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *prefix_param = NULL, _0, _1; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_STR(prefix) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &prefix_param); + if (!prefix_param) { + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); + } else { + zephir_get_strval(&prefix, prefix_param); + } + + + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_keys(&_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getfilteredkeys", NULL, 0, &_0, &prefix); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, prefixedKey, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { + zephir_get_strval(&key, key_param); + } else { + ZEPHIR_INIT_VAR(&key); + } + + + ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_key_exists(&_0, &prefixedKey)); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long value, ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&newValue); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key_param, &value_param); + if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { + zephir_get_strval(&key, key_param); + } else { + ZEPHIR_INIT_VAR(&key); } + if (!value_param) { + value = 1; + } else { + value = zephir_get_intval(value_param); + } + + + ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&result); - ZVAL_LONG(&result, (zephir_get_intval(¤t) + value)); - zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &result); + ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey)); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 145); + ZEPHIR_INIT_VAR(&newValue); + ZVAL_LONG(&newValue, (zephir_get_intval(¤t) + value)); + ZEPHIR_CPY_WRT(&result, &newValue); + zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue); + } RETURN_CCTOR(&result); } @@ -160205,6 +154833,38 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Memory, setForever) RETURN_MM(); } +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 206); + RETURN_CTOR(&_1); +} + zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type) { zval _0, _2, _1$$3, _3$$4; @@ -160487,55 +155147,6 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete) RETURN_MM_BOOL(zephir_get_boolval(&_1)); } -static PHP_METHOD(Phalcon_Storage_Adapter_Redis, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_1, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter) { zval connection, _0, _1$$3, _2$$3, _3$$3, _4$$3; @@ -160559,17 +155170,17 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter) object_init_ex(&connection, zephir_get_internal_ce(SL("redis"))); ZEPHIR_CALL_METHOD(NULL, &connection, "__construct", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkconnect", NULL, 136, &connection); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkconnect", NULL, 108, &connection); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "checkauth", NULL, 137, &connection); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "checkauth", NULL, 109, &connection); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "checkindex", NULL, 138, &connection); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "checkindex", NULL, 110, &connection); zephir_check_call_status(); zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_4$$3, 2); ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_4$$3, &_3$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 139, &connection); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 111, &connection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection); } @@ -160863,7 +155474,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkAuth) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&auth); - zephir_array_fetch_string(&auth, &_0, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 244); + zephir_array_fetch_string(&auth, &_0, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 231); /* try_start_1: */ @@ -160889,7 +155500,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkAuth) } } if (error) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 255); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 242); return; } RETURN_THIS(); @@ -160935,16 +155546,16 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&options, &_0); ZEPHIR_OBS_VAR(&host); - zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 273); + zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 260); ZEPHIR_OBS_VAR(&port); - zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 274); + zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 261); ZEPHIR_OBS_VAR(&timeout); - zephir_array_fetch_string(&timeout, &options, SL("timeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 275); + zephir_array_fetch_string(&timeout, &options, SL("timeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 262); ZEPHIR_OBS_VAR(&retryInterval); - zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 276); + zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 263); ZEPHIR_OBS_VAR(&readTimeout); - zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 277); - zephir_array_fetch_string(&_1, &options, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 279); + zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 264); + zephir_array_fetch_string(&_1, &options, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 266); ZEPHIR_INIT_VAR(&method); ZEPHIR_INIT_VAR(¶meter); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { @@ -160954,11 +155565,11 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) ZVAL_STRING(&method, "pconnect"); zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&persistentId); - zephir_array_fetch_string(&persistentId, &_2$$4, SL("persistentId"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 284); + zephir_array_fetch_string(&persistentId, &_2$$4, SL("persistentId"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 271); if (!(ZEPHIR_IS_EMPTY(&persistentId))) { ZEPHIR_CPY_WRT(¶meter, &persistentId); } else { - zephir_array_fetch_string(&_3$$4, &options, SL("index"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 285); + zephir_array_fetch_string(&_3$$4, &options, SL("index"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 272); ZEPHIR_CONCAT_SV(¶meter, "persistentId", &_3$$4); } } @@ -160969,11 +155580,11 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) object_init_ex(&_4$$5, phalcon_storage_exception_ce); ZEPHIR_INIT_VAR(&_5$$5); ZVAL_STRING(&_5$$5, "Could not connect to the Redisd server [%s:%s]"); - ZEPHIR_CALL_FUNCTION(&_6$$5, "sprintf", NULL, 140, &_5$$5, &host, &port); + ZEPHIR_CALL_FUNCTION(&_6$$5, "sprintf", NULL, 112, &_5$$5, &host, &port); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 31, &_6$$5); + ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 29, &_6$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$5, "phalcon/Storage/Adapter/Redis.zep", 304); + zephir_throw_exception_debug(&_4$$5, "phalcon/Storage/Adapter/Redis.zep", 291); ZEPHIR_MM_RESTORE(); return; } @@ -161006,7 +155617,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkIndex) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&index); - zephir_array_fetch_string(&index, &_0, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 320); + zephir_array_fetch_string(&index, &_0, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 307); _1 = ZEPHIR_GT_LONG(&index, 0); if (_1) { ZEPHIR_CALL_METHOD(&_2, connection, "select", NULL, 0, &index); @@ -161014,7 +155625,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkIndex) _1 = !ZEPHIR_IS_TRUE_IDENTICAL(&_2); } if (_1) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 325); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 312); return; } RETURN_THIS(); @@ -161059,40 +155670,40 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer) ZEPHIR_INIT_VAR(&map); zephir_create_array(&map, 2, 0); - add_assoc_long_ex(&map, SL("none"), 0); - add_assoc_long_ex(&map, SL("php"), 1); + add_assoc_long_ex(&map, SL("redis_none"), 0); + add_assoc_long_ex(&map, SL("redis_php"), 1); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_IGBINARY"); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "\\Redis::SERIALIZER_IGBINARY"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "constant", NULL, 142, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "constant", NULL, 114, &_2$$3); zephir_check_call_status(); - zephir_array_update_string(&map, SL("igbinary"), &_3$$3, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_igbinary"), &_3$$3, PH_COPY | PH_SEPARATE); } ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_MSGPACK"); - ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_VAR(&_5$$4); ZVAL_STRING(&_5$$4, "\\Redis::SERIALIZER_MSGPACK"); - ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 142, &_5$$4); + ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 114, &_5$$4); zephir_check_call_status(); - zephir_array_update_string(&map, SL("msgpack"), &_6$$4, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_msgpack"), &_6$$4, PH_COPY | PH_SEPARATE); } ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_JSON"); - ZEPHIR_CALL_FUNCTION(&_7, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_7, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_7)) { ZEPHIR_INIT_VAR(&_8$$5); ZVAL_STRING(&_8$$5, "\\Redis::SERIALIZER_JSON"); - ZEPHIR_CALL_FUNCTION(&_9$$5, "constant", NULL, 142, &_8$$5); + ZEPHIR_CALL_FUNCTION(&_9$$5, "constant", NULL, 114, &_8$$5); zephir_check_call_status(); - zephir_array_update_string(&map, SL("json"), &_9$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_json"), &_9$$5, PH_COPY | PH_SEPARATE); } zephir_read_property(&_10, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&serializer); @@ -161102,7 +155713,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer) ZEPHIR_INIT_NVAR(&_11$$6); ZVAL_STRING(&_11$$6, ""); zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_11$$6); - zephir_array_fetch(&_12$$6, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 367); + zephir_array_fetch(&_12$$6, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 354); ZVAL_LONG(&_13$$6, 1); ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_13$$6, &_12$$6); zephir_check_call_status(); @@ -161176,7 +155787,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, __construct) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "The 'storageDir' must be specified in the options", "phalcon/Storage/Adapter/Stream.zep", 63); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getdirseparator", NULL, 143, &storageDir); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getdirseparator", NULL, 115, &storageDir); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("storageDir"), &_2); ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_stream_ce, getThis(), "__construct", &_3, 0, factory, &options); @@ -161212,9 +155823,9 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) result = 1; zephir_read_property(&_0, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdirseparator", NULL, 143, &_0); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdirseparator", NULL, 115, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 144, &directory); + ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 116, &directory); zephir_check_call_status(); zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 94); if (Z_TYPE_P(&iterator) == IS_ARRAY) { @@ -161224,15 +155835,15 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) ZVAL_COPY(&file, _1); ZEPHIR_CALL_METHOD(&_3$$3, &file, "isfile", NULL, 0); zephir_check_call_status(); - _4$$3 = zephir_is_true(&_3$$3); + _4$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3); if (_4$$3) { - ZEPHIR_CALL_METHOD(&_5$$3, &file, "getpathname", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$3, &file, "getpathname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$3, "unlink", &_7, 145, &_5$$3); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "phpunlink", &_7, 0, &_6$$3); zephir_check_call_status(); - _4$$3 = !zephir_is_true(&_6$$3); + _4$$3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3); } - if (_4$$3) { + if (UNEXPECTED(_4$$3)) { result = 0; } } ZEND_HASH_FOREACH_END(); @@ -161249,15 +155860,15 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$5, &file, "isfile", NULL, 0); zephir_check_call_status(); - _9$$5 = zephir_is_true(&_8$$5); + _9$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_8$$5); if (_9$$5) { - ZEPHIR_CALL_METHOD(&_10$$5, &file, "getpathname", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$5, &file, "getpathname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_11$$5, "unlink", &_7, 145, &_10$$5); + ZEPHIR_CALL_METHOD(&_10$$5, this_ptr, "phpunlink", &_7, 0, &_11$$5); zephir_check_call_status(); - _9$$5 = !zephir_is_true(&_11$$5); + _9$$5 = !ZEPHIR_IS_TRUE_IDENTICAL(&_10$$5); } - if (_9$$5) { + if (UNEXPECTED(_9$$5)) { result = 0; } ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0); @@ -161272,12 +155883,13 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS, _1; - zval *key_param = NULL, *value_param = NULL, data, _0; + zval *key_param = NULL, *value_param = NULL, data, result, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&data); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -161309,7 +155921,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key); @@ -161317,9 +155929,12 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) _1 = (zephir_get_intval(&data) - value); ZEPHIR_INIT_NVAR(&data); ZVAL_LONG(&data, _1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data); + ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data); zephir_check_call_status(); - RETURN_MM(); + if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + ZEPHIR_CPY_WRT(&result, &data); + } + RETURN_CCTOR(&result); } static PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete) @@ -161356,12 +155971,12 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 145, &filepath); + ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 118, &filepath); zephir_check_call_status(); RETURN_MM(); } @@ -161410,17 +156025,17 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, get) } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); zephir_check_call_status(); if (1 != (zephir_file_exists(&filepath) == SUCCESS)) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 147, &filepath); + ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 119, &filepath); zephir_check_call_status(); _0 = ZEPHIR_IS_EMPTY(&payload); if (!(_0)) { - ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 148, &payload); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 120, &payload); zephir_check_call_status(); _0 = zephir_is_true(&_1); } @@ -161442,7 +156057,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) zval files; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, directory, file, iterator, *_0, _1, _2$$4, _3$$5, _4$$5, _5$$5, _6$$6, _7$$7, _8$$7, _9$$7; + zval *prefix_param = NULL, directory, file, iterator, _0, *_1, _2, _3$$4, _4$$5, _5$$5, _6$$5, _7$$6, _8$$7, _9$$7, _10$$7; zval prefix; zval *this_ptr = getThis(); @@ -161450,15 +156065,16 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) ZVAL_UNDEF(&directory); ZVAL_UNDEF(&file); ZVAL_UNDEF(&iterator); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$5); ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$6); - ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$6); ZVAL_UNDEF(&_8$$7); ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$7); ZVAL_UNDEF(&files); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -161489,51 +156105,53 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) ZEPHIR_INIT_VAR(&files); array_init(&files); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 149); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 121); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &directory); zephir_check_call_status(); - if (!((zephir_file_exists(&directory) == SUCCESS))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { array_init(return_value); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 144, &directory); + ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 116, &directory); zephir_check_call_status(); - zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 195); + zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 200); if (Z_TYPE_P(&iterator) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _0) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _1) { ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - ZEPHIR_CALL_METHOD(&_2$$4, &file, "isfile", NULL, 0); + ZVAL_COPY(&file, _1); + ZEPHIR_CALL_METHOD(&_3$$4, &file, "isfile", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(&_2$$4)) { - zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_4$$5, &file, "getfilename", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_3$$4)) { + zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$5, &file, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_5$$5); - ZEPHIR_CONCAT_VV(&_5$$5, &_3$$5, &_4$$5); - zephir_array_append(&files, &_5$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 191); + ZEPHIR_INIT_NVAR(&_6$$5); + ZEPHIR_CONCAT_VV(&_6$$5, &_4$$5, &_5$$5); + zephir_array_append(&files, &_6$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 196); } } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_1, &iterator, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &iterator, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_1)) { + if (!zend_is_true(&_2)) { break; } ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$6, &file, "isfile", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$6, &file, "isfile", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(&_6$$6)) { - zephir_read_property(&_7$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_8$$7, &file, "getfilename", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$6)) { + zephir_read_property(&_8$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_9$$7, &file, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_9$$7); - ZEPHIR_CONCAT_VV(&_9$$7, &_7$$7, &_8$$7); - zephir_array_append(&files, &_9$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 191); + ZEPHIR_INIT_NVAR(&_10$$7); + ZEPHIR_CONCAT_VV(&_10$$7, &_8$$7, &_9$$7); + zephir_array_append(&files, &_10$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 196); } ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0); zephir_check_call_status(); @@ -161549,7 +156167,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, payload, filepath, _0; + zval *key_param = NULL, payload, filepath, _0, _1; zval key; zval *this_ptr = getThis(); @@ -161557,6 +156175,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) ZVAL_UNDEF(&payload); ZVAL_UNDEF(&filepath); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -161578,31 +156197,34 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); zephir_check_call_status(); - if (!((zephir_file_exists(&filepath) == SUCCESS))) { + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &filepath); + zephir_check_call_status(); + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 147, &filepath); + ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 119, &filepath); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isexpired", NULL, 148, &payload); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 120, &payload); zephir_check_call_status(); - RETURN_MM_BOOL(!zephir_is_true(&_0)); + RETURN_MM_BOOL(!zephir_is_true(&_1)); } static PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS, _1; - zval *key_param = NULL, *value_param = NULL, data, _0; + zval *key_param = NULL, *value_param = NULL, data, result, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&data); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -161634,7 +156256,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key); @@ -161642,9 +156264,12 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) _1 = (zephir_get_intval(&data) + value); ZEPHIR_INIT_NVAR(&data); ZVAL_LONG(&data, _1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data); + ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data); zephir_check_call_status(); - RETURN_MM(); + if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + ZEPHIR_CPY_WRT(&result, &data); + } + RETURN_CCTOR(&result); } static PHP_METHOD(Phalcon_Storage_Adapter_Stream, set) @@ -161712,7 +156337,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, set) ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); zephir_array_update_string(&payload, SL("content"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 150, &payload, &key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 122, &payload, &key); zephir_check_call_status(); RETURN_MM(); } @@ -161762,7 +156387,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, setForever) ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); zephir_array_update_string(&payload, SL("content"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 150, &payload, &key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 122, &payload, &key); zephir_check_call_status(); RETURN_MM(); } @@ -161816,18 +156441,18 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDir) zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_VV(&_2, &_0, &_1); - ZEPHIR_CALL_METHOD(&dirPrefix, this_ptr, "getdirseparator", NULL, 143, &_2); + ZEPHIR_CALL_METHOD(&dirPrefix, this_ptr, "getdirseparator", NULL, 115, &_2); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3); zephir_read_property(&_4, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ""); zephir_fast_str_replace(&_3, &_4, &_5, &key); - ZEPHIR_CALL_METHOD(&dirFromFile, this_ptr, "getdirfromfile", NULL, 151, &_3); + ZEPHIR_CALL_METHOD(&dirFromFile, this_ptr, "getdirfromfile", NULL, 123, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_VV(&_6, &dirPrefix, &dirFromFile); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getdirseparator", NULL, 143, &_6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getdirseparator", NULL, 115, &_6); zephir_check_call_status(); RETURN_MM(); } @@ -161866,7 +156491,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getFilepath) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 149, &key); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 121, &key); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); zephir_read_property(&_2, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); @@ -161913,10 +156538,10 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator) ZEPHIR_INIT_VAR(&_0); object_init_ex(&_0, spl_ce_RecursiveDirectoryIterator); ZVAL_LONG(&_1, 4096); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 152, &dir, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 124, &dir, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 153, &_0, &_1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 125, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -161962,52 +156587,52 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload) ZVAL_BOOL(&payload, 0); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "r"); - ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 90, &filepath, &_0); + ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &filepath, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&pointer)) { + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&pointer))) { array_init(return_value); RETURN_MM(); } ZVAL_LONG(&_1, 1); - ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 154, &pointer, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 126, &pointer, &_1); zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_NVAR(&payload); - zephir_file_get_contents(&payload, &filepath); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_2))) { + ZEPHIR_CALL_METHOD(&payload, this_ptr, "phpfilegetcontents", NULL, 0, &filepath); + zephir_check_call_status(); } zephir_fclose(&pointer); - if (ZEPHIR_IS_FALSE_IDENTICAL(&payload)) { + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&payload))) { array_init(return_value); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "8.0"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, ">="); - ZEPHIR_CALL_FUNCTION(&_4, "version_compare", NULL, 88, &version, &_0, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "version_compare", NULL, 128, &version, &_0, &_3); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_VAR(&_5$$6); ZEPHIR_INIT_NVAR(&_5$$6); - zephir_create_closure_ex(&_5$$6, NULL, phalcon_3__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_5$$6, NULL, phalcon_1__closure_ce, SL("__invoke")); ZVAL_LONG(&_6$$6, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$6, &_6$$6); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_5$$6, &_6$$6); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_7$$7); ZEPHIR_INIT_NVAR(&_7$$7); - zephir_create_closure_ex(&_7$$7, NULL, phalcon_4__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_7$$7, NULL, phalcon_2__closure_ce, SL("__invoke")); ZVAL_LONG(&_8$$7, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_7$$7, &_8$$7); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_7$$7, &_8$$7); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_9, "unserialize", NULL, 16, &payload); zephir_check_call_status(); ZEPHIR_CPY_WRT(&payload, &_9); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); zephir_check_call_status(); _10 = ZEPHIR_GLOBAL(warning).enable; if (!(_10)) { @@ -162107,21 +156732,172 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, storePayload) ZEPHIR_CALL_FUNCTION(&_0, "serialize", NULL, 15, &payload); zephir_check_call_status(); ZEPHIR_CPY_WRT(&payload, &_0); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 149, &key); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 121, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_0, "is_dir", NULL, 155, &directory); + ZEPHIR_CALL_FUNCTION(&_0, "is_dir", NULL, 131, &directory); zephir_check_call_status(); if (!(zephir_is_true(&_0))) { ZVAL_LONG(&_1$$3, 0777); - ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 156, &directory, &_1$$3, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 132, &directory, &_1$$3, &__$true); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_CONCAT_VV(&_2, &directory, &key); - ZVAL_LONG(&_3, 2); - ZEPHIR_CALL_FUNCTION(&_4, "file_put_contents", NULL, 157, &_2, &payload, &_3); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VV(&_3, &directory, &key); + ZVAL_LONG(&_4, 2); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &_3, &payload, &_4); zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_4)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2)); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS)); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileGetContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + zephir_file_get_contents(return_value, &filename); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFilePutContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long flags, ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_STR(filename) + Z_PARAM_ZVAL(data) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(flags) + Z_PARAM_ZVAL_OR_NULL(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context); + zephir_get_strval(&filename, filename_param); + if (!flags_param) { + flags = 0; + } else { + flags = zephir_get_intval(flags_param); + } + if (!context) { + context = &context_sub; + context = &__$null; + } + + + ZVAL_LONG(&_0, flags); + ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 133, &filename, data, &_0, context); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFopen) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *mode_param = NULL; + zval filename, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&mode); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(filename) + Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &filename_param, &mode_param); + zephir_get_strval(&filename, filename_param); + zephir_get_strval(&mode, mode_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpUnlink) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 118, &filename); + zephir_check_call_status(); + RETURN_MM(); } static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) @@ -162167,7 +156943,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) ZVAL_LONG(&_0, 8); - ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, -2); @@ -162190,7 +156966,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) } ZEPHIR_INIT_VAR(&_7); ZVAL_LONG(&_8, 2); - ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 115, &start, &_8); + ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 84, &start, &_8); zephir_check_call_status(); zephir_fast_join_str(&_7, SL("/"), &_9); ZEPHIR_CONCAT_VS(return_value, &_7, "/"); @@ -162434,7 +157210,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, getAssetKey) ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "sha256"); - ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 99, &_2, &key); + ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 68, &_2, &key); zephir_check_call_status(); RETURN_MM(); } @@ -162484,7 +157260,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, getContent) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "sourcePath"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkpath", NULL, 100, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkpath", NULL, 69, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&completePath); ZEPHIR_CONCAT_VV(&completePath, &basePath, &_0); @@ -162496,13 +157272,13 @@ static PHP_METHOD(Phalcon_Assets_Asset, getContent) _3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_4); } if (_3) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 101, &completePath); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 70, &completePath); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&content, this_ptr, "phpfilegetcontents", NULL, 0, &completePath); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&content)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 101, &completePath); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 70, &completePath); zephir_check_call_status(); } RETURN_CCTOR(&content); @@ -162543,13 +157319,13 @@ static PHP_METHOD(Phalcon_Assets_Asset, getRealSourcePath) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sourcePath"); - ZEPHIR_CALL_METHOD(&source, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&source, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VV(&_2$$3, &basePath, &source); - ZEPHIR_CALL_FUNCTION(&_3$$3, "realpath", NULL, 102, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "realpath", NULL, 71, &_2$$3); zephir_check_call_status(); zephir_cast_to_string(&_4$$3, &_3$$3); ZEPHIR_CPY_WRT(&source, &_4$$3); @@ -162592,7 +157368,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, getRealTargetPath) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "targetPath"); - ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_1)) { @@ -162601,7 +157377,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, getRealTargetPath) ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "phpfileexists", NULL, 0, &completePath); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_2$$3)) { - ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 102, &completePath); + ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 71, &completePath); zephir_check_call_status(); ZEPHIR_CPY_WRT(&completePath, &_3$$4); if (ZEPHIR_IS_FALSE_IDENTICAL(&completePath)) { @@ -162637,7 +157413,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, getRealTargetUri) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "targetUri"); - ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); ZEPHIR_OBS_VAR(&ver); zephir_read_property(&ver, this_ptr, ZEND_STRL("version"), PH_NOISY_CC); @@ -163007,7 +157783,7 @@ static PHP_METHOD(Phalcon_Assets_Asset, throwException) object_init_ex(&_0, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SVS(&_1, "Asset's content for '", &completePath, "' cannot be read"); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 31, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 29, &_1); zephir_check_call_status(); zephir_throw_exception_debug(&_0, "phalcon/Assets/Asset.zep", 441); ZEPHIR_MM_RESTORE(); @@ -163240,7 +158016,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, add) zephir_fetch_params(1, 1, 0, &asset); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 178, asset); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 159, asset); zephir_check_call_status(); RETURN_THIS(); } @@ -163319,7 +158095,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, addCss) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 179, &_0, &path, isLocal, &_1, &attributes, &version, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 160, &_0, &path, isLocal, &_1, &attributes, &version, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -163365,7 +158141,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, addInline) zephir_fetch_params(1, 1, 0, &code); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 178, code); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 159, code); zephir_check_call_status(); RETURN_THIS(); } @@ -163418,7 +158194,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, addInlineCss) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 180, &_0, &content, &_1, &attributes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 161, &_0, &content, &_1, &attributes); zephir_check_call_status(); RETURN_MM(); } @@ -163471,7 +158247,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, addInlineJs) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 180, &_0, &content, &_1, &attributes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 161, &_0, &content, &_1, &attributes); zephir_check_call_status(); RETURN_MM(); } @@ -163550,7 +158326,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, addJs) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 179, &_0, &path, isLocal, &_1, &attributes, &version, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 160, &_0, &path, isLocal, &_1, &attributes, &version, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -163623,7 +158399,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath) ZEPHIR_INIT_VAR(&completePath); ZEPHIR_CONCAT_VV(&completePath, &basePath, &_0); if (1 == (zephir_file_exists(&completePath) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 102, &completePath); + ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 71, &completePath); zephir_check_call_status(); RETURN_MM(); } @@ -164113,7 +158889,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, processAdd) ZEPHIR_CPY_WRT(&name, &_0); ZEPHIR_OBS_VAR(&flag); zephir_read_property(&flag, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 181, &attributes); + ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 162, &attributes); zephir_check_call_status(); if (Z_TYPE_P(isLocal) != IS_NULL) { ZEPHIR_INIT_NVAR(&flag); @@ -164199,7 +158975,7 @@ static PHP_METHOD(Phalcon_Assets_Collection, processAddInline) ZEPHIR_INIT_VAR(&_0); ZEPHIR_CONCAT_SV(&_0, "Phalcon\\Assets\\Inline\\", &className); ZEPHIR_CPY_WRT(&name, &_0); - ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 181, &attributes); + ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 162, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&asset); zephir_fetch_safe_class(&_1, &name); @@ -164473,7 +159249,7 @@ static PHP_METHOD(Phalcon_Assets_Inline, getAssetKey) ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "sha256"); - ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 99, &_2, &key); + ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 68, &_2, &key); zephir_check_call_status(); RETURN_MM(); } @@ -164674,7 +159450,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addAssetByType) } - ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 182, &type); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 163, &type); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &collection, "add", NULL, 0, asset); zephir_check_call_status(); @@ -164769,7 +159545,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addCss) } else { ZVAL_BOOL(&_3, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 183, &path, &_1, &_2, &attributes, &version, &_3); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 164, &path, &_1, &_2, &attributes, &version, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "css"); @@ -164839,7 +159615,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addInlineCodeByType) } - ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 182, &type); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 163, &type); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &collection, "addinline", NULL, 0, code); zephir_check_call_status(); @@ -164895,7 +159671,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addInlineCss) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 184, &content, &_1, &attributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 165, &content, &_1, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "css"); @@ -164953,7 +159729,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addInlineJs) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 185, &content, &_1, &attributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 166, &content, &_1, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "js"); @@ -165050,7 +159826,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, addJs) } else { ZVAL_BOOL(&_3, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 186, &path, &_1, &_2, &attributes, &version, &_3); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 167, &path, &_1, &_2, &attributes, &version, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "js"); @@ -165081,7 +159857,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, collection) zephir_get_strval(&name, name_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &name); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &name); zephir_check_call_status(); RETURN_MM(); } @@ -165264,7 +160040,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, getCss) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "css"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -165283,7 +160059,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, getJs) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "js"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -165503,20 +160279,20 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_3$$9, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_4$$9); ZEPHIR_CONCAT_SVS(&_4$$9, "Path '", &completeTargetPath, "' is not a valid target path (1)"); - ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", NULL, 31, &_4$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", NULL, 29, &_4$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$9, "phalcon/Assets/Manager.zep", 462); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(&_5$$8, "is_dir", NULL, 155, &completeTargetPath); + ZEPHIR_CALL_FUNCTION(&_5$$8, "is_dir", NULL, 131, &completeTargetPath); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_5$$8)) { ZEPHIR_INIT_VAR(&_6$$10); object_init_ex(&_6$$10, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_7$$10); ZEPHIR_CONCAT_SVS(&_7$$10, "Path '", &completeTargetPath, "' is not a valid target path (2), it is a directory."); - ZEPHIR_CALL_METHOD(NULL, &_6$$10, "__construct", NULL, 31, &_7$$10); + ZEPHIR_CALL_METHOD(NULL, &_6$$10, "__construct", NULL, 29, &_7$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$10, "phalcon/Assets/Manager.zep", 468); ZEPHIR_MM_RESTORE(); @@ -165547,7 +160323,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_11$$14, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_12$$14); ZEPHIR_CONCAT_SVS(&_12$$14, "Asset '", &sourcePath, "' does not have a valid source path"); - ZEPHIR_CALL_METHOD(NULL, &_11$$14, "__construct", NULL, 31, &_12$$14); + ZEPHIR_CALL_METHOD(NULL, &_11$$14, "__construct", NULL, 29, &_12$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$14, "phalcon/Assets/Manager.zep", 498); ZEPHIR_MM_RESTORE(); @@ -165561,7 +160337,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_13$$15, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_14$$15); ZEPHIR_CONCAT_SVS(&_14$$15, "Asset '", &sourcePath, "' does not have a valid target path"); - ZEPHIR_CALL_METHOD(NULL, &_13$$15, "__construct", NULL, 31, &_14$$15); + ZEPHIR_CALL_METHOD(NULL, &_13$$15, "__construct", NULL, 29, &_14$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_13$$15, "phalcon/Assets/Manager.zep", 514); ZEPHIR_MM_RESTORE(); @@ -165575,7 +160351,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_16$$17, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_17$$17); ZEPHIR_CONCAT_SVS(&_17$$17, "Asset '", &targetPath, "' have the same source and target paths"); - ZEPHIR_CALL_METHOD(NULL, &_16$$17, "__construct", NULL, 31, &_17$$17); + ZEPHIR_CALL_METHOD(NULL, &_16$$17, "__construct", NULL, 29, &_17$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$17, "phalcon/Assets/Manager.zep", 524); ZEPHIR_MM_RESTORE(); @@ -165598,13 +160374,13 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_21$$21, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_20$$21, &_21$$21); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_20$$21, &_21$$21); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_23$$21, &asset, "getattributes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_24$$21, &asset, "islocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_23$$21, &prefixedPath, &_24$$21); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_23$$21, &prefixedPath, &_24$$21); zephir_check_call_status(); zephir_read_property(&_26$$21, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_26$$21)) { @@ -165681,12 +160457,12 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_31$$36, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_30$$36, &_31$$36); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_30$$36, &_31$$36); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_32$$36, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZVAL_BOOL(&_34$$36, 1); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_32$$36, &prefixedPath, &_34$$36); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_32$$36, &prefixedPath, &_34$$36); zephir_check_call_status(); zephir_read_property(&_34$$36, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_34$$36)) { @@ -165724,7 +160500,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_36$$42, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_37$$42); ZEPHIR_CONCAT_SVS(&_37$$42, "Asset '", &sourcePath, "' does not have a valid source path"); - ZEPHIR_CALL_METHOD(NULL, &_36$$42, "__construct", NULL, 31, &_37$$42); + ZEPHIR_CALL_METHOD(NULL, &_36$$42, "__construct", NULL, 29, &_37$$42); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$42, "phalcon/Assets/Manager.zep", 498); ZEPHIR_MM_RESTORE(); @@ -165738,7 +160514,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_38$$43, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_39$$43); ZEPHIR_CONCAT_SVS(&_39$$43, "Asset '", &sourcePath, "' does not have a valid target path"); - ZEPHIR_CALL_METHOD(NULL, &_38$$43, "__construct", NULL, 31, &_39$$43); + ZEPHIR_CALL_METHOD(NULL, &_38$$43, "__construct", NULL, 29, &_39$$43); zephir_check_call_status(); zephir_throw_exception_debug(&_38$$43, "phalcon/Assets/Manager.zep", 514); ZEPHIR_MM_RESTORE(); @@ -165752,7 +160528,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_41$$45, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_42$$45); ZEPHIR_CONCAT_SVS(&_42$$45, "Asset '", &targetPath, "' have the same source and target paths"); - ZEPHIR_CALL_METHOD(NULL, &_41$$45, "__construct", NULL, 31, &_42$$45); + ZEPHIR_CALL_METHOD(NULL, &_41$$45, "__construct", NULL, 29, &_42$$45); zephir_check_call_status(); zephir_throw_exception_debug(&_41$$45, "phalcon/Assets/Manager.zep", 524); ZEPHIR_MM_RESTORE(); @@ -165775,13 +160551,13 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_46$$49, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_45$$49, &_46$$49); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_45$$49, &_46$$49); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_47$$49, &asset, "getattributes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_48$$49, &asset, "islocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_47$$49, &prefixedPath, &_48$$49); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_47$$49, &prefixedPath, &_48$$49); zephir_check_call_status(); zephir_read_property(&_49$$49, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_49$$49)) { @@ -165858,12 +160634,12 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_54$$64, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_53$$64, &_54$$64); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_53$$64, &_54$$64); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_55$$64, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZVAL_BOOL(&_56$$64, 1); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_55$$64, &prefixedPath, &_56$$64); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_55$$64, &prefixedPath, &_56$$64); zephir_check_call_status(); zephir_read_property(&_56$$64, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_56$$64)) { @@ -165885,13 +160661,13 @@ static PHP_METHOD(Phalcon_Assets_Manager, output) zephir_file_put_contents(NULL, &completeTargetPath, &filteredJoinedContent); ZEPHIR_CALL_METHOD(&_58$$67, collection, "gettargeturi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_58$$67, &completeTargetPath); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_58$$67, &completeTargetPath); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_59$$67, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_60$$67, collection, "gettargetislocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_59$$67, &prefixedPath, &_60$$67); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_59$$67, &prefixedPath, &_60$$67); zephir_check_call_status(); zephir_read_property(&_61$$67, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_61$$67)) { @@ -166011,7 +160787,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0); zephir_check_call_status(); if (1 != ZEPHIR_IS_EMPTY(&codes)) { - zephir_is_iterable(&codes, 0, "phalcon/Assets/Manager.zep", 770); + zephir_is_iterable(&codes, 0, "phalcon/Assets/Manager.zep", 769); if (Z_TYPE_P(&codes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&codes), _0$$3) { @@ -166021,14 +160797,14 @@ static PHP_METHOD(Phalcon_Assets_Manager, outputInline) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 758); + zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 757); if (Z_TYPE_P(&filters) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _2$$4) { ZEPHIR_INIT_NVAR(&filter); ZVAL_COPY(&filter, _2$$4); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_4$$5, &filter, "filter", NULL, 0, &content); @@ -166047,7 +160823,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_5$$7, &filter, "filter", NULL, 0, &content); @@ -166087,14 +160863,14 @@ static PHP_METHOD(Phalcon_Assets_Manager, outputInline) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 758); + zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 757); if (Z_TYPE_P(&filters) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _11$$11) { ZEPHIR_INIT_NVAR(&filter); ZVAL_COPY(&filter, _11$$11); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_13$$12, &filter, "filter", NULL, 0, &content); @@ -166113,7 +160889,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_14$$14, &filter, "filter", NULL, 0, &content); @@ -166485,7 +161261,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, checkAndCreateCollection) zephir_update_property_array(this_ptr, SL("collections"), &type, &_1$$3); } zephir_read_property(&_2, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_3, &_2, &type, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 934); + zephir_array_fetch(&_3, &_2, &type, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 933); RETURN_CTOR(&_3); } @@ -166537,7 +161313,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, cssLink) ZVAL_STRING(&_2, "text/css"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "href"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 189, parameters, &_0, &_1, &_2, &_3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 170, parameters, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_MM(); } @@ -166589,7 +161365,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, doCallback) } ZEPHIR_INIT_VAR(&_1); ZVAL_BOOL(&_1, local); - zephir_array_append(¶meters, &_1, PH_SEPARATE, "phalcon/Assets/Manager.zep", 982); + zephir_array_append(¶meters, &_1, PH_SEPARATE, "phalcon/Assets/Manager.zep", 981); ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, callback, ¶meters); zephir_check_call_status(); RETURN_MM(); @@ -166643,7 +161419,7 @@ static PHP_METHOD(Phalcon_Assets_Manager, jsLink) ZVAL_STRING(&_2, "application/javascript"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "src"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 189, parameters, &_0, &_1, &_2, &_3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 170, parameters, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_MM(); } @@ -166710,13 +161486,13 @@ static PHP_METHOD(Phalcon_Assets_Manager, processParameters) } if (1 == zephir_array_isset_long(¶ms, 1)) { ZEPHIR_OBS_VAR(&_2$$4); - zephir_array_fetch_long(&_2$$4, ¶ms, 1, PH_NOISY, "phalcon/Assets/Manager.zep", 1026); + zephir_array_fetch_long(&_2$$4, ¶ms, 1, PH_NOISY, "phalcon/Assets/Manager.zep", 1025); local = zephir_get_boolval(&_2$$4); zephir_array_unset_long(¶ms, 1, PH_SEPARATE); } else { if (1 == zephir_array_isset_string(¶ms, SL("local"))) { ZEPHIR_OBS_VAR(&_3$$6); - zephir_array_fetch_string(&_3$$6, ¶ms, SL("local"), PH_NOISY, "phalcon/Assets/Manager.zep", 1030); + zephir_array_fetch_string(&_3$$6, ¶ms, SL("local"), PH_NOISY, "phalcon/Assets/Manager.zep", 1029); local = zephir_get_boolval(&_3$$6); zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } @@ -166736,13 +161512,13 @@ static PHP_METHOD(Phalcon_Assets_Manager, processParameters) ZVAL_STRING(&_6$$9, ""); zephir_array_update_zval(¶ms, &name, &_6$$9, PH_COPY | PH_SEPARATE); if (1 == zephir_array_isset_long(¶ms, 0)) { - zephir_array_fetch_long(&_7$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 1050); + zephir_array_fetch_long(&_7$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 1049); zephir_array_update_zval(¶ms, &name, &_7$$10, PH_COPY | PH_SEPARATE); zephir_array_unset_long(¶ms, 0, PH_SEPARATE); } } ZEPHIR_OBS_VAR(&tag); - zephir_array_fetch(&tag, ¶ms, &name, PH_NOISY, "phalcon/Assets/Manager.zep", 1055); + zephir_array_fetch(&tag, ¶ms, &name, PH_NOISY, "phalcon/Assets/Manager.zep", 1054); zephir_array_unset(¶ms, &name, PH_SEPARATE); if (local) { ZEPHIR_INIT_VAR(&_8$$11); @@ -167339,7 +162115,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Application_AbstractApplication) ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Application, AbstractApplication, phalcon, application_abstractapplication, phalcon_di_injectable_ce, phalcon_application_abstractapplication_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("container"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_application_abstractapplication_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("eventsManager"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("modules"), ZEND_ACC_PROTECTED); phalcon_application_abstractapplication_ce->create_object = zephir_init_properties_Phalcon_Application_AbstractApplication; @@ -167435,7 +162211,7 @@ static PHP_METHOD(Phalcon_Application_AbstractApplication, getModule) object_init_ex(&_1$$3, phalcon_application_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Module '", &name, "' is not registered in the application container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Application/AbstractApplication.zep", 83); ZEPHIR_MM_RESTORE(); @@ -167781,7 +162557,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, get) object_init_ex(&_1$$3, phalcon_filter_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Filter ", &name, " is not registered"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Filter/Filter.zep", 119); ZEPHIR_MM_RESTORE(); @@ -167792,7 +162568,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, get) zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("mapper"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&definition); zephir_array_fetch(&definition, &_4$$4, &name, PH_NOISY, "phalcon/Filter/Filter.zep", 123); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "createinstance", NULL, 290, &definition); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "createinstance", NULL, 272, &definition); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_5$$4); } @@ -167864,7 +162640,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, sanitize) } else { ZVAL_BOOL(&_0$$3, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarraysanitizers", NULL, 291, sanitizers, value, &_0$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarraysanitizers", NULL, 273, sanitizers, value, &_0$$3); zephir_check_call_status(); RETURN_MM(); } @@ -167873,11 +162649,11 @@ static PHP_METHOD(Phalcon_Filter_Filter, sanitize) _1 = !noRecursive; } if (_1) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarrayvalues", NULL, 292, value, sanitizers); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarrayvalues", NULL, 274, value, sanitizers); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "sanitizer", NULL, 293, value, sanitizers); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "sanitizer", NULL, 275, value, sanitizers); zephir_check_call_status(); RETURN_MM(); } @@ -168067,7 +162843,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } ZEPHIR_INIT_NVAR(&sanitizer); ZVAL_COPY(&sanitizer, _0); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 294, &sanitizerKey, &sanitizer); + ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 276, &sanitizerKey, &sanitizer); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sanitizerName); zephir_array_fetch_long(&sanitizerName, &split, 0, PH_NOISY, "phalcon/Filter/Filter.zep", 279); @@ -168078,10 +162854,10 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } else { ZVAL_BOOL(&_6$$4, 0); } - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisarray", &_7, 295, value, &sanitizerName, &sanitizerParams, &_6$$4); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisarray", &_7, 277, value, &sanitizerName, &sanitizerParams, &_6$$4); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_5$$4); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisnotarray", &_8, 296, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisnotarray", &_8, 278, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_5$$4); } ZEND_HASH_FOREACH_END(); @@ -168098,7 +162874,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&sanitizer, &sanitizers, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 294, &sanitizerKey, &sanitizer); + ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 276, &sanitizerKey, &sanitizer); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sanitizerName); zephir_array_fetch_long(&sanitizerName, &split, 0, PH_NOISY, "phalcon/Filter/Filter.zep", 279); @@ -168109,10 +162885,10 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } else { ZVAL_BOOL(&_10$$5, 0); } - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisarray", &_7, 295, value, &sanitizerName, &sanitizerParams, &_10$$5); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisarray", &_7, 277, value, &sanitizerName, &sanitizerParams, &_10$$5); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_9$$5); - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisnotarray", &_8, 296, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisnotarray", &_8, 278, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_9$$5); ZEPHIR_CALL_METHOD(NULL, &sanitizers, "next", NULL, 0); @@ -168183,7 +162959,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArrayValues) } ZEPHIR_INIT_NVAR(&itemValue); ZVAL_COPY(&itemValue, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "sanitizer", &_5, 293, &itemValue, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "sanitizer", &_5, 275, &itemValue, &sanitizerName, &sanitizerParams); zephir_check_call_status(); zephir_array_update_zval(&arrayValues, &itemKey, &_4$$3, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -168200,7 +162976,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processArrayValues) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&itemValue, &values, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "sanitizer", &_5, 293, &itemValue, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "sanitizer", &_5, 275, &itemValue, &sanitizerName, &sanitizerParams); zephir_check_call_status(); zephir_array_update_zval(&arrayValues, &itemKey, &_6$$4, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0); @@ -168315,7 +163091,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processValueIsArray) _0 = !noRecursive; } if (_0) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "processarrayvalues", NULL, 292, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "processarrayvalues", NULL, 274, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_1$$3); } @@ -168354,7 +163130,7 @@ static PHP_METHOD(Phalcon_Filter_Filter, processValueIsNotArray) if (Z_TYPE_P(value) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "sanitizer", NULL, 293, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "sanitizer", NULL, 275, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_0$$3); } @@ -168462,7 +163238,7 @@ static PHP_METHOD(Phalcon_Filter_FilterFactory, newInstance) object_init_ex(return_value, phalcon_filter_filter_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getservices", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 297, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 279, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -168728,7 +163504,7 @@ static PHP_METHOD(Phalcon_Filter_Validation, appendMessage) ZEPHIR_CALL_METHOD(NULL, &messages, "__construct", NULL, 8); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &messages, "appendmessage", NULL, 303, message); + ZEPHIR_CALL_METHOD(NULL, &messages, "appendmessage", NULL, 285, message); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages); RETURN_THIS(); @@ -169074,7 +163850,7 @@ static PHP_METHOD(Phalcon_Filter_Validation, getValue) zephir_camelize(&_6$$13, &field, NULL ); ZEPHIR_INIT_VAR(&method); ZEPHIR_CONCAT_SV(&method, "set", &_6$$13); - ZEPHIR_CALL_FUNCTION(&_7$$13, "property_exists", NULL, 304, &entity, &field); + ZEPHIR_CALL_FUNCTION(&_7$$13, "property_exists", NULL, 286, &entity, &field); zephir_check_call_status(); if ((zephir_method_exists(&entity, &method) == SUCCESS)) { ZEPHIR_CALL_METHOD_ZVAL(NULL, &entity, &method, NULL, 0, &value); @@ -169694,7 +164470,7 @@ static PHP_METHOD(Phalcon_Filter_Validation, preChecking) { ZEPHIR_INIT_NVAR(&singleField); ZVAL_COPY(&singleField, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "prechecking", &_3, 305, &singleField, validator); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "prechecking", &_3, 287, &singleField, validator); zephir_check_call_status(); zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Filter/Validation.zep", 592); if (zephir_fast_in_array(&__$false, &results)) { @@ -169713,7 +164489,7 @@ static PHP_METHOD(Phalcon_Filter_Validation, preChecking) } ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "prechecking", &_3, 305, &singleField, validator); + ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "prechecking", &_3, 287, &singleField, validator); zephir_check_call_status(); zephir_array_append(&results, &_4$$6, PH_SEPARATE, "phalcon/Filter/Validation.zep", 592); if (zephir_fast_in_array(&__$false, &results)) { @@ -170262,14 +165038,15 @@ static PHP_METHOD(Phalcon_Filter_Validation_AbstractValidator, prepareCode) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field_param = NULL, code, _0, _1$$3; + zval *field_param = NULL, code, _0, _1, _2$$3; zval field; zval *this_ptr = getThis(); ZVAL_UNDEF(&field); ZVAL_UNDEF(&code); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -170293,11 +165070,12 @@ static PHP_METHOD(Phalcon_Filter_Validation_AbstractValidator, prepareCode) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "code"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_ARRAY) { - zephir_array_fetch(&_1$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/AbstractValidator.zep", 188); - ZEPHIR_CPY_WRT(&code, &_1$$3); + zephir_array_fetch(&_2$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/AbstractValidator.zep", 188); + ZEPHIR_CPY_WRT(&code, &_2$$3); } RETURN_CCTOR(&code); } @@ -170574,7 +165352,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_AbstractValidatorComposite, validate zephir_get_class(&_2$$3, this_ptr, 0); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_VS(&_3$$3, &_2$$3, " does not have any validator added"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Filter/Validation/AbstractValidatorComposite.zep", 33); ZEPHIR_MM_RESTORE(); @@ -170962,7 +165740,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Alnum, validate) if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_FUNCTION(&_1, "ctype_alnum", NULL, 306, &value); + ZEPHIR_CALL_FUNCTION(&_1, "ctype_alnum", NULL, 288, &value); zephir_check_call_status(); if (!(zephir_is_true(&_1))) { ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -171295,7 +166073,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Callback, validate) ZEPHIR_CALL_METHOD(&data, validation, "getdata", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&returnedValue, "call_user_func", NULL, 199, &callback, &data); + ZEPHIR_CALL_FUNCTION(&returnedValue, "call_user_func", NULL, 180, &callback, &data); zephir_check_call_status(); _1$$3 = Z_TYPE_P(&returnedValue) == IS_OBJECT; if (_1$$3) { @@ -171418,7 +166196,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Confirmation, validate) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&valueWith, validation, "getvalue", NULL, 0, &fieldWith); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 307, &value, &valueWith); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 289, &value, &valueWith); zephir_check_call_status(); if (!(zephir_is_true(&_2))) { ZEPHIR_INIT_VAR(&_3$$4); @@ -171498,7 +166276,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Confirmation, compare) zephir_check_call_status(); zephir_get_strval(&b, &_5$$3); } - ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 308, &a, &b); + ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 290, &a, &b); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_6, 0)); } @@ -171588,7 +166366,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, validate) if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 309, &value); + ZEPHIR_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 291, &value); zephir_check_call_status(); if (!(zephir_is_true(&valid))) { ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -171640,11 +166418,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, verifyByLuhnAl ZEPHIR_INIT_VAR(&hash); ZVAL_STRING(&hash, ""); - ZEPHIR_CALL_FUNCTION(&_0, "str_split", NULL, 115, &number); + ZEPHIR_CALL_FUNCTION(&_0, "str_split", NULL, 84, &number); zephir_check_call_status(); zephir_get_arrval(&_1, &_0); ZEPHIR_CPY_WRT(&digits, &_1); - ZEPHIR_CALL_FUNCTION(&_3, "array_reverse", NULL, 310, &digits); + ZEPHIR_CALL_FUNCTION(&_3, "array_reverse", NULL, 292, &digits); zephir_check_call_status(); zephir_is_iterable(&_3, 0, "phalcon/Filter/Validation/Validator/CreditCard.zep", 109); if (Z_TYPE_P(&_3) == IS_ARRAY) { @@ -171694,9 +166472,9 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, verifyByLuhnAl } ZEPHIR_INIT_NVAR(&digit); ZEPHIR_INIT_NVAR(&position); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &hash); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &hash); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "array_sum", NULL, 311, &_10); + ZEPHIR_CALL_FUNCTION(&result, "array_sum", NULL, 293, &_10); zephir_check_call_status(); RETURN_MM_BOOL((zephir_safe_mod_zval_long(&result, 10) == 0)); } @@ -171801,7 +166579,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Date, validate) ZEPHIR_INIT_NVAR(&format); ZVAL_STRING(&format, "Y-m-d"); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "checkdate", NULL, 312, &value, &format); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "checkdate", NULL, 294, &value, &format); zephir_check_call_status(); if (!(zephir_is_true(&_3))) { ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -171947,7 +166725,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Digit, validate) } _1 = Z_TYPE_P(&value) == IS_LONG; if (!(_1)) { - ZEPHIR_CALL_FUNCTION(&_2, "ctype_digit", NULL, 313, &value); + ZEPHIR_CALL_FUNCTION(&_2, "ctype_digit", NULL, 295, &value); zephir_check_call_status(); _1 = zephir_is_true(&_2); } @@ -172048,7 +166826,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Email, validate) RETURN_MM_BOOL(1); } ZVAL_LONG(&_1, 274); - ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 298, &value, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 280, &value, &_1); zephir_check_call_status(); if (!(zephir_is_true(&_2))) { ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -172205,7 +166983,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_ExclusionIn, validate) return; } } - ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 314, &value, &domain, &strict); + ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 296, &value, &domain, &strict); zephir_check_call_status(); if (zephir_is_true(&_5)) { ZEPHIR_INIT_VAR(&replacePairs); @@ -172347,21 +167125,21 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) if (zephir_array_isset_string(&options, SL("messageFileEmpty"))) { ZEPHIR_INIT_VAR(&_0$$3); ZVAL_STRING(&_0$$3, "messageFileEmpty"); - ZEPHIR_CALL_METHOD(&messageFileEmpty, &helper, "__invoke", NULL, 171, &options, &_0$$3); + ZEPHIR_CALL_METHOD(&messageFileEmpty, &helper, "__invoke", NULL, 150, &options, &_0$$3); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageFileEmpty"), PH_SEPARATE); } if (zephir_array_isset_string(&options, SL("messageIniSize"))) { ZEPHIR_INIT_VAR(&_1$$4); ZVAL_STRING(&_1$$4, "messageIniSize"); - ZEPHIR_CALL_METHOD(&messageIniSize, &helper, "__invoke", NULL, 171, &options, &_1$$4); + ZEPHIR_CALL_METHOD(&messageIniSize, &helper, "__invoke", NULL, 150, &options, &_1$$4); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageIniSize"), PH_SEPARATE); } if (zephir_array_isset_string(&options, SL("messageValid"))) { ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, "messageValid"); - ZEPHIR_CALL_METHOD(&messageValid, &helper, "__invoke", NULL, 171, &options, &_2$$5); + ZEPHIR_CALL_METHOD(&messageValid, &helper, "__invoke", NULL, 150, &options, &_2$$5); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageValid"), PH_SEPARATE); } @@ -172379,40 +167157,40 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) ZVAL_COPY(&value, _3); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "minSize"); - ZEPHIR_CALL_FUNCTION(&_8$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_8$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "maxSize"); - ZEPHIR_CALL_FUNCTION(&_10$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_10$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "equalSize"); - ZEPHIR_CALL_FUNCTION(&_11$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "allowedTypes"); - ZEPHIR_CALL_FUNCTION(&_12$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_12$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "maxResolution"); - ZEPHIR_CALL_FUNCTION(&_13$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_13$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "minResolution"); - ZEPHIR_CALL_FUNCTION(&_14$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_14$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "equalResolution"); - ZEPHIR_CALL_FUNCTION(&_15$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_8$$6, 0)) { ZEPHIR_INIT_NVAR(&_16$$7); ZVAL_STRING(&_16$$7, "messageMinSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_16$$7); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_16$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$7); ZVAL_STRING(&_16$$7, "includedMinSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_16$$7); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_16$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_min_ce); @@ -172421,18 +167199,18 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_17$$7, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_17$$7, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_17$$7, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_18, 315, &_17$$7); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_18, 297, &_17$$7); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_10$$6, 0)) { ZEPHIR_INIT_NVAR(&_19$$8); ZVAL_STRING(&_19$$8, "messageSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_19$$8); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_19$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$8); ZVAL_STRING(&_19$$8, "includedSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_19$$8); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_19$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_max_ce); @@ -172441,7 +167219,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_20$$8, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_20$$8, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_20$$8, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_21, 316, &_20$$8); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_21, 298, &_20$$8); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE); @@ -172449,7 +167227,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_11$$6, 0)) { ZEPHIR_INIT_NVAR(&_22$$9); ZVAL_STRING(&_22$$9, "messageEqualSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_22$$9); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_22$$9); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_equal_ce); @@ -172457,14 +167235,14 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_23$$9, 2, 0); zephir_array_update_string(&_23$$9, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_23$$9, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_24, 317, &_23$$9); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_24, 299, &_23$$9); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_12$$6, 0)) { ZEPHIR_INIT_NVAR(&_25$$10); ZVAL_STRING(&_25$$10, "messageType"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_25$$10); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_25$$10); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_mimetype_ce); @@ -172472,18 +167250,18 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_26$$10, 2, 0); zephir_array_update_string(&_26$$10, SL("types"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_26$$10, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_27, 318, &_26$$10); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_27, 300, &_26$$10); zephir_check_call_status(); zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$6, 0)) { ZEPHIR_INIT_NVAR(&_28$$11); ZVAL_STRING(&_28$$11, "messageMaxResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_28$$11); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_28$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$11); ZVAL_STRING(&_28$$11, "includedMaxResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_28$$11); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_28$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_max_ce); @@ -172492,7 +167270,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_29$$11, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_29$$11, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_29$$11, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_30, 319, &_29$$11); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_30, 301, &_29$$11); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE); @@ -172500,11 +167278,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_14$$6, 0)) { ZEPHIR_INIT_NVAR(&_31$$12); ZVAL_STRING(&_31$$12, "messageMinResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_31$$12); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_31$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_31$$12); ZVAL_STRING(&_31$$12, "includedMinResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_31$$12); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_31$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_min_ce); @@ -172513,7 +167291,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_32$$12, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_32$$12, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_32$$12, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_33, 320, &_32$$12); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_33, 302, &_32$$12); zephir_check_call_status(); zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE); @@ -172521,7 +167299,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_15$$6, 0)) { ZEPHIR_INIT_NVAR(&_34$$13); ZVAL_STRING(&_34$$13, "messageEqualResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_34$$13); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_34$$13); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_equal_ce); @@ -172529,7 +167307,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_35$$13, 2, 0); zephir_array_update_string(&_35$$13, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_35$$13, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_35$$13); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_35$$13); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE); @@ -172537,15 +167315,15 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) continue; } if (Z_TYPE_P(&messageFileEmpty) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 322, &messageFileEmpty); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 304, &messageFileEmpty); zephir_check_call_status(); } if (Z_TYPE_P(&messageIniSize) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 323, &messageIniSize); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 305, &messageIniSize); zephir_check_call_status(); } if (Z_TYPE_P(&messageValid) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 324, &messageValid); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 306, &messageValid); zephir_check_call_status(); } zephir_update_property_array_append(this_ptr, SL("validators"), &validator); @@ -172565,40 +167343,40 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "minSize"); - ZEPHIR_CALL_FUNCTION(&_41$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_41$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "maxSize"); - ZEPHIR_CALL_FUNCTION(&_42$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_42$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "equalSize"); - ZEPHIR_CALL_FUNCTION(&_43$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_43$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "allowedTypes"); - ZEPHIR_CALL_FUNCTION(&_44$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_44$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "maxResolution"); - ZEPHIR_CALL_FUNCTION(&_45$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_45$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "minResolution"); - ZEPHIR_CALL_FUNCTION(&_46$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_46$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "equalResolution"); - ZEPHIR_CALL_FUNCTION(&_47$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_47$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_41$$18, 0)) { ZEPHIR_INIT_NVAR(&_48$$19); ZVAL_STRING(&_48$$19, "messageMinSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_48$$19); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_48$$19); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_48$$19); ZVAL_STRING(&_48$$19, "includedMinSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_48$$19); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_48$$19); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_min_ce); @@ -172607,18 +167385,18 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_49$$19, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_49$$19, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_49$$19, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_49$$19); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_49$$19); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_42$$18, 0)) { ZEPHIR_INIT_NVAR(&_50$$20); ZVAL_STRING(&_50$$20, "messageSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_50$$20); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_50$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_50$$20); ZVAL_STRING(&_50$$20, "includedSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_50$$20); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_50$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_max_ce); @@ -172627,7 +167405,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_51$$20, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_51$$20, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_51$$20, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_51$$20); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_51$$20); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE); @@ -172635,7 +167413,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_43$$18, 0)) { ZEPHIR_INIT_NVAR(&_52$$21); ZVAL_STRING(&_52$$21, "messageEqualSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_52$$21); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_52$$21); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_equal_ce); @@ -172643,14 +167421,14 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_53$$21, 2, 0); zephir_array_update_string(&_53$$21, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_53$$21, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_53$$21); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_53$$21); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_44$$18, 0)) { ZEPHIR_INIT_NVAR(&_54$$22); ZVAL_STRING(&_54$$22, "messageType"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_54$$22); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_54$$22); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_mimetype_ce); @@ -172658,18 +167436,18 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_55$$22, 2, 0); zephir_array_update_string(&_55$$22, SL("types"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_55$$22, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_55$$22); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_55$$22); zephir_check_call_status(); zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_45$$18, 0)) { ZEPHIR_INIT_NVAR(&_56$$23); ZVAL_STRING(&_56$$23, "messageMaxResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_56$$23); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_56$$23); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_56$$23); ZVAL_STRING(&_56$$23, "includedMaxResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_56$$23); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_56$$23); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_max_ce); @@ -172678,7 +167456,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_57$$23, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_57$$23, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_57$$23, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_57$$23); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_57$$23); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE); @@ -172686,11 +167464,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_46$$18, 0)) { ZEPHIR_INIT_NVAR(&_58$$24); ZVAL_STRING(&_58$$24, "messageMinResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_58$$24); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_58$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_58$$24); ZVAL_STRING(&_58$$24, "includedMinResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_58$$24); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_58$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_min_ce); @@ -172699,7 +167477,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_59$$24, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_59$$24, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_59$$24, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_59$$24); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_59$$24); zephir_check_call_status(); zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE); @@ -172707,7 +167485,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_47$$18, 0)) { ZEPHIR_INIT_NVAR(&_60$$25); ZVAL_STRING(&_60$$25, "messageEqualResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_60$$25); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_60$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_equal_ce); @@ -172715,7 +167493,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_61$$25, 2, 0); zephir_array_update_string(&_61$$25, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_61$$25, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_61$$25); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_61$$25); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE); @@ -172723,15 +167501,15 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) continue; } if (Z_TYPE_P(&messageFileEmpty) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 322, &messageFileEmpty); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 304, &messageFileEmpty); zephir_check_call_status(); } if (Z_TYPE_P(&messageIniSize) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 323, &messageIniSize); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 305, &messageIniSize); zephir_check_call_status(); } if (Z_TYPE_P(&messageValid) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 324, &messageValid); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 306, &messageValid); zephir_check_call_status(); } zephir_update_property_array_append(this_ptr, SL("validators"), &validator); @@ -173002,7 +167780,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_InclusionIn, validate) return; } } - ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 314, &value, &domain, &strict); + ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 296, &value, &domain, &strict); zephir_check_call_status(); if (!(zephir_is_true(&_5))) { ZEPHIR_INIT_VAR(&replacePairs); @@ -173175,7 +167953,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Ip, validate) zephir_bitwise_or_function(&_10, &_9, &allowReserved); zephir_array_update_string(&options, SL("flags"), &_10, PH_COPY | PH_SEPARATE); ZVAL_LONG(&_2, 275); - ZEPHIR_CALL_FUNCTION(&_11, "filter_var", NULL, 298, &value, &_2, &options); + ZEPHIR_CALL_FUNCTION(&_11, "filter_var", NULL, 280, &value, &_2, &options); zephir_check_call_status(); if (!(zephir_is_true(&_11))) { ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -173455,10 +168233,10 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, __construct) static PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) { - zend_bool failed = 0; + zend_bool failed = 0, _3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validation, validation_sub, *field, field_sub, matches, value, pattern, _0, _1, _2$$4, _3$$5, _4$$7; + zval *validation, validation_sub, *field, field_sub, matches, value, pattern, _0, _1, _2$$4, _4$$5, _5$$7; zval *this_ptr = getThis(); ZVAL_UNDEF(&validation_sub); @@ -173469,8 +168247,8 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$7); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) @@ -173501,18 +168279,22 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) zephir_array_fetch(&_2$$4, &pattern, field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 94); ZEPHIR_CPY_WRT(&pattern, &_2$$4); } - ZEPHIR_INIT_NVAR(&_1); - zephir_preg_match(&_1, &pattern, &value, &matches, 0, 0 , 0 ); - if (zephir_is_true(&_1)) { - zephir_array_fetch_long(&_3$$5, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 98); - failed = !ZEPHIR_IS_EQUAL(&_3$$5, &value); + _3 = Z_TYPE_P(&value) != IS_NULL; + if (_3) { + ZEPHIR_INIT_NVAR(&_1); + zephir_preg_match(&_1, &pattern, &value, &matches, 0, 0 , 0 ); + _3 = zephir_is_true(&_1); + } + if (_3) { + zephir_array_fetch_long(&_4$$5, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 101); + failed = !ZEPHIR_IS_EQUAL(&_4$$5, &value); } else { failed = 1; } if (failed) { - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "messagefactory", NULL, 0, validation, field); + ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "messagefactory", NULL, 0, validation, field); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$7); zephir_check_call_status(); RETURN_MM_BOOL(0); } @@ -173601,11 +168383,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) ZVAL_COPY(&value, _0); ZEPHIR_INIT_NVAR(&_4$$3); ZVAL_STRING(&_4$$3, "min"); - ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 47, &key, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 35, &key, &_4$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_4$$3); ZVAL_STRING(&_4$$3, "max"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 47, &key, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 35, &key, &_4$$3); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_5$$3, 0)) { if (zephir_array_isset_string(&options, SL("message"))) { @@ -173629,7 +168411,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_8$$4, SL("min"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$4, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$4, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_9, 329, &_8$$4); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_9, 311, &_8$$4); zephir_check_call_status(); zephir_array_unset_string(&options, SL("min"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -173658,7 +168440,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_10$$9, SL("max"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$9, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$9, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_10$$9); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_10$$9); zephir_check_call_status(); zephir_array_unset_string(&options, SL("max"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -173685,11 +168467,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$15); ZVAL_STRING(&_12$$15, "min"); - ZEPHIR_CALL_FUNCTION(&_13$$15, "strcasecmp", &_6, 47, &key, &_12$$15); + ZEPHIR_CALL_FUNCTION(&_13$$15, "strcasecmp", &_6, 35, &key, &_12$$15); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$15); ZVAL_STRING(&_12$$15, "max"); - ZEPHIR_CALL_FUNCTION(&_14$$15, "strcasecmp", &_6, 47, &key, &_12$$15); + ZEPHIR_CALL_FUNCTION(&_14$$15, "strcasecmp", &_6, 35, &key, &_12$$15); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$15, 0)) { if (zephir_array_isset_string(&options, SL("message"))) { @@ -173713,7 +168495,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_15$$16, SL("min"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$16, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$16, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_15$$16); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_15$$16); zephir_check_call_status(); zephir_array_unset_string(&options, SL("min"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -173742,7 +168524,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_16$$21, SL("max"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$21, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$21, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_16$$21); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_16$$21); zephir_check_call_status(); zephir_array_unset_string(&options, SL("max"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -174297,7 +169079,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Uniqueness, isUniquenessMo zephir_array_keys(&_10$$6, &except); ZVAL_LONG(&_11$$6, 0); ZVAL_LONG(&_12$$6, (zephir_fast_count_int(&except) - 1)); - ZEPHIR_CALL_FUNCTION(&_13$$6, "range", &_14, 331, &_11$$6, &_12$$6); + ZEPHIR_CALL_FUNCTION(&_13$$6, "range", &_14, 313, &_11$$6, &_12$$6); zephir_check_call_status(); _9$$6 = !ZEPHIR_IS_IDENTICAL(&_10$$6, &_13$$6); } @@ -174701,7 +169483,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Uniqueness, isUniquenessMo zephir_array_keys(&_88$$37, &except); ZVAL_LONG(&_89$$37, 0); ZVAL_LONG(&_90$$37, (zephir_fast_count_int(&except) - 1)); - ZEPHIR_CALL_FUNCTION(&_91$$37, "range", &_14, 331, &_89$$37, &_90$$37); + ZEPHIR_CALL_FUNCTION(&_91$$37, "range", &_14, 313, &_89$$37, &_90$$37); zephir_check_call_status(); _87$$37 = !ZEPHIR_IS_IDENTICAL(&_88$$37, &_91$$37); } @@ -175233,11 +170015,11 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_Url, validate) zephir_read_property(&_1, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset_string_fetch(&options, &_1, SL("options"), 0)) { ZVAL_LONG(&_2$$4, 273); - ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 298, &value, &_2$$4, &options); + ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 280, &value, &_2$$4, &options); zephir_check_call_status(); } else { ZVAL_LONG(&_3$$5, 273); - ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 298, &value, &_3$$5); + ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 280, &value, &_3$$5); zephir_check_call_status(); } if (!(zephir_is_true(&result))) { @@ -175877,12 +170659,12 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File_MimeType, validate) } if ((zephir_function_exists_ex(ZEND_STRL("finfo_open")) == SUCCESS)) { ZVAL_LONG(&_2$$6, 16); - ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 325, &_2$$6); + ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 307, &_2$$6); zephir_check_call_status(); zephir_array_fetch_string(&_3$$6, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/MimeType.zep", 101); - ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 326, &tmp, &_3$$6); + ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 308, &tmp, &_3$$6); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 327, &tmp); + ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 309, &tmp); zephir_check_call_status(); } else { ZEPHIR_OBS_NVAR(&mime); @@ -176001,7 +170783,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Equal, val ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep", 88); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep", 89); @@ -176145,7 +170927,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Max, valid ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Max.zep", 94); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Max.zep", 95); @@ -176313,7 +171095,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Min, valid ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Min.zep", 94); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Min.zep", 95); @@ -176905,7 +171687,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength_Max, validate RETURN_MM_BOOL(1); } if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &value); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &value); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&length); @@ -177046,7 +171828,7 @@ static PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength_Min, validate RETURN_MM_BOOL(1); } if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &value); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &value); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&length); @@ -177133,10 +171915,10 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_AbsInt, __invoke) ZVAL_LONG(&_0, 519); - ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 298, input, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 280, input, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, zephir_get_intval(&_1)); - ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 299, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 281, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -177184,7 +171966,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Alnum, __invoke) ZVAL_STRING(&_0, "/[^A-Za-z0-9]/"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, &_0, &_1, input); zephir_check_call_status(); RETURN_MM(); } @@ -177232,7 +172014,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Alpha, __invoke) ZVAL_STRING(&_0, "/[^A-Za-z]/"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, &_0, &_1, input); zephir_check_call_status(); RETURN_MM(); } @@ -177360,7 +172142,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Email, __invoke) ZVAL_LONG(&_0, 517); ZVAL_LONG(&_1, 1048576); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -177410,7 +172192,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_FloatVal, __invoke) zephir_create_array(&_0, 1, 0); add_assoc_long_ex(&_0, SL("flags"), 4096); ZVAL_LONG(&_1, 520); - ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 298, input, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 280, input, &_1, &_0); zephir_check_call_status(); RETURN_MM_DOUBLE(zephir_get_doubleval(&_2)); } @@ -177455,7 +172237,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_IntVal, __invoke) ZVAL_LONG(&_0, 519); - ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 298, input, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM_LONG(zephir_get_intval(&_1)); } @@ -177518,7 +172300,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Lower, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); zephir_fast_strtolower(return_value, &_2); RETURN_MM(); @@ -177571,7 +172353,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_LowerFirst, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("lcfirst", NULL, 104, &input); + ZEPHIR_RETURN_CALL_FUNCTION("lcfirst", NULL, 73, &input); zephir_check_call_status(); RETURN_MM(); } @@ -177617,7 +172399,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Regex, __invoke) zephir_fetch_params(1, 3, 0, &input, &pattern, &replace); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, pattern, replace, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, pattern, replace, input); zephir_check_call_status(); RETURN_MM(); } @@ -177754,7 +172536,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Special, __invoke) ZVAL_LONG(&_0, 515); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -177798,7 +172580,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_SpecialFull, __invoke) ZVAL_LONG(&_0, 522); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -177822,13 +172604,23 @@ ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_StringVal) static PHP_METHOD(Phalcon_Filter_Sanitize_StringVal, __invoke) { + zval _7, _8; + zval _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *input, input_sub, _0; + zval *input = NULL, input_sub, _0, _1, _3, _4, _5, _6; zval *this_ptr = getThis(); ZVAL_UNDEF(&input_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -177839,12 +172631,46 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_StringVal, __invoke) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &input); + ZEPHIR_SEPARATE_PARAM(input); - ZVAL_LONG(&_0, 513); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + if (Z_TYPE_P(input) == IS_ARRAY) { + RETURN_MM_BOOL(0); + } + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); - RETURN_MM(); + zephir_cast_to_string(&_2, input); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, ""); + ZEPHIR_INIT_NVAR(input); + zephir_fast_str_replace(input, &_1, &_3, &_2); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "/<[^>]*>?/"); + ZEPHIR_INIT_VAR(&_5); + ZVAL_STRING(&_5, ""); + ZEPHIR_CALL_FUNCTION(&_6, "preg_replace", NULL, 37, &_4, &_5, input); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(input, &_6); + ZEPHIR_INIT_VAR(&_7); + zephir_create_array(&_7, 2, 0); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "'"); + zephir_array_fast_append(&_7, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "\""); + zephir_array_fast_append(&_7, &_4); + ZEPHIR_INIT_VAR(&_8); + zephir_create_array(&_8, 2, 0); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "'"); + zephir_array_fast_append(&_8, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, """); + zephir_array_fast_append(&_8, &_4); + ZEPHIR_INIT_NVAR(&_4); + zephir_fast_str_replace(&_4, &_7, &_8, input); + RETURN_CCTOR(&_4); } @@ -177894,7 +172720,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Striptags, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 301, &input); + ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 283, &input); zephir_check_call_status(); RETURN_MM(); } @@ -178007,7 +172833,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Upper, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); zephir_fast_strtoupper(return_value, &_2); RETURN_MM(); @@ -178121,9 +172947,9 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_UpperWords, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ucwords", NULL, 302, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("ucwords", NULL, 284, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -178167,7 +172993,7 @@ static PHP_METHOD(Phalcon_Filter_Sanitize_Url, __invoke) ZVAL_LONG(&_0, 518); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -178765,7 +173591,7 @@ static PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) ZEPHIR_INIT_NVAR(&item); ZVAL_COPY(&item, _1$$7); zephir_array_fetch_string(&_3$$8, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139); - ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 169, &_3$$8); + ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 148, &_3$$8); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) { @@ -178786,7 +173612,7 @@ static PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) ZEPHIR_CALL_METHOD(&item, &_0$$7, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_5$$11, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139); - ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 169, &_5$$11); + ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 148, &_5$$11); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) { @@ -178803,7 +173629,7 @@ static PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) } if (ZEPHIR_IS_LONG(&type, 300)) { object_init_ex(return_value, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 170, &expr); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 149, &expr); zephir_check_call_status(); RETURN_MM(); } @@ -178811,7 +173637,7 @@ static PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) object_init_ex(&_6$$15, phalcon_annotations_exception_ce); ZEPHIR_INIT_VAR(&_7$$15); ZEPHIR_CONCAT_SVS(&_7$$15, "The expression ", &type, " is unknown"); - ZEPHIR_CALL_METHOD(NULL, &_6$$15, "__construct", NULL, 31, &_7$$15); + ZEPHIR_CALL_METHOD(NULL, &_6$$15, "__construct", NULL, 29, &_7$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$15, "phalcon/Annotations/Annotation.zep", 154); ZEPHIR_MM_RESTORE(); @@ -179069,7 +173895,7 @@ static PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, load) array_init(&_2); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "options"); - ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 171, config, &_3, &_2); + ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 150, config, &_3, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); @@ -179215,7 +174041,7 @@ static PHP_METHOD(Phalcon_Annotations_Collection, __construct) ZVAL_COPY(&annotationData, _0); ZEPHIR_INIT_NVAR(&_2$$3); object_init_ex(&_2$$3, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 170, &annotationData); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 149, &annotationData); zephir_check_call_status(); zephir_array_append(&annotations, &_2$$3, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55); } ZEND_HASH_FOREACH_END(); @@ -179232,7 +174058,7 @@ static PHP_METHOD(Phalcon_Annotations_Collection, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_4$$4); object_init_ex(&_4$$4, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", &_3, 170, &annotationData); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", &_3, 149, &annotationData); zephir_check_call_status(); zephir_array_append(&annotations, &_4$$4, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55); ZEPHIR_CALL_METHOD(NULL, &reflectionData, "next", NULL, 0); @@ -179345,7 +174171,7 @@ static PHP_METHOD(Phalcon_Annotations_Collection, get) object_init_ex(&_5, phalcon_annotations_exception_ce); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVS(&_6, "Collection doesn't have an annotation called '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 31, &_6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 29, &_6); zephir_check_call_status(); zephir_throw_exception_debug(&_5, "phalcon/Annotations/Collection.zep", 100); ZEPHIR_MM_RESTORE(); @@ -180939,39 +175765,51 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) { zval annotations; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, line = 0; - zval *className_param = NULL, reflection, comment, properties, methods, property, method, classAnnotations, annotationsProperties, propertyAnnotations, annotationsMethods, methodAnnotations, _0$$3, _1$$3, *_2$$5, _3$$5, _4$$7, _5$$7, _6$$8, _7$$10, _8$$10, _9$$11, *_10$$13, _11$$13, _12$$15, _13$$15, _14$$16, _15$$18, _16$$18, _17$$19; + zval *className_param = NULL, reflection, comment, arrayKeys, classAnnotations, properties, property, annotationsProperties, propertyAnnotations, methods, method, annotationsMethods, methodAnnotations, constants, constant, anotationsConstants, constantAnnotations, constantReflection, _0$$3, _1$$3, *_2$$5, _3$$5, _5$$7, _6$$7, _7$$10, _8$$10, *_9$$13, _10$$13, _11$$15, _12$$15, _13$$16, _14$$18, _15$$18, _16$$19, *_17$$21, _18$$21, _19$$23, _20$$23, _21$$24, _22$$26, _23$$26, _24$$27; zval className; zval *this_ptr = getThis(); ZVAL_UNDEF(&className); ZVAL_UNDEF(&reflection); ZVAL_UNDEF(&comment); + ZVAL_UNDEF(&arrayKeys); + ZVAL_UNDEF(&classAnnotations); ZVAL_UNDEF(&properties); - ZVAL_UNDEF(&methods); ZVAL_UNDEF(&property); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&classAnnotations); ZVAL_UNDEF(&annotationsProperties); ZVAL_UNDEF(&propertyAnnotations); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&method); ZVAL_UNDEF(&annotationsMethods); ZVAL_UNDEF(&methodAnnotations); + ZVAL_UNDEF(&constants); + ZVAL_UNDEF(&constant); + ZVAL_UNDEF(&anotationsConstants); + ZVAL_UNDEF(&constantAnnotations); + ZVAL_UNDEF(&constantReflection); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_4$$7); ZVAL_UNDEF(&_5$$7); - ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_6$$7); ZVAL_UNDEF(&_7$$10); ZVAL_UNDEF(&_8$$10); - ZVAL_UNDEF(&_9$$11); - ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_11$$15); ZVAL_UNDEF(&_12$$15); - ZVAL_UNDEF(&_13$$15); - ZVAL_UNDEF(&_14$$16); + ZVAL_UNDEF(&_13$$16); + ZVAL_UNDEF(&_14$$18); ZVAL_UNDEF(&_15$$18); - ZVAL_UNDEF(&_16$$18); - ZVAL_UNDEF(&_17$$19); + ZVAL_UNDEF(&_16$$19); + ZVAL_UNDEF(&_18$$21); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$23); + ZVAL_UNDEF(&_21$$24); + ZVAL_UNDEF(&_22$$26); + ZVAL_UNDEF(&_23$$26); + ZVAL_UNDEF(&_24$$27); ZVAL_UNDEF(&annotations); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -180990,15 +175828,15 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) array_init(&annotations); ZEPHIR_INIT_VAR(&reflection); object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 172, &className); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 151, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 173); + ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 152); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_VAR(&classAnnotations); - ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 175); + ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 154); zephir_check_call_status(); ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&classAnnotations, &comment, &_0$$3, &_1$$3); zephir_check_call_status(); @@ -181006,31 +175844,96 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_array_update_string(&annotations, SL("class"), &classAnnotations, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 176); + ZEPHIR_CALL_METHOD(&constants, &reflection, "getconstants", NULL, 155); + zephir_check_call_status(); + if (zephir_fast_count_int(&constants)) { + line = 1; + ZEPHIR_INIT_VAR(&arrayKeys); + zephir_array_keys(&arrayKeys, &constants); + ZEPHIR_INIT_VAR(&anotationsConstants); + array_init(&anotationsConstants); + zephir_is_iterable(&arrayKeys, 0, "phalcon/Annotations/Reader.zep", 93); + if (Z_TYPE_P(&arrayKeys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arrayKeys), _2$$5) + { + ZEPHIR_INIT_NVAR(&constant); + ZVAL_COPY(&constant, _2$$5); + ZEPHIR_CALL_METHOD(&constantReflection, &reflection, "getreflectionconstant", &_4, 156, &constant); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&comment, &constantReflection, "getdoccomment", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&constantAnnotations); + ZEPHIR_CALL_METHOD(&_5$$7, &reflection, "getfilename", NULL, 153); + zephir_check_call_status(); + ZVAL_LONG(&_6$$7, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&constantAnnotations, &comment, &_5$$7, &_6$$7); + zephir_check_call_status(); + if (Z_TYPE_P(&constantAnnotations) == IS_ARRAY) { + zephir_array_update_zval(&anotationsConstants, &constant, &constantAnnotations, PH_COPY | PH_SEPARATE); + } + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &arrayKeys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_3$$5, &arrayKeys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_3$$5)) { + break; + } + ZEPHIR_CALL_METHOD(&constant, &arrayKeys, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&constantReflection, &reflection, "getreflectionconstant", &_4, 156, &constant); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&comment, &constantReflection, "getdoccomment", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&constantAnnotations); + ZEPHIR_CALL_METHOD(&_7$$10, &reflection, "getfilename", NULL, 153); + zephir_check_call_status(); + ZVAL_LONG(&_8$$10, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&constantAnnotations, &comment, &_7$$10, &_8$$10); + zephir_check_call_status(); + if (Z_TYPE_P(&constantAnnotations) == IS_ARRAY) { + zephir_array_update_zval(&anotationsConstants, &constant, &constantAnnotations, PH_COPY | PH_SEPARATE); + } + } + ZEPHIR_CALL_METHOD(NULL, &arrayKeys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&constant); + if (zephir_fast_count_int(&anotationsConstants)) { + zephir_array_update_string(&annotations, SL("constants"), &anotationsConstants, PH_COPY | PH_SEPARATE); + } + } + ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 157); zephir_check_call_status(); if (zephir_fast_count_int(&properties)) { line = 1; ZEPHIR_INIT_VAR(&annotationsProperties); array_init(&annotationsProperties); - zephir_is_iterable(&properties, 0, "phalcon/Annotations/Reader.zep", 92); + zephir_is_iterable(&properties, 0, "phalcon/Annotations/Reader.zep", 132); if (Z_TYPE_P(&properties) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _2$$5) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _9$$13) { ZEPHIR_INIT_NVAR(&property); - ZVAL_COPY(&property, _2$$5); + ZVAL_COPY(&property, _9$$13); ZEPHIR_CALL_METHOD(&comment, &property, "getdoccomment", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&propertyAnnotations); - ZEPHIR_CALL_METHOD(&_4$$7, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_11$$15, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZVAL_LONG(&_5$$7, line); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_4$$7, &_5$$7); + ZVAL_LONG(&_12$$15, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_11$$15, &_12$$15); zephir_check_call_status(); if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_6$$8); - zephir_read_property(&_6$$8, &property, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, &_6$$8, &propertyAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$16); + zephir_read_property(&_13$$16, &property, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, &_13$$16, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } } ZEND_HASH_FOREACH_END(); @@ -181038,9 +175941,9 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) ZEPHIR_CALL_METHOD(NULL, &properties, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_3$$5, &properties, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$13, &properties, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_3$$5)) { + if (!zend_is_true(&_10$$13)) { break; } ZEPHIR_CALL_METHOD(&property, &properties, "current", NULL, 0); @@ -181049,15 +175952,15 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&propertyAnnotations); - ZEPHIR_CALL_METHOD(&_7$$10, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_14$$18, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZVAL_LONG(&_8$$10, line); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_7$$10, &_8$$10); + ZVAL_LONG(&_15$$18, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_14$$18, &_15$$18); zephir_check_call_status(); if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_9$$11); - zephir_read_property(&_9$$11, &property, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, &_9$$11, &propertyAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_16$$19); + zephir_read_property(&_16$$19, &property, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, &_16$$19, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_METHOD(NULL, &properties, "next", NULL, 0); @@ -181069,31 +175972,31 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_array_update_string(&annotations, SL("properties"), &annotationsProperties, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 177); + ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 158); zephir_check_call_status(); if (zephir_fast_count_int(&methods)) { ZEPHIR_INIT_VAR(&annotationsMethods); array_init(&annotationsMethods); - zephir_is_iterable(&methods, 0, "phalcon/Annotations/Reader.zep", 127); + zephir_is_iterable(&methods, 0, "phalcon/Annotations/Reader.zep", 167); if (Z_TYPE_P(&methods) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _10$$13) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _17$$21) { ZEPHIR_INIT_NVAR(&method); - ZVAL_COPY(&method, _10$$13); + ZVAL_COPY(&method, _17$$21); ZEPHIR_CALL_METHOD(&comment, &method, "getdoccomment", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&methodAnnotations); - ZEPHIR_CALL_METHOD(&_12$$15, &method, "getfilename", NULL, 0); + ZEPHIR_CALL_METHOD(&_19$$23, &method, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13$$15, &method, "getstartline", NULL, 0); + ZEPHIR_CALL_METHOD(&_20$$23, &method, "getstartline", NULL, 0); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_12$$15, &_13$$15); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_19$$23, &_20$$23); zephir_check_call_status(); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_14$$16); - zephir_read_property(&_14$$16, &method, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, &_14$$16, &methodAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_21$$24); + zephir_read_property(&_21$$24, &method, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, &_21$$24, &methodAnnotations, PH_COPY | PH_SEPARATE); } } } ZEND_HASH_FOREACH_END(); @@ -181101,9 +176004,9 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_11$$13, &methods, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_18$$21, &methods, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_11$$13)) { + if (!zend_is_true(&_18$$21)) { break; } ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); @@ -181112,16 +176015,16 @@ static PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&methodAnnotations); - ZEPHIR_CALL_METHOD(&_15$$18, &method, "getfilename", NULL, 0); + ZEPHIR_CALL_METHOD(&_22$$26, &method, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$18, &method, "getstartline", NULL, 0); + ZEPHIR_CALL_METHOD(&_23$$26, &method, "getstartline", NULL, 0); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_15$$18, &_16$$18); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_22$$26, &_23$$26); zephir_check_call_status(); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_17$$19); - zephir_read_property(&_17$$19, &method, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, &_17$$19, &methodAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_24$$27); + zephir_read_property(&_24$$27, &method, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, &_24$$27, &methodAnnotations, PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); @@ -181217,8 +176120,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection) ZEPHIR_REGISTER_CLASS(Phalcon\\Annotations, Reflection, phalcon, annotations_reflection, phalcon_annotations_reflection_method_entry, 0); zend_declare_property_null(phalcon_annotations_reflection_ce, SL("classAnnotations"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_annotations_reflection_ce, SL("methodAnnotations"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_annotations_reflection_ce, SL("constantAnnotations"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_annotations_reflection_ce, SL("propertyAnnotations"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_annotations_reflection_ce, SL("methodAnnotations"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_annotations_reflection_ce, SL("reflectionData"), ZEND_ACC_PROTECTED); phalcon_annotations_reflection_ce->create_object = zephir_init_properties_Phalcon_Annotations_Reflection; @@ -181279,7 +176183,7 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) if (zephir_array_isset_string_fetch(&reflectionClass, &_1$$3, SL("class"), 1)) { ZEPHIR_INIT_VAR(&_2$$4); object_init_ex(&_2$$4, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 48, &reflectionClass); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 34, &reflectionClass); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("classAnnotations"), &_2$$4); } else { @@ -181293,6 +176197,182 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) RETURN_MM_MEMBER(getThis(), "classAnnotations"); } +static PHP_METHOD(Phalcon_Annotations_Reflection, getConstantsAnnotations) +{ + zend_string *_6$$5; + zend_ulong _5$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval __$true, __$false, reflectionConstants, constant, reflectionConstant, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; + zephir_fcall_cache_entry *_8 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&reflectionConstants); + ZVAL_UNDEF(&constant); + ZVAL_UNDEF(&reflectionConstant); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("constantAnnotations"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_OBS_VAR(&reflectionConstants); + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionConstants, &_1$$3, SL("constants"), 0)) { + if (zephir_fast_count_int(&reflectionConstants)) { + ZEPHIR_INIT_VAR(&_2$$5); + array_init(&_2$$5); + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &_2$$5); + zephir_is_iterable(&reflectionConstants, 0, "phalcon/Annotations/Reflection.zep", 106); + if (Z_TYPE_P(&reflectionConstants) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionConstants), _5$$5, _6$$5, _3$$5) + { + ZEPHIR_INIT_NVAR(&constant); + if (_6$$5 != NULL) { + ZVAL_STR_COPY(&constant, _6$$5); + } else { + ZVAL_LONG(&constant, _5$$5); + } + ZEPHIR_INIT_NVAR(&reflectionConstant); + ZVAL_COPY(&reflectionConstant, _3$$5); + ZEPHIR_INIT_NVAR(&_7$$6); + object_init_ex(&_7$$6, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionConstant); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("constantAnnotations"), &constant, &_7$$6); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &reflectionConstants, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_4$$5, &reflectionConstants, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_4$$5)) { + break; + } + ZEPHIR_CALL_METHOD(&constant, &reflectionConstants, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&reflectionConstant, &reflectionConstants, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_9$$7); + object_init_ex(&_9$$7, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionConstant); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("constantAnnotations"), &constant, &_9$$7); + ZEPHIR_CALL_METHOD(NULL, &reflectionConstants, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&reflectionConstant); + ZEPHIR_INIT_NVAR(&constant); + RETURN_MM_MEMBER(getThis(), "constantAnnotations"); + } + } + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &__$false); + } + } + RETURN_MM_MEMBER(getThis(), "constantAnnotations"); +} + +static PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) +{ + zend_string *_6$$5; + zend_ulong _5$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval __$true, __$false, reflectionProperties, property, reflectionProperty, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; + zephir_fcall_cache_entry *_8 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&reflectionProperties); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&reflectionProperty); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("propertyAnnotations"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_OBS_VAR(&reflectionProperties); + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionProperties, &_1$$3, SL("properties"), 0)) { + if (zephir_fast_count_int(&reflectionProperties)) { + ZEPHIR_INIT_VAR(&_2$$5); + array_init(&_2$$5); + zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &_2$$5); + zephir_is_iterable(&reflectionProperties, 0, "phalcon/Annotations/Reflection.zep", 134); + if (Z_TYPE_P(&reflectionProperties) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionProperties), _5$$5, _6$$5, _3$$5) + { + ZEPHIR_INIT_NVAR(&property); + if (_6$$5 != NULL) { + ZVAL_STR_COPY(&property, _6$$5); + } else { + ZVAL_LONG(&property, _5$$5); + } + ZEPHIR_INIT_NVAR(&reflectionProperty); + ZVAL_COPY(&reflectionProperty, _3$$5); + ZEPHIR_INIT_NVAR(&_7$$6); + object_init_ex(&_7$$6, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionProperty); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_7$$6); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_4$$5, &reflectionProperties, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_4$$5)) { + break; + } + ZEPHIR_CALL_METHOD(&property, &reflectionProperties, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&reflectionProperty, &reflectionProperties, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_9$$7); + object_init_ex(&_9$$7, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionProperty); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_9$$7); + ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&reflectionProperty); + ZEPHIR_INIT_NVAR(&property); + RETURN_MM_MEMBER(getThis(), "propertyAnnotations"); + } + } + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$false); + } + } + RETURN_MM_MEMBER(getThis(), "propertyAnnotations"); +} + static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) { zend_string *_6$$5; @@ -181327,7 +176407,7 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) ZEPHIR_INIT_VAR(&_2$$5); array_init(&_2$$5); zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &_2$$5); - zephir_is_iterable(&reflectionMethods, 0, "phalcon/Annotations/Reflection.zep", 100); + zephir_is_iterable(&reflectionMethods, 0, "phalcon/Annotations/Reflection.zep", 162); if (Z_TYPE_P(&reflectionMethods) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionMethods), _5$$5, _6$$5, _3$$5) { @@ -181341,7 +176421,7 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) ZVAL_COPY(&reflectionMethod, _3$$5); ZEPHIR_INIT_NVAR(&_7$$6); object_init_ex(&_7$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionMethod); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionMethod); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_7$$6); } ZEND_HASH_FOREACH_END(); @@ -181360,7 +176440,7 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_9$$7); object_init_ex(&_9$$7, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionMethod); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionMethod); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_9$$7); ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "next", NULL, 0); @@ -181381,94 +176461,6 @@ static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) RETURN_MM_MEMBER(getThis(), "methodAnnotations"); } -static PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) -{ - zend_string *_6$$5; - zend_ulong _5$$5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval __$true, __$false, reflectionProperties, property, reflectionProperty, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; - zephir_fcall_cache_entry *_8 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&reflectionProperties); - ZVAL_UNDEF(&property); - ZVAL_UNDEF(&reflectionProperty); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$5); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_7$$6); - ZVAL_UNDEF(&_9$$7); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("propertyAnnotations"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_OBS_VAR(&reflectionProperties); - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY); - if (zephir_array_isset_string_fetch(&reflectionProperties, &_1$$3, SL("properties"), 0)) { - if (zephir_fast_count_int(&reflectionProperties)) { - ZEPHIR_INIT_VAR(&_2$$5); - array_init(&_2$$5); - zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &_2$$5); - zephir_is_iterable(&reflectionProperties, 0, "phalcon/Annotations/Reflection.zep", 128); - if (Z_TYPE_P(&reflectionProperties) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionProperties), _5$$5, _6$$5, _3$$5) - { - ZEPHIR_INIT_NVAR(&property); - if (_6$$5 != NULL) { - ZVAL_STR_COPY(&property, _6$$5); - } else { - ZVAL_LONG(&property, _5$$5); - } - ZEPHIR_INIT_NVAR(&reflectionProperty); - ZVAL_COPY(&reflectionProperty, _3$$5); - ZEPHIR_INIT_NVAR(&_7$$6); - object_init_ex(&_7$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionProperty); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_7$$6); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4$$5, &reflectionProperties, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4$$5)) { - break; - } - ZEPHIR_CALL_METHOD(&property, &reflectionProperties, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&reflectionProperty, &reflectionProperties, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_9$$7); - object_init_ex(&_9$$7, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionProperty); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_9$$7); - ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&reflectionProperty); - ZEPHIR_INIT_NVAR(&property); - RETURN_MM_MEMBER(getThis(), "propertyAnnotations"); - } - } - if (0) { - zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &__$false); - } - } - RETURN_MM_MEMBER(getThis(), "propertyAnnotations"); -} - static PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData) { zval *this_ptr = getThis(); @@ -182452,7 +177444,7 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&classAnnotations); object_init_ex(&classAnnotations, phalcon_annotations_reflection_ce); - ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 46, &parsedAnnotations); + ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 33, &parsedAnnotations); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("annotations"), &realClassName, &classAnnotations); ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &realClassName, &classAnnotations); @@ -182461,96 +177453,45 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get) RETURN_CCTOR(&classAnnotations); } -static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod) +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant) { - zend_string *_3$$3; - zend_ulong _2$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$3, _1$$3, _4$$4, _6$$6; - zval className, methodName; + zval *className_param = NULL, *constantName_param = NULL, constants, constant; + zval className, constantName; zval *this_ptr = getThis(); ZVAL_UNDEF(&className); - ZVAL_UNDEF(&methodName); - ZVAL_UNDEF(&classAnnotations); - ZVAL_UNDEF(&methods); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&methodKey); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&constantName); + ZVAL_UNDEF(&constants); + ZVAL_UNDEF(&constant); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(className) - Z_PARAM_STR(methodName) + Z_PARAM_STR(constantName) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &className_param, &methodName_param); + zephir_fetch_params(1, 2, 0, &className_param, &constantName_param); zephir_get_strval(&className, className_param); - zephir_get_strval(&methodName, methodName_param); + zephir_get_strval(&constantName, constantName_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&constants, this_ptr, "getconstants", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(&methods) == IS_ARRAY) { - zephir_is_iterable(&methods, 0, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 94); - if (Z_TYPE_P(&methods) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _2$$3, _3$$3, _0$$3) - { - ZEPHIR_INIT_NVAR(&methodKey); - if (_3$$3 != NULL) { - ZVAL_STR_COPY(&methodKey, _3$$3); - } else { - ZVAL_LONG(&methodKey, _2$$3); - } - ZEPHIR_INIT_NVAR(&method); - ZVAL_COPY(&method, _0$$3); - ZEPHIR_CALL_FUNCTION(&_4$$4, "strcasecmp", &_5, 47, &methodKey, &methodName); - zephir_check_call_status(); - if (!(zephir_is_true(&_4$$4))) { - RETURN_CCTOR(&method); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1$$3, &methods, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&methodKey, &methods, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$6, "strcasecmp", &_5, 47, &methodKey, &methodName); - zephir_check_call_status(); - if (!(zephir_is_true(&_6$$6))) { - RETURN_CCTOR(&method); - } - ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&method); - ZEPHIR_INIT_NVAR(&methodKey); + if (!(zephir_array_isset_fetch(&constant, &constants, &constantName, 1))) { + object_init_ex(return_value, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); + zephir_check_call_status(); + RETURN_MM(); } - object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48); - zephir_check_call_status(); - RETURN_MM(); + RETURN_CTOR(&constant); } -static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; @@ -182575,7 +177516,7 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getconstantsannotations", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -182614,7 +177555,7 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty) zephir_check_call_status(); if (!(zephir_array_isset_fetch(&property, &properties, &propertyName, 1))) { object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); zephir_check_call_status(); RETURN_MM(); } @@ -182651,6 +177592,125 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties) RETURN_MM(); } +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod) +{ + zend_string *_3$$3; + zend_ulong _2$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_5 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$3, _1$$3, _4$$4, _6$$6; + zval className, methodName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&methodKey); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(className) + Z_PARAM_STR(methodName) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &className_param, &methodName_param); + zephir_get_strval(&className, className_param); + zephir_get_strval(&methodName, methodName_param); + + + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&methods) == IS_ARRAY) { + zephir_is_iterable(&methods, 0, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 167); + if (Z_TYPE_P(&methods) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _2$$3, _3$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&methodKey); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&methodKey, _3$$3); + } else { + ZVAL_LONG(&methodKey, _2$$3); + } + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _0$$3); + ZEPHIR_CALL_FUNCTION(&_4$$4, "strcasecmp", &_5, 35, &methodKey, &methodName); + zephir_check_call_status(); + if (!(zephir_is_true(&_4$$4))) { + RETURN_CCTOR(&method); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1$$3, &methods, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1$$3)) { + break; + } + ZEPHIR_CALL_METHOD(&methodKey, &methods, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(&_6$$6, "strcasecmp", &_5, 35, &methodKey, &methodName); + zephir_check_call_status(); + if (!(zephir_is_true(&_6$$6))) { + RETURN_CCTOR(&method); + } + ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_INIT_NVAR(&methodKey); + } + object_init_ex(return_value, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *className_param = NULL, classAnnotations; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&classAnnotations); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(className) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &className_param); + zephir_get_strval(&className, className_param); + + + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getReader) { zval _0, _1$$3; @@ -182741,10 +177801,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AdapterInterface) } ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, get); -ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethod); -ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethods); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getConstant); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getConstants); ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperty); ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperties); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethod); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethods); ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getReader); ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, setReader); @@ -182842,7 +177904,7 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, read) ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); zephir_fast_strtolower(&_0, &_2); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 128, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 102, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -182889,7 +177951,7 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, write) ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); zephir_fast_strtolower(&_0, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("ttl"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 131, &_0, data, &_3); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 103, &_0, data, &_3); zephir_check_call_status(); RETURN_MM(); } @@ -183098,33 +178160,33 @@ static PHP_METHOD(Phalcon_Annotations_Adapter_Stream, read) RETURN_MM_BOOL(0); } ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "8.0"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ">="); - ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 88, &version, &_4, &_5); + ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 128, &version, &_4, &_5); zephir_check_call_status(); if (zephir_is_true(&_6)) { ZEPHIR_INIT_VAR(&_7$$5); ZEPHIR_INIT_NVAR(&_7$$5); zephir_create_closure_ex(&_7$$5, NULL, phalcon_5__closure_ce, SL("__invoke")); ZVAL_LONG(&_8$$5, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_7$$5, &_8$$5); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_7$$5, &_8$$5); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_9$$6); ZEPHIR_INIT_NVAR(&_9$$6); zephir_create_closure_ex(&_9$$6, NULL, phalcon_6__closure_ce, SL("__invoke")); ZVAL_LONG(&_10$$6, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_9$$6, &_10$$6); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_9$$6, &_10$$6); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_11, "unserialize", NULL, 16, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_11); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Cannot read annotation data", "phalcon/Annotations/Adapter/Stream.zep", 102); @@ -184406,7 +179468,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getColumnList) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _0); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getsqlcolumn", &_3, 40, &column, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&columns, &_2$$3, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125); } ZEND_HASH_FOREACH_END(); @@ -184421,7 +179483,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getColumnList) } ZEPHIR_CALL_METHOD(&column, &columnList, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getsqlcolumn", &_3, 40, &column, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&columns, &_4$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125); ZEPHIR_CALL_METHOD(NULL, &columnList, "next", NULL, 0); @@ -184618,17 +179680,17 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) } do { if (ZEPHIR_IS_STRING(&type, "scalar")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 54, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 41, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "object")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 55, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 42, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "qualified")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 56, &expression, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 43, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -184677,34 +179739,34 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) RETURN_CTOR(&_6$$8); } if (ZEPHIR_IS_STRING(&type, "binary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 57, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 44, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "unary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 58, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 45, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "parentheses")) { zephir_array_fetch_string(&_8$$14, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 304); - ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 59, &_8$$14, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 46, &_8$$14, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, "(", &_7$$14, ")"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "functionCall")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 60, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 47, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "list")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 61, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 48, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "all")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 62, &expression, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 49, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -184716,17 +179778,17 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "cast")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 63, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 50, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "convert")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 64, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 51, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "case")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 65, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 52, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } @@ -184736,7 +179798,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) object_init_ex(&_11, phalcon_db_exception_ce); ZEPHIR_INIT_VAR(&_12); ZEPHIR_CONCAT_SVS(&_12, "Invalid SQL expression type '", &type, "'"); - ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 31, &_12); + ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 29, &_12); zephir_check_call_status(); zephir_throw_exception_debug(&_11, "phalcon/Db/Dialect.zep", 369); ZEPHIR_MM_RESTORE(); @@ -184786,7 +179848,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlTable) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, table, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, table, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -185026,12 +180088,12 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) } zephir_read_property(&_0, this_ptr, ZEND_STRL("escapeChar"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&escapeChar, &_0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &columns, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &columns, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SV(&_2, " ", &_1); zephir_concat_self(&sql, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getsqlexpressionfrom", NULL, 68, &tables, &escapeChar); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "getsqlexpressionfrom", NULL, 55, &tables, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, " ", &_3); @@ -185043,7 +180105,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) } if (_5) { zephir_array_fetch_string(&_7$$10, &definition, SL("joins"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 517); - ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "getsqlexpressionjoins", NULL, 69, &_7$$10, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "getsqlexpressionjoins", NULL, 56, &_7$$10, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$10); ZEPHIR_CONCAT_SV(&_8$$10, " ", &_6$$10); @@ -185055,7 +180117,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) _9 = zephir_is_true(&where); } if (_9) { - ZEPHIR_CALL_METHOD(&_10$$11, this_ptr, "getsqlexpressionwhere", NULL, 70, &where, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_10$$11, this_ptr, "getsqlexpressionwhere", NULL, 57, &where, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11$$11); ZEPHIR_CONCAT_SV(&_11$$11, " ", &_10$$11); @@ -185067,7 +180129,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) _12 = zephir_is_true(&groupBy); } if (_12) { - ZEPHIR_CALL_METHOD(&_13$$12, this_ptr, "getsqlexpressiongroupby", NULL, 71, &groupBy, &escapeChar); + ZEPHIR_CALL_METHOD(&_13$$12, this_ptr, "getsqlexpressiongroupby", NULL, 58, &groupBy, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_14$$12); ZEPHIR_CONCAT_SV(&_14$$12, " ", &_13$$12); @@ -185079,7 +180141,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) _15 = zephir_is_true(&having); } if (_15) { - ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "getsqlexpressionhaving", NULL, 72, &having, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "getsqlexpressionhaving", NULL, 59, &having, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_17$$13); ZEPHIR_CONCAT_SV(&_17$$13, " ", &_16$$13); @@ -185091,7 +180153,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) _18 = zephir_is_true(&orderBy); } if (_18) { - ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "getsqlexpressionorderby", NULL, 73, &orderBy, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "getsqlexpressionorderby", NULL, 60, &orderBy, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_20$$14); ZEPHIR_CONCAT_SV(&_20$$14, " ", &_19$$14); @@ -185107,7 +180169,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, select) zephir_create_array(&_22$$15, 2, 0); zephir_array_update_string(&_22$$15, SL("sql"), &sql, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$15, SL("value"), &limit, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 74, &_22$$15, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 61, &_22$$15, &escapeChar, &bindCounts); zephir_check_call_status(); } _23 = zephir_array_isset_string_fetch(&forUpdate, &definition, SL("forUpdate"), 1); @@ -185355,7 +180417,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionBinaryOperations) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 660); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_2, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 665); ZEPHIR_CONCAT_VSVSV(return_value, &left, " ", &_2, " ", &right); @@ -185442,17 +180504,17 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) zephir_array_fetch_string(&_6$$3, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685); if (ZEPHIR_IS_STRING(&_6$$3, "when")) { zephir_array_fetch_string(&_8$$4, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 59, &_8$$4, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 46, &_8$$4, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_10$$4, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 59, &_10$$4, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 46, &_10$$4, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_CONCAT_SVSV(&_11$$4, " WHEN ", &_7$$4, " THEN ", &_9$$4); zephir_concat_self(&sql, &_11$$4); } else { zephir_array_fetch_string(&_13$$5, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 59, &_13$$5, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 46, &_13$$5, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$5); ZEPHIR_CONCAT_SV(&_14$$5, " ELSE ", &_12$$5); @@ -185473,17 +180535,17 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) zephir_array_fetch_string(&_15$$6, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685); if (ZEPHIR_IS_STRING(&_15$$6, "when")) { zephir_array_fetch_string(&_17$$7, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687); - ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "getsqlexpression", NULL, 59, &_17$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "getsqlexpression", NULL, 46, &_17$$7, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_19$$7, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689); - ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "getsqlexpression", NULL, 59, &_19$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "getsqlexpression", NULL, 46, &_19$$7, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_20$$7); ZEPHIR_CONCAT_SVSV(&_20$$7, " WHEN ", &_16$$7, " THEN ", &_18$$7); zephir_concat_self(&sql, &_20$$7); } else { zephir_array_fetch_string(&_22$$8, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691); - ZEPHIR_CALL_METHOD(&_21$$8, this_ptr, "getsqlexpression", NULL, 59, &_22$$8, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_21$$8, this_ptr, "getsqlexpression", NULL, 46, &_22$$8, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_23$$8); ZEPHIR_CONCAT_SV(&_23$$8, " ELSE ", &_21$$8); @@ -185545,7 +180607,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCastValue) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 718); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "CAST(", &left, " AS ", &right, ")"); RETURN_MM(); @@ -185598,7 +180660,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionConvertValue) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 746); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "CONVERT(", &left, " USING ", &right, ")"); RETURN_MM(); @@ -185649,7 +180711,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqltable", &_3, 62, &table, &escapeChar); zephir_check_call_status(); zephir_array_append(&tables, &_2$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765); } ZEND_HASH_FOREACH_END(); @@ -185664,7 +180726,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) } ZEPHIR_CALL_METHOD(&table, expression, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqltable", &_3, 62, &table, &escapeChar); zephir_check_call_status(); zephir_array_append(&tables, &_4$$5, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765); ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0); @@ -185844,7 +180906,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionGroupBy) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-GROUP-BY expression", "phalcon/Db/Dialect.zep", 834); return; } - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getsqlexpression", &_3, 59, &field, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getsqlexpression", &_3, 46, &field, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&fields, &_4$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 841); ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0); @@ -185995,7 +181057,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { ZEPHIR_INIT_NVAR(&condition); ZVAL_COPY(&condition, _4$$6); - ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_6$$7, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); } ZEND_HASH_FOREACH_END(); @@ -186010,7 +181072,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_7$$8, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0); @@ -186035,7 +181097,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) zephir_concat_self_str(&joinType, SL(" ")); } zephir_array_fetch_string(&_10$$3, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913); - ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_10$$3, &escapeChar); + ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 62, &_10$$3, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$3); ZEPHIR_CONCAT_SVSVSV(&_12$$3, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition); @@ -186059,7 +181121,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } if (_13$$11) { if (!(zephir_array_isset_long(&joinConditionsArray, 0))) { - ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 59, &joinConditionsArray, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 46, &joinConditionsArray, &escapeChar, &bindCounts); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&joinCondition); @@ -186070,7 +181132,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { ZEPHIR_INIT_NVAR(&condition); ZVAL_COPY(&condition, _14$$14); - ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_16$$15, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); } ZEND_HASH_FOREACH_END(); @@ -186085,7 +181147,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_17$$16, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0); @@ -186110,7 +181172,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) zephir_concat_self_str(&joinType, SL(" ")); } zephir_array_fetch_string(&_20$$11, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913); - ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_20$$11, &escapeChar); + ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 62, &_20$$11, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_21$$11); ZEPHIR_CONCAT_SVSVSV(&_21$$11, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition); @@ -186197,7 +181259,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionLimit) _2$$4 = Z_TYPE_P(&offset) == IS_ARRAY; } if (_2$$4) { - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 59, &offset, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 46, &offset, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CPY_WRT(&offset, &_3$$7); } @@ -186303,7 +181365,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionList) } ZEPHIR_CALL_METHOD(&item, &values, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getsqlexpression", &_5, 59, &item, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getsqlexpression", &_5, 46, &item, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&items, &_6$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 993); ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0); @@ -186490,7 +181552,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionOrderBy) return; } zephir_array_fetch_long(&_6$$7, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1053); - ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 59, &_6$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 46, &_6$$7, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&type); _7$$7 = zephir_array_isset_long_fetch(&type, &field, 1, 0); @@ -186606,7 +181668,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionScalar) if (zephir_array_isset_string(&expression, SL("column"))) { zephir_array_fetch_string(&_0$$3, &expression, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1107); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 53, &_0$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 40, &_0$$3); zephir_check_call_status(); RETURN_MM(); } @@ -186679,7 +181741,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionUnaryOperations) ZEPHIR_OBS_VAR(&right); if (zephir_array_isset_string_fetch(&right, &expression, SL("right"), 0)) { zephir_array_fetch_string(&_2$$4, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1145); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 59, &right, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 46, &right, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &_2$$4, " ", &_3$$4); RETURN_MM(); @@ -186784,7 +181846,7 @@ static PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias) if (!ZEPHIR_IS_STRING(&alias, "")) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 66, &alias, &escapeChar); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 53, &alias, &escapeChar); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &qualified, " AS ", &_0$$3); RETURN_MM(); @@ -186849,18 +181911,18 @@ static PHP_METHOD(Phalcon_Db_Dialect, prepareTable) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 53, &table, &escapeChar); zephir_check_call_status(); zephir_get_strval(&table, &_0); if (!ZEPHIR_IS_STRING(&schema, "")) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 76, &schema, &escapeChar); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 63, &schema, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VSV(&_2$$3, &_1$$3, ".", &table); zephir_get_strval(&table, &_2$$3); } if (!ZEPHIR_IS_STRING(&alias, "")) { - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 66, &alias, &escapeChar); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 53, &alias, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$4); ZEPHIR_CONCAT_VSV(&_4$$4, &table, " AS ", &_3$$4); @@ -186918,11 +181980,11 @@ static PHP_METHOD(Phalcon_Db_Dialect, prepareQualified) if (!ZEPHIR_IS_STRING(&domain, "")) { ZEPHIR_INIT_VAR(&_0$$3); ZEPHIR_CONCAT_VSV(&_0$$3, &domain, ".", &column); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &_0$$3, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, &_0$$3, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &column, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, &column, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -187050,6 +182112,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Enum) zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_UNIQUE"), 196608); + zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_DEFAULT"), 0); + return SUCCESS; } @@ -187309,19 +182373,19 @@ static PHP_METHOD(Phalcon_Db_Profiler, startProfile) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 232, &sqlStatement); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 213, &sqlStatement); zephir_check_call_status(); if (Z_TYPE_P(sqlVariables) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 233, sqlVariables); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 214, sqlVariables); zephir_check_call_status(); } if (Z_TYPE_P(sqlBindTypes) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 234, sqlBindTypes); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 215, sqlBindTypes); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_0, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&_0, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 235, &_0); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 216, &_0); zephir_check_call_status(); if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("beforestartprofile")) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "beforestartprofile", NULL, 0, &activeProfile); @@ -187349,7 +182413,7 @@ static PHP_METHOD(Phalcon_Db_Profiler, stopProfile) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&finalTime, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&finalTime, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("activeProfile"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&activeProfile, &_0); @@ -188573,7 +183637,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeIndexes) ZVAL_COPY(&indexColumns, _8); ZEPHIR_INIT_NVAR(&_12$$9); object_init_ex(&_12$$9, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_13, 32, &name, &indexColumns); + ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_13, 30, &name, &indexColumns); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_12$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -188592,7 +183656,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeIndexes) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$10); object_init_ex(&_14$$10, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_13, 32, &name, &indexColumns); + ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_13, 30, &name, &indexColumns); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_14$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -188822,7 +183886,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeReferences) ZEPHIR_OBS_NVAR(&_26$$9); zephir_array_fetch_string(&_26$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413); zephir_array_update_string(&_25$$9, SL("referencedColumns"), &_26$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_24$$9, "__construct", &_27, 33, &name, &_25$$9); + ZEPHIR_CALL_METHOD(NULL, &_24$$9, "__construct", &_27, 31, &name, &_25$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_24$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -188855,7 +183919,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeReferences) ZEPHIR_OBS_NVAR(&_30$$10); zephir_array_fetch_string(&_30$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413); zephir_array_update_string(&_29$$10, SL("referencedColumns"), &_30$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$10, "__construct", &_27, 33, &name, &_29$$10); + ZEPHIR_CALL_METHOD(NULL, &_28$$10, "__construct", &_27, 31, &name, &_29$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -189576,7 +184640,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultIdValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "null"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -189596,7 +184660,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "DEFAULT"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -189755,7 +184819,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, insert) object_init_ex(&_0$$3, phalcon_db_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_SVS(&_1$$3, "Unable to insert into ", &table, " without data"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Db/Adapter/AbstractAdapter.zep", 810); ZEPHIR_MM_RESTORE(); @@ -191285,7 +186349,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, load) array_init(&_2); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "options"); - ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 171, config, &_3, &_2); + ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 150, config, &_3, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); @@ -191877,7 +186941,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, convertBoundParams) ZEPHIR_INIT_NVAR(&placeMatch); ZEPHIR_INIT_VAR(&_9$$3); ZVAL_STRING(&_9$$3, "?"); - ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 50, &bindPattern, &_9$$3, &sql); + ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 37, &bindPattern, &_9$$3, &sql); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&boundSql, &sql); @@ -192119,7 +187183,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared) do { if (ZEPHIR_IS_LONG(&type, 1)) { ZVAL_LONG(&_6$$12, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_6$$12); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 38, &value, &_6$$12); zephir_check_call_status(); break; } @@ -192300,7 +187364,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared) do { if (ZEPHIR_IS_LONG(&type, 1)) { ZVAL_LONG(&_26$$43, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_26$$43); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 38, &value, &_26$$43); zephir_check_call_status(); break; } @@ -192686,7 +187750,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query) zephir_check_call_status(); } object_init_ex(return_value, phalcon_db_result_pdoresult_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 52, this_ptr, &statement, &sqlStatement, &bindParams, &bindTypes); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 39, this_ptr, &statement, &sqlStatement, &bindParams, &bindTypes); zephir_check_call_status(); RETURN_MM(); } @@ -192918,7 +187982,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql) ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); ZVAL_LONG(&_16$$3, 1); - ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &keys, &values, &statement, &_16$$3); + ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 37, &keys, &values, &statement, &_16$$3); zephir_check_call_status(); } zephir_update_property_zval(this_ptr, ZEND_STRL("realSqlStatement"), &result); @@ -193520,7 +188584,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 495); ZEPHIR_INIT_NVAR(&_63$$3); object_init_ex(&_63$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_63$$3, "__construct", &_64, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_63$$3, "__construct", &_64, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_63$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 496); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -193822,7 +188886,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 495); ZEPHIR_INIT_NVAR(&_124$$49); object_init_ex(&_124$$49, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_124$$49, "__construct", &_64, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_124$$49, "__construct", &_64, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_124$$49, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 496); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -194040,7 +189104,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) object_init_ex(&_26$$19, phalcon_db_index_ce); zephir_array_fetch_string(&_27$$19, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551); zephir_array_fetch_string(&_28$$19, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 553); - ZEPHIR_CALL_METHOD(NULL, &_26$$19, "__construct", &_29, 32, &name, &_27$$19, &_28$$19); + ZEPHIR_CALL_METHOD(NULL, &_26$$19, "__construct", &_29, 30, &name, &_27$$19, &_28$$19); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_26$$19, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -194061,7 +189125,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) object_init_ex(&_30$$20, phalcon_db_index_ce); zephir_array_fetch_string(&_31$$20, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551); zephir_array_fetch_string(&_32$$20, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 553); - ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", &_29, 32, &name, &_31$$20, &_32$$20); + ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", &_29, 30, &name, &_31$$20, &_32$$20); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_30$$20, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -194327,7 +189391,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) ZEPHIR_OBS_NVAR(&_30$$9); zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 620); zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9); + ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 31, &name, &_29$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -194366,7 +189430,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) ZEPHIR_OBS_NVAR(&_34$$10); zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 620); zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10); + ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 31, &name, &_33$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -195094,13 +190158,13 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) ZVAL_STRING(&_52$$38, "/^'|'?::[[:alnum:][:space:]]+$/"); ZEPHIR_INIT_NVAR(&_53$$38); ZVAL_STRING(&_53$$38, ""); - ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 50, &_52$$38, &_53$$38, &_51$$38); + ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 37, &_52$$38, &_53$$38, &_51$$38); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_54$$38, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_56$$38, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509); ZEPHIR_INIT_NVAR(&_52$$38); ZVAL_STRING(&_52$$38, "null"); - ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 47, &_56$$38, &_52$$38); + ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 35, &_56$$38, &_52$$38); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_57$$38, 0)) { zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE); @@ -195114,7 +190178,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524); ZEPHIR_INIT_NVAR(&_61$$3); object_init_ex(&_61$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_61$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -195392,13 +190456,13 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) ZVAL_STRING(&_111$$76, "/^'|'?::[[:alnum:][:space:]]+$/"); ZEPHIR_INIT_NVAR(&_112$$76); ZVAL_STRING(&_112$$76, ""); - ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 50, &_111$$76, &_112$$76, &_110$$76); + ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 37, &_111$$76, &_112$$76, &_110$$76); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_113$$76, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_114$$76, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509); ZEPHIR_INIT_NVAR(&_111$$76); ZVAL_STRING(&_111$$76, "null"); - ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 47, &_114$$76, &_111$$76); + ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 35, &_114$$76, &_111$$76); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_115$$76, 0)) { zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE); @@ -195413,7 +190477,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524); ZEPHIR_INIT_NVAR(&_118$$41); object_init_ex(&_118$$41, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_118$$41, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -195679,7 +190743,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences) ZEPHIR_OBS_NVAR(&_30$$9); zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593); zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9); + ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 31, &name, &_29$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -195718,7 +190782,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences) ZEPHIR_OBS_NVAR(&_34$$10); zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593); zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10); + ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 31, &name, &_33$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -195745,7 +190809,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "DEFAULT"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -196030,11 +191094,11 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect) static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) { - zend_bool _5$$3, _34$$3, _43$$28, _71$$28; + zend_bool _5$$3, _31$$3, _43$$28, _69$$28; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_33 = NULL, *_40 = NULL, *_41 = NULL; + zephir_fcall_cache_entry *_35 = NULL, *_40 = NULL, *_41 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _28$$3, _29$$3, _30$$3, _31$$3, _32$$3, _35$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$5, _11$$7, _12$$7, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$12, _20$$13, _21$$14, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27, _42$$28, _66$$28, _67$$28, _68$$28, _69$$28, _70$$28, _72$$28, _44$$29, _45$$29, _46$$30, _47$$30, _48$$30, _49$$32, _50$$32, _51$$33, _52$$34, _53$$35, _54$$36, _55$$36, _56$$37, _57$$37, _58$$38, _59$$39, _60$$40, _61$$41, _62$$42, _63$$43, _64$$45, _65$$46, _73$$52, _74$$52, _75$$52, _76$$52; + zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _28$$3, _29$$3, _30$$3, _32$$3, _33$$3, _34$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$5, _11$$7, _12$$7, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$12, _20$$13, _21$$14, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27, _42$$28, _66$$28, _67$$28, _68$$28, _70$$28, _71$$28, _72$$28, _44$$29, _45$$29, _46$$30, _47$$30, _48$$30, _49$$32, _50$$32, _51$$33, _52$$34, _53$$35, _54$$36, _55$$36, _56$$37, _57$$37, _58$$38, _59$$39, _60$$40, _61$$41, _62$$42, _63$$43, _64$$45, _65$$46, _73$$52, _74$$52, _75$$52, _76$$52; zval table, schema; zval *this_ptr = getThis(); @@ -196060,9 +191124,9 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_UNDEF(&_28$$3); ZVAL_UNDEF(&_29$$3); ZVAL_UNDEF(&_30$$3); - ZVAL_UNDEF(&_31$$3); ZVAL_UNDEF(&_32$$3); - ZVAL_UNDEF(&_35$$3); + ZVAL_UNDEF(&_33$$3); + ZVAL_UNDEF(&_34$$3); ZVAL_UNDEF(&_6$$4); ZVAL_UNDEF(&_7$$4); ZVAL_UNDEF(&_8$$5); @@ -196093,8 +191157,8 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_UNDEF(&_66$$28); ZVAL_UNDEF(&_67$$28); ZVAL_UNDEF(&_68$$28); - ZVAL_UNDEF(&_69$$28); ZVAL_UNDEF(&_70$$28); + ZVAL_UNDEF(&_71$$28); ZVAL_UNDEF(&_72$$28); ZVAL_UNDEF(&_44$$29); ZVAL_UNDEF(&_45$$29); @@ -196170,7 +191234,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_2, 3); ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2); zephir_check_call_status(); - zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 312); + zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 311); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3) { @@ -196180,12 +191244,12 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_create_array(&definition, 1, 0); add_assoc_long_ex(&definition, SL("bindType"), 2); ZEPHIR_OBS_NVAR(&columnType); - zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128); - _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 127); + _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); if (!(_5$$3)) { - _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); } - if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) { + if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 142)) { ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_LONG(&_6$$4, 14); zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE); @@ -196201,11 +191265,11 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_9$$5); ZVAL_LONG(&_9$$5, 1); zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_10$$5, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158); + zephir_array_fetch_long(&_10$$5, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 157); if (zephir_is_true(&_10$$5)) { zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) { + } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 160)) { ZEPHIR_INIT_NVAR(&_11$$7); ZVAL_LONG(&_11$$7, 8); zephir_array_update_string(&definition, SL("type"), &_11$$7, PH_COPY | PH_SEPARATE); @@ -196214,19 +191278,19 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_array_update_string(&definition, SL("bindType"), &_12$$7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&columnType); ZVAL_STRING(&columnType, "boolean"); - } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) { + } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 171)) { ZEPHIR_INIT_NVAR(&_13$$8); ZVAL_LONG(&_13$$8, 5); zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) { + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 180)) { ZEPHIR_INIT_NVAR(&_14$$9); ZVAL_LONG(&_14$$9, 4); zephir_array_update_string(&definition, SL("type"), &_14$$9, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) { + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 185)) { ZEPHIR_INIT_NVAR(&_15$$10); ZVAL_LONG(&_15$$10, 1); zephir_array_update_string(&definition, SL("type"), &_15$$10, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) { + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 194)) { ZEPHIR_INIT_NVAR(&_16$$11); ZVAL_LONG(&_16$$11, 3); zephir_array_update_string(&definition, SL("type"), &_16$$11, PH_COPY | PH_SEPARATE); @@ -196234,7 +191298,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_17$$11); ZVAL_LONG(&_17$$11, 32); zephir_array_update_string(&definition, SL("bindType"), &_17$$11, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) { + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 201)) { ZEPHIR_INIT_NVAR(&_18$$12); ZVAL_LONG(&_18$$12, 7); zephir_array_update_string(&definition, SL("type"), &_18$$12, PH_COPY | PH_SEPARATE); @@ -196242,19 +191306,19 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_19$$12); ZVAL_LONG(&_19$$12, 3); zephir_array_update_string(&definition, SL("bindType"), &_19$$12, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) { + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 212)) { ZEPHIR_INIT_NVAR(&_20$$13); ZVAL_LONG(&_20$$13, 17); zephir_array_update_string(&definition, SL("type"), &_20$$13, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) { + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 221)) { ZEPHIR_INIT_NVAR(&_21$$14); ZVAL_LONG(&_21$$14, 2); zephir_array_update_string(&definition, SL("type"), &_21$$14, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) { + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 226)) { ZEPHIR_INIT_NVAR(&_22$$15); ZVAL_LONG(&_22$$15, 5); zephir_array_update_string(&definition, SL("type"), &_22$$15, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) { + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 231)) { ZEPHIR_INIT_NVAR(&_23$$16); ZVAL_LONG(&_23$$16, 6); zephir_array_update_string(&definition, SL("type"), &_23$$16, PH_COPY | PH_SEPARATE); @@ -196263,7 +191327,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_24$$17, 2); zephir_array_update_string(&definition, SL("type"), &_24$$17, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) { + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 248)) { ZEPHIR_INIT_NVAR(&matches); ZVAL_NULL(&matches); ZEPHIR_INIT_NVAR(&_25$$18); @@ -196283,7 +191347,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } } } - if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) { + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 264)) { zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&oldColumn) == IS_NULL) { @@ -196291,40 +191355,41 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281); + zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 280); if (zephir_is_true(&_28$$3)) { zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288); + zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 287); if (ZEPHIR_IS_LONG(&_29$$3, 0)) { zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - ZEPHIR_INIT_NVAR(&_31$$3); - ZVAL_STRING(&_31$$3, "null"); - ZEPHIR_CALL_FUNCTION(&_32$$3, "strcasecmp", &_33, 47, &_30$$3, &_31$$3); - zephir_check_call_status(); - _34$$3 = !ZEPHIR_IS_LONG(&_32$$3, 0); - if (_34$$3) { - zephir_array_fetch_long(&_35$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - _34$$3 = !ZEPHIR_IS_STRING(&_35$$3, ""); + ZEPHIR_OBS_NVAR(&_30$$3); + zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + _31$$3 = !(ZEPHIR_IS_EMPTY(&_30$$3)); + if (_31$$3) { + zephir_array_fetch_long(&_32$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + ZEPHIR_INIT_NVAR(&_33$$3); + ZVAL_STRING(&_33$$3, "null"); + ZEPHIR_CALL_FUNCTION(&_34$$3, "strcasecmp", &_35, 35, &_32$$3, &_33$$3); + zephir_check_call_status(); + _31$$3 = !ZEPHIR_IS_LONG_IDENTICAL(&_34$$3, 0); } - if (_34$$3) { - zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301); + if (_31$$3) { + zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 300); ZEPHIR_INIT_NVAR(&_37$$27); ZVAL_STRING(&_37$$27, "/^'|'$/"); ZEPHIR_INIT_NVAR(&_38$$27); ZVAL_STRING(&_38$$27, ""); - ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 50, &_37$$27, &_38$$27, &_36$$27); + ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 37, &_37$$27, &_38$$27, &_36$$27); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_39$$27, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); - ZEPHIR_INIT_NVAR(&_31$$3); - object_init_ex(&_31$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_31$$3, "__construct", &_41, 227, &columnName, &definition); + zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 306); + ZEPHIR_INIT_NVAR(&_33$$3); + object_init_ex(&_33$$3, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_33$$3, "__construct", &_41, 208, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, &_31$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308); + zephir_array_append(&columns, &_33$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); ZEPHIR_CPY_WRT(&oldColumn, &columnName); } ZEND_HASH_FOREACH_END(); } else { @@ -196343,12 +191408,12 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) add_assoc_long_ex(&_42$$28, SL("bindType"), 2); ZEPHIR_CPY_WRT(&definition, &_42$$28); ZEPHIR_OBS_NVAR(&columnType); - zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128); - _43$$28 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 127); + _43$$28 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); if (!(_43$$28)) { - _43$$28 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + _43$$28 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); } - if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) { + if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 142)) { ZEPHIR_INIT_NVAR(&_44$$29); ZVAL_LONG(&_44$$29, 14); zephir_array_update_string(&definition, SL("type"), &_44$$29, PH_COPY | PH_SEPARATE); @@ -196364,11 +191429,11 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_47$$30); ZVAL_LONG(&_47$$30, 1); zephir_array_update_string(&definition, SL("bindType"), &_47$$30, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_48$$30, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158); + zephir_array_fetch_long(&_48$$30, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 157); if (zephir_is_true(&_48$$30)) { zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) { + } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 160)) { ZEPHIR_INIT_NVAR(&_49$$32); ZVAL_LONG(&_49$$32, 8); zephir_array_update_string(&definition, SL("type"), &_49$$32, PH_COPY | PH_SEPARATE); @@ -196377,19 +191442,19 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_array_update_string(&definition, SL("bindType"), &_50$$32, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&columnType); ZVAL_STRING(&columnType, "boolean"); - } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) { + } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 171)) { ZEPHIR_INIT_NVAR(&_51$$33); ZVAL_LONG(&_51$$33, 5); zephir_array_update_string(&definition, SL("type"), &_51$$33, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) { + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 180)) { ZEPHIR_INIT_NVAR(&_52$$34); ZVAL_LONG(&_52$$34, 4); zephir_array_update_string(&definition, SL("type"), &_52$$34, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) { + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 185)) { ZEPHIR_INIT_NVAR(&_53$$35); ZVAL_LONG(&_53$$35, 1); zephir_array_update_string(&definition, SL("type"), &_53$$35, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) { + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 194)) { ZEPHIR_INIT_NVAR(&_54$$36); ZVAL_LONG(&_54$$36, 3); zephir_array_update_string(&definition, SL("type"), &_54$$36, PH_COPY | PH_SEPARATE); @@ -196397,7 +191462,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_55$$36); ZVAL_LONG(&_55$$36, 32); zephir_array_update_string(&definition, SL("bindType"), &_55$$36, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) { + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 201)) { ZEPHIR_INIT_NVAR(&_56$$37); ZVAL_LONG(&_56$$37, 7); zephir_array_update_string(&definition, SL("type"), &_56$$37, PH_COPY | PH_SEPARATE); @@ -196405,19 +191470,19 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_57$$37); ZVAL_LONG(&_57$$37, 3); zephir_array_update_string(&definition, SL("bindType"), &_57$$37, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) { + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 212)) { ZEPHIR_INIT_NVAR(&_58$$38); ZVAL_LONG(&_58$$38, 17); zephir_array_update_string(&definition, SL("type"), &_58$$38, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) { + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 221)) { ZEPHIR_INIT_NVAR(&_59$$39); ZVAL_LONG(&_59$$39, 2); zephir_array_update_string(&definition, SL("type"), &_59$$39, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) { + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 226)) { ZEPHIR_INIT_NVAR(&_60$$40); ZVAL_LONG(&_60$$40, 5); zephir_array_update_string(&definition, SL("type"), &_60$$40, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) { + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 231)) { ZEPHIR_INIT_NVAR(&_61$$41); ZVAL_LONG(&_61$$41, 6); zephir_array_update_string(&definition, SL("type"), &_61$$41, PH_COPY | PH_SEPARATE); @@ -196426,7 +191491,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_62$$42, 2); zephir_array_update_string(&definition, SL("type"), &_62$$42, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) { + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 248)) { ZEPHIR_INIT_NVAR(&matches); ZVAL_NULL(&matches); ZEPHIR_INIT_NVAR(&_63$$43); @@ -196446,7 +191511,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } } } - if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) { + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 264)) { zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&oldColumn) == IS_NULL) { @@ -196454,41 +191519,42 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_66$$28, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281); + zephir_array_fetch_long(&_66$$28, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 280); if (zephir_is_true(&_66$$28)) { zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_67$$28, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288); + zephir_array_fetch_long(&_67$$28, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 287); if (ZEPHIR_IS_LONG(&_67$$28, 0)) { zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_68$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - ZEPHIR_INIT_NVAR(&_69$$28); - ZVAL_STRING(&_69$$28, "null"); - ZEPHIR_CALL_FUNCTION(&_70$$28, "strcasecmp", &_33, 47, &_68$$28, &_69$$28); - zephir_check_call_status(); - _71$$28 = !ZEPHIR_IS_LONG(&_70$$28, 0); - if (_71$$28) { - zephir_array_fetch_long(&_72$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - _71$$28 = !ZEPHIR_IS_STRING(&_72$$28, ""); + ZEPHIR_OBS_NVAR(&_68$$28); + zephir_array_fetch_long(&_68$$28, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + _69$$28 = !(ZEPHIR_IS_EMPTY(&_68$$28)); + if (_69$$28) { + zephir_array_fetch_long(&_70$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + ZEPHIR_INIT_NVAR(&_71$$28); + ZVAL_STRING(&_71$$28, "null"); + ZEPHIR_CALL_FUNCTION(&_72$$28, "strcasecmp", &_35, 35, &_70$$28, &_71$$28); + zephir_check_call_status(); + _69$$28 = !ZEPHIR_IS_LONG_IDENTICAL(&_72$$28, 0); } - if (_71$$28) { - zephir_array_fetch_long(&_73$$52, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301); + if (_69$$28) { + zephir_array_fetch_long(&_73$$52, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 300); ZEPHIR_INIT_NVAR(&_74$$52); ZVAL_STRING(&_74$$52, "/^'|'$/"); ZEPHIR_INIT_NVAR(&_75$$52); ZVAL_STRING(&_75$$52, ""); - ZEPHIR_CALL_FUNCTION(&_76$$52, "preg_replace", &_40, 50, &_74$$52, &_75$$52, &_73$$52); + ZEPHIR_CALL_FUNCTION(&_76$$52, "preg_replace", &_40, 37, &_74$$52, &_75$$52, &_73$$52); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_76$$52, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_NVAR(&columnName); - zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); - ZEPHIR_INIT_NVAR(&_69$$28); - object_init_ex(&_69$$28, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_69$$28, "__construct", &_41, 227, &columnName, &definition); + zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 306); + ZEPHIR_INIT_NVAR(&_71$$28); + object_init_ex(&_71$$28, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_71$$28, "__construct", &_41, 208, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, &_69$$28, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308); + zephir_array_append(&columns, &_71$$28, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); ZEPHIR_CPY_WRT(&oldColumn, &columnName); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); @@ -196611,27 +191677,27 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_3, 2); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 370); + zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 369); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) { ZEPHIR_INIT_NVAR(&index); ZVAL_COPY(&index, _4); ZEPHIR_OBS_NVAR(&keyName); - zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332); + zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 331); if (!(zephir_array_isset(&indexes, &keyName))) { ZEPHIR_INIT_NVAR(&_6$$4); array_init(&_6$$4); zephir_array_update_zval(&indexes, &keyName, &_6$$4, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338); + zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 337); if (!(zephir_array_isset_string(&_7$$3, SL("columns")))) { ZEPHIR_INIT_NVAR(&columns); array_init(&columns); } else { - zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); } zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_10$$3, &_9$$3, "describeindex", NULL, 0, &keyName); @@ -196639,14 +191705,14 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_11$$3, 2); ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_10$$3, &_11$$3); zephir_check_call_status(); - zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353); + zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 352); if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _12$$3) { ZEPHIR_INIT_NVAR(&describeIndex); ZVAL_COPY(&describeIndex, _12$$3); - zephir_array_fetch_string(&_14$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_14$$7, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_14$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_14$$7, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0); @@ -196659,8 +191725,8 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) } ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_15$$8, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_15$$8, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_15$$8, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_15$$8, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0); zephir_check_call_status(); } @@ -196672,7 +191738,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_16$$3); zephir_check_call_status(); - zephir_array_fetch_string(&_18$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359); + zephir_array_fetch_string(&_18$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 358); if (zephir_is_true(&_18$$3)) { ZEPHIR_INIT_NVAR(&_19$$9); ZEPHIR_INIT_NVAR(&_20$$9); @@ -196706,20 +191772,20 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZEPHIR_CALL_METHOD(&index, &_0, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&keyName); - zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332); + zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 331); if (!(zephir_array_isset(&indexes, &keyName))) { ZEPHIR_INIT_NVAR(&_25$$14); array_init(&_25$$14); zephir_array_update_zval(&indexes, &keyName, &_25$$14, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_26$$13, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338); + zephir_array_fetch(&_26$$13, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 337); if (!(zephir_array_isset_string(&_26$$13, SL("columns")))) { ZEPHIR_INIT_NVAR(&columns); array_init(&columns); } else { - zephir_array_fetch(&_27$$16, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch(&_27$$16, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_27$$16, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch_string(&columns, &_27$$16, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); } zephir_read_property(&_28$$13, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_29$$13, &_28$$13, "describeindex", NULL, 0, &keyName); @@ -196727,14 +191793,14 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_30$$13, 2); ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_29$$13, &_30$$13); zephir_check_call_status(); - zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353); + zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 352); if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _31$$13) { ZEPHIR_INIT_NVAR(&describeIndex); ZVAL_COPY(&describeIndex, _31$$13); - zephir_array_fetch_string(&_33$$17, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_33$$17, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_33$$17, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_33$$17, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0); @@ -196747,8 +191813,8 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) } ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_34$$18, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_34$$18, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_34$$18, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_34$$18, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0); zephir_check_call_status(); } @@ -196760,7 +191826,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_35$$13); zephir_check_call_status(); - zephir_array_fetch_string(&_36$$13, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359); + zephir_array_fetch_string(&_36$$13, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 358); if (zephir_is_true(&_36$$13)) { ZEPHIR_INIT_NVAR(&_37$$19); ZEPHIR_INIT_NVAR(&_38$$19); @@ -196788,7 +191854,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZEPHIR_INIT_NVAR(&index); ZEPHIR_INIT_VAR(&indexObjects); array_init(&indexObjects); - zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 380); + zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 379); if (Z_TYPE_P(&indexes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _45, _46, _43) { @@ -196802,9 +191868,9 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_COPY(&index, _43); ZEPHIR_INIT_NVAR(&_47$$23); object_init_ex(&_47$$23, phalcon_db_index_ce); - zephir_array_fetch_string(&_48$$23, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375); - zephir_array_fetch_string(&_49$$23, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377); - ZEPHIR_CALL_METHOD(NULL, &_47$$23, "__construct", &_50, 32, &name, &_48$$23, &_49$$23); + zephir_array_fetch_string(&_48$$23, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 374); + zephir_array_fetch_string(&_49$$23, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 376); + ZEPHIR_CALL_METHOD(NULL, &_47$$23, "__construct", &_50, 30, &name, &_48$$23, &_49$$23); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_47$$23, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -196823,9 +191889,9 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_51$$24); object_init_ex(&_51$$24, phalcon_db_index_ce); - zephir_array_fetch_string(&_52$$24, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375); - zephir_array_fetch_string(&_53$$24, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377); - ZEPHIR_CALL_METHOD(NULL, &_51$$24, "__construct", &_50, 32, &name, &_52$$24, &_53$$24); + zephir_array_fetch_string(&_52$$24, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 374); + zephir_array_fetch_string(&_53$$24, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 376); + ZEPHIR_CALL_METHOD(NULL, &_51$$24, "__construct", &_50, 30, &name, &_52$$24, &_53$$24); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_51$$24, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -196932,7 +191998,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZVAL_LONG(&_3, 3); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 420); + zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 419); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _6, _7, _4) { @@ -196950,29 +192016,29 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&referencedSchema); ZVAL_NULL(&referencedSchema); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399); + zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 398); ZEPHIR_INIT_NVAR(&columns); array_init(&columns); ZEPHIR_INIT_NVAR(&referencedColumns); array_init(&referencedColumns); } else { - zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); ZEPHIR_OBS_NVAR(&referencedSchema); - zephir_array_fetch_string(&referencedSchema, &_8$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); - zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch_string(&referencedSchema, &_8$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); + zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_string(&referencedTable, &_9$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); - zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); + zephir_array_fetch_string(&referencedTable, &_9$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_10$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); - zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&columns, &_10$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); ZEPHIR_OBS_NVAR(&referencedColumns); - zephir_array_fetch_string(&referencedColumns, &_11$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&referencedColumns, &_11$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); } - zephir_array_fetch_long(&_12$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_fetch_long(&_13$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); - zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); + zephir_array_fetch_long(&_12$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_fetch_long(&_13$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); + zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); ZEPHIR_INIT_NVAR(&_14$$3); zephir_create_array(&_14$$3, 4, 0); zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); @@ -197000,29 +192066,29 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&referencedSchema); ZVAL_NULL(&referencedSchema); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399); + zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 398); ZEPHIR_INIT_NVAR(&columns); array_init(&columns); ZEPHIR_INIT_NVAR(&referencedColumns); array_init(&referencedColumns); } else { - zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); ZEPHIR_OBS_NVAR(&referencedSchema); - zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); - zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); + zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); - zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); + zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); - zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); ZEPHIR_OBS_NVAR(&referencedColumns); - zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); } - zephir_array_fetch_long(&_19$$6, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_append(&columns, &_19$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_fetch_long(&_20$$6, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); - zephir_array_append(&referencedColumns, &_20$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); + zephir_array_fetch_long(&_19$$6, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_append(&columns, &_19$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_fetch_long(&_20$$6, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); + zephir_array_append(&referencedColumns, &_20$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); ZEPHIR_INIT_NVAR(&_21$$6); zephir_create_array(&_21$$6, 4, 0); zephir_array_update_string(&_21$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); @@ -197038,7 +192104,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&number); ZEPHIR_INIT_VAR(&referenceObjects); array_init(&referenceObjects); - zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 434); + zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 433); if (Z_TYPE_P(&references) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _24, _25, _22) { @@ -197055,18 +192121,18 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&_27$$9); zephir_create_array(&_27$$9, 4, 0); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 425); zephir_array_update_string(&_27$$9, SL("referencedSchema"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); zephir_array_update_string(&_27$$9, SL("referencedTable"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); zephir_array_update_string(&_27$$9, SL("columns"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 429); zephir_array_update_string(&_27$$9, SL("referencedColumns"), &_28$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_26$$9, "__construct", &_29, 33, &name, &_27$$9); + ZEPHIR_CALL_METHOD(NULL, &_26$$9, "__construct", &_29, 31, &name, &_27$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_26$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -197088,18 +192154,18 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&_31$$10); zephir_create_array(&_31$$10, 4, 0); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 425); zephir_array_update_string(&_31$$10, SL("referencedSchema"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); zephir_array_update_string(&_31$$10, SL("referencedTable"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); zephir_array_update_string(&_31$$10, SL("columns"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 429); zephir_array_update_string(&_31$$10, SL("referencedColumns"), &_32$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_30$$10, "__construct", &_29, 33, &name, &_31$$10); + ZEPHIR_CALL_METHOD(NULL, &_30$$10, "__construct", &_29, 31, &name, &_31$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_30$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -197126,7 +192192,7 @@ static PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "NULL"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -197272,7 +192338,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) } _8$$5 = _7$$5; if (!(_8$$5)) { - ZEPHIR_CALL_FUNCTION(&_9$$5, "is_float", NULL, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_9$$5, "is_float", NULL, 209, &defaultValue); zephir_check_call_status(); _8$$5 = zephir_is_true(&_9$$5); } @@ -197283,7 +192349,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) } else { ZEPHIR_INIT_VAR(&_11$$7); ZVAL_STRING(&_11$$7, "\""); - ZEPHIR_CALL_FUNCTION(&_12$$7, "addcslashes", NULL, 229, &defaultValue, &_11$$7); + ZEPHIR_CALL_FUNCTION(&_12$$7, "addcslashes", NULL, 210, &defaultValue, &_11$$7); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_13$$7); ZEPHIR_CONCAT_SVS(&_13$$7, " DEFAULT \"", &_12$$7, "\""); @@ -197388,7 +192454,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) } ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -197398,7 +192464,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_11, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getcolumnlist", NULL, 67, &_11); + ZEPHIR_CALL_METHOD(&_10, this_ptr, "getcolumnlist", NULL, 54, &_11); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_12); ZEPHIR_CONCAT_SVSVSVS(&_12, " FOREIGN KEY (", &_5, ") REFERENCES ", &_7, "(", &_10, ")"); @@ -197490,7 +192556,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_5, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 67, &_5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 54, &_5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVSVS(&_6, "`", &_3, "` (", &_4, ")"); @@ -197548,7 +192614,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, addPrimaryKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &_2); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " ADD PRIMARY KEY (", &_1, ")"); RETURN_MM(); @@ -197759,7 +192825,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } _11$$10 = _10$$10; if (!(_11$$10)) { - ZEPHIR_CALL_FUNCTION(&_12$$10, "is_float", &_13, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_12$$10, "is_float", &_13, 209, &defaultValue); zephir_check_call_status(); _11$$10 = zephir_is_true(&_12$$10); } @@ -197770,7 +192836,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_INIT_NVAR(&_15$$12); ZVAL_STRING(&_15$$12, "\""); - ZEPHIR_CALL_FUNCTION(&_16$$12, "addcslashes", &_17, 229, &defaultValue, &_15$$12); + ZEPHIR_CALL_FUNCTION(&_16$$12, "addcslashes", &_17, 210, &defaultValue, &_15$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_18$$12); ZEPHIR_CONCAT_SVS(&_18$$12, " DEFAULT \"", &_16$$12, "\""); @@ -197839,7 +192905,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } _30$$19 = _29$$19; if (!(_30$$19)) { - ZEPHIR_CALL_FUNCTION(&_31$$19, "is_float", &_13, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_31$$19, "is_float", &_13, 209, &defaultValue); zephir_check_call_status(); _30$$19 = zephir_is_true(&_31$$19); } @@ -197850,7 +192916,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_INIT_NVAR(&_33$$21); ZVAL_STRING(&_33$$21, "\""); - ZEPHIR_CALL_FUNCTION(&_34$$21, "addcslashes", &_17, 229, &defaultValue, &_33$$21); + ZEPHIR_CALL_FUNCTION(&_34$$21, "addcslashes", &_17, 210, &defaultValue, &_33$$21); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_35$$21); ZEPHIR_CONCAT_SVS(&_35$$21, " DEFAULT \"", &_34$$21, "\""); @@ -197897,7 +192963,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_44$$27, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_43$$27, this_ptr, "getcolumnlist", &_45, 67, &_44$$27); + ZEPHIR_CALL_METHOD(&_43$$27, this_ptr, "getcolumnlist", &_45, 54, &_44$$27); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_46$$27); ZEPHIR_CONCAT_SVS(&_46$$27, "PRIMARY KEY (", &_43$$27, ")"); @@ -197906,7 +192972,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_48$$29, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_47$$29, this_ptr, "getcolumnlist", &_45, 67, &_48$$29); + ZEPHIR_CALL_METHOD(&_47$$29, this_ptr, "getcolumnlist", &_45, 54, &_48$$29); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$29); ZEPHIR_CONCAT_VSVSVS(&_49$$29, &indexType, " KEY `", &indexName, "` (", &_47$$29, ")"); @@ -197914,7 +192980,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_CALL_METHOD(&_51$$30, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_50$$30, this_ptr, "getcolumnlist", &_45, 67, &_51$$30); + ZEPHIR_CALL_METHOD(&_50$$30, this_ptr, "getcolumnlist", &_45, 54, &_51$$30); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_52$$30); ZEPHIR_CONCAT_SVSVS(&_52$$30, "KEY `", &indexName, "` (", &_50$$30, ")"); @@ -197941,7 +193007,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_54$$32, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_53$$32, this_ptr, "getcolumnlist", &_45, 67, &_54$$32); + ZEPHIR_CALL_METHOD(&_53$$32, this_ptr, "getcolumnlist", &_45, 54, &_54$$32); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_55$$32); ZEPHIR_CONCAT_SVS(&_55$$32, "PRIMARY KEY (", &_53$$32, ")"); @@ -197950,7 +193016,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_57$$34, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_56$$34, this_ptr, "getcolumnlist", &_45, 67, &_57$$34); + ZEPHIR_CALL_METHOD(&_56$$34, this_ptr, "getcolumnlist", &_45, 54, &_57$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_58$$34); ZEPHIR_CONCAT_VSVSVS(&_58$$34, &indexType, " KEY `", &indexName, "` (", &_56$$34, ")"); @@ -197958,7 +193024,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_CALL_METHOD(&_60$$35, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_59$$35, this_ptr, "getcolumnlist", &_45, 67, &_60$$35); + ZEPHIR_CALL_METHOD(&_59$$35, this_ptr, "getcolumnlist", &_45, 54, &_60$$35); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_61$$35); ZEPHIR_CONCAT_SVSVS(&_61$$35, "KEY `", &indexName, "` (", &_59$$35, ")"); @@ -197984,7 +193050,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_66$$37, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_65$$37, this_ptr, "getcolumnlist", &_45, 67, &_66$$37); + ZEPHIR_CALL_METHOD(&_65$$37, this_ptr, "getcolumnlist", &_45, 54, &_66$$37); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_68$$37, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -197994,7 +193060,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_71$$37, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_70$$37, this_ptr, "getcolumnlist", &_45, 67, &_71$$37); + ZEPHIR_CALL_METHOD(&_70$$37, this_ptr, "getcolumnlist", &_45, 54, &_71$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_72$$37); ZEPHIR_CONCAT_SVSVSSVSVS(&_72$$37, "CONSTRAINT `", &_64$$37, "` FOREIGN KEY (", &_65$$37, ")", " REFERENCES ", &_67$$37, " (", &_70$$37, ")"); @@ -198030,7 +193096,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_77$$40, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_76$$40, this_ptr, "getcolumnlist", &_45, 67, &_77$$40); + ZEPHIR_CALL_METHOD(&_76$$40, this_ptr, "getcolumnlist", &_45, 54, &_77$$40); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_79$$40, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -198040,7 +193106,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_82$$40, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_81$$40, this_ptr, "getcolumnlist", &_45, 67, &_82$$40); + ZEPHIR_CALL_METHOD(&_81$$40, this_ptr, "getcolumnlist", &_45, 54, &_82$$40); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_83$$40); ZEPHIR_CONCAT_SVSVSSVSVS(&_83$$40, "CONSTRAINT `", &_75$$40, "` FOREIGN KEY (", &_76$$40, ")", " REFERENCES ", &_78$$40, " (", &_81$$40, ")"); @@ -198713,7 +193779,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VV(&_2$$3, &_0$$3, &_1$$3); @@ -198775,7 +193841,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_7$$18, this_ptr, "getcolumnsizeandscale", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$18, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_8$$18, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$18); ZEPHIR_CONCAT_VV(&_9$$18, &_7$$18, &_8$$18); @@ -198786,9 +193852,9 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DOUBLE")); } - ZEPHIR_CALL_METHOD(&_10$$20, this_ptr, "checkcolumnsizeandscale", NULL, 231, column); + ZEPHIR_CALL_METHOD(&_10$$20, this_ptr, "checkcolumnsizeandscale", NULL, 212, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_12$$20); ZEPHIR_CONCAT_VV(&_12$$20, &_10$$20, &_11$$20); @@ -198808,9 +193874,9 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT")); } - ZEPHIR_CALL_METHOD(&_14$$24, this_ptr, "checkcolumnsizeandscale", NULL, 231, column); + ZEPHIR_CALL_METHOD(&_14$$24, this_ptr, "checkcolumnsizeandscale", NULL, 212, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15$$24, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_15$$24, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_16$$24); ZEPHIR_CONCAT_VV(&_16$$24, &_14$$24, &_15$$24); @@ -198823,7 +193889,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_17$$26, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_18$$26, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_18$$26, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_19$$26); ZEPHIR_CONCAT_VV(&_19$$26, &_17$$26, &_18$$26); @@ -198860,7 +193926,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_20$$36, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_21$$36, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_21$$36, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_22$$36); ZEPHIR_CONCAT_VV(&_22$$36, &_20$$36, &_21$$36); @@ -198879,7 +193945,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_23$$40, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_24$$40, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_24$$40, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_25$$40); ZEPHIR_CONCAT_VV(&_25$$40, &_23$$40, &_24$$40); @@ -198930,7 +193996,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_30$$52, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_31$$52, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_31$$52, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_32$$52); ZEPHIR_CONCAT_VV(&_32$$52, &_30$$52, &_31$$52); @@ -198959,7 +194025,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_36$$59); ZEPHIR_CONCAT_SV(&_36$$59, "Unrecognized MySQL data type at column ", &_35$$59); - ZEPHIR_CALL_METHOD(NULL, &_34$$59, "__construct", NULL, 31, &_36$$59); + ZEPHIR_CALL_METHOD(NULL, &_34$$59, "__construct", NULL, 29, &_36$$59); zephir_check_call_status(); zephir_throw_exception_debug(&_34$$59, "phalcon/Db/Dialect/Mysql.zep", 635); ZEPHIR_MM_RESTORE(); @@ -198979,7 +194045,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) ZVAL_COPY(&value$$61, _37$$61); ZEPHIR_INIT_NVAR(&_39$$62); ZVAL_STRING(&_39$$62, "\""); - ZEPHIR_CALL_FUNCTION(&_40$$62, "addcslashes", &_41, 229, &value$$61, &_39$$62); + ZEPHIR_CALL_FUNCTION(&_40$$62, "addcslashes", &_41, 210, &value$$61, &_39$$62); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_42$$62); ZEPHIR_CONCAT_SVS(&_42$$62, "\"", &_40$$62, "\", "); @@ -198998,7 +194064,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_43$$63); ZVAL_STRING(&_43$$63, "\""); - ZEPHIR_CALL_FUNCTION(&_44$$63, "addcslashes", &_41, 229, &value$$61, &_43$$63); + ZEPHIR_CALL_FUNCTION(&_44$$63, "addcslashes", &_41, 210, &value$$61, &_43$$63); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$63); ZEPHIR_CONCAT_SVS(&_45$$63, "\"", &_44$$63, "\", "); @@ -199018,7 +194084,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_50$$64); ZVAL_STRING(&_50$$64, "\""); - ZEPHIR_CALL_FUNCTION(&_51$$64, "addcslashes", &_41, 229, &typeValues, &_50$$64); + ZEPHIR_CALL_FUNCTION(&_51$$64, "addcslashes", &_41, 210, &typeValues, &_50$$64); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_52$$64); ZEPHIR_CONCAT_SVS(&_52$$64, "(\"", &_51$$64, "\")"); @@ -199247,7 +194313,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) } _13$$8 = _12$$8; if (!(_13$$8)) { - ZEPHIR_CALL_FUNCTION(&_14$$8, "is_float", NULL, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_14$$8, "is_float", NULL, 209, &defaultValue); zephir_check_call_status(); _13$$8 = zephir_is_true(&_14$$8); } @@ -199258,7 +194324,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) } else { ZEPHIR_INIT_VAR(&_16$$10); ZVAL_STRING(&_16$$10, "\""); - ZEPHIR_CALL_FUNCTION(&_17$$10, "addcslashes", NULL, 229, &defaultValue, &_16$$10); + ZEPHIR_CALL_FUNCTION(&_17$$10, "addcslashes", NULL, 210, &defaultValue, &_16$$10); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_18$$10); ZEPHIR_CONCAT_SVS(&_18$$10, " DEFAULT \"", &_17$$10, "\""); @@ -199847,13 +194913,13 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addForeignKey) } ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_7, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_9, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8, this_ptr, "getcolumnlist", NULL, 67, &_9); + ZEPHIR_CALL_METHOD(&_8, this_ptr, "getcolumnlist", NULL, 54, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_10); ZEPHIR_CONCAT_SVSSVSVS(&_10, " FOREIGN KEY (", &_5, ")", " REFERENCES \"", &_7, "\" (", &_8, ")"); @@ -199953,7 +195019,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addIndex) zephir_concat_self(&sql, &_4); ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVS(&_7, " (", &_5, ")"); @@ -200011,7 +195077,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addPrimaryKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &_2); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVSVS(return_value, "ALTER TABLE ", &_0, " ADD CONSTRAINT \"", &tableName, "_PRIMARY\" PRIMARY KEY (", &_1, ")"); RETURN_MM(); @@ -200302,7 +195368,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) } ZEPHIR_INIT_NVAR(&column); if (!(ZEPHIR_IS_EMPTY(&primaryColumns))) { - ZEPHIR_CALL_METHOD(&_30$$19, this_ptr, "getcolumnlist", NULL, 67, &primaryColumns); + ZEPHIR_CALL_METHOD(&_30$$19, this_ptr, "getcolumnlist", NULL, 54, &primaryColumns); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_31$$19); ZEPHIR_CONCAT_SVS(&_31$$19, "PRIMARY KEY (", &_30$$19, ")"); @@ -200324,7 +195390,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_35$$22, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_34$$22, this_ptr, "getcolumnlist", NULL, 67, &_35$$22); + ZEPHIR_CALL_METHOD(&_34$$22, this_ptr, "getcolumnlist", NULL, 54, &_35$$22); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$22); ZEPHIR_CONCAT_SVS(&_36$$22, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_34$$22, ")"); @@ -200333,7 +195399,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_38$$24, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_37$$24, this_ptr, "getcolumnlist", NULL, 67, &_38$$24); + ZEPHIR_CALL_METHOD(&_37$$24, this_ptr, "getcolumnlist", NULL, 54, &_38$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_39$$24); ZEPHIR_CONCAT_SVSVSVS(&_39$$24, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_37$$24, ")"); @@ -200348,7 +195414,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&indexSqlAfterCreate, &_42$$25); ZEPHIR_CALL_METHOD(&_44$$25, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_43$$25, this_ptr, "getcolumnlist", NULL, 67, &_44$$25); + ZEPHIR_CALL_METHOD(&_43$$25, this_ptr, "getcolumnlist", NULL, 54, &_44$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$25); ZEPHIR_CONCAT_SVS(&_45$$25, " (", &_43$$25, ");"); @@ -200378,7 +195444,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_47$$28, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_46$$28, this_ptr, "getcolumnlist", NULL, 67, &_47$$28); + ZEPHIR_CALL_METHOD(&_46$$28, this_ptr, "getcolumnlist", NULL, 54, &_47$$28); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_48$$28); ZEPHIR_CONCAT_SVS(&_48$$28, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_46$$28, ")"); @@ -200387,7 +195453,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_50$$30, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_49$$30, this_ptr, "getcolumnlist", NULL, 67, &_50$$30); + ZEPHIR_CALL_METHOD(&_49$$30, this_ptr, "getcolumnlist", NULL, 54, &_50$$30); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_51$$30); ZEPHIR_CONCAT_SVSVSVS(&_51$$30, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_49$$30, ")"); @@ -200402,7 +195468,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&indexSqlAfterCreate, &_54$$31); ZEPHIR_CALL_METHOD(&_56$$31, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_55$$31, this_ptr, "getcolumnlist", NULL, 67, &_56$$31); + ZEPHIR_CALL_METHOD(&_55$$31, this_ptr, "getcolumnlist", NULL, 54, &_56$$31); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_57$$31); ZEPHIR_CONCAT_SVS(&_57$$31, " (", &_55$$31, ");"); @@ -200430,7 +195496,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_62$$34, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_61$$34, this_ptr, "getcolumnlist", NULL, 67, &_62$$34); + ZEPHIR_CALL_METHOD(&_61$$34, this_ptr, "getcolumnlist", NULL, 54, &_62$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_63$$34); ZEPHIR_CONCAT_SVSVS(&_63$$34, "CONSTRAINT \"", &_60$$34, "\" FOREIGN KEY (", &_61$$34, ") REFERENCES "); @@ -200442,7 +195508,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&referenceSql, &_64$$34); ZEPHIR_CALL_METHOD(&_67$$34, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_66$$34, this_ptr, "getcolumnlist", NULL, 67, &_67$$34); + ZEPHIR_CALL_METHOD(&_66$$34, this_ptr, "getcolumnlist", NULL, 54, &_67$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_68$$34); ZEPHIR_CONCAT_SVS(&_68$$34, " (", &_66$$34, ")"); @@ -200478,7 +195544,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_73$$37, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_72$$37, this_ptr, "getcolumnlist", NULL, 67, &_73$$37); + ZEPHIR_CALL_METHOD(&_72$$37, this_ptr, "getcolumnlist", NULL, 54, &_73$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_74$$37); ZEPHIR_CONCAT_SVSVS(&_74$$37, "CONSTRAINT \"", &_71$$37, "\" FOREIGN KEY (", &_72$$37, ") REFERENCES "); @@ -200490,7 +195556,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&referenceSql, &_75$$37); ZEPHIR_CALL_METHOD(&_78$$37, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_77$$37, this_ptr, "getcolumnlist", NULL, 67, &_78$$37); + ZEPHIR_CALL_METHOD(&_77$$37, this_ptr, "getcolumnlist", NULL, 54, &_78$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_79$$37); ZEPHIR_CONCAT_SVS(&_79$$37, " (", &_77$$37, ")"); @@ -201227,7 +196293,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7$$36); ZEPHIR_CONCAT_SV(&_7$$36, "Unrecognized PostgreSQL data type at column ", &_6$$36); - ZEPHIR_CALL_METHOD(NULL, &_5$$36, "__construct", NULL, 31, &_7$$36); + ZEPHIR_CALL_METHOD(NULL, &_5$$36, "__construct", NULL, 29, &_7$$36); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$36, "phalcon/Db/Dialect/Postgresql.zep", 511); ZEPHIR_MM_RESTORE(); @@ -201246,7 +196312,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) ZVAL_COPY(&value$$38, _8$$38); ZEPHIR_INIT_NVAR(&_10$$39); ZVAL_STRING(&_10$$39, "\'"); - ZEPHIR_CALL_FUNCTION(&_11$$39, "addcslashes", &_12, 229, &value$$38, &_10$$39); + ZEPHIR_CALL_FUNCTION(&_11$$39, "addcslashes", &_12, 210, &value$$38, &_10$$39); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$39); ZEPHIR_CONCAT_SVS(&_13$$39, "'", &_11$$39, "', "); @@ -201265,7 +196331,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$40); ZVAL_STRING(&_14$$40, "\'"); - ZEPHIR_CALL_FUNCTION(&_15$$40, "addcslashes", &_12, 229, &value$$38, &_14$$40); + ZEPHIR_CALL_FUNCTION(&_15$$40, "addcslashes", &_12, 210, &value$$38, &_14$$40); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$40); ZEPHIR_CONCAT_SVS(&_16$$40, "'", &_15$$40, "', "); @@ -201285,7 +196351,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_21$$41); ZVAL_STRING(&_21$$41, "\'"); - ZEPHIR_CALL_FUNCTION(&_22$$41, "addcslashes", &_12, 229, &typeValues, &_21$$41); + ZEPHIR_CALL_FUNCTION(&_22$$41, "addcslashes", &_12, 210, &typeValues, &_21$$41); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_23$$41); ZEPHIR_CONCAT_SVS(&_23$$41, "('", &_22$$41, "')"); @@ -201857,7 +196923,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Postgresql, castDefault) } else { ZEPHIR_INIT_VAR(&_7$$6); ZVAL_STRING(&_7$$6, "\'"); - ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 229, &defaultValue, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 210, &defaultValue, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$6); ZEPHIR_CONCAT_SVS(&_9$$6, "'", &_8$$6, "'"); @@ -201989,7 +197055,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addColumn) } else { ZEPHIR_INIT_VAR(&_7$$5); ZVAL_STRING(&_7$$5, "\""); - ZEPHIR_CALL_FUNCTION(&_8$$5, "addcslashes", NULL, 229, &defaultValue, &_7$$5); + ZEPHIR_CALL_FUNCTION(&_8$$5, "addcslashes", NULL, 210, &defaultValue, &_7$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$5); ZEPHIR_CONCAT_SVS(&_9$$5, " DEFAULT \"", &_8$$5, "\""); @@ -202135,7 +197201,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex) } ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVSVS(&_7, " ON \"", &tableName, "\" (", &_5, ")"); @@ -202381,7 +197447,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else { ZEPHIR_INIT_NVAR(&_13$$12); ZVAL_STRING(&_13$$12, "\""); - ZEPHIR_CALL_FUNCTION(&_14$$12, "addcslashes", &_15, 229, &defaultValue, &_13$$12); + ZEPHIR_CALL_FUNCTION(&_14$$12, "addcslashes", &_15, 210, &defaultValue, &_13$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$12); ZEPHIR_CONCAT_SVS(&_16$$12, " DEFAULT \"", &_14$$12, "\""); @@ -202445,7 +197511,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else { ZEPHIR_INIT_NVAR(&_26$$20); ZVAL_STRING(&_26$$20, "\""); - ZEPHIR_CALL_FUNCTION(&_27$$20, "addcslashes", &_15, 229, &defaultValue, &_26$$20); + ZEPHIR_CALL_FUNCTION(&_27$$20, "addcslashes", &_15, 210, &defaultValue, &_26$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$20); ZEPHIR_CONCAT_SVS(&_28$$20, " DEFAULT \"", &_27$$20, "\""); @@ -202490,7 +197556,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) if (_32$$24) { ZEPHIR_CALL_METHOD(&_36$$25, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$25, this_ptr, "getcolumnlist", &_37, 67, &_36$$25); + ZEPHIR_CALL_METHOD(&_35$$25, this_ptr, "getcolumnlist", &_37, 54, &_36$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_38$$25); ZEPHIR_CONCAT_SVS(&_38$$25, "PRIMARY KEY (", &_35$$25, ")"); @@ -202498,7 +197564,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else if (_33$$24) { ZEPHIR_CALL_METHOD(&_40$$26, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_39$$26, this_ptr, "getcolumnlist", &_37, 67, &_40$$26); + ZEPHIR_CALL_METHOD(&_39$$26, this_ptr, "getcolumnlist", &_37, 54, &_40$$26); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_41$$26); ZEPHIR_CONCAT_SVS(&_41$$26, "UNIQUE (", &_39$$26, ")"); @@ -202533,7 +197599,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) if (_42$$27) { ZEPHIR_CALL_METHOD(&_46$$28, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_45$$28, this_ptr, "getcolumnlist", &_37, 67, &_46$$28); + ZEPHIR_CALL_METHOD(&_45$$28, this_ptr, "getcolumnlist", &_37, 54, &_46$$28); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_47$$28); ZEPHIR_CONCAT_SVS(&_47$$28, "PRIMARY KEY (", &_45$$28, ")"); @@ -202541,7 +197607,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else if (_43$$27) { ZEPHIR_CALL_METHOD(&_49$$29, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_48$$29, this_ptr, "getcolumnlist", &_37, 67, &_49$$29); + ZEPHIR_CALL_METHOD(&_48$$29, this_ptr, "getcolumnlist", &_37, 54, &_49$$29); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_50$$29); ZEPHIR_CONCAT_SVS(&_50$$29, "UNIQUE (", &_48$$29, ")"); @@ -202565,13 +197631,13 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_55$$31, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_54$$31, this_ptr, "getcolumnlist", &_37, 67, &_55$$31); + ZEPHIR_CALL_METHOD(&_54$$31, this_ptr, "getcolumnlist", &_37, 54, &_55$$31); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_56$$31, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_58$$31, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_57$$31, this_ptr, "getcolumnlist", &_37, 67, &_58$$31); + ZEPHIR_CALL_METHOD(&_57$$31, this_ptr, "getcolumnlist", &_37, 54, &_58$$31); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&referenceSql); ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_53$$31, "` FOREIGN KEY (", &_54$$31, ")", " REFERENCES `", &_56$$31, "`(", &_57$$31, ")"); @@ -202606,13 +197672,13 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_63$$34, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_62$$34, this_ptr, "getcolumnlist", &_37, 67, &_63$$34); + ZEPHIR_CALL_METHOD(&_62$$34, this_ptr, "getcolumnlist", &_37, 54, &_63$$34); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_64$$34, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_66$$34, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_65$$34, this_ptr, "getcolumnlist", &_37, 67, &_66$$34); + ZEPHIR_CALL_METHOD(&_65$$34, this_ptr, "getcolumnlist", &_37, 54, &_66$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&referenceSql); ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_61$$34, "` FOREIGN KEY (", &_62$$34, ")", " REFERENCES `", &_64$$34, "`(", &_65$$34, ")"); @@ -203396,7 +198462,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7$$38); ZEPHIR_CONCAT_SV(&_7$$38, "Unrecognized SQLite data type at column ", &_6$$38); - ZEPHIR_CALL_METHOD(NULL, &_5$$38, "__construct", NULL, 31, &_7$$38); + ZEPHIR_CALL_METHOD(NULL, &_5$$38, "__construct", NULL, 29, &_7$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$38, "phalcon/Db/Dialect/Sqlite.zep", 520); ZEPHIR_MM_RESTORE(); @@ -203416,7 +198482,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) ZVAL_COPY(&value$$40, _8$$40); ZEPHIR_INIT_NVAR(&_10$$41); ZVAL_STRING(&_10$$41, "\""); - ZEPHIR_CALL_FUNCTION(&_11$$41, "addcslashes", &_12, 229, &value$$40, &_10$$41); + ZEPHIR_CALL_FUNCTION(&_11$$41, "addcslashes", &_12, 210, &value$$40, &_10$$41); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$41); ZEPHIR_CONCAT_SVS(&_13$$41, "\"", &_11$$41, "\", "); @@ -203435,7 +198501,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$42); ZVAL_STRING(&_14$$42, "\""); - ZEPHIR_CALL_FUNCTION(&_15$$42, "addcslashes", &_12, 229, &value$$40, &_14$$42); + ZEPHIR_CALL_FUNCTION(&_15$$42, "addcslashes", &_12, 210, &value$$40, &_14$$42); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$42); ZEPHIR_CONCAT_SVS(&_16$$42, "\"", &_15$$42, "\", "); @@ -203455,7 +198521,7 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_21$$43); ZVAL_STRING(&_21$$43, "\""); - ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_12, 229, &typeValues, &_21$$43); + ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_12, 210, &typeValues, &_21$$43); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_23$$43); ZEPHIR_CONCAT_SVS(&_23$$43, "(\"", &_22$$43, "\")"); @@ -203517,13 +198583,13 @@ static PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listIndexesSql) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 53, &table); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SVS(&_1, "SELECT sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ", &_0, " COLLATE NOCASE"); zephir_get_strval(&sql, &_1); if (!(ZEPHIR_IS_EMPTY(&keyName))) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 66, &keyName); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 53, &keyName); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVS(&_3$$3, " AND name = ", &_2$$3, " COLLATE NOCASE"); @@ -203877,7 +198943,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Result_PdoResult) zend_declare_property_null(phalcon_db_result_pdoresult_ce, SL("bindParams"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_db_result_pdoresult_ce, SL("bindTypes"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_db_result_pdoresult_ce, SL("connection"), ZEND_ACC_PROTECTED); - zend_declare_property_long(phalcon_db_result_pdoresult_ce, SL("fetchMode"), 5, ZEND_ACC_PROTECTED); + zend_declare_property_long(phalcon_db_result_pdoresult_ce, SL("fetchMode"), 0, ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_db_result_pdoresult_ce, SL("pdoStatement"), ZEND_ACC_PROTECTED); zend_declare_property_null(phalcon_db_result_pdoresult_ce, SL("result"), ZEND_ACC_PROTECTED); zend_declare_property_bool(phalcon_db_result_pdoresult_ce, SL("rowCount"), 0, ZEND_ACC_PROTECTED); @@ -203938,8 +199004,8 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) { long n = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; - zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0, _1$$4, _2$$4; + zephir_fcall_cache_entry *_4 = NULL; + zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0, _1$$4, _2$$4, _3$$6; zend_long number, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -203951,6 +199017,7 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$4); ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$6); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -203992,7 +199059,8 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) if (!(n != number)) { break; } - ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_3, 0); + zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_4, 0, &_3$$6); zephir_check_call_status(); n++; } @@ -204020,129 +199088,153 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, execute) static PHP_METHOD(Phalcon_Db_Result_PdoResult, fetch) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, fetchStyle_sub, *cursorOrientation = NULL, cursorOrientation_sub, *cursorOffset = NULL, cursorOffset_sub, __$null, _0; + zval *fetchStyle_param = NULL, *cursorOrientation_param = NULL, *cursorOffset_param = NULL, mode, _0, _1, _2; + zend_long fetchStyle, cursorOrientation, cursorOffset, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&fetchStyle_sub); - ZVAL_UNDEF(&cursorOrientation_sub); - ZVAL_UNDEF(&cursorOffset_sub); - ZVAL_NULL(&__$null); + ZVAL_UNDEF(&mode); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(fetchStyle) - Z_PARAM_ZVAL_OR_NULL(cursorOrientation) - Z_PARAM_ZVAL_OR_NULL(cursorOffset) + Z_PARAM_LONG_OR_NULL(fetchStyle, is_null_true) + Z_PARAM_LONG(cursorOrientation) + Z_PARAM_LONG(cursorOffset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &fetchStyle, &cursorOrientation, &cursorOffset); - if (!fetchStyle) { - fetchStyle = &fetchStyle_sub; - fetchStyle = &__$null; + zephir_fetch_params(1, 0, 3, &fetchStyle_param, &cursorOrientation_param, &cursorOffset_param); + if (!fetchStyle_param) { + fetchStyle = 0; + } else { + fetchStyle = zephir_get_intval(fetchStyle_param); } - if (!cursorOrientation) { - cursorOrientation = &cursorOrientation_sub; - cursorOrientation = &__$null; + if (!cursorOrientation_param) { + cursorOrientation = 0; + } else { + cursorOrientation = zephir_get_intval(cursorOrientation_param); } - if (!cursorOffset) { - cursorOffset = &cursorOffset_sub; - cursorOffset = &__$null; + if (!cursorOffset_param) { + cursorOffset = 0; + } else { + cursorOffset = zephir_get_intval(cursorOffset_param); } + if (1 == 1) { + ZEPHIR_INIT_VAR(&mode); + ZVAL_LONG(&mode, fetchStyle); + } else { + ZEPHIR_OBS_NVAR(&mode); + zephir_read_property(&mode, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC); + } zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, fetchStyle, cursorOrientation, cursorOffset); + ZVAL_LONG(&_1, cursorOrientation); + ZVAL_LONG(&_2, cursorOffset); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, &mode, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Db_Result_PdoResult, fetchAll) { - zend_bool _1; + zend_bool _3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, fetchStyle_sub, *fetchArgument = NULL, fetchArgument_sub, *ctorArgs = NULL, ctorArgs_sub, __$null, pdoStatement, _0; + zval *fetchStyle_param = NULL, *fetchArgument_param = NULL, *ctorArgs_param = NULL, pdoStatement, mode, _0, _1$$3, _2$$3, _4$$4, _5$$4; + zend_long fetchStyle, fetchArgument, ctorArgs, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&fetchStyle_sub); - ZVAL_UNDEF(&fetchArgument_sub); - ZVAL_UNDEF(&ctorArgs_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&pdoStatement); + ZVAL_UNDEF(&mode); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(fetchStyle) - Z_PARAM_ZVAL_OR_NULL(fetchArgument) - Z_PARAM_ZVAL_OR_NULL(ctorArgs) + Z_PARAM_LONG_OR_NULL(fetchStyle, is_null_true) + Z_PARAM_LONG(fetchArgument) + Z_PARAM_LONG(ctorArgs) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &fetchStyle, &fetchArgument, &ctorArgs); - if (!fetchStyle) { - fetchStyle = &fetchStyle_sub; - fetchStyle = &__$null; + zephir_fetch_params(1, 0, 3, &fetchStyle_param, &fetchArgument_param, &ctorArgs_param); + if (!fetchStyle_param) { + fetchStyle = 0; + } else { + fetchStyle = zephir_get_intval(fetchStyle_param); } - if (!fetchArgument) { - fetchArgument = &fetchArgument_sub; - fetchArgument = &__$null; + if (!fetchArgument_param) { + fetchArgument = 0; + } else { + fetchArgument = zephir_get_intval(fetchArgument_param); } - if (!ctorArgs) { - ctorArgs = &ctorArgs_sub; - ctorArgs = &__$null; + if (!ctorArgs_param) { + ctorArgs = 0; + } else { + ctorArgs = zephir_get_intval(ctorArgs_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&pdoStatement, &_0); - if (Z_TYPE_P(fetchStyle) != IS_LONG) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); + if (1 == 1) { + ZEPHIR_INIT_VAR(&mode); + ZVAL_LONG(&mode, fetchStyle); + } else { + ZEPHIR_OBS_NVAR(&mode); + zephir_read_property(&mode, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC); } - if (ZEPHIR_IS_LONG(fetchStyle, 8)) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs); + if (fetchStyle == 8) { + ZVAL_LONG(&_1$$3, fetchArgument); + ZVAL_LONG(&_2$$3, ctorArgs); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &mode, &_1$$3, &_2$$3); zephir_check_call_status(); RETURN_MM(); } - _1 = ZEPHIR_IS_LONG(fetchStyle, 7); - if (!(_1)) { - _1 = ZEPHIR_IS_LONG(fetchStyle, 10); + _3 = fetchStyle == 7; + if (!(_3)) { + _3 = fetchStyle == 10; } - if (_1) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); + if (_3) { + ZVAL_LONG(&_4$$4, fetchStyle); + ZVAL_LONG(&_5$$4, fetchArgument); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &_4$$4, &_5$$4); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle); + ZVAL_LONG(&_0, fetchStyle); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Db_Result_PdoResult, fetchArray) { - zval _0; + zval _0, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0); + zephir_read_property(&_1, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -204217,7 +199309,7 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, numRows) ZVAL_STRING(&_7$$6, "/^SELECT\\s+(.*)/i"); zephir_preg_match(&_6$$6, &_7$$6, &sqlStatement, &matches, 0, 0 , 0 ); if (zephir_is_true(&_6$$6)) { - zephir_array_fetch_long(&_8$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Result/PdoResult.zep", 309); + zephir_array_fetch_long(&_8$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Result/PdoResult.zep", 311); ZEPHIR_INIT_VAR(&_9$$7); ZEPHIR_CONCAT_SVS(&_9$$7, "SELECT COUNT(*) \"numrows\" FROM (SELECT ", &_8$$7, ")"); zephir_read_property(&_10$$7, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY); @@ -204227,7 +199319,7 @@ static PHP_METHOD(Phalcon_Db_Result_PdoResult, numRows) ZEPHIR_CALL_METHOD(&row, &result, "fetch", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&rowCount); - zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/Db/Result/PdoResult.zep", 315); + zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/Db/Result/PdoResult.zep", 317); } } else { ZEPHIR_INIT_NVAR(&rowCount); @@ -204869,9 +199961,9 @@ static PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage) { ZEPHIR_INIT_NVAR(&item); ZVAL_COPY(&item, _2); - ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 109, &item); + ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 78, &item); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 110, &type, &prepared); + ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 79, &type, &prepared); zephir_check_call_status(); zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) { @@ -204892,9 +199984,9 @@ static PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage) } ZEPHIR_CALL_METHOD(&item, message, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 109, &item); + ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 78, &item); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 110, &type, &prepared); + ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 79, &type, &prepared); zephir_check_call_status(); zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$8)) { @@ -205082,13 +200174,13 @@ static PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareHtmlMessage) RETURN_CTOR(&message); } zephir_read_property(&_1, this_ptr, ZEND_STRL("cssClasses"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&cssClasses, this_ptr, "checkclasses", NULL, 111, &_1, &type); + ZEPHIR_CALL_METHOD(&cssClasses, this_ptr, "checkclasses", NULL, 80, &_1, &type); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("cssIconClasses"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&cssIconClasses, this_ptr, "checkclasses", NULL, 111, &_2, &type); + ZEPHIR_CALL_METHOD(&cssIconClasses, this_ptr, "checkclasses", NULL, 80, &_2, &type); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 112, &cssClasses, &cssIconClasses); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 81, &cssClasses, &cssIconClasses); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); zephir_create_array(&_5, 3, 0); @@ -205875,21 +200967,21 @@ static PHP_METHOD(Phalcon_Image_ImageFactory, load) zephir_check_call_status(); ZEPHIR_CPY_WRT(config, &_0); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 47); + zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 44); zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "file"); - ZEPHIR_CALL_METHOD(&file, this_ptr, "getarrval", NULL, 478, config, &_1); + ZEPHIR_CALL_METHOD(&file, this_ptr, "getarrval", NULL, 402, config, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "height"); ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&height, this_ptr, "getarrval", NULL, 478, config, &_1, &_2); + ZEPHIR_CALL_METHOD(&height, this_ptr, "getarrval", NULL, 402, config, &_1, &_2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "width"); ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&width, this_ptr, "getarrval", NULL, 478, config, &_1, &_2); + ZEPHIR_CALL_METHOD(&width, this_ptr, "getarrval", NULL, 402, config, &_1, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &file, &width, &height); zephir_check_call_status(); @@ -206174,20 +201266,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, background) ZVAL_STRING(&_6$$4, "/./"); ZEPHIR_INIT_VAR(&_7$$4); ZVAL_STRING(&_7$$4, "$0$0"); - ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 50, &_6$$4, &_7$$4, &color); + ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 37, &_6$$4, &_7$$4, &color); zephir_check_call_status(); zephir_get_strval(&color, &_8$$4); } ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &color, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11); ZVAL_STRING(&_11, "hexdec"); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 97, &_11, &_10); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 66, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); - zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); - zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); ZVAL_LONG(&_9, opacity); ZEPHIR_CALL_METHOD(NULL, this_ptr, "processbackground", NULL, 0, &_12, &_13, &_14, &_9); zephir_check_call_status(); @@ -206575,7 +201667,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, render) if (ZEPHIR_IS_EMPTY(&ext)) { zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 4); - ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 116, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 85, &_0$$3, &_1$$3); zephir_check_call_status(); zephir_cast_to_string(&_3$$3, &_2$$3); ZEPHIR_CPY_WRT(&ext, &_3$$3); @@ -206667,7 +201759,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _0$$3 = !height; } if (UNEXPECTED(_0$$3)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 277); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 275); return; } } else { @@ -206677,7 +201769,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _1$$6 = !height; } if (UNEXPECTED(_1$$6)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 284); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 282); return; } ZEPHIR_INIT_VAR(&_2$$6); @@ -206698,7 +201790,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _5$$8 = !height; } if (UNEXPECTED(_5$$8)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 293); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 291); return; } ZEPHIR_INIT_VAR(&_6$$8); @@ -206716,7 +201808,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) do { if (master == 2) { if (UNEXPECTED(!width)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 303); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 301); return; } zephir_read_property(&_9$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); @@ -206726,7 +201818,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) } if (master == 3) { if (UNEXPECTED(!height)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 312); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 310); return; } zephir_read_property(&_11$$12, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -206740,7 +201832,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _13$$14 = !height; } if (UNEXPECTED(_13$$14)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 323); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 321); return; } zephir_read_property(&_14$$14, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -206779,14 +201871,14 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) ZVAL_LONG(&_24, width); zephir_round(&_23, &_24, NULL, NULL); ZVAL_LONG(&_25, 1); - ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 117, &_23, &_25); + ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 86, &_23, &_25); zephir_check_call_status(); width = zephir_get_intval(&_26); ZEPHIR_INIT_VAR(&_27); ZVAL_LONG(&_25, height); zephir_round(&_27, &_25, NULL, NULL); ZVAL_LONG(&_28, 1); - ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 117, &_27, &_28); + ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 86, &_27, &_28); zephir_check_call_status(); height = zephir_get_intval(&_29); ZVAL_LONG(&_28, width); @@ -207022,20 +202114,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, text) ZVAL_STRING(&_6$$7, "/./"); ZEPHIR_INIT_VAR(&_7$$7); ZVAL_STRING(&_7$$7, "$0$0"); - ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 50, &_6$$7, &_7$$7, &color); + ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 37, &_6$$7, &_7$$7, &color); zephir_check_call_status(); zephir_get_strval(&color, &_8$$7); } ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &color, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11); ZVAL_STRING(&_11, "hexdec"); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 97, &_11, &_10); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 66, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 449); - zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 450); - zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 451); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 447); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 448); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 449); ZVAL_LONG(&_9, opacity); ZVAL_LONG(&_15, size); ZEPHIR_CALL_METHOD(NULL, this_ptr, "processtext", NULL, 0, &text, offsetX, offsetY, &_9, &_12, &_13, &_14, &_15, &fontfile); @@ -207261,11 +202353,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_1, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); if ((zephir_file_exists(&_1) == SUCCESS)) { zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 102, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 71, &_2$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_3$$4); zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 328, &_4$$4); + ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 310, &_4$$4); zephir_check_call_status(); if (zephir_is_true(&imageinfo)) { zephir_array_fetch_long(&_5$$5, &imageinfo, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 38); @@ -207281,35 +202373,35 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) do { if (ZEPHIR_IS_LONG(&_9$$4, 1)) { zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 435, &_10$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 359, &_10$$6); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_11$$6); break; } if (ZEPHIR_IS_LONG(&_9$$4, 2)) { zephir_read_property(&_12$$7, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 436, &_12$$7); + ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 360, &_12$$7); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_13$$7); break; } if (ZEPHIR_IS_LONG(&_9$$4, 3)) { zephir_read_property(&_14$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 437, &_14$$8); + ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 361, &_14$$8); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_15$$8); break; } if (ZEPHIR_IS_LONG(&_9$$4, 15)) { zephir_read_property(&_16$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 438, &_16$$9); + ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 362, &_16$$9); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_17$$9); break; } if (ZEPHIR_IS_LONG(&_9$$4, 16)) { zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 439, &_18$$10); + ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 363, &_18$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_19$$10); break; @@ -207321,7 +202413,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_22$$12, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_23$$12); ZEPHIR_CONCAT_SVS(&_23$$12, "Installed GD does not support ", &_22$$12, " images"); - ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 31, &_23$$12); + ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 29, &_23$$12); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$12, "phalcon/Image/Adapter/Gd.zep", 69); ZEPHIR_MM_RESTORE(); @@ -207332,7 +202424,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) } while(0); zephir_read_property(&_24$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &_24$$4, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &_24$$4, &__$true); zephir_check_call_status(); } else { _25$$13 = !width; @@ -207345,7 +202437,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_27$$14, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_28$$14); ZEPHIR_CONCAT_SV(&_28$$14, "Failed to create image from file ", &_27$$14); - ZEPHIR_CALL_METHOD(NULL, &_26$$14, "__construct", NULL, 31, &_28$$14); + ZEPHIR_CALL_METHOD(NULL, &_26$$14, "__construct", NULL, 29, &_28$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_26$$14, "phalcon/Image/Adapter/Gd.zep", 83); ZEPHIR_MM_RESTORE(); @@ -207353,14 +202445,14 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) } ZVAL_LONG(&_29$$13, width); ZVAL_LONG(&_30$$13, height); - ZEPHIR_CALL_FUNCTION(&_31$$13, "imagecreatetruecolor", NULL, 441, &_29$$13, &_30$$13); + ZEPHIR_CALL_FUNCTION(&_31$$13, "imagecreatetruecolor", NULL, 365, &_29$$13, &_30$$13); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_31$$13); zephir_read_property(&_29$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &_29$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &_29$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_30$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &_30$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &_30$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_32$$13, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_32$$13); @@ -207397,7 +202489,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct) zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&image, &_0); if (Z_TYPE_P(&image) == IS_RESOURCE) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &image); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &image); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -207437,14 +202529,14 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, check) ZVAL_STRING(&_1, "2.0.1"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, ">="); - ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 88, &version, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 128, &version, &_1, &_2); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_3))) { ZEPHIR_INIT_VAR(&_4$$5); object_init_ex(&_4$$5, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_5$$5); ZEPHIR_CONCAT_SV(&_5$$5, "Phalcon\\Image\\Adapter\\GD requires GD version '2.0.1' or greater, you have ", &version); - ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 31, &_5$$5); + ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 29, &_5$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$5, "phalcon/Image/Adapter/Gd.zep", 129); ZEPHIR_MM_RESTORE(); @@ -207483,13 +202575,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, getVersion) ZVAL_NULL(&version); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "GD_VERSION"); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_1)) { ZEPHIR_INIT_NVAR(&version); ZEPHIR_GET_CONSTANT(&version, "GD_VERSION"); } else { - ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 444); + ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 368); zephir_check_call_status(); ZEPHIR_INIT_VAR(&matches); ZVAL_NULL(&matches); @@ -207552,7 +202644,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); @@ -207564,9 +202656,9 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZVAL_LONG(&_5, g); ZVAL_LONG(&_6, b); ZVAL_LONG(&_7, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &background, &_4, &_5, &_6, &_7); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &background, &_4, &_5, &_6, &_7); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &background, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &background, &__$true); zephir_check_call_status(); zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -207575,11 +202667,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZVAL_LONG(&_8, 0); ZVAL_LONG(&_9, 0); ZVAL_LONG(&_10, 0); - ZEPHIR_CALL_FUNCTION(&_11, "imagecopy", NULL, 446, &background, &_4, &_7, &_8, &_9, &_10, &_5, &_6); + ZEPHIR_CALL_FUNCTION(&_11, "imagecopy", NULL, 370, &background, &_4, &_7, &_8, &_9, &_10, &_5, &_6); zephir_check_call_status(); if (zephir_is_true(&_11)) { zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_12$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_12$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &background); } @@ -207616,7 +202708,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processBlur) } zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 7); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 447, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 371, &_0$$3, &_1$$3); zephir_check_call_status(); i++; } @@ -207652,11 +202744,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCreate) ZVAL_LONG(&_0, width); ZVAL_LONG(&_1, height); - ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 441, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 365, &_0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &image, &__$false); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &image, &__$false); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &image, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &image, &__$true); zephir_check_call_status(); RETURN_CCTOR(&image); } @@ -207709,16 +202801,16 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processCrop) ZVAL_LONG(&_0, height); zephir_array_update_string(&rect, SL("height"), &_0, PH_COPY | PH_SEPARATE); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 448, &_1, &rect); + ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 372, &_1, &rect); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_2); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); - ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 373, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3); - ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4); ZEPHIR_MM_RESTORE(); @@ -207751,12 +202843,12 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processFlip) if (direction == 11) { zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 451, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 375, &_0$$3, &_1$$3); zephir_check_call_status(); } else { zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 451, &_2$$4, &_3$$4); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 375, &_2$$4, &_3$$4); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -207821,32 +202913,32 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZEPHIR_CALL_METHOD(&_0, mask, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 452, &_0); + ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 376, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 449, &maskImage); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 373, &maskImage); zephir_check_call_status(); mask_width = zephir_get_intval(&_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 450, &maskImage); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 374, &maskImage); zephir_check_call_status(); mask_height = zephir_get_intval(&_2); alpha = 127; - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &maskImage, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &maskImage, &__$true); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_4, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&newimage, this_ptr, "processcreate", NULL, 0, &_3, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &newimage, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &newimage, &__$true); zephir_check_call_status(); ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &newimage, &_5, &_6, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &newimage, &_5, &_6, &_7, &_8); zephir_check_call_status(); ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 453, &newimage, &_5, &_6, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 377, &newimage, &_5, &_6, &color); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); _9 = !ZEPHIR_IS_LONG(&_5, mask_width); @@ -207857,7 +202949,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) if (_9) { zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 441, &_10$$3, &_11$$3); + ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 365, &_10$$3, &_11$$3); zephir_check_call_status(); zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_13$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); @@ -207867,9 +202959,9 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZVAL_LONG(&_17$$3, 0); ZVAL_LONG(&_18$$3, mask_width); ZVAL_LONG(&_19$$3, mask_height); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 454, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 378, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &maskImage); zephir_check_call_status(); ZEPHIR_CPY_WRT(&maskImage, &tempImage); } @@ -207887,9 +202979,9 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) } ZVAL_LONG(&_21$$5, x); ZVAL_LONG(&_22$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 455, &maskImage, &_21$$5, &_22$$5); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 379, &maskImage, &_21$$5, &_22$$5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 456, &maskImage, &index); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 380, &maskImage, &index); zephir_check_call_status(); if (zephir_array_isset_string(&color, SL("red"))) { zephir_array_fetch_string(&_25$$6, &color, SL("red"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 291); @@ -207899,10 +202991,10 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) zephir_read_property(&_21$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_22$$5, x); ZVAL_LONG(&_27$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 455, &_21$$5, &_22$$5, &_27$$5); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 379, &_21$$5, &_22$$5, &_27$$5); zephir_check_call_status(); zephir_read_property(&_22$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 456, &_22$$5, &index); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 380, &_22$$5, &index); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&r); zephir_array_fetch_string(&r, &color, SL("red"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 296); @@ -207911,20 +203003,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZEPHIR_OBS_NVAR(&b); zephir_array_fetch_string(&b, &color, SL("blue"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 298); ZVAL_LONG(&_27$$5, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &newimage, &r, &g, &b, &_27$$5); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &newimage, &r, &g, &b, &_27$$5); zephir_check_call_status(); ZVAL_LONG(&_27$$5, x); ZVAL_LONG(&_28$$5, y); - ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 457, &newimage, &_27$$5, &_28$$5, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 381, &newimage, &_27$$5, &_28$$5, &color); zephir_check_call_status(); y++; } x++; } zephir_read_property(&_8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_8); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_8); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &maskImage); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &newimage); ZEPHIR_MM_RESTORE(); @@ -207989,7 +203081,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate) zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_6$$4, x1); ZVAL_LONG(&_7$$4, y1); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_8, 455, &_5$$4, &_6$$4, &_7$$4); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_8, 379, &_5$$4, &_6$$4, &_7$$4); zephir_check_call_status(); x2 = (x + amount); y2 = (y + amount); @@ -207998,7 +203090,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate) ZVAL_LONG(&_9$$4, y); ZVAL_LONG(&_10$$4, x2); ZVAL_LONG(&_11$$4, y2); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_12, 458, &_6$$4, &_7$$4, &_9$$4, &_10$$4, &_11$$4, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_12, 382, &_6$$4, &_7$$4, &_9$$4, &_10$$4, &_11$$4, &color); zephir_check_call_status(); y += amount; } @@ -208065,7 +203157,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); @@ -208086,7 +203178,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_8, 0); ZVAL_LONG(&_9, 0); ZVAL_LONG(&_10, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6); zephir_check_call_status(); offset = 0; while (1) { @@ -208119,14 +203211,14 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_22$$5, 0); ZVAL_LONG(&_23$$5, src_y); ZVAL_LONG(&_24$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5); zephir_check_call_status(); ZVAL_LONG(&_20$$5, 4); ZVAL_LONG(&_21$$5, 0); ZVAL_LONG(&_22$$5, 0); ZVAL_LONG(&_23$$5, 0); ZVAL_LONG(&_24$$5, dst_opacity); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 447, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 371, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5); zephir_check_call_status(); zephir_read_property(&_20$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_21$$5, 0); @@ -208134,18 +203226,18 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_23$$5, 0); ZVAL_LONG(&_24$$5, 0); ZVAL_LONG(&_26$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5); zephir_check_call_status(); offset++; } zephir_read_property(&_7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_7); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_7); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &reflection); - ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 449, &reflection); + ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 373, &reflection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_27); - ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 450, &reflection); + ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 374, &reflection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_28); ZEPHIR_MM_RESTORE(); @@ -208196,69 +203288,69 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRender) ZEPHIR_INIT_VAR(&_0); zephir_fast_strtolower(&_0, &ext); zephir_get_strval(&ext, &_0); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 459); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 383); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "gif"); - ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "jpg"); - ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); _4 = ZEPHIR_IS_LONG(&_3, 0); if (!(_4)) { ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_5, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_5, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); _4 = ZEPHIR_IS_LONG(&_5, 0); } ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "png"); - ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "wbmp"); - ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "xbm"); - ZEPHIR_CALL_FUNCTION(&_8, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_8, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_2, 0)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 460, &_9$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 384, &_9$$3); zephir_check_call_status(); } else if (_4) { zephir_read_property(&_10$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_11$$4, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_10$$4, &__$null, &_11$$4); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_10$$4, &__$null, &_11$$4); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_6, 0)) { zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 462, &_12$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 386, &_12$$5); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_7, 0)) { zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 463, &_13$$6); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 387, &_13$$6); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_8, 0)) { zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 464, &_14$$7, &__$null); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 388, &_14$$7, &__$null); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_15$$8); object_init_ex(&_15$$8, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_16$$8); ZEPHIR_CONCAT_SVS(&_16$$8, "Installed GD does not support '", &ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, &_15$$8, "__construct", NULL, 31, &_16$$8); + ZEPHIR_CALL_METHOD(NULL, &_15$$8, "__construct", NULL, 29, &_16$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$8, "phalcon/Image/Adapter/Gd.zep", 454); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 465); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 389); zephir_check_call_status(); RETURN_MM(); } @@ -208294,16 +203386,16 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processResize) zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1, width); ZVAL_LONG(&_2, height); - ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 466, &_0, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 390, &_0, &_1, &_2); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_1); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); - ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 373, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3); - ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4); ZEPHIR_MM_RESTORE(); @@ -208349,18 +203441,18 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate) ZVAL_LONG(&_2, 0); ZVAL_LONG(&_3, 0); ZVAL_LONG(&_4, 127); - ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 445, &_0, &_1, &_2, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 369, &_0, &_1, &_2, &_3, &_4); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2, (360 - degrees)); ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 467, &_1, &_2, &transparent, &_3); + ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 391, &_1, &_2, &transparent, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &image, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &image, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 373, &image); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3, 0); @@ -208368,11 +203460,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate) ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); ZVAL_LONG(&_7, 100); - ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 468, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 392, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7); zephir_check_call_status(); if (zephir_is_true(&_8)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_9$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_9$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &width); @@ -208436,11 +203528,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); if (!(zephir_is_true(&ext))) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 469, &_1$$3, &__$false); + ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 393, &_1$$3, &__$false); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_2); @@ -208448,30 +203540,30 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZEPHIR_CPY_WRT(&ext, &_2); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "gif"); - ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_3, 0)) { ZEPHIR_INIT_ZVAL_NREF(_4$$4); ZVAL_LONG(&_4$$4, 1); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_4$$4); zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 470, &_4$$4); + ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 394, &_4$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_5$$4); zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 460, &_6$$4, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 384, &_6$$4, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "jpg"); - ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); _8 = ZEPHIR_IS_LONG(&_7, 0); if (!(_8)) { ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); _8 = ZEPHIR_IS_LONG(&_9, 0); } @@ -208480,7 +203572,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZVAL_LONG(&_10$$5, 2); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_10$$5); zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 470, &_10$$5); + ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 394, &_10$$5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_11$$5); if (quality >= 0) { @@ -208491,63 +203583,63 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) } zephir_read_property(&_12$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_13$$6, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_12$$6, &file, &_13$$6); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_12$$6, &file, &_13$$6); zephir_check_call_status(); } else { zephir_read_property(&_14$$9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_14$$9, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_14$$9, &file); zephir_check_call_status(); } RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "png"); - ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_15, 0)) { ZEPHIR_INIT_ZVAL_NREF(_16$$10); ZVAL_LONG(&_16$$10, 3); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_16$$10); zephir_read_property(&_16$$10, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 470, &_16$$10); + ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 394, &_16$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_17$$10); zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 462, &_18$$10, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 386, &_18$$10, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "wbmp"); - ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_19, 0)) { ZEPHIR_INIT_ZVAL_NREF(_20$$11); ZVAL_LONG(&_20$$11, 15); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_20$$11); zephir_read_property(&_20$$11, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 470, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 394, &_20$$11); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_21$$11); zephir_read_property(&_22$$11, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 463, &_22$$11, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 387, &_22$$11, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "xbm"); - ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_23, 0)) { ZEPHIR_INIT_ZVAL_NREF(_24$$12); ZVAL_LONG(&_24$$12, 16); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_24$$12); zephir_read_property(&_24$$12, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 470, &_24$$12); + ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 394, &_24$$12); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_25$$12); zephir_read_property(&_26$$12, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 464, &_26$$12, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 388, &_26$$12, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -208555,7 +203647,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) object_init_ex(&_2, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_27); ZEPHIR_CONCAT_SVS(&_27, "Installed GD does not support '", &ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 31, &_27); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 29, &_27); zephir_check_call_status(); zephir_throw_exception_debug(&_2, "phalcon/Image/Adapter/Gd.zep", 576); ZEPHIR_MM_RESTORE(); @@ -208599,7 +203691,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen) ZEPHIR_INIT_VAR(&_0); ZVAL_LONG(&_1, (-18 + ((amount * 0.08)))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 2); zephir_round(&_0, &_2, &_1, NULL); @@ -208645,15 +203737,15 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen) zephir_read_property(&_5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_6, (amount - 8)); ZVAL_LONG(&_7, 0); - ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 471, &_5, &matrix, &_6, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 395, &_5, &matrix, &_6, &_7); zephir_check_call_status(); if (zephir_is_true(&_8)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 449, &_9$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 373, &_9$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_10$$3); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 450, &_11$$3); + ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 374, &_11$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_12$$3); } @@ -208733,14 +203825,14 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) topRightY = 0; ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); if (!(ZEPHIR_IS_EMPTY(&fontfile))) { ZVAL_LONG(&_3$$3, size); ZVAL_LONG(&_4$$3, 0); - ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 472, &_3$$3, &_4$$3, &fontfile, &text); + ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 396, &_3$$3, &_4$$3, &fontfile, &text); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&space)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Call to imagettfbbox() failed", "phalcon/Image/Adapter/Gd.zep", 618); @@ -208761,11 +203853,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) topRightY = zephir_get_intval(&_8$$5); } ZVAL_LONG(&_3$$3, (topRightX - bottomLeftX)); - ZEPHIR_CALL_FUNCTION(&_9$$3, "abs", NULL, 299, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_9$$3, "abs", NULL, 281, &_3$$3); zephir_check_call_status(); width = (zephir_get_numberval(&_9$$3) + 10); ZVAL_LONG(&_3$$3, (topRightY - bottomLeftY)); - ZEPHIR_CALL_FUNCTION(&_10$$3, "abs", NULL, 299, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "abs", NULL, 281, &_3$$3); zephir_check_call_status(); height = (zephir_get_numberval(&_10$$3) + 10); if (offsetX < 0) { @@ -208781,7 +203873,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_13$$3, g); ZVAL_LONG(&_14$$3, b); ZVAL_LONG(&_15$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &_3$$3, &_4$$3, &_13$$3, &_14$$3, &_15$$3); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &_3$$3, &_4$$3, &_13$$3, &_14$$3, &_15$$3); zephir_check_call_status(); angle = 0; zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -208789,15 +203881,15 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_14$$3, angle); ZVAL_LONG(&_15$$3, offsetX); ZVAL_LONG(&_16$$3, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 473, &_4$$3, &_13$$3, &_14$$3, &_15$$3, &_16$$3, &color, &fontfile, &text); + ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 397, &_4$$3, &_13$$3, &_14$$3, &_15$$3, &_16$$3, &color, &fontfile, &text); zephir_check_call_status(); } else { ZVAL_LONG(&_17$$8, size); - ZEPHIR_CALL_FUNCTION(&_18$$8, "imagefontwidth", NULL, 474, &_17$$8); + ZEPHIR_CALL_FUNCTION(&_18$$8, "imagefontwidth", NULL, 398, &_17$$8); zephir_check_call_status(); width = (zephir_get_intval(&_18$$8) * zephir_fast_strlen_ev(&text)); ZVAL_LONG(&_17$$8, size); - ZEPHIR_CALL_FUNCTION(&_19$$8, "imagefontheight", NULL, 475, &_17$$8); + ZEPHIR_CALL_FUNCTION(&_19$$8, "imagefontheight", NULL, 399, &_17$$8); zephir_check_call_status(); height = zephir_get_intval(&_19$$8); if (offsetX < 0) { @@ -208813,13 +203905,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_23$$8, g); ZVAL_LONG(&_24$$8, b); ZVAL_LONG(&_25$$8, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &_17$$8, &_22$$8, &_23$$8, &_24$$8, &_25$$8); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &_17$$8, &_22$$8, &_23$$8, &_24$$8, &_25$$8); zephir_check_call_status(); zephir_read_property(&_22$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_23$$8, size); ZVAL_LONG(&_24$$8, offsetX); ZVAL_LONG(&_25$$8, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 476, &_22$$8, &_23$$8, &_24$$8, &_25$$8, &text, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 400, &_22$$8, &_23$$8, &_24$$8, &_25$$8, &text, &color); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -208874,20 +203966,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZEPHIR_CALL_METHOD(&_0, watermark, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 452, &_0); + ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 376, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &overlay, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &overlay, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 449, &overlay); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 373, &overlay); zephir_check_call_status(); width = zephir_get_intval(&_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 450, &overlay); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 374, &overlay); zephir_check_call_status(); height = zephir_get_intval(&_2); if (opacity < 100) { ZEPHIR_INIT_VAR(&_3$$3); ZVAL_DOUBLE(&_4$$3, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 299, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 281, &_4$$3); zephir_check_call_status(); zephir_round(&_3$$3, &_5$$3, NULL, NULL); opacity = zephir_get_intval(&_3$$3); @@ -208895,20 +203987,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZVAL_LONG(&_6$$3, 127); ZVAL_LONG(&_7$$3, 127); ZVAL_LONG(&_8$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, 3); - ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 477, &overlay, &_4$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 401, &overlay, &_4$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, 0); ZVAL_LONG(&_6$$3, 0); ZVAL_LONG(&_7$$3, width); ZVAL_LONG(&_8$$3, height); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 458, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 382, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color); zephir_check_call_status(); } zephir_read_property(&_9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &_9, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &_9, &__$true); zephir_check_call_status(); zephir_read_property(&_10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_11, offsetX); @@ -208917,10 +204009,10 @@ static PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZVAL_LONG(&_14, 0); ZVAL_LONG(&_15, width); ZVAL_LONG(&_16, height); - ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 446, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16); + ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 370, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16); zephir_check_call_status(); if (zephir_is_true(&_17)) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &overlay); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &overlay); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -209042,7 +204134,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_2, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); if ((zephir_file_exists(&_2) == SUCCESS)) { zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 102, &_3$$4); + ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 71, &_3$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_4$$4); zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -209055,7 +204147,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_10$$5); ZEPHIR_CONCAT_SVS(&_10$$5, "Imagick::readImage ", &_9$$5, " failed"); - ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 31, &_10$$5); + ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 29, &_10$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$5, "phalcon/Image/Adapter/Imagick.zep", 63); ZEPHIR_MM_RESTORE(); @@ -209068,7 +204160,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$6); ZVAL_STRING(&_14$$6, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 142, &_14$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 114, &_14$$6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_13$$6, "setimagealphachannel", NULL, 0, &_15$$6); zephir_check_call_status(); @@ -209097,7 +204189,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_22$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_23$$9); ZEPHIR_CONCAT_SV(&_23$$9, "Failed to create image from file ", &_22$$9); - ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 31, &_23$$9); + ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 29, &_23$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$9, "phalcon/Image/Adapter/Imagick.zep", 84); ZEPHIR_MM_RESTORE(); @@ -209206,12 +204298,12 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, check) } ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "Imagick::IMAGICK_EXTNUM"); - ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 141, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 113, &_2); zephir_check_call_status(); if (zephir_is_true(&_3)) { ZEPHIR_INIT_VAR(&_4$$5); ZVAL_STRING(&_4$$5, "Imagick::IMAGICK_EXTNUM"); - ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 142, &_4$$5); + ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 114, &_4$$5); zephir_check_call_status(); zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, ZEND_STRL("version"), &_5$$5); } @@ -209319,7 +204411,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) ZVAL_LONG(&_1, r); ZVAL_LONG(&_2, g); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 140, &_0, &_1, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 112, &_0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&pixel1); object_init_ex(&pixel1, zephir_get_internal_ce(SL("imagickpixel"))); @@ -209349,7 +204441,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) if (!(zephir_is_true(&_7$$3))) { ZEPHIR_INIT_NVAR(&_9$$4); ZVAL_STRING(&_9$$4, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 142, &_9$$4); + ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 114, &_9$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &background, "setimagealphachannel", &_12, 0, &_10$$4); zephir_check_call_status(); @@ -209358,11 +204450,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZVAL_LONG(&_17$$3, opacity); ZEPHIR_CALL_METHOD(NULL, &background, "evaluateimage", &_18, 0, &_15$$3, &_17$$3, &_16$$3); @@ -209375,7 +204467,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) zephir_read_property(&_21$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::COMPOSITE_DISSOLVE"); - ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZVAL_LONG(&_23$$3, 0); ZVAL_LONG(&_24$$3, 0); @@ -209688,7 +204780,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processMask) zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_5$$3); ZVAL_STRING(&_5$$3, "Imagick::COMPOSITE_DSTIN"); - ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 142, &_5$$3); + ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 114, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_8$$3, 0); ZVAL_LONG(&_9$$3, 0); @@ -209914,7 +205006,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) while (1) { ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::COMPOSITE_DSTOUT"); - ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZVAL_LONG(&_22$$7, 0); ZVAL_LONG(&_23$$7, 0); @@ -209926,11 +205018,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) } ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZVAL_LONG(&_22$$7, opacity); ZEPHIR_CALL_METHOD(NULL, &reflection, "evaluateimage", &_27, 0, &_25$$7, &_22$$7, &_26$$7); @@ -209966,7 +205058,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$10); ZVAL_STRING(&_36$$10, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 142, &_36$$10); + ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 114, &_36$$10); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &image, "setimagealphachannel", &_38, 0, &_37$$10); zephir_check_call_status(); @@ -209983,7 +205075,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) zephir_read_property(&_44$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_36$$10); ZVAL_STRING(&_36$$10, "Imagick::COMPOSITE_SRC"); - ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 142, &_36$$10); + ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 114, &_36$$10); zephir_check_call_status(); ZVAL_LONG(&_46$$10, 0); ZVAL_LONG(&_47$$10, 0); @@ -210009,7 +205101,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) while (1) { ZEPHIR_INIT_NVAR(&_50$$13); ZVAL_STRING(&_50$$13, "Imagick::COMPOSITE_OVER"); - ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 142, &_50$$13); + ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 114, &_50$$13); zephir_check_call_status(); zephir_read_property(&_52$$13, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_53$$13, 0); @@ -210107,7 +205199,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender) zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_3); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "gif"); - ZEPHIR_CALL_FUNCTION(&_5, "strcasecmp", NULL, 47, &extension, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "strcasecmp", NULL, 35, &extension, &_4); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_5, 0)) { ZEPHIR_CALL_METHOD(NULL, &image, "optimizeimagelayers", NULL, 0); @@ -210115,20 +205207,20 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender) } else { ZEPHIR_INIT_VAR(&_6$$4); ZVAL_STRING(&_6$$4, "jpg"); - ZEPHIR_CALL_FUNCTION(&_7$$4, "strcasecmp", NULL, 47, &extension, &_6$$4); + ZEPHIR_CALL_FUNCTION(&_7$$4, "strcasecmp", NULL, 35, &extension, &_6$$4); zephir_check_call_status(); _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_7$$4, 0); if (!(_8$$4)) { ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_STRING(&_6$$4, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_9$$4, "strcasecmp", NULL, 47, &extension, &_6$$4); + ZEPHIR_CALL_FUNCTION(&_9$$4, "strcasecmp", NULL, 35, &extension, &_6$$4); zephir_check_call_status(); _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_9$$4, 0); } if (_8$$4) { ZEPHIR_INIT_VAR(&_10$$5); ZVAL_STRING(&_10$$5, "Imagick::COMPRESSION_JPEG"); - ZEPHIR_CALL_FUNCTION(&_11$$5, "constant", NULL, 142, &_10$$5); + ZEPHIR_CALL_FUNCTION(&_11$$5, "constant", NULL, 114, &_10$$5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompression", NULL, 0, &_11$$5); zephir_check_call_status(); @@ -210316,7 +205408,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_0, "setformat", NULL, 0, &ext); @@ -210336,7 +205428,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_6); ZEPHIR_INIT_VAR(&_7); ZVAL_STRING(&_7, "gif"); - ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_8, 0)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -210344,7 +205436,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_10$$3); ZVAL_STRING(&_10$$3, "w"); - ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 90, &file, &_10$$3); + ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 134, &file, &_10$$3); zephir_check_call_status(); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_11$$3, "writeimagesfile", NULL, 0, &fp); @@ -210354,13 +205446,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) } ZEPHIR_INIT_NVAR(&_7); ZVAL_STRING(&_7, "jpg"); - ZEPHIR_CALL_FUNCTION(&_12, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_12, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); _13 = ZEPHIR_IS_LONG(&_12, 0); if (!(_13)) { ZEPHIR_INIT_NVAR(&_7); ZVAL_STRING(&_7, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_14, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_14, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); _13 = ZEPHIR_IS_LONG(&_14, 0); } @@ -210368,7 +205460,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_read_property(&_15$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_16$$4); ZVAL_STRING(&_16$$4, "Imagick::COMPRESSION_JPEG"); - ZEPHIR_CALL_FUNCTION(&_17$$4, "constant", NULL, 142, &_16$$4); + ZEPHIR_CALL_FUNCTION(&_17$$4, "constant", NULL, 114, &_16$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_15$$4, "setimagecompression", NULL, 0, &_17$$4); zephir_check_call_status(); @@ -210523,7 +205615,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(&_1, r); ZVAL_LONG(&_2, g); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 140, &_0, &_1, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 112, &_0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); object_init_ex(&_0, zephir_get_internal_ce(SL("imagickpixel"))); @@ -210555,7 +205647,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_6$$7); ZVAL_STRING(&_6$$7, "Imagick::GRAVITY_CENTER"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_6$$7); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_6$$7); zephir_check_call_status(); } else { if (Z_TYPE_P(offsetY) == IS_LONG) { @@ -210568,13 +205660,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_7$$11); ZVAL_STRING(&_7$$11, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_7$$11); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_7$$11); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_8$$12); ZVAL_STRING(&_8$$12, "Imagick::GRAVITY_NORTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_8$$12); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_8$$12); zephir_check_call_status(); } } else { @@ -210585,13 +205677,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_9$$14); ZVAL_STRING(&_9$$14, "Imagick::GRAVITY_SOUTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_9$$14); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_9$$14); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_10$$15); ZVAL_STRING(&_10$$15, "Imagick::GRAVITY_NORTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_10$$15); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_10$$15); zephir_check_call_status(); } } @@ -210610,13 +205702,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_11$$21); ZVAL_STRING(&_11$$21, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_11$$21); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_11$$21); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_12$$22); ZVAL_STRING(&_12$$22, "Imagick::GRAVITY_SOUTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_12$$22); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_12$$22); zephir_check_call_status(); } } else { @@ -210627,13 +205719,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_13$$24); ZVAL_STRING(&_13$$24, "Imagick::GRAVITY_EAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_13$$24); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_13$$24); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_14$$25); ZVAL_STRING(&_14$$25, "Imagick::GRAVITY_WEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_14$$25); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_14$$25); zephir_check_call_status(); } } @@ -210649,13 +205741,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_15$$29); ZVAL_STRING(&_15$$29, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_15$$29); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_15$$29); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, (x * -1)); ZEPHIR_INIT_VAR(&_16$$30); ZVAL_STRING(&_16$$30, "Imagick::GRAVITY_NORTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_16$$30); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_16$$30); zephir_check_call_status(); } } else { @@ -210666,13 +205758,13 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_17$$32); ZVAL_STRING(&_17$$32, "Imagick::GRAVITY_SOUTHWEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_17$$32); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_17$$32); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_18$$33); ZVAL_STRING(&_18$$33, "Imagick::GRAVITY_NORTHWEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_18$$33); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_18$$33); zephir_check_call_status(); } } @@ -210755,11 +205847,11 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_2, "constant", NULL, 142, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "constant", NULL, 114, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 142, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 114, &_1); zephir_check_call_status(); ZVAL_LONG(&_4, opacity); ZEPHIR_CALL_METHOD(NULL, &watermark, "evaluateimage", NULL, 0, &_2, &_4, &_3); @@ -210772,7 +205864,7 @@ static PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark) zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$3); ZVAL_STRING(&_7$$3, "Imagick::COMPOSITE_OVER"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "constant", NULL, 142, &_7$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "constant", NULL, 114, &_7$$3); zephir_check_call_status(); ZVAL_LONG(&_9$$3, offsetX); ZVAL_LONG(&_10$$3, offsetY); @@ -210855,7 +205947,7 @@ static PHP_METHOD(Phalcon_Config_Config, merge) ZEPHIR_CALL_METHOD(NULL, this_ptr, "clear", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(toMerge) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 22, &source, toMerge); + ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 20, &source, toMerge); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result); zephir_check_call_status(); @@ -210868,7 +205960,7 @@ static PHP_METHOD(Phalcon_Config_Config, merge) if (_0) { ZEPHIR_CALL_METHOD(&_1$$4, toMerge, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 22, &source, &_1$$4); + ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 20, &source, &_1$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result); zephir_check_call_status(); @@ -210947,7 +206039,7 @@ static PHP_METHOD(Phalcon_Config_Config, path) break; } ZEPHIR_MAKE_REF(&keys); - ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_2, 23, &keys); + ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_2, 21, &keys); ZEPHIR_UNREF(&keys); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3$$5, &config, "has", NULL, 0, &key); @@ -211145,7 +206237,7 @@ static PHP_METHOD(Phalcon_Config_Config, internalMerge) } if (_5$$3) { zephir_array_fetch(&_8$$4, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 226); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "internalmerge", &_9, 22, &_8$$4, &value); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "internalmerge", &_9, 20, &_8$$4, &value); zephir_check_call_status(); zephir_array_update_zval(&source, &key, &_7$$4, PH_COPY | PH_SEPARATE); continue; @@ -211177,7 +206269,7 @@ static PHP_METHOD(Phalcon_Config_Config, internalMerge) } if (_11$$5) { zephir_array_fetch(&_14$$6, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 226); - ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "internalmerge", &_9, 22, &_14$$6, &value); + ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "internalmerge", &_9, 20, &_14$$6, &value); zephir_check_call_status(); zephir_array_update_zval(&source, &key, &_13$$6, PH_COPY | PH_SEPARATE); continue; @@ -211236,7 +206328,7 @@ static PHP_METHOD(Phalcon_Config_Config, setData) if (Z_TYPE_P(value) == IS_ARRAY) { ZEPHIR_INIT_VAR(&_2$$3); object_init_ex(&_2$$3, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 24, value); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 22, value); zephir_check_call_status(); zephir_array_update_zval(&data, element, &_2$$3, PH_COPY | PH_SEPARATE); } else { @@ -211333,10 +206425,10 @@ static PHP_METHOD(Phalcon_Config_ConfigFactory, load) ZEPHIR_OBS_VAR(&filePath); zephir_array_fetch_string(&filePath, &configArray, SL("filePath"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 61); ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_FUNCTION(&_2, "pathinfo", NULL, 116, &filePath, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "pathinfo", NULL, 85, &filePath, &_1); zephir_check_call_status(); if (1 == ZEPHIR_IS_EMPTY(&_2)) { - ZEPHIR_CALL_FUNCTION(&_3$$3, "lcfirst", NULL, 104, &adapter); + ZEPHIR_CALL_FUNCTION(&_3$$3, "lcfirst", NULL, 73, &adapter); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SV(&_4$$3, ".", &_3$$3); @@ -211481,7 +206573,7 @@ static PHP_METHOD(Phalcon_Config_ConfigFactory, parseConfig) if (Z_TYPE_P(config) == IS_STRING) { ZEPHIR_CPY_WRT(&oldConfig, config); ZVAL_LONG(&_0$$3, 4); - ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 116, config, &_0$$3); + ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 85, config, &_0$$3); zephir_check_call_status(); if (1 == ZEPHIR_IS_EMPTY(&extension)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "You need to provide the extension in the file path", "phalcon/Config/ConfigFactory.zep", 161); @@ -211506,7 +206598,7 @@ static PHP_METHOD(Phalcon_Config_ConfigFactory, parseConfig) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Config must be array or Phalcon\\Config\\Config object", "phalcon/Config/ConfigFactory.zep", 177); return; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkconfigarray", NULL, 213, config); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkconfigarray", NULL, 194, config); zephir_check_call_status(); RETVAL_ZVAL(config, 1, 0); RETURN_MM(); @@ -211692,9 +206784,9 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) if (ZEPHIR_IS_IDENTICAL(&_6$$5, &defaultAdapter)) { ZEPHIR_INIT_NVAR(&_7$$6); object_init_ex(&_7$$6, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$6, &_7$$6, "load", &_10, 205, &configName); + ZEPHIR_CALL_METHOD(&_9$$6, &_7$$6, "load", &_10, 185, &configName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &_9$$6); zephir_check_call_status(); @@ -211717,7 +206809,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) object_init_ex(&_14$$9, phalcon_config_exception_ce); ZEPHIR_INIT_NVAR(&_15$$9); ZEPHIR_CONCAT_SS(&_15$$9, "To use 'array' adapter you have to specify ", "the 'config' as an array."); - ZEPHIR_CALL_METHOD(NULL, &_14$$9, "__construct", &_16, 31, &_15$$9); + ZEPHIR_CALL_METHOD(NULL, &_14$$9, "__construct", &_16, 29, &_15$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_14$$9, "phalcon/Config/Adapter/Grouped.zep", 110); ZEPHIR_MM_RESTORE(); @@ -211727,14 +206819,14 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113); ZEPHIR_INIT_NVAR(&configInstance); object_init_ex(&configInstance, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 24, &configArray); + ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_18$$10); object_init_ex(&_18$$10, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_18$$10, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_18$$10, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_10, 205, &configInstance); + ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_10, 185, &configInstance); zephir_check_call_status(); ZEPHIR_CPY_WRT(&configInstance, &_19$$10); } @@ -211767,9 +206859,9 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) if (ZEPHIR_IS_IDENTICAL(&_21$$13, &defaultAdapter)) { ZEPHIR_INIT_NVAR(&_22$$14); object_init_ex(&_22$$14, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_22$$14, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_22$$14, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_10, 205, &configName); + ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_10, 185, &configName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &_23$$14); zephir_check_call_status(); @@ -211792,7 +206884,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) object_init_ex(&_27$$17, phalcon_config_exception_ce); ZEPHIR_INIT_NVAR(&_28$$17); ZEPHIR_CONCAT_SS(&_28$$17, "To use 'array' adapter you have to specify ", "the 'config' as an array."); - ZEPHIR_CALL_METHOD(NULL, &_27$$17, "__construct", &_16, 31, &_28$$17); + ZEPHIR_CALL_METHOD(NULL, &_27$$17, "__construct", &_16, 29, &_28$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_27$$17, "phalcon/Config/Adapter/Grouped.zep", 110); ZEPHIR_MM_RESTORE(); @@ -211802,14 +206894,14 @@ static PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113); ZEPHIR_INIT_NVAR(&configInstance); object_init_ex(&configInstance, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 24, &configArray); + ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_29$$18); object_init_ex(&_29$$18, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_29$$18, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_29$$18, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_30$$18, &_29$$18, "load", &_10, 205, &configInstance); + ZEPHIR_CALL_METHOD(&_30$$18, &_29$$18, "load", &_10, 185, &configInstance); zephir_check_call_status(); ZEPHIR_CPY_WRT(&configInstance, &_30$$18); } @@ -211913,7 +207005,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) zephir_basename(&_3$$3, &filePath); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SVS(&_4$$3, "Configuration file ", &_3$$3, " cannot be loaded"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 31, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 29, &_4$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$3, "phalcon/Config/Adapter/Ini.zep", 79); ZEPHIR_MM_RESTORE(); @@ -212273,7 +207365,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, parseIniString) ZEPHIR_INIT_VAR(&_3); zephir_substr(&_3, &path, zephir_get_intval(&_2), 0, ZEPHIR_SUBSTR_NO_LENGTH); zephir_get_strval(&path, &_3); - ZEPHIR_CALL_METHOD(&result, this_ptr, "parseinistring", NULL, 206, &path, &castValue); + ZEPHIR_CALL_METHOD(&result, this_ptr, "parseinistring", NULL, 186, &path, &castValue); zephir_check_call_status(); zephir_create_array(return_value, 1, 0); zephir_array_update_zval(return_value, &key, &result, PH_COPY); @@ -212320,7 +207412,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Ini, phpParseIniFile) ZVAL_BOOL(&_0, (processSections ? 1 : 0)); ZVAL_LONG(&_1, scannerMode); - ZEPHIR_RETURN_CALL_FUNCTION("parse_ini_file", NULL, 207, &filename, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("parse_ini_file", NULL, 187, &filename, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -212379,7 +207471,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Json, __construct) ZEPHIR_INIT_VAR(&_2); zephir_file_get_contents(&_2, &filePath); ZVAL_BOOL(&_3, 1); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "decode", NULL, 208, &_2, &_3); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "decode", NULL, 188, &_2, &_3); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", &_0, 0, &_1); zephir_check_call_status(); @@ -212449,16 +207541,16 @@ static PHP_METHOD(Phalcon_Config_Adapter_Json, decode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Config/Adapter/Json.zep", 68); ZEPHIR_MM_RESTORE(); @@ -212615,7 +207707,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct) zephir_basename(&_5$$6, &filePath); ZEPHIR_INIT_VAR(&_6$$6); ZEPHIR_CONCAT_SVS(&_6$$6, "Configuration file ", &_5$$6, " can't be loaded"); - ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 31, &_6$$6); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 29, &_6$$6); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$6, "phalcon/Config/Adapter/Yaml.zep", 76); ZEPHIR_MM_RESTORE(); @@ -212669,7 +207761,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpYamlParseFile) ZEPHIR_MAKE_REF(ndocs); - ZEPHIR_RETURN_CALL_FUNCTION("yaml_parse_file", NULL, 211, filename, pos, ndocs, callbacks); + ZEPHIR_RETURN_CALL_FUNCTION("yaml_parse_file", NULL, 192, filename, pos, ndocs, callbacks); ZEPHIR_UNREF(ndocs); zephir_check_call_status(); RETURN_MM(); @@ -212697,7 +207789,7 @@ static PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpExtensionLoaded) zephir_get_strval(&name, name_param); - ZEPHIR_RETURN_CALL_FUNCTION("extension_loaded", NULL, 212, &name); + ZEPHIR_RETURN_CALL_FUNCTION("extension_loaded", NULL, 193, &name); zephir_check_call_status(); RETURN_MM(); } @@ -212921,9 +208013,9 @@ static PHP_METHOD(Phalcon_Events_Event, __construct) zephir_gettype(&_2$$3, source); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVSV(&_3$$3, "The source of ", &type, " event must be an object, got ", &_2$$3); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Events/Event.zep", 75); + zephir_throw_exception_debug(&_1$$3, "phalcon/Events/Event.zep", 73); ZEPHIR_MM_RESTORE(); return; } @@ -213029,7 +208121,7 @@ static PHP_METHOD(Phalcon_Events_Event, stop) zephir_read_property(&_0, this_ptr, ZEND_STRL("cancelable"), PH_NOISY_CC | PH_READONLY); if (UNEXPECTED(!zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/Events/Event.zep", 137); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/Events/Event.zep", 135); return; } if (1) { @@ -213177,7 +208269,7 @@ static PHP_METHOD(Phalcon_Events_Manager, attach) ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 58); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 56); return; } ZEPHIR_OBS_VAR(&priorityQueue); @@ -213191,7 +208283,7 @@ static PHP_METHOD(Phalcon_Events_Manager, attach) } ZVAL_LONG(&_2$$4, 1); - ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 286, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 268, &_2$$4); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("events"), &eventType, &priorityQueue); } @@ -213200,7 +208292,7 @@ static PHP_METHOD(Phalcon_Events_Manager, attach) priority = 100; } ZVAL_LONG(&_4, priority); - ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 287, handler, &_4); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 269, handler, &_4); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -213287,7 +208379,7 @@ static PHP_METHOD(Phalcon_Events_Manager, detach) ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 109); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 107); return; } ZEPHIR_OBS_VAR(&priorityQueue); @@ -213301,7 +208393,7 @@ static PHP_METHOD(Phalcon_Events_Manager, detach) } ZVAL_LONG(&_2$$4, 1); - ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 286, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 268, &_2$$4); zephir_check_call_status(); ZVAL_LONG(&_2$$4, 3); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 0, &_2$$4); @@ -213318,11 +208410,11 @@ static PHP_METHOD(Phalcon_Events_Manager, detach) zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_5, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_6$$5, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 134); + zephir_array_fetch_string(&_6$$5, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 132); if (!ZEPHIR_IS_IDENTICAL(&_6$$5, handler)) { - zephir_array_fetch_string(&_7$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 136); - zephir_array_fetch_string(&_8$$6, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 138); - ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_9, 287, &_7$$6, &_8$$6); + zephir_array_fetch_string(&_7$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 134); + zephir_array_fetch_string(&_8$$6, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 136); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_9, 269, &_7$$6, &_8$$6); zephir_check_call_status(); } } @@ -213472,23 +208564,23 @@ static PHP_METHOD(Phalcon_Events_Manager, fire) if (ZEPHIR_IS_EMPTY(&events)) { RETURN_MM_NULL(); } - if (UNEXPECTED(!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/Events/Manager.zep", 199)))) { + if (UNEXPECTED(!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/Events/Manager.zep", 197)))) { ZEPHIR_INIT_VAR(&_1$$4); object_init_ex(&_1$$4, phalcon_events_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SV(&_2$$4, "Invalid event type ", &eventType); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Events/Manager.zep", 200); + zephir_throw_exception_debug(&_1$$4, "phalcon/Events/Manager.zep", 198); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_INIT_VAR(&eventParts); zephir_fast_explode_str(&eventParts, SL(":"), &eventType, LONG_MAX); ZEPHIR_OBS_VAR(&type); - zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/Events/Manager.zep", 204); + zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/Events/Manager.zep", 202); ZEPHIR_OBS_VAR(&eventName); - zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/Events/Manager.zep", 205); + zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/Events/Manager.zep", 203); ZEPHIR_INIT_VAR(&status); ZVAL_NULL(&status); zephir_read_property(&_0, this_ptr, ZEND_STRL("collect"), PH_NOISY_CC | PH_READONLY); @@ -213504,19 +208596,19 @@ static PHP_METHOD(Phalcon_Events_Manager, fire) } else { ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 288, &eventName, source, data, &_4); + ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 270, &eventName, source, data, &_4); zephir_check_call_status(); ZEPHIR_OBS_VAR(&fireEvents); if (zephir_array_isset_fetch(&fireEvents, &events, &type, 0)) { if (Z_TYPE_P(&fireEvents) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 289, &fireEvents, &event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 271, &fireEvents, &event); zephir_check_call_status(); } } ZEPHIR_OBS_NVAR(&fireEvents); if (zephir_array_isset_fetch(&fireEvents, &events, &eventType, 0)) { if (Z_TYPE_P(&fireEvents) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 289, &fireEvents, &event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 271, &fireEvents, &event); zephir_check_call_status(); } } @@ -213564,7 +208656,7 @@ static PHP_METHOD(Phalcon_Events_Manager, fireQueue) ZEPHIR_CALL_METHOD(&eventName, event, "gettype", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&eventName) != IS_STRING)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/Events/Manager.zep", 252); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/Events/Manager.zep", 250); return; } ZEPHIR_CALL_METHOD(&source, event, "getsource", NULL, 0); @@ -213692,7 +208784,7 @@ static PHP_METHOD(Phalcon_Events_Manager, getListeners) } ZEPHIR_CALL_METHOD(&_2$$4, &priorityQueue, "current", &_3, 0); zephir_check_call_status(); - zephir_array_append(&listeners, &_2$$4, PH_SEPARATE, "phalcon/Events/Manager.zep", 335); + zephir_array_append(&listeners, &_2$$4, PH_SEPARATE, "phalcon/Events/Manager.zep", 333); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_4, 0); zephir_check_call_status(); } @@ -214100,7 +209192,7 @@ static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) } ZEPHIR_INIT_NVAR(&optionText); ZVAL_COPY(&optionText, _0); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 337, &optionValue); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 319, &optionValue); zephir_check_call_status(); if (Z_TYPE_P(&optionText) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&_5$$4); @@ -214153,7 +209245,7 @@ static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&optionText, &data, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 337, &optionValue); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 319, &optionValue); zephir_check_call_status(); if (Z_TYPE_P(&optionText) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&_16$$12); @@ -214355,6 +209447,584 @@ static PHP_METHOD(Phalcon_Tag_Select, optionsFromResultset) +ZEPHIR_INIT_CLASS(Phalcon_Logger_AbstractLogger) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, AbstractLogger, phalcon, logger_abstractlogger, phalcon_logger_abstractlogger_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("adapters"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("excluded"), ZEND_ACC_PROTECTED); + zend_declare_property_long(phalcon_logger_abstractlogger_ce, SL("logLevel"), 8, ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_logger_abstractlogger_ce, SL("name"), "", ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("timezone"), ZEND_ACC_PROTECTED); + phalcon_logger_abstractlogger_ce->create_object = zephir_init_properties_Phalcon_Logger_AbstractLogger; + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("ALERT"), 2); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("CRITICAL"), 1); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("CUSTOM"), 8); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("DEBUG"), 7); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("EMERGENCY"), 0); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("ERROR"), 3); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("INFO"), 6); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("NOTICE"), 5); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("WARNING"), 4); + + return SUCCESS; +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, __construct) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval adapters; + zval *name_param = NULL, *adapters_param = NULL, *timezone = NULL, timezone_sub, __$null, defaultTimezone; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&timezone_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&defaultTimezone); + ZVAL_UNDEF(&adapters); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_STR(name) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(adapters) + Z_PARAM_OBJECT_OF_CLASS_OR_NULL(timezone, php_date_get_timezone_ce()) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 2, &name_param, &adapters_param, &timezone); + zephir_get_strval(&name, name_param); + if (!adapters_param) { + ZEPHIR_INIT_VAR(&adapters); + array_init(&adapters); + } else { + zephir_get_arrval(&adapters, adapters_param); + } + if (!timezone) { + timezone = &timezone_sub; + ZEPHIR_CPY_WRT(timezone, &__$null); + } else { + ZEPHIR_SEPARATE_PARAM(timezone); + } + + + if (Z_TYPE_P(timezone) == IS_NULL) { + ZEPHIR_CALL_FUNCTION(&defaultTimezone, "date_default_timezone_get", NULL, 92); + zephir_check_call_status(); + if (UNEXPECTED(1 == ZEPHIR_IS_EMPTY(&defaultTimezone))) { + ZEPHIR_INIT_NVAR(&defaultTimezone); + ZVAL_STRING(&defaultTimezone, "UTC"); + } + ZEPHIR_INIT_NVAR(timezone); + object_init_ex(timezone, php_date_get_timezone_ce()); + ZEPHIR_CALL_METHOD(NULL, timezone, "__construct", NULL, 0, &defaultTimezone); + zephir_check_call_status(); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); + zephir_update_property_zval(this_ptr, ZEND_STRL("timezone"), timezone); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setadapters", NULL, 0, &adapters); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, addAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, *adapter, adapter_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&adapter_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(name) + Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_logger_adapter_adapterinterface_ce) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &name_param, &adapter); + zephir_get_strval(&name, name_param); + + + zephir_update_property_array(this_ptr, SL("adapters"), &name, adapter); + RETURN_THIS(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, excludeAdapters) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *adapters_param = NULL, __$true, adapter, registered, *_0, _1; + zval adapters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapters); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(®istered); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(adapters) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &adapters_param); + if (!adapters_param) { + ZEPHIR_INIT_VAR(&adapters); + array_init(&adapters); + } else { + zephir_get_arrval(&adapters, adapters_param); + } + + + zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&adapters, 0, "phalcon/Logger/AbstractLogger.zep", 155); + if (Z_TYPE_P(&adapters) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _0) + { + ZEPHIR_INIT_NVAR(&adapter); + ZVAL_COPY(&adapter, _0); + if (1 == zephir_array_isset(®istered, &adapter)) { + zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, &adapters, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_array_isset(®istered, &adapter)) { + zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); + } + ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&adapter); + RETURN_THIS(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, _0, _1, _2; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (1 != zephir_array_isset(&_0, &name)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/AbstractLogger.zep", 171); + return; + } + zephir_read_property(&_1, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_2, &_1, &name, PH_NOISY | PH_READONLY, "phalcon/Logger/AbstractLogger.zep", 174); + RETURN_CTOR(&_2); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapters) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "adapters"); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLogLevel) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "logLevel"); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getName) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "name"); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, removeAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (1 != zephir_array_isset(&_0, &name)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/AbstractLogger.zep", 216); + return; + } + zephir_unset_property_array(this_ptr, ZEND_STRL("adapters"), &name); + zephir_read_property(&_1, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1, &name, PH_SEPARATE); + RETURN_THIS(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, setAdapters) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *adapters_param = NULL; + zval adapters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapters); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(adapters) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &adapters_param); + zephir_get_arrval(&adapters, adapters_param); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); + RETURN_THIS(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, setLogLevel) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *level_param = NULL, levels, _0; + zend_long level, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_LONG(level) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &level_param); + level = zephir_get_intval(level_param); + + + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_0); + if (1 == zephir_array_isset_long(&levels, level)) { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, level); + } else { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 8); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); + RETURN_THIS(); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, addMessage) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval context; + zval message; + zval *level_param = NULL, *message_param = NULL, *context_param = NULL, adapter, collection, item, levelName, levels, method, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, *_7$$3, _8$$3, _9$$5, _10$$7; + zend_long level, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&levelName); + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_LONG(level) + Z_PARAM_STR(message) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &level_param, &message_param, &context_param); + level = zephir_get_intval(level_param); + zephir_get_strval(&message, message_param); + if (!context_param) { + ZEPHIR_INIT_VAR(&context); + array_init(&context); + } else { + zephir_get_arrval(&context, context_param); + } + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("logLevel"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GE_LONG(&_0, level)) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (zephir_fast_count_int(&_1$$3) == 0) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "No adapters specified", "phalcon/Logger/AbstractLogger.zep", 275); + return; + } + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_array_isset_long(&levels, level)) { + ZEPHIR_OBS_VAR(&levelName); + zephir_array_fetch_long(&levelName, &levels, level, PH_NOISY, "phalcon/Logger/AbstractLogger.zep", 279); + } else { + ZEPHIR_OBS_NVAR(&levelName); + zephir_array_fetch_long(&levelName, &levels, 8, PH_NOISY, "phalcon/Logger/AbstractLogger.zep", 279); + } + ZEPHIR_INIT_VAR(&item); + object_init_ex(&item, phalcon_logger_item_ce); + ZEPHIR_INIT_VAR(&_2$$3); + object_init_ex(&_2$$3, php_date_get_immutable_ce()); + zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("timezone"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "now"); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, &_4$$3, &_3$$3); + zephir_check_call_status(); + ZVAL_LONG(&_5$$3, level); + ZEPHIR_CALL_METHOD(NULL, &item, "__construct", NULL, 93, &message, &levelName, &_5$$3, &_2$$3, &context); + zephir_check_call_status(); + zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&collection, "array_diff_key", NULL, 94, &_5$$3, &_6$$3); + zephir_check_call_status(); + zephir_is_iterable(&collection, 0, "phalcon/Logger/AbstractLogger.zep", 305); + if (Z_TYPE_P(&collection) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _7$$3) + { + ZEPHIR_INIT_NVAR(&adapter); + ZVAL_COPY(&adapter, _7$$3); + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "process"); + ZEPHIR_CALL_METHOD(&_9$$5, &adapter, "intransaction", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_9$$5)) { + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "add"); + } + ZEPHIR_CALL_METHOD_ZVAL(NULL, &adapter, &method, NULL, 0, &item); + zephir_check_call_status(); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_8$$3, &collection, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_8$$3)) { + break; + } + ZEPHIR_CALL_METHOD(&adapter, &collection, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "process"); + ZEPHIR_CALL_METHOD(&_10$$7, &adapter, "intransaction", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_10$$7)) { + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "add"); + } + ZEPHIR_CALL_METHOD_ZVAL(NULL, &adapter, &method, NULL, 0, &item); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&adapter); + ZEPHIR_INIT_NVAR(&_4$$3); + array_init(&_4$$3); + zephir_update_property_zval(this_ptr, ZEND_STRL("excluded"), &_4$$3); + } + RETURN_MM_BOOL(1); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevelNumber) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *level, level_sub, levelName, levels, _0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&level_sub); + ZVAL_UNDEF(&levelName); + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(level) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &level); + + + if (1 == Z_TYPE_P(level) == IS_STRING) { + ZEPHIR_INIT_VAR(&levelName); + zephir_fast_strtoupper(&levelName, level); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(&levels, "array_flip", NULL, 95, &_0$$3); + zephir_check_call_status(); + if (zephir_array_isset(&levels, &levelName)) { + zephir_array_fetch(&_1$$4, &levels, &levelName, PH_NOISY | PH_READONLY, "phalcon/Logger/AbstractLogger.zep", 330); + RETURN_CTOR(&_1$$4); + } + } else if (1 == zephir_is_numeric(level)) { + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + if (zephir_array_isset(&levels, level)) { + RETURN_MM_LONG(zephir_get_intval(level)); + } + } + RETURN_MM_LONG(8); +} + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevels) +{ + zval *this_ptr = getThis(); + + + + zephir_create_array(return_value, 9, 0); + add_index_stringl(return_value, 2, SL("ALERT")); + add_index_stringl(return_value, 1, SL("CRITICAL")); + add_index_stringl(return_value, 7, SL("DEBUG")); + add_index_stringl(return_value, 0, SL("EMERGENCY")); + add_index_stringl(return_value, 3, SL("ERROR")); + add_index_stringl(return_value, 6, SL("INFO")); + add_index_stringl(return_value, 5, SL("NOTICE")); + add_index_stringl(return_value, 4, SL("WARNING")); + add_index_stringl(return_value, 8, SL("CUSTOM")); + return; +} + +zend_object *zephir_init_properties_Phalcon_Logger_AbstractLogger(zend_class_entry *class_type) +{ + zval _0, _2, _1$$3, _3$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + + + ZEPHIR_MM_GROW(); + + { + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("excluded"), &_1$$3); + } + zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("adapters"), &_3$$4); + } + ZEPHIR_MM_RESTORE(); + return Z_OBJ_P(this_ptr); + } +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Logger_AdapterFactory) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, AdapterFactory, phalcon, logger_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_logger_adapterfactory_method_entry, 0); @@ -214491,6 +210161,41 @@ static PHP_METHOD(Phalcon_Logger_AdapterFactory, getServices) +ZEPHIR_INIT_CLASS(Phalcon_Logger_Enum) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Enum, phalcon, logger_enum, NULL, 0); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("ALERT"), 2); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("CRITICAL"), 1); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("CUSTOM"), 8); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("DEBUG"), 7); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("EMERGENCY"), 0); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("ERROR"), 3); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("INFO"), 6); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("NOTICE"), 5); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("WARNING"), 4); + + return SUCCESS; +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Logger_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, Exception, phalcon, logger_exception, zend_ce_exception, NULL, 0); @@ -214653,176 +210358,28 @@ zend_object *zephir_init_properties_Phalcon_Logger_Item(zend_class_entry *class_ ZEPHIR_INIT_CLASS(Phalcon_Logger_Logger) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Logger, phalcon, logger_logger, phalcon_logger_logger_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, Logger, phalcon, logger_logger, phalcon_logger_abstractlogger_ce, phalcon_logger_logger_method_entry, 0); - zend_declare_property_null(phalcon_logger_logger_ce, SL("adapters"), ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_logger_logger_ce, SL("excluded"), ZEND_ACC_PROTECTED); - zend_declare_property_long(phalcon_logger_logger_ce, SL("logLevel"), 8, ZEND_ACC_PROTECTED); - zend_declare_property_string(phalcon_logger_logger_ce, SL("name"), "", ZEND_ACC_PROTECTED); - zend_declare_property_null(phalcon_logger_logger_ce, SL("timezone"), ZEND_ACC_PROTECTED); - phalcon_logger_logger_ce->create_object = zephir_init_properties_Phalcon_Logger_Logger; - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("ALERT"), 2); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("CRITICAL"), 1); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("CUSTOM"), 8); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("DEBUG"), 7); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("EMERGENCY"), 0); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("ERROR"), 3); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("INFO"), 6); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("NOTICE"), 5); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("WARNING"), 4); - - zend_class_implements(phalcon_logger_logger_ce, 1, zephir_get_internal_ce(SL("psr\\log\\loggerinterface"))); + zend_class_implements(phalcon_logger_logger_ce, 1, phalcon_logger_loggerinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Logger_Logger, getAdapters) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "adapters"); -} - -static PHP_METHOD(Phalcon_Logger_Logger, getLogLevel) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "logLevel"); -} - -static PHP_METHOD(Phalcon_Logger_Logger, getName) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "name"); -} - -static PHP_METHOD(Phalcon_Logger_Logger, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval adapters; - zval *name_param = NULL, *adapters_param = NULL, *timezone = NULL, timezone_sub, __$null, localTimeZone, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&timezone_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&localTimeZone); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&adapters); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(adapters) - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(timezone, php_date_get_timezone_ce()) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 2, &name_param, &adapters_param, &timezone); - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - } - if (!adapters_param) { - ZEPHIR_INIT_VAR(&adapters); - array_init(&adapters); - } else { - ZEPHIR_OBS_COPY_OR_DUP(&adapters, adapters_param); - } - if (!timezone) { - timezone = &timezone_sub; - timezone = &__$null; - } - - - ZEPHIR_CPY_WRT(&localTimeZone, timezone); - if (ZEPHIR_IS_EMPTY(timezone)) { - ZEPHIR_CALL_FUNCTION(&localTimeZone, "date_default_timezone_get", NULL, 484); - zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(&localTimeZone)) { - ZEPHIR_INIT_NVAR(&localTimeZone); - ZVAL_STRING(&localTimeZone, "UTC"); - } - } - zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, php_date_get_timezone_ce()); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &localTimeZone); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("timezone"), &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setadapters", NULL, 0, &adapters); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Logger_Logger, addAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, *adapter, adapter_sub; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapter_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_STR(name) - Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_logger_adapter_adapterinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name_param, &adapter); - zephir_get_strval(&name, name_param); - - - zephir_update_property_array(this_ptr, SL("adapters"), &name, adapter); - RETURN_THIS(); -} - static PHP_METHOD(Phalcon_Logger_Logger, alert) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -214830,7 +210387,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, alert) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -214839,30 +210397,28 @@ static PHP_METHOD(Phalcon_Logger_Logger, alert) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } static PHP_METHOD(Phalcon_Logger_Logger, critical) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -214870,7 +210426,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, critical) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -214879,30 +210436,28 @@ static PHP_METHOD(Phalcon_Logger_Logger, critical) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } static PHP_METHOD(Phalcon_Logger_Logger, debug) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -214910,7 +210465,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, debug) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -214919,30 +210475,28 @@ static PHP_METHOD(Phalcon_Logger_Logger, debug) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 7); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 7); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Logger_Logger, error) +static PHP_METHOD(Phalcon_Logger_Logger, emergency) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -214950,7 +210504,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, error) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -214959,30 +210514,28 @@ static PHP_METHOD(Phalcon_Logger_Logger, error) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Logger_Logger, emergency) +static PHP_METHOD(Phalcon_Logger_Logger, error) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -214990,7 +210543,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, emergency) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -214999,129 +210553,28 @@ static PHP_METHOD(Phalcon_Logger_Logger, emergency) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Logger_Logger, excludeAdapters) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *adapters_param = NULL, __$true, adapter, registered, *_0, _1; - zval adapters; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapters); - ZVAL_BOOL(&__$true, 1); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(®istered); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(adapters) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &adapters_param); - if (!adapters_param) { - ZEPHIR_INIT_VAR(&adapters); - array_init(&adapters); - } else { - zephir_get_arrval(&adapters, adapters_param); - } - - - zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&adapters, 0, "phalcon/Logger/Logger.zep", 227); - if (Z_TYPE_P(&adapters) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _0) - { - ZEPHIR_INIT_NVAR(&adapter); - ZVAL_COPY(&adapter, _0); - if (zephir_array_isset(®istered, &adapter)) { - zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &adapters, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); - zephir_check_call_status(); - if (zephir_array_isset(®istered, &adapter)) { - zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); - } - ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&adapter); - RETURN_THIS(); -} - -static PHP_METHOD(Phalcon_Logger_Logger, getAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, adapter, adapters, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&adapters, &_0); - ZEPHIR_OBS_VAR(&adapter); - if (!(zephir_array_isset_fetch(&adapter, &adapters, &name, 0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/Logger.zep", 245); - return; - } - RETURN_CCTOR(&adapter); -} - static PHP_METHOD(Phalcon_Logger_Logger, info) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -215129,7 +210582,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, info) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -215138,32 +210592,31 @@ static PHP_METHOD(Phalcon_Logger_Logger, info) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 6); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } static PHP_METHOD(Phalcon_Logger_Logger, log) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *level, level_sub, *message, message_sub, *context_param = NULL, intLevel; + zval message, _0; + zval *level, level_sub, *message_param = NULL, *context_param = NULL, intLevel; zval *this_ptr = getThis(); ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&intLevel); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_ZVAL(level) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -215171,7 +210624,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, log) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level, &message, &context_param); + zephir_fetch_params(1, 2, 1, &level, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -215180,9 +210634,9 @@ static PHP_METHOD(Phalcon_Logger_Logger, log) } - ZEPHIR_CALL_METHOD(&intLevel, this_ptr, "getlevelnumber", NULL, 485, level); + ZEPHIR_CALL_METHOD(&intLevel, this_ptr, "getlevelnumber", NULL, 0, level); zephir_check_call_status(); - zephir_cast_to_string(&_0, message); + zephir_cast_to_string(&_0, &message); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &intLevel, &_0, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -215190,21 +210644,20 @@ static PHP_METHOD(Phalcon_Logger_Logger, log) static PHP_METHOD(Phalcon_Logger_Logger, notice) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -215212,7 +210665,8 @@ static PHP_METHOD(Phalcon_Logger_Logger, notice) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -215221,175 +210675,27 @@ static PHP_METHOD(Phalcon_Logger_Logger, notice) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 5); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -static PHP_METHOD(Phalcon_Logger_Logger, removeAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, adapters, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&adapters, &_0); - if (1 != zephir_array_isset(&adapters, &name)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/Logger.zep", 312); - return; - } - zephir_array_unset(&adapters, &name, PH_SEPARATE); - zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); - RETURN_THIS(); -} - -static PHP_METHOD(Phalcon_Logger_Logger, setAdapters) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *adapters_param = NULL; - zval adapters; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapters); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(adapters) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &adapters_param); - ZEPHIR_OBS_COPY_OR_DUP(&adapters, adapters_param); - - - zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); - RETURN_THIS(); -} - -static PHP_METHOD(Phalcon_Logger_Logger, setLogLevel) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *level_param = NULL, levels, _0; - zend_long level, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(level) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &level_param); - level = zephir_get_intval(level_param); - - - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (!(zephir_array_isset_long(&levels, level))) { - level = 8; - } - ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(&_0, level); - zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); - RETURN_THIS(); -} - static PHP_METHOD(Phalcon_Logger_Logger, warning) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); - if (!context_param) { - ZEPHIR_INIT_VAR(&context); - array_init(&context); - } else { - zephir_get_arrval(&context, context_param); - } - - - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -static PHP_METHOD(Phalcon_Logger_Logger, addMessage) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval context; + zval *message_param = NULL, *context_param = NULL, _0; zval message; - zval *level_param = NULL, *message_param = NULL, *context_param = NULL, adapter, adapters, excluded, item, levelName, levels, registered, _0, _1$$3, _2$$3, _3$$3, _4$$3, *_5$$3, _6$$3, _7$$6, _8$$9; - zend_long level, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&excluded); - ZVAL_UNDEF(&item); - ZVAL_UNDEF(&levelName); - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(®istered); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$6); - ZVAL_UNDEF(&_8$$9); ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_LONG(level) + ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) @@ -215398,8 +210704,7 @@ static PHP_METHOD(Phalcon_Logger_Logger, addMessage) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level_param, &message_param, &context_param); - level = zephir_get_intval(level_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); @@ -215409,179 +210714,10 @@ static PHP_METHOD(Phalcon_Logger_Logger, addMessage) } - zephir_read_property(&_0, this_ptr, ZEND_STRL("logLevel"), PH_NOISY_CC | PH_READONLY); - if (ZEPHIR_GE_LONG(&_0, level)) { - ZEPHIR_OBS_VAR(®istered); - zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC); - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&excluded, &_1$$3); - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (1 == ZEPHIR_IS_EMPTY(®istered)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "No adapters specified", "phalcon/Logger/Logger.zep", 397); - return; - } - ZEPHIR_OBS_VAR(&levelName); - if (UNEXPECTED(!(zephir_array_isset_long_fetch(&levelName, &levels, level, 0)))) { - ZEPHIR_OBS_NVAR(&levelName); - zephir_array_fetch_long(&levelName, &levels, 8, PH_NOISY, "phalcon/Logger/Logger.zep", 401); - } - ZEPHIR_INIT_VAR(&item); - object_init_ex(&item, phalcon_logger_item_ce); - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, php_date_get_immutable_ce()); - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("timezone"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "now"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, &_3$$3, &_1$$3); - zephir_check_call_status(); - ZVAL_LONG(&_4$$3, level); - ZEPHIR_CALL_METHOD(NULL, &item, "__construct", NULL, 486, &message, &levelName, &_4$$3, &_2$$3, &context); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&adapters, "array_diff_key", NULL, 487, ®istered, &excluded); - zephir_check_call_status(); - zephir_is_iterable(&adapters, 0, "phalcon/Logger/Logger.zep", 427); - if (Z_TYPE_P(&adapters) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _5$$3) - { - ZEPHIR_INIT_NVAR(&adapter); - ZVAL_COPY(&adapter, _5$$3); - ZEPHIR_CALL_METHOD(&_7$$6, &adapter, "intransaction", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$6)) { - ZEPHIR_CALL_METHOD(NULL, &adapter, "add", NULL, 0, &item); - zephir_check_call_status(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapter, "process", NULL, 0, &item); - zephir_check_call_status(); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_6$$3, &adapters, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_6$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$9, &adapter, "intransaction", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$9)) { - ZEPHIR_CALL_METHOD(NULL, &adapter, "add", NULL, 0, &item); - zephir_check_call_status(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapter, "process", NULL, 0, &item); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&adapter); - ZEPHIR_INIT_NVAR(&_3$$3); - array_init(&_3$$3); - zephir_update_property_zval(this_ptr, ZEND_STRL("excluded"), &_3$$3); - } - RETURN_MM_BOOL(1); -} - -static PHP_METHOD(Phalcon_Logger_Logger, getLevels) -{ - zval *this_ptr = getThis(); - - - - zephir_create_array(return_value, 9, 0); - add_index_stringl(return_value, 2, SL("ALERT")); - add_index_stringl(return_value, 1, SL("CRITICAL")); - add_index_stringl(return_value, 7, SL("DEBUG")); - add_index_stringl(return_value, 0, SL("EMERGENCY")); - add_index_stringl(return_value, 3, SL("ERROR")); - add_index_stringl(return_value, 6, SL("INFO")); - add_index_stringl(return_value, 5, SL("NOTICE")); - add_index_stringl(return_value, 4, SL("WARNING")); - add_index_stringl(return_value, 8, SL("CUSTOM")); - return; -} - -static PHP_METHOD(Phalcon_Logger_Logger, getLevelNumber) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *level, level_sub, levelName, levels, _0$$3, _1$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&levelName); - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(level) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &level); - - - if (Z_TYPE_P(level) == IS_STRING) { - ZEPHIR_INIT_VAR(&levelName); - zephir_fast_strtoupper(&levelName, level); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&levels, "array_flip", NULL, 203, &_0$$3); - zephir_check_call_status(); - if (zephir_array_isset(&levels, &levelName)) { - zephir_array_fetch(&_1$$4, &levels, &levelName, PH_NOISY | PH_READONLY, "phalcon/Logger/Logger.zep", 473); - RETURN_CTOR(&_1$$4); - } - } else if (zephir_is_numeric(level)) { - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (zephir_array_isset(&levels, level)) { - RETURN_MM_LONG(zephir_get_intval(level)); - } - } - RETURN_MM_LONG(8); -} - -zend_object *zephir_init_properties_Phalcon_Logger_Logger(zend_class_entry *class_type) -{ - zval _0, _2, _1$$3, _3$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("excluded"), &_1$$3); - } - zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("adapters"), &_3$$4); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); } @@ -215810,7 +210946,7 @@ static PHP_METHOD(Phalcon_Logger_LoggerFactory, newInstance) object_init_ex(return_value, phalcon_logger_logger_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 488, &name, &adapters, timezone); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 408, &name, &adapters, timezone); zephir_check_call_status(); RETURN_MM(); } @@ -215873,6 +211009,36 @@ static PHP_METHOD(Phalcon_Logger_LoggerFactory, getExceptionClass) +ZEPHIR_INIT_CLASS(Phalcon_Logger_LoggerInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Logger, LoggerInterface, phalcon, logger_loggerinterface, phalcon_logger_loggerinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, alert); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, critical); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, debug); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, emergency); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, error); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getAdapter); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getAdapters); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getLogLevel); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getName); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, info); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, log); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, notice); +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, warning); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_AbstractFormatter) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger\\Formatter, AbstractFormatter, phalcon, logger_formatter_abstractformatter, phalcon_support_helper_str_abstractstr_ce, phalcon_logger_formatter_abstractformatter_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); @@ -216334,7 +211500,7 @@ static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, commit) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 95); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 64); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("queue"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&queue, &_0); @@ -216365,7 +211531,7 @@ static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, commit) } } ZEPHIR_INIT_NVAR(&item); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 96); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 65); zephir_check_call_status(); RETURN_THIS(); } @@ -216384,9 +211550,8 @@ static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, getFormatter) ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("formatter"), PH_NOISY_CC); - if (Z_TYPE_P(&_0) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("formatter"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("defaultFormatter"), PH_NOISY_CC | PH_READONLY); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&_1$$3, &_2$$3); @@ -216419,9 +211584,9 @@ static PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, rollback) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 95); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 64); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 96); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 65); zephir_check_call_status(); RETURN_THIS(); } @@ -216643,13 +211808,16 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, getName) static PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval options; - zval *name_param = NULL, *options_param = NULL, mode; + zval *name_param = NULL, *options_param = NULL, mode, _0, _1; zval name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name); ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -216672,17 +211840,21 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) } - ZEPHIR_OBS_VAR(&mode); - if (zephir_array_isset_string_fetch(&mode, &options, SL("mode"), 0)) { - if (zephir_memnstr_str(&mode, SL("r"), "phalcon/Logger/Adapter/Stream.zep", 83)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter cannot be opened in read mode", "phalcon/Logger/Adapter/Stream.zep", 84); - return; - } - } - if (Z_TYPE_P(&mode) == IS_NULL) { + if (1 == zephir_array_isset_string(&options, SL("mode"))) { + ZEPHIR_OBS_VAR(&mode); + zephir_array_fetch_string(&mode, &options, SL("mode"), PH_NOISY, "phalcon/Logger/Adapter/Stream.zep", 82); + } else { ZEPHIR_INIT_NVAR(&mode); ZVAL_STRING(&mode, "ab"); } + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "r"); + ZEPHIR_CALL_FUNCTION(&_1, "mb_strpos", NULL, 82, &mode, &_0); + zephir_check_call_status(); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter cannot be opened in read mode", "phalcon/Logger/Adapter/Stream.zep", 84); + return; + } zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); zephir_update_property_zval(this_ptr, ZEND_STRL("mode"), &mode); ZEPHIR_MM_RESTORE(); @@ -216714,16 +211886,16 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *item, item_sub, __$null, message, _0, _10, _11, _12, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4; + zval *item, item_sub, __$null, message, _0, _9, _10, _11, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&item_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_9); ZVAL_UNDEF(&_10); ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_3$$3); @@ -216732,7 +211904,6 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) ZVAL_UNDEF(&_6$$4); ZVAL_UNDEF(&_7$$4); ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_9$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -216760,24 +211931,22 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("mode"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_8$$4); - ZVAL_STRING(&_8$$4, "The file '%s' cannot be opened with mode '%s'"); - ZEPHIR_CALL_FUNCTION(&_9$$4, "sprintf", NULL, 140, &_8$$4, &_6$$4, &_7$$4); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_5$$4, "__construct", NULL, 479, &_9$$4); + ZEPHIR_CONCAT_SVSVS(&_8$$4, "The file '", &_6$$4, "' cannot be opened with mode '", &_7$$4, "'"); + ZEPHIR_CALL_METHOD(NULL, &_5$$4, "__construct", NULL, 403, &_8$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$4, "phalcon/Logger/Adapter/Stream.zep", 133); + zephir_throw_exception_debug(&_5$$4, "phalcon/Logger/Adapter/Stream.zep", 128); ZEPHIR_MM_RESTORE(); return; } } - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getformatteditem", NULL, 0, item); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "getformatteditem", NULL, 0, item); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_11); - ZEPHIR_GET_CONSTANT(&_11, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_GET_CONSTANT(&_10, "PHP_EOL"); ZEPHIR_INIT_VAR(&message); - ZEPHIR_CONCAT_VV(&message, &_10, &_11); - zephir_read_property(&_12, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY); - zephir_fwrite(NULL, &_12, &message); + ZEPHIR_CONCAT_VV(&message, &_9, &_10); + zephir_read_property(&_11, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY); + zephir_fwrite(NULL, &_11, &message); ZEPHIR_MM_RESTORE(); } @@ -216806,7 +211975,7 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Stream, phpFopen) zephir_get_strval(&mode, mode_param); - ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 90, &filename, &mode); + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); zephir_check_call_status(); RETURN_MM(); } @@ -216905,7 +212074,7 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, close) if (!(zephir_is_true(&_0))) { RETURN_MM_BOOL(1); } - ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 480); + ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 404); zephir_check_call_status(); RETURN_MM(); } @@ -216962,9 +212131,9 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, process) zephir_cast_to_string(&_6$$3, &_5$$3); ZEPHIR_INIT_VAR(&_7$$3); ZVAL_STRING(&_7$$3, "Cannot open syslog for name [%s] and facility [%s]"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "sprintf", NULL, 140, &_7$$3, &_4$$3, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "sprintf", NULL, 112, &_7$$3, &_4$$3, &_6$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 479, &_8$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 403, &_8$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Logger/Adapter/Syslog.zep", 106); ZEPHIR_MM_RESTORE(); @@ -216977,9 +212146,9 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, process) } ZEPHIR_CALL_METHOD(&_9, item, "getlevel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&level, this_ptr, "logleveltosyslog", NULL, 481, &_9); + ZEPHIR_CALL_METHOD(&level, this_ptr, "logleveltosyslog", NULL, 405, &_9); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 482, &level, &message); + ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 406, &level, &message); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -217014,7 +212183,7 @@ static PHP_METHOD(Phalcon_Logger_Adapter_Syslog, openlog) ZVAL_LONG(&_0, option); ZVAL_LONG(&_1, facility); - ZEPHIR_RETURN_CALL_FUNCTION("openlog", NULL, 483, &ident, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("openlog", NULL, 407, &ident, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -217598,10 +212767,10 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponent) } else { ZEPHIR_INIT_NVAR(&componentObject); object_init_ex(&componentObject, phalcon_acl_component_ce); - ZEPHIR_CALL_METHOD(NULL, &componentObject, "__construct", NULL, 158, componentValue); + ZEPHIR_CALL_METHOD(NULL, &componentObject, "__construct", NULL, 137, componentValue); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 159); + ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 138); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_1, &componentName))) { @@ -217655,7 +212824,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponentAccess) zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Component"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &componentName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &componentName, &_1); zephir_check_call_status(); _2 = Z_TYPE_P(accessList) != IS_ARRAY; if (_2) { @@ -217798,7 +212967,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZVAL_STRING(&_1, "Role"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "role list"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &roleName, &_1, &_2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &roleName, &_1, &_2); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_3, &roleName))) { @@ -217840,7 +213009,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_11$$10, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_12$$10); ZEPHIR_CONCAT_SVS(&_12$$10, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, &_11$$10, "__construct", &_13, 31, &_12$$10); + ZEPHIR_CALL_METHOD(NULL, &_11$$10, "__construct", &_13, 29, &_12$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$10, "phalcon/Acl/Adapter/Memory.zep", 317); ZEPHIR_MM_RESTORE(); @@ -217862,7 +213031,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _17$$12); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -217878,7 +213047,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_16$$12, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_16$$12, "next", NULL, 0); @@ -217893,7 +213062,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -217905,7 +213074,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_21$$17, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_22$$17); ZEPHIR_CONCAT_SVS(&_22$$17, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop"); - ZEPHIR_CALL_METHOD(NULL, &_21$$17, "__construct", &_13, 31, &_22$$17); + ZEPHIR_CALL_METHOD(NULL, &_21$$17, "__construct", &_13, 29, &_22$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$17, "phalcon/Acl/Adapter/Memory.zep", 349); ZEPHIR_MM_RESTORE(); @@ -217922,7 +213091,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _26$$18); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -217938,7 +213107,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_25$$18, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_25$$18, "next", NULL, 0); @@ -217983,7 +213152,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_32$$25, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_33$$25); ZEPHIR_CONCAT_SVS(&_33$$25, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, &_32$$25, "__construct", &_13, 31, &_33$$25); + ZEPHIR_CALL_METHOD(NULL, &_32$$25, "__construct", &_13, 29, &_33$$25); zephir_check_call_status(); zephir_throw_exception_debug(&_32$$25, "phalcon/Acl/Adapter/Memory.zep", 317); ZEPHIR_MM_RESTORE(); @@ -218005,7 +213174,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _37$$27); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -218021,7 +213190,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_36$$27, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_36$$27, "next", NULL, 0); @@ -218036,7 +213205,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -218048,7 +213217,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_39$$32, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_40$$32); ZEPHIR_CONCAT_SVS(&_40$$32, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop"); - ZEPHIR_CALL_METHOD(NULL, &_39$$32, "__construct", &_13, 31, &_40$$32); + ZEPHIR_CALL_METHOD(NULL, &_39$$32, "__construct", &_13, 29, &_40$$32); zephir_check_call_status(); zephir_throw_exception_debug(&_39$$32, "phalcon/Acl/Adapter/Memory.zep", 349); ZEPHIR_MM_RESTORE(); @@ -218065,7 +213234,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _44$$33); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -218081,7 +213250,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_43$$33, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_43$$33, "next", NULL, 0); @@ -218142,13 +213311,13 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole) } else if (Z_TYPE_P(role) == IS_STRING) { ZEPHIR_INIT_NVAR(&roleObject); object_init_ex(&roleObject, phalcon_acl_role_ce); - ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 162, role); + ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 141, role); zephir_check_call_status(); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role must be either a string or implement RoleInterface", "phalcon/Acl/Adapter/Memory.zep", 393); return; } - ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 163); + ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 142); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_1, &roleName)) { @@ -218223,7 +213392,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) ZEPHIR_INIT_NVAR(&role); ZVAL_COPY(&role, _2); ZVAL_LONG(&_4$$4, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_4$$4, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_4$$4, func); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -218238,7 +213407,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0); zephir_check_call_status(); ZVAL_LONG(&_6$$5, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_6$$5, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_6$$5, func); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0); zephir_check_call_status(); @@ -218308,7 +213477,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) ZEPHIR_INIT_NVAR(&role); ZVAL_COPY(&role, _2); ZVAL_LONG(&_4$$4, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_4$$4, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_4$$4, func); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -218323,7 +213492,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0); zephir_check_call_status(); ZVAL_LONG(&_6$$5, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_6$$5, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_6$$5, func); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0); zephir_check_call_status(); @@ -218618,7 +213787,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_1$$6, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_2$$6); ZEPHIR_CONCAT_SS(&_2$$6, "Object passed as roleName must implement ", "Phalcon\\Acl\\RoleAwareInterface or Phalcon\\Acl\\RoleInterface"); - ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 31, &_2$$6); + ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 29, &_2$$6); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$6, "phalcon/Acl/Adapter/Memory.zep", 587); ZEPHIR_MM_RESTORE(); @@ -218639,7 +213808,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_4$$10, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_5$$10); ZEPHIR_CONCAT_SS(&_5$$10, "Object passed as componentName must implement ", "Phalcon\\Acl\\ComponentAwareInterface or Phalcon\\Acl\\ComponentInterface"); - ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 31, &_5$$10); + ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 29, &_5$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$10, "phalcon/Acl/Adapter/Memory.zep", 601); ZEPHIR_MM_RESTORE(); @@ -218671,7 +213840,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_read_property(&_9$$12, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY); RETURN_MM_BOOL((ZEPHIR_IS_LONG(&_9$$12, 1))); } - ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 165, roleName, componentName, &access); + ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 144, roleName, componentName, &access); zephir_check_call_status(); _10 = Z_TYPE_P(&accessKey) != IS_NULL; if (_10) { @@ -218700,9 +213869,9 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) if (zephir_is_callable(&funcAccess)) { ZEPHIR_INIT_VAR(&reflectionFunction); object_init_ex(&reflectionFunction, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 166, &funcAccess); + ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 145, &funcAccess); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 167); + ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 146); zephir_check_call_status(); ZEPHIR_INIT_VAR(¶meterNumber); ZVAL_LONG(¶meterNumber, zephir_fast_count_int(&reflectionParameters)); @@ -218718,7 +213887,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) } ZEPHIR_INIT_VAR(¶metersForFunction); array_init(¶metersForFunction); - ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 168); + ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 147); zephir_check_call_status(); ZEPHIR_CPY_WRT(&userParametersSizeShouldBe, ¶meterNumber); zephir_is_iterable(&reflectionParameters, 0, "phalcon/Acl/Adapter/Memory.zep", 736); @@ -218788,7 +213957,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_32$$21); ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_32$$21, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_29$$21, " , Class in defined function: ", &_31$$21, "."); - ZEPHIR_CALL_METHOD(NULL, &_28$$21, "__construct", NULL, 31, &_32$$21); + ZEPHIR_CALL_METHOD(NULL, &_28$$21, "__construct", NULL, 29, &_32$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$21, "phalcon/Acl/Adapter/Memory.zep", 723); ZEPHIR_MM_RESTORE(); @@ -218872,7 +214041,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$27); ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_49$$27, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_46$$27, " , Class in defined function: ", &_48$$27, "."); - ZEPHIR_CALL_METHOD(NULL, &_45$$27, "__construct", NULL, 31, &_49$$27); + ZEPHIR_CALL_METHOD(NULL, &_45$$27, "__construct", NULL, 29, &_49$$27); zephir_check_call_status(); zephir_throw_exception_debug(&_45$$27, "phalcon/Acl/Adapter/Memory.zep", 723); ZEPHIR_MM_RESTORE(); @@ -218932,7 +214101,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_60$$15, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_61$$15); ZEPHIR_CONCAT_SSVSVSVS(&_61$$15, "You did not provide all necessary parameters for the ", "defined function when checking if '", roleName, "' can '", &access, "' for '", componentName, "'."); - ZEPHIR_CALL_METHOD(NULL, &_60$$15, "__construct", NULL, 31, &_61$$15); + ZEPHIR_CALL_METHOD(NULL, &_60$$15, "__construct", NULL, 29, &_61$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_60$$15, "phalcon/Acl/Adapter/Memory.zep", 777); ZEPHIR_MM_RESTORE(); @@ -219073,12 +214242,12 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) zephir_read_property(&_0, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Role"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &roleName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &roleName, &_1); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Component"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_2, &componentName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_2, &componentName, &_1); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&accessList, &_3); @@ -219096,7 +214265,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_6$$5, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVSVS(&_7$$5, "Access '", &accessName, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", &_8, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", &_8, 29, &_7$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$5, "phalcon/Acl/Adapter/Memory.zep", 829); ZEPHIR_MM_RESTORE(); @@ -219121,7 +214290,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_9$$7, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_10$$7); ZEPHIR_CONCAT_SVSVS(&_10$$7, "Access '", &accessName, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 31, &_10$$7); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 29, &_10$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$7, "phalcon/Acl/Adapter/Memory.zep", 829); ZEPHIR_MM_RESTORE(); @@ -219176,7 +214345,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_13$$14, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_14$$14); ZEPHIR_CONCAT_SVSVS(&_14$$14, "Access '", access, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 31, &_14$$14); + ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 29, &_14$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_13$$14, "phalcon/Acl/Adapter/Memory.zep", 849); ZEPHIR_MM_RESTORE(); @@ -219271,7 +214440,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _3$$6); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -219287,7 +214456,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_2$$6, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_2$$6, "next", NULL, 0); @@ -219302,7 +214471,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -219338,7 +214507,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _13$$14); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -219354,7 +214523,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_12$$14, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_12$$14, "next", NULL, 0); @@ -219413,7 +214582,7 @@ static PHP_METHOD(Phalcon_Acl_Adapter_Memory, checkExists) object_init_ex(&_0$$3, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_VSVSV(&_1$$3, &elementName, " '", &element, "' does not exist in the ", &suffix); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Acl/Adapter/Memory.zep", 985); ZEPHIR_MM_RESTORE(); @@ -219857,7 +215026,7 @@ static PHP_METHOD(Phalcon_Translate_Interpolator_IndexedArray, replacePlaceholde if (1 != ZEPHIR_IS_EMPTY(&placeholders)) { ZEPHIR_MAKE_REF(&placeholders); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &placeholders, &translation); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &placeholders, &translation); ZEPHIR_UNREF(&placeholders); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0$$3); @@ -220021,7 +215190,8 @@ static PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *translateKey, translateKey_sub; + zval translateKey_sub; + zval *translateKey; zval *this_ptr = getThis(); ZVAL_UNDEF(&translateKey_sub); @@ -220453,7 +215623,7 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load) object_init_ex(&_1$$3, phalcon_translate_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Error opening translation file '", &file, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/Csv.zep", 133); ZEPHIR_MM_RESTORE(); @@ -220487,6 +215657,15 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load) ZEPHIR_MM_RESTORE(); } +static PHP_METHOD(Phalcon_Translate_Adapter_Csv, toArray) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "translate"); +} + static PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -220512,7 +215691,7 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen) zephir_get_strval(&mode, mode_param); - ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 90, &filename, &mode); + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); zephir_check_call_status(); RETURN_MM(); } @@ -221358,7 +216537,7 @@ static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound) object_init_ex(&_1$$3, phalcon_translate_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SV(&_2$$3, "Cannot find translation key: ", &index); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/NativeArray.zep", 107); ZEPHIR_MM_RESTORE(); @@ -221421,6 +216600,15 @@ static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query) RETURN_MM(); } +static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, toArray) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "translate"); +} + zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_class_entry *class_type) { zval _0, _1$$3; @@ -221455,6 +216643,551 @@ zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_c +ZEPHIR_INIT_CLASS(Phalcon_Cache_AbstractCache) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, AbstractCache, phalcon, cache_abstractcache, phalcon_cache_abstractcache_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + zend_declare_property_null(phalcon_cache_abstractcache_ce, SL("adapter"), ZEND_ACC_PROTECTED); + zend_class_implements(phalcon_cache_abstractcache_ce, 1, phalcon_cache_cacheinterface_ce); + return SUCCESS; +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, __construct) +{ + zval *adapter, adapter_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapter_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_cache_adapter_adapterinterface_ce) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, &adapter); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, getAdapter) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "adapter"); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKey) +{ + zend_class_entry *_6$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, exception, _0, _1, _2, _3, _4$$3, _5$$3, _7$$3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "/[^A-Za-z0-9-_.]/"); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "/[^A-Za-z0-9-_.]/"); + zephir_preg_match(&_2, &_3, &key, &_0, 0, 0 , 0 ); + if (zephir_is_true(&_2)) { + ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_4$$3); + zephir_fetch_safe_class(&_5$$3, &exception); + _6$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$3), Z_STRLEN_P(&_5$$3), ZEND_FETCH_CLASS_AUTO); + if(!_6$$3) { + RETURN_MM_NULL(); + } + object_init_ex(&_4$$3, _6$$3); + ZEPHIR_INIT_VAR(&_7$$3); + ZVAL_STRING(&_7$$3, "The key contains invalid characters"); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 0, &_7$$3); + zephir_check_call_status(); + zephir_throw_exception_debug(&_4$$3, "phalcon/Cache/AbstractCache.zep", 68); + ZEPHIR_MM_RESTORE(); + return; + } + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKeys) +{ + zend_class_entry *_3$$3; + zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, exception, _1$$3, _2$$3, _4$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(keys) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &keys); + + + _0 = Z_TYPE_P(keys) == IS_ARRAY; + if (!(_0)) { + _0 = zephir_zval_is_traversable(keys); + } + if (!(_0)) { + ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_fetch_safe_class(&_2$$3, &exception); + _3$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_2$$3), Z_STRLEN_P(&_2$$3), ZEND_FETCH_CLASS_AUTO); + if(!_3$$3) { + RETURN_MM_NULL(); + } + object_init_ex(&_1$$3, _3$$3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "The keys need to be an array or instance of Traversable"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0, &_4$$3); + zephir_check_call_status(); + zephir_throw_exception_debug(&_1$$3, "phalcon/Cache/AbstractCache.zep", 87); + ZEPHIR_MM_RESTORE(); + return; + } + ZEPHIR_MM_RESTORE(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doClear) +{ + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "clear", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doDelete) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "delete", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doDeleteMultiple) +{ + zend_bool result = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, key, *_0, _1, _2$$3, _3$$3, _4$$5, _5$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(keys) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &keys); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + zephir_check_call_status(); + result = 1; + zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 135); + if (Z_TYPE_P(keys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) + { + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _0); + zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "delete", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3)) { + result = 0; + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$5, &_4$$5, "delete", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5$$5)) { + result = 0; + } + ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&key); + RETURN_MM_BOOL(result); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &key, defaultValue); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doGetMultiple) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null, element, results, *_0, _1, _2$$3, _4$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&results); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(keys) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &keys, &defaultValue); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&results); + array_init(&results); + zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 171); + if (Z_TYPE_P(keys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) + { + ZEPHIR_INIT_NVAR(&element); + ZVAL_COPY(&element, _0); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "get", &_3, 0, &element, defaultValue); + zephir_check_call_status(); + zephir_array_update_zval(&results, &element, &_2$$3, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&element, keys, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "get", &_5, 0, &element, defaultValue); + zephir_check_call_status(); + zephir_array_update_zval(&results, &element, &_4$$4, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&element); + RETURN_CCTOR(&results); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doHas) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doSet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&ttl_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STR(key) + Z_PARAM_ZVAL(value) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl); + zephir_get_strval(&key, key_param); + if (!ttl) { + ttl = &ttl_sub; + ttl = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, value, ttl); + zephir_check_call_status(); + RETURN_MM(); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, doSetMultiple) +{ + zend_string *_3; + zend_ulong _2; + zend_bool result = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *values, values_sub, *ttl = NULL, ttl_sub, __$null, key, value, *_0, _1, _4$$3, _6$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&values_sub); + ZVAL_UNDEF(&ttl_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$5); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(values) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &values, &ttl); + if (!ttl) { + ttl = &ttl_sub; + ttl = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, values); + zephir_check_call_status(); + result = 1; + zephir_is_iterable(values, 0, "phalcon/Cache/AbstractCache.zep", 232); + if (Z_TYPE_P(values) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _2, _3, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "set", &_5, 0, &key, &value, ttl); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$3)) { + result = 0; + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, values, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&key, values, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_6$$5, this_ptr, "set", &_7, 0, &key, &value, ttl); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) { + result = 0; + } + ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_MM_BOOL(result); +} + +static PHP_METHOD(Phalcon_Cache_AbstractCache, getExceptionClass) +{ +} + + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Cache_AdapterFactory) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, AdapterFactory, phalcon, cache_adapterfactory, phalcon_factory_abstractfactory_ce, phalcon_cache_adapterfactory_method_entry, 0); @@ -221591,109 +217324,61 @@ static PHP_METHOD(Phalcon_Cache_AdapterFactory, getServices) ZEPHIR_INIT_CLASS(Phalcon_Cache_Cache) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, Cache, phalcon, cache_cache, phalcon_cache_cache_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, Cache, phalcon, cache_cache, phalcon_cache_abstractcache_ce, phalcon_cache_cache_method_entry, 0); - zend_declare_property_null(phalcon_cache_cache_ce, SL("adapter"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_cache_cache_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))); return SUCCESS; } -static PHP_METHOD(Phalcon_Cache_Cache, getAdapter) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "adapter"); -} - -static PHP_METHOD(Phalcon_Cache_Cache, __construct) -{ - zval *adapter, adapter_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapter_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_cache_adapter_adapterinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &adapter); - - - zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter); -} - static PHP_METHOD(Phalcon_Cache_Cache, clear) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "clear", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doclear", NULL, 0); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, delete) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, _1; + zval *key_param = NULL; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&key); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "delete", NULL, 0, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodelete", NULL, 0, &key); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple) { - zend_bool result = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keys, keys_sub, key, *_0, _1, _2$$3, _3$$3, _4$$5, _5$$5; + zval *keys, keys_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&keys_sub); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_5$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -221706,64 +217391,26 @@ static PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple) zephir_fetch_params(1, 1, 0, &keys); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodeletemultiple", NULL, 0, keys); zephir_check_call_status(); - result = 1; - zephir_is_iterable(keys, 0, "phalcon/Cache/Cache.zep", 100); - if (Z_TYPE_P(keys) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) - { - ZEPHIR_INIT_NVAR(&key); - ZVAL_COPY(&key, _0); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "delete", NULL, 0, &key); - zephir_check_call_status(); - if (!(zephir_is_true(&_3$$3))) { - result = 0; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); - zephir_check_call_status(); - zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_5$$5, &_4$$5, "delete", NULL, 0, &key); - zephir_check_call_status(); - if (!(zephir_is_true(&_5$$5))) { - result = 0; - } - ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&key); - RETURN_MM_BOOL(result); + RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, get) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, *defaultValue = NULL, defaultValue_sub, __$null, _1; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(defaultValue) ZEND_PARSE_PARAMETERS_END(); @@ -221771,41 +217418,29 @@ static PHP_METHOD(Phalcon_Cache_Cache, get) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key, &defaultValue); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); if (!defaultValue) { defaultValue = &defaultValue_sub; defaultValue = &__$null; } - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "get", NULL, 0, key, defaultValue); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doget", NULL, 0, &key, defaultValue); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, getMultiple) { - zval results; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null, element, *_0, _1, _2$$3, _4$$4; + zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null; zval *this_ptr = getThis(); ZVAL_UNDEF(&keys_sub); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&element); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&results); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -221824,94 +217459,54 @@ static PHP_METHOD(Phalcon_Cache_Cache, getMultiple) } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetmultiple", NULL, 0, keys, defaultValue); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&results); - array_init(&results); - zephir_is_iterable(keys, 0, "phalcon/Cache/Cache.zep", 151); - if (Z_TYPE_P(keys) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) - { - ZEPHIR_INIT_NVAR(&element); - ZVAL_COPY(&element, _0); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "get", &_3, 0, &element, defaultValue); - zephir_check_call_status(); - zephir_array_update_zval(&results, &element, &_2$$3, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&element, keys, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "get", &_3, 0, &element, defaultValue); - zephir_check_call_status(); - zephir_array_update_zval(&results, &element, &_4$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&element); - RETURN_CTOR(&results); + RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, has) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, _1; + zval *key_param = NULL; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&key); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "has", NULL, 0, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dohas", NULL, 0, &key); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, set) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _1; + zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&value_sub); ZVAL_UNDEF(&ttl_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) Z_PARAM_ZVAL(value) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(ttl) @@ -221920,43 +217515,29 @@ static PHP_METHOD(Phalcon_Cache_Cache, set) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &key, &value, &ttl); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl); + zephir_get_strval(&key, key_param); if (!ttl) { ttl = &ttl_sub; ttl = &__$null; } - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "set", NULL, 0, key, value, ttl); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doset", NULL, 0, &key, value, ttl); zephir_check_call_status(); RETURN_MM(); } static PHP_METHOD(Phalcon_Cache_Cache, setMultiple) { - zend_string *_3; - zend_ulong _2; - zend_bool result = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values, values_sub, *ttl = NULL, ttl_sub, __$null, key, value, *_0, _1, _4$$3, _6$$5; + zval *values, values_sub, *ttl = NULL, ttl_sub, __$null; zval *this_ptr = getThis(); ZVAL_UNDEF(&values_sub); ZVAL_UNDEF(&ttl_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -221975,119 +217556,18 @@ static PHP_METHOD(Phalcon_Cache_Cache, setMultiple) } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, values); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dosetmultiple", NULL, 0, values, ttl); zephir_check_call_status(); - result = 1; - zephir_is_iterable(values, 0, "phalcon/Cache/Cache.zep", 231); - if (Z_TYPE_P(values) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "set", &_5, 0, &key, &value, ttl); - zephir_check_call_status(); - if (!(zephir_is_true(&_4$$3))) { - result = 0; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, values, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, values, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$5, this_ptr, "set", &_5, 0, &key, &value, ttl); - zephir_check_call_status(); - if (!(zephir_is_true(&_6$$5))) { - result = 0; - } - ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&key); - RETURN_MM_BOOL(result); -} - -static PHP_METHOD(Phalcon_Cache_Cache, checkKey) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *key_param = NULL, _0, _1, _2, _3; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key_param); - zephir_get_strval(&key, key_param); - - - ZEPHIR_INIT_VAR(&_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "/[^A-Za-z0-9-_.]/"); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "/[^A-Za-z0-9-_.]/"); - zephir_preg_match(&_2, &_3, &key, &_0, 0, 0 , 0 ); - if (zephir_is_true(&_2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_invalidargumentexception_ce, "The key contains invalid characters", "phalcon/Cache/Cache.zep", 246); - return; - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Cache_Cache, checkKeys) +static PHP_METHOD(Phalcon_Cache_Cache, getExceptionClass) { - zend_bool _0; - zval *keys, keys_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&keys_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(keys) - ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &keys); - - _0 = Z_TYPE_P(keys) == IS_ARRAY; - if (!(_0)) { - _0 = zephir_zval_is_traversable(keys); - } - if (!(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_cache_exception_invalidargumentexception_ce, "The keys need to be an array or instance of Traversable", "phalcon/Cache/Cache.zep", 262); - return; - } + RETURN_STRING("Phalcon\\Cache\\Exception\\InvalidArgumentException"); } @@ -222162,7 +217642,7 @@ static PHP_METHOD(Phalcon_Cache_CacheFactory, load) zephir_check_call_status(); ZEPHIR_CPY_WRT(config, &_0); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 76); + zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 75); ZEPHIR_OBS_VAR(&options); if (!(zephir_array_isset_string_fetch(&options, config, SL("options"), 0))) { ZEPHIR_INIT_NVAR(&options); @@ -222219,7 +217699,7 @@ static PHP_METHOD(Phalcon_Cache_CacheFactory, newInstance) ZEPHIR_CALL_METHOD(&adapter, &_0, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); object_init_ex(return_value, phalcon_cache_cache_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 200, &adapter); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 181, &adapter); zephir_check_call_status(); RETURN_MM(); } @@ -222243,11 +217723,35 @@ static PHP_METHOD(Phalcon_Cache_CacheFactory, getExceptionClass) +ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Cache, CacheInterface, phalcon, cache_cacheinterface, phalcon_cache_cacheinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, clear); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, delete); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, deleteMultiple); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, get); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, getMultiple); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, has); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, set); +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, setMultiple); + + + +#ifdef HAVE_CONFIG_H +#endif + + + + + ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, Exception, phalcon, cache_exception_exception, zend_ce_exception, NULL, 0); - zend_class_implements(phalcon_cache_exception_exception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\cacheexception"))); return SUCCESS; } @@ -222265,7 +217769,6 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_InvalidArgumentException) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, InvalidArgumentException, phalcon, cache_exception_invalidargumentexception, zend_ce_exception, NULL, 0); - zend_class_implements(phalcon_cache_exception_invalidargumentexception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\invalidargumentexception"))); return SUCCESS; } @@ -223109,7 +218612,8 @@ static PHP_METHOD(Phalcon_Messages_Messages, next) static PHP_METHOD(Phalcon_Messages_Messages, offsetExists) { - zval *index, index_sub, _0; + zval index_sub, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -223132,7 +218636,8 @@ static PHP_METHOD(Phalcon_Messages_Messages, offsetExists) static PHP_METHOD(Phalcon_Messages_Messages, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *index, index_sub, message, returnValue, _0; + zval index_sub, message, returnValue, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -223162,11 +218667,14 @@ static PHP_METHOD(Phalcon_Messages_Messages, offsetGet) static PHP_METHOD(Phalcon_Messages_Messages, offsetSet) { - zval *index, index_sub, *message, message_sub; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval index_sub, message_sub, _0; + zval *index, *message; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) @@ -223176,21 +218684,26 @@ static PHP_METHOD(Phalcon_Messages_Messages, offsetSet) #endif - zephir_fetch_params_without_memory_grow(2, 0, &index, &message); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &index, &message); - if (Z_TYPE_P(message) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241); + ZEPHIR_INIT_VAR(&_0); + zephir_gettype(&_0, message); + if (!ZEPHIR_IS_STRING(&_0, "object")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241); return; } zephir_update_property_array(this_ptr, SL("messages"), index, message); + ZEPHIR_MM_RESTORE(); } static PHP_METHOD(Phalcon_Messages_Messages, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index, index_sub, _0, _1$$3, _2$$3; + zval index_sub, _0, _1$$3, _2$$3; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -223214,7 +218727,7 @@ static PHP_METHOD(Phalcon_Messages_Messages, offsetUnset) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2$$3, 1); ZEPHIR_MAKE_REF(&_1$$3); - ZEPHIR_CALL_FUNCTION(NULL, "array_splice", NULL, 489, &_1$$3, index, &_2$$3); + ZEPHIR_CALL_FUNCTION(NULL, "array_splice", NULL, 409, &_1$$3, index, &_2$$3); ZEPHIR_UNREF(&_1$$3); zephir_check_call_status(); } @@ -223270,19 +218783,20 @@ zend_class_entry *phalcon_filter_validation_validatorinterface_ce; zend_class_entry *phalcon_events_eventsawareinterface_ce; zend_class_entry *phalcon_support_collection_collectioninterface_ce; zend_class_entry *phalcon_storage_adapter_adapterinterface_ce; +zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; zend_class_entry *phalcon_forms_element_elementinterface_ce; zend_class_entry *phalcon_dispatcher_dispatcherinterface_ce; zend_class_entry *phalcon_encryption_crypt_padding_padinterface_ce; -zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; zend_class_entry *phalcon_assets_assetinterface_ce; zend_class_entry *phalcon_config_configinterface_ce; zend_class_entry *phalcon_mvc_model_metadatainterface_ce; zend_class_entry *phalcon_cache_adapter_adapterinterface_ce; zend_class_entry *phalcon_db_adapter_adapterinterface_ce; -zend_class_entry *phalcon_http_message_requestmethodinterface_ce; zend_class_entry *phalcon_annotations_adapter_adapterinterface_ce; zend_class_entry *phalcon_datamapper_pdo_connection_pdointerface_ce; zend_class_entry *phalcon_db_dialectinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_linkinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_linkproviderinterface_ce; zend_class_entry *phalcon_logger_adapter_adapterinterface_ce; zend_class_entry *phalcon_mvc_model_resultsetinterface_ce; zend_class_entry *phalcon_paginator_adapter_adapterinterface_ce; @@ -223299,9 +218813,10 @@ zend_class_entry *phalcon_mvc_model_behaviorinterface_ce; zend_class_entry *phalcon_mvc_view_engine_engineinterface_ce; zend_class_entry *phalcon_mvc_viewbaseinterface_ce; zend_class_entry *phalcon_acl_adapter_adapterinterface_ce; +zend_class_entry *phalcon_cache_cacheinterface_ce; zend_class_entry *phalcon_domain_payload_readableinterface_ce; zend_class_entry *phalcon_domain_payload_writeableinterface_ce; -zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; +zend_class_entry *phalcon_logger_loggerinterface_ce; zend_class_entry *phalcon_mvc_entityinterface_ce; zend_class_entry *phalcon_mvc_model_metadata_strategy_strategyinterface_ce; zend_class_entry *phalcon_mvc_model_resultinterface_ce; @@ -223329,8 +218844,12 @@ zend_class_entry *phalcon_filter_validation_validationinterface_ce; zend_class_entry *phalcon_html_attributes_attributesinterface_ce; zend_class_entry *phalcon_html_attributes_renderinterface_ce; zend_class_entry *phalcon_html_escaper_escaperinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce; zend_class_entry *phalcon_html_link_serializer_serializerinterface_ce; zend_class_entry *phalcon_http_cookie_cookieinterface_ce; +zend_class_entry *phalcon_http_message_requestmethodinterface_ce; +zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; zend_class_entry *phalcon_http_request_fileinterface_ce; zend_class_entry *phalcon_http_requestinterface_ce; zend_class_entry *phalcon_http_response_cookiesinterface_ce; @@ -223355,10 +218874,12 @@ zend_class_entry *phalcon_mvc_router_routeinterface_ce; zend_class_entry *phalcon_mvc_url_urlinterface_ce; zend_class_entry *phalcon_mvc_viewinterface_ce; zend_class_entry *phalcon_paginator_repositoryinterface_ce; +zend_class_entry *phalcon_session_baginterface_ce; zend_class_entry *phalcon_session_managerinterface_ce; zend_class_entry *phalcon_acl_componentawareinterface_ce; zend_class_entry *phalcon_acl_roleawareinterface_ce; zend_class_entry *phalcon_cli_routerinterface_ce; +zend_class_entry *phalcon_di_initializationawareinterface_ce; zend_class_entry *phalcon_di_serviceproviderinterface_ce; zend_class_entry *phalcon_mvc_controller_bindmodelinterface_ce; zend_class_entry *phalcon_mvc_micro_middlewareinterface_ce; @@ -223370,28 +218891,26 @@ zend_class_entry *phalcon_html_helper_input_abstractinput_ce; zend_class_entry *phalcon_factory_abstractconfigfactory_ce; zend_class_entry *phalcon_di_abstractinjectionaware_ce; zend_class_entry *phalcon_factory_abstractfactory_ce; +zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; zend_class_entry *phalcon_di_injectable_ce; zend_class_entry *phalcon_forms_element_abstractelement_ce; zend_class_entry *phalcon_support_helper_str_abstractstr_ce; zend_class_entry *phalcon_storage_adapter_abstractadapter_ce; zend_class_entry *phalcon_support_collection_ce; zend_class_entry *phalcon_support_helper_arr_abstractarr_ce; +zend_class_entry *phalcon_storage_serializer_none_ce; zend_class_entry *phalcon_filter_validation_validator_file_abstractfile_ce; -zend_class_entry *phalcon_http_message_abstractcommon_ce; -zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; zend_class_entry *phalcon_config_config_ce; zend_class_entry *phalcon_datamapper_query_abstractquery_ce; zend_class_entry *phalcon_mvc_model_metadata_ce; zend_class_entry *phalcon_db_adapter_abstractadapter_ce; zend_class_entry *phalcon_html_helper_abstractseries_ce; -zend_class_entry *phalcon_http_message_abstractmessage_ce; zend_class_entry *phalcon_annotations_adapter_abstractadapter_ce; zend_class_entry *phalcon_datamapper_query_abstractconditions_ce; zend_class_entry *phalcon_db_adapter_pdo_abstractpdo_ce; zend_class_entry *phalcon_db_dialect_ce; zend_class_entry *phalcon_events_abstracteventsaware_ce; zend_class_entry *phalcon_html_helper_abstractlist_ce; -zend_class_entry *phalcon_http_message_stream_ce; zend_class_entry *phalcon_logger_adapter_abstractadapter_ce; zend_class_entry *phalcon_mvc_model_exception_ce; zend_class_entry *phalcon_paginator_adapter_abstractadapter_ce; @@ -223409,7 +218928,8 @@ zend_class_entry *phalcon_dispatcher_exception_ce; zend_class_entry *phalcon_encryption_security_jwt_token_abstractitem_ce; zend_class_entry *phalcon_filter_validation_abstractvalidatorcomposite_ce; zend_class_entry *phalcon_flash_abstractflash_ce; -zend_class_entry *phalcon_http_message_abstractrequest_ce; +zend_class_entry *phalcon_html_link_abstractlink_ce; +zend_class_entry *phalcon_html_link_abstractlinkprovider_ce; zend_class_entry *phalcon_image_adapter_abstractadapter_ce; zend_class_entry *phalcon_logger_formatter_abstractformatter_ce; zend_class_entry *phalcon_mvc_model_behavior_ce; @@ -223417,6 +218937,7 @@ zend_class_entry *phalcon_mvc_model_resultset_ce; zend_class_entry *phalcon_mvc_view_engine_abstractengine_ce; zend_class_entry *phalcon_session_adapter_abstractadapter_ce; zend_class_entry *phalcon_acl_adapter_abstractadapter_ce; +zend_class_entry *phalcon_cache_abstractcache_ce; zend_class_entry *phalcon_di_exception_ce; zend_class_entry *phalcon_di_factorydefault_ce; zend_class_entry *phalcon_encryption_crypt_exception_exception_ce; @@ -223427,6 +218948,7 @@ zend_class_entry *phalcon_html_helper_ol_ce; zend_class_entry *phalcon_html_helper_style_ce; zend_class_entry *phalcon_html_link_link_ce; zend_class_entry *phalcon_html_link_linkprovider_ce; +zend_class_entry *phalcon_logger_abstractlogger_ce; zend_class_entry *phalcon_mvc_model_transaction_exception_ce; zend_class_entry *phalcon_mvc_router_ce; zend_class_entry *phalcon_mvc_view_exception_ce; @@ -223436,16 +218958,13 @@ zend_class_entry *phalcon_storage_adapter_libmemcached_ce; zend_class_entry *phalcon_storage_adapter_memory_ce; zend_class_entry *phalcon_storage_adapter_redis_ce; zend_class_entry *phalcon_storage_adapter_stream_ce; +zend_class_entry *phalcon_storage_serializer_igbinary_ce; zend_class_entry *phalcon_0__closure_ce; zend_class_entry *phalcon_10__closure_ce; zend_class_entry *phalcon_11__closure_ce; zend_class_entry *phalcon_12__closure_ce; zend_class_entry *phalcon_13__closure_ce; zend_class_entry *phalcon_14__closure_ce; -zend_class_entry *phalcon_15__closure_ce; -zend_class_entry *phalcon_16__closure_ce; -zend_class_entry *phalcon_17__closure_ce; -zend_class_entry *phalcon_18__closure_ce; zend_class_entry *phalcon_1__closure_ce; zend_class_entry *phalcon_2__closure_ce; zend_class_entry *phalcon_3__closure_ce; @@ -223506,7 +219025,6 @@ zend_class_entry *phalcon_config_adapter_php_ce; zend_class_entry *phalcon_config_adapter_yaml_ce; zend_class_entry *phalcon_config_configfactory_ce; zend_class_entry *phalcon_config_exception_ce; -zend_class_entry *phalcon_container_container_ce; zend_class_entry *phalcon_datamapper_pdo_connection_ce; zend_class_entry *phalcon_datamapper_pdo_connection_decorated_ce; zend_class_entry *phalcon_datamapper_pdo_connectionlocator_ce; @@ -223697,21 +219215,6 @@ zend_class_entry *phalcon_html_link_serializer_header_ce; zend_class_entry *phalcon_html_tagfactory_ce; zend_class_entry *phalcon_http_cookie_ce; zend_class_entry *phalcon_http_cookie_exception_ce; -zend_class_entry *phalcon_http_message_exception_invalidargumentexception_ce; -zend_class_entry *phalcon_http_message_request_ce; -zend_class_entry *phalcon_http_message_requestfactory_ce; -zend_class_entry *phalcon_http_message_response_ce; -zend_class_entry *phalcon_http_message_responsefactory_ce; -zend_class_entry *phalcon_http_message_serverrequest_ce; -zend_class_entry *phalcon_http_message_serverrequestfactory_ce; -zend_class_entry *phalcon_http_message_stream_input_ce; -zend_class_entry *phalcon_http_message_stream_memory_ce; -zend_class_entry *phalcon_http_message_stream_temp_ce; -zend_class_entry *phalcon_http_message_streamfactory_ce; -zend_class_entry *phalcon_http_message_uploadedfile_ce; -zend_class_entry *phalcon_http_message_uploadedfilefactory_ce; -zend_class_entry *phalcon_http_message_uri_ce; -zend_class_entry *phalcon_http_message_urifactory_ce; zend_class_entry *phalcon_http_request_ce; zend_class_entry *phalcon_http_request_exception_ce; zend_class_entry *phalcon_http_request_file_ce; @@ -223719,8 +219222,6 @@ zend_class_entry *phalcon_http_response_ce; zend_class_entry *phalcon_http_response_cookies_ce; zend_class_entry *phalcon_http_response_exception_ce; zend_class_entry *phalcon_http_response_headers_ce; -zend_class_entry *phalcon_http_server_abstractmiddleware_ce; -zend_class_entry *phalcon_http_server_abstractrequesthandler_ce; zend_class_entry *phalcon_image_adapter_gd_ce; zend_class_entry *phalcon_image_adapter_imagick_ce; zend_class_entry *phalcon_image_enum_ce; @@ -223730,6 +219231,7 @@ zend_class_entry *phalcon_logger_adapter_noop_ce; zend_class_entry *phalcon_logger_adapter_stream_ce; zend_class_entry *phalcon_logger_adapter_syslog_ce; zend_class_entry *phalcon_logger_adapterfactory_ce; +zend_class_entry *phalcon_logger_enum_ce; zend_class_entry *phalcon_logger_exception_ce; zend_class_entry *phalcon_logger_formatter_json_ce; zend_class_entry *phalcon_logger_formatter_line_ce; @@ -223800,11 +219302,17 @@ zend_class_entry *phalcon_session_manager_ce; zend_class_entry *phalcon_storage_adapterfactory_ce; zend_class_entry *phalcon_storage_exception_ce; zend_class_entry *phalcon_storage_serializer_base64_ce; -zend_class_entry *phalcon_storage_serializer_igbinary_ce; zend_class_entry *phalcon_storage_serializer_json_ce; +zend_class_entry *phalcon_storage_serializer_memcachedigbinary_ce; +zend_class_entry *phalcon_storage_serializer_memcachedjson_ce; +zend_class_entry *phalcon_storage_serializer_memcachedphp_ce; zend_class_entry *phalcon_storage_serializer_msgpack_ce; -zend_class_entry *phalcon_storage_serializer_none_ce; zend_class_entry *phalcon_storage_serializer_php_ce; +zend_class_entry *phalcon_storage_serializer_redisigbinary_ce; +zend_class_entry *phalcon_storage_serializer_redisjson_ce; +zend_class_entry *phalcon_storage_serializer_redismsgpack_ce; +zend_class_entry *phalcon_storage_serializer_redisnone_ce; +zend_class_entry *phalcon_storage_serializer_redisphp_ce; zend_class_entry *phalcon_storage_serializerfactory_ce; zend_class_entry *phalcon_support_collection_exception_ce; zend_class_entry *phalcon_support_collection_readonlycollection_ce; @@ -223923,19 +219431,20 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Events_EventsAwareInterface); ZEPHIR_INIT(Phalcon_Support_Collection_CollectionInterface); ZEPHIR_INIT(Phalcon_Storage_Adapter_AdapterInterface); + ZEPHIR_INIT(Phalcon_Storage_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Forms_Element_ElementInterface); ZEPHIR_INIT(Phalcon_Dispatcher_DispatcherInterface); ZEPHIR_INIT(Phalcon_Encryption_Crypt_Padding_PadInterface); - ZEPHIR_INIT(Phalcon_Storage_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Assets_AssetInterface); ZEPHIR_INIT(Phalcon_Config_ConfigInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaDataInterface); ZEPHIR_INIT(Phalcon_Cache_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_Db_Adapter_AdapterInterface); - ZEPHIR_INIT(Phalcon_Http_Message_RequestMethodInterface); ZEPHIR_INIT(Phalcon_Annotations_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection_PdoInterface); ZEPHIR_INIT(Phalcon_Db_DialectInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_LinkInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_LinkProviderInterface); ZEPHIR_INIT(Phalcon_Logger_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_ResultsetInterface); ZEPHIR_INIT(Phalcon_Paginator_Adapter_AdapterInterface); @@ -223952,9 +219461,10 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_ViewBaseInterface); ZEPHIR_INIT(Phalcon_Mvc_View_Engine_EngineInterface); ZEPHIR_INIT(Phalcon_Acl_Adapter_AdapterInterface); + ZEPHIR_INIT(Phalcon_Cache_CacheInterface); ZEPHIR_INIT(Phalcon_Domain_Payload_ReadableInterface); ZEPHIR_INIT(Phalcon_Domain_Payload_WriteableInterface); - ZEPHIR_INIT(Phalcon_Http_Message_ResponseStatusCodeInterface); + ZEPHIR_INIT(Phalcon_Logger_LoggerInterface); ZEPHIR_INIT(Phalcon_Mvc_EntityInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_ResultInterface); @@ -223982,8 +219492,12 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_Attributes_AttributesInterface); ZEPHIR_INIT(Phalcon_Html_Attributes_RenderInterface); ZEPHIR_INIT(Phalcon_Html_Escaper_EscaperInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface); ZEPHIR_INIT(Phalcon_Html_Link_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Http_Cookie_CookieInterface); + ZEPHIR_INIT(Phalcon_Http_Message_RequestMethodInterface); + ZEPHIR_INIT(Phalcon_Http_Message_ResponseStatusCodeInterface); ZEPHIR_INIT(Phalcon_Http_RequestInterface); ZEPHIR_INIT(Phalcon_Http_Request_FileInterface); ZEPHIR_INIT(Phalcon_Http_ResponseInterface); @@ -224008,10 +219522,12 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_Url_UrlInterface); ZEPHIR_INIT(Phalcon_Mvc_ViewInterface); ZEPHIR_INIT(Phalcon_Paginator_RepositoryInterface); + ZEPHIR_INIT(Phalcon_Session_BagInterface); ZEPHIR_INIT(Phalcon_Session_ManagerInterface); ZEPHIR_INIT(Phalcon_Acl_ComponentAwareInterface); ZEPHIR_INIT(Phalcon_Acl_RoleAwareInterface); ZEPHIR_INIT(Phalcon_Cli_RouterInterface); + ZEPHIR_INIT(Phalcon_Di_InitializationAwareInterface); ZEPHIR_INIT(Phalcon_Di_ServiceProviderInterface); ZEPHIR_INIT(Phalcon_Mvc_Controller_BindModelInterface); ZEPHIR_INIT(Phalcon_Mvc_Micro_MiddlewareInterface); @@ -224023,28 +219539,26 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Factory_AbstractConfigFactory); ZEPHIR_INIT(Phalcon_Di_AbstractInjectionAware); ZEPHIR_INIT(Phalcon_Factory_AbstractFactory); + ZEPHIR_INIT(Phalcon_Storage_Serializer_AbstractSerializer); ZEPHIR_INIT(Phalcon_Di_Injectable); ZEPHIR_INIT(Phalcon_Forms_Element_AbstractElement); ZEPHIR_INIT(Phalcon_Support_Helper_Str_AbstractStr); ZEPHIR_INIT(Phalcon_Storage_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Support_Collection); ZEPHIR_INIT(Phalcon_Support_Helper_Arr_AbstractArr); + ZEPHIR_INIT(Phalcon_Storage_Serializer_None); ZEPHIR_INIT(Phalcon_Filter_Validation_Validator_File_AbstractFile); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractCommon); - ZEPHIR_INIT(Phalcon_Storage_Serializer_AbstractSerializer); ZEPHIR_INIT(Phalcon_Config_Config); ZEPHIR_INIT(Phalcon_DataMapper_Query_AbstractQuery); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaData); ZEPHIR_INIT(Phalcon_Db_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Html_Helper_AbstractSeries); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractMessage); ZEPHIR_INIT(Phalcon_Annotations_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_DataMapper_Query_AbstractConditions); ZEPHIR_INIT(Phalcon_Db_Adapter_Pdo_AbstractPdo); ZEPHIR_INIT(Phalcon_Db_Dialect); ZEPHIR_INIT(Phalcon_Events_AbstractEventsAware); ZEPHIR_INIT(Phalcon_Html_Helper_AbstractList); - ZEPHIR_INIT(Phalcon_Http_Message_Stream); ZEPHIR_INIT(Phalcon_Logger_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Mvc_Model_Exception); ZEPHIR_INIT(Phalcon_Paginator_Adapter_AbstractAdapter); @@ -224062,7 +219576,8 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Encryption_Security_JWT_Token_AbstractItem); ZEPHIR_INIT(Phalcon_Filter_Validation_AbstractValidatorComposite); ZEPHIR_INIT(Phalcon_Flash_AbstractFlash); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractRequest); + ZEPHIR_INIT(Phalcon_Html_Link_AbstractLink); + ZEPHIR_INIT(Phalcon_Html_Link_AbstractLinkProvider); ZEPHIR_INIT(Phalcon_Image_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Logger_Formatter_AbstractFormatter); ZEPHIR_INIT(Phalcon_Mvc_Model_Behavior); @@ -224070,6 +219585,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_View_Engine_AbstractEngine); ZEPHIR_INIT(Phalcon_Session_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Acl_Adapter_AbstractAdapter); + ZEPHIR_INIT(Phalcon_Cache_AbstractCache); ZEPHIR_INIT(Phalcon_Di_Exception); ZEPHIR_INIT(Phalcon_Di_FactoryDefault); ZEPHIR_INIT(Phalcon_Encryption_Crypt_Exception_Exception); @@ -224080,6 +219596,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_Helper_Style); ZEPHIR_INIT(Phalcon_Html_Link_Link); ZEPHIR_INIT(Phalcon_Html_Link_LinkProvider); + ZEPHIR_INIT(Phalcon_Logger_AbstractLogger); ZEPHIR_INIT(Phalcon_Mvc_Model_Transaction_Exception); ZEPHIR_INIT(Phalcon_Mvc_Router); ZEPHIR_INIT(Phalcon_Mvc_View_Exception); @@ -224089,6 +219606,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Storage_Adapter_Memory); ZEPHIR_INIT(Phalcon_Storage_Adapter_Redis); ZEPHIR_INIT(Phalcon_Storage_Adapter_Stream); + ZEPHIR_INIT(Phalcon_Storage_Serializer_Igbinary); ZEPHIR_INIT(Phalcon_Acl_Adapter_Memory); ZEPHIR_INIT(Phalcon_Acl_Component); ZEPHIR_INIT(Phalcon_Acl_Enum); @@ -224140,7 +219658,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Config_Adapter_Yaml); ZEPHIR_INIT(Phalcon_Config_ConfigFactory); ZEPHIR_INIT(Phalcon_Config_Exception); - ZEPHIR_INIT(Phalcon_Container_Container); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_ConnectionLocator); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection_Decorated); @@ -224331,21 +219848,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_TagFactory); ZEPHIR_INIT(Phalcon_Http_Cookie); ZEPHIR_INIT(Phalcon_Http_Cookie_Exception); - ZEPHIR_INIT(Phalcon_Http_Message_Exception_InvalidArgumentException); - ZEPHIR_INIT(Phalcon_Http_Message_Request); - ZEPHIR_INIT(Phalcon_Http_Message_RequestFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Response); - ZEPHIR_INIT(Phalcon_Http_Message_ResponseFactory); - ZEPHIR_INIT(Phalcon_Http_Message_ServerRequest); - ZEPHIR_INIT(Phalcon_Http_Message_ServerRequestFactory); - ZEPHIR_INIT(Phalcon_Http_Message_StreamFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Input); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Memory); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Temp); - ZEPHIR_INIT(Phalcon_Http_Message_UploadedFile); - ZEPHIR_INIT(Phalcon_Http_Message_UploadedFileFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Uri); - ZEPHIR_INIT(Phalcon_Http_Message_UriFactory); ZEPHIR_INIT(Phalcon_Http_Request); ZEPHIR_INIT(Phalcon_Http_Request_Exception); ZEPHIR_INIT(Phalcon_Http_Request_File); @@ -224353,8 +219855,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Http_Response_Cookies); ZEPHIR_INIT(Phalcon_Http_Response_Exception); ZEPHIR_INIT(Phalcon_Http_Response_Headers); - ZEPHIR_INIT(Phalcon_Http_Server_AbstractMiddleware); - ZEPHIR_INIT(Phalcon_Http_Server_AbstractRequestHandler); ZEPHIR_INIT(Phalcon_Image_Adapter_Gd); ZEPHIR_INIT(Phalcon_Image_Adapter_Imagick); ZEPHIR_INIT(Phalcon_Image_Enum); @@ -224364,6 +219864,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Logger_Adapter_Noop); ZEPHIR_INIT(Phalcon_Logger_Adapter_Stream); ZEPHIR_INIT(Phalcon_Logger_Adapter_Syslog); + ZEPHIR_INIT(Phalcon_Logger_Enum); ZEPHIR_INIT(Phalcon_Logger_Exception); ZEPHIR_INIT(Phalcon_Logger_Formatter_Json); ZEPHIR_INIT(Phalcon_Logger_Formatter_Line); @@ -224435,11 +219936,17 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Storage_Exception); ZEPHIR_INIT(Phalcon_Storage_SerializerFactory); ZEPHIR_INIT(Phalcon_Storage_Serializer_Base64); - ZEPHIR_INIT(Phalcon_Storage_Serializer_Igbinary); ZEPHIR_INIT(Phalcon_Storage_Serializer_Json); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedIgbinary); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedJson); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedPhp); ZEPHIR_INIT(Phalcon_Storage_Serializer_Msgpack); - ZEPHIR_INIT(Phalcon_Storage_Serializer_None); ZEPHIR_INIT(Phalcon_Storage_Serializer_Php); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisIgbinary); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisJson); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisMsgpack); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisNone); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisPhp); ZEPHIR_INIT(Phalcon_Support_Collection_Exception); ZEPHIR_INIT(Phalcon_Support_Collection_ReadOnlyCollection); ZEPHIR_INIT(Phalcon_Support_Debug); @@ -224525,10 +220032,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(phalcon_12__closure); ZEPHIR_INIT(phalcon_13__closure); ZEPHIR_INIT(phalcon_14__closure); - ZEPHIR_INIT(phalcon_15__closure); - ZEPHIR_INIT(phalcon_16__closure); - ZEPHIR_INIT(phalcon_17__closure); - ZEPHIR_INIT(phalcon_18__closure); ZEPHIR_INIT(phalcon_1__closure); ZEPHIR_INIT(phalcon_2__closure); ZEPHIR_INIT(phalcon_3__closure); @@ -224661,7 +220164,6 @@ static const zend_module_dep php_phalcon_deps[] = { ZEND_MOD_REQUIRED("standard") ZEND_MOD_REQUIRED("hash") ZEND_MOD_REQUIRED("json") - ZEND_MOD_REQUIRED("psr") ZEND_MOD_END }; diff --git a/build/phalcon/phalcon.zep.h b/build/phalcon/phalcon.zep.h index 0814c7d9ca9..5ffc4fde264 100644 --- a/build/phalcon/phalcon.zep.h +++ b/build/phalcon/phalcon.zep.h @@ -223,7 +223,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstra ZEND_ARG_INFO(0, field) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstractvalidator_preparecode, 0, 1, IS_LONG, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstractvalidator_preparecode, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -572,6 +572,78 @@ ZEPHIR_INIT_FUNCS(phalcon_factory_abstractfactory_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_serializerinterface_getdata, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_serializerinterface_setdata, 0, 1, IS_VOID, 0) + + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_serializerinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Storage_Serializer_SerializerInterface, getData, arginfo_phalcon_storage_serializer_serializerinterface_getdata) + PHP_ABSTRACT_ME(Phalcon_Storage_Serializer_SerializerInterface, setData, arginfo_phalcon_storage_serializer_serializerinterface_setdata) + PHP_FE_END +}; + +zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer); + +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __serialize); +static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___construct, 0, 0, 0) + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_getdata, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_issuccess, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_setdata, 0, 1, IS_VOID, 0) + + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_isserializable, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_abstractserializer_method_entry) { + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __construct, arginfo_phalcon_storage_serializer_abstractserializer___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) +#if PHP_VERSION_ID >= 80000 + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, arginfo_phalcon_storage_serializer_abstractserializer_getdata, ZEND_ACC_PUBLIC) +#else + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, NULL, ZEND_ACC_PUBLIC) +#endif + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess, arginfo_phalcon_storage_serializer_abstractserializer_issuccess, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, setData, arginfo_phalcon_storage_serializer_abstractserializer_setdata, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable, arginfo_phalcon_storage_serializer_abstractserializer_isserializable, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __serialize, arginfo_phalcon_storage_serializer_abstractserializer___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize, arginfo_phalcon_storage_serializer_abstractserializer___unserialize, ZEND_ACC_PUBLIC) + PHP_FE_END +}; + zend_class_entry *phalcon_di_injectable_ce; ZEPHIR_INIT_CLASS(Phalcon_Di_Injectable); @@ -1066,6 +1138,7 @@ static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, has); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, increment); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, set); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer); +static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, doGet); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey); static PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData); @@ -1134,6 +1207,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_abstract ZEND_ARG_TYPE_INFO(0, serializer, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_abstractadapter_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_abstractadapter_getfilteredkeys, 0, 2, IS_ARRAY, 0) ZEND_ARG_INFO(0, keys) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) @@ -1175,7 +1252,7 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, clear, arginfo_phalcon_storage_adapter_abstractadapter_clear, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, decrement, arginfo_phalcon_storage_adapter_abstractadapter_decrement, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, delete, arginfo_phalcon_storage_adapter_abstractadapter_delete, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, get, arginfo_phalcon_storage_adapter_abstractadapter_get, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, get, arginfo_phalcon_storage_adapter_abstractadapter_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter, arginfo_phalcon_storage_adapter_abstractadapter_getadapter, ZEND_ACC_PUBLIC) #else @@ -1187,6 +1264,7 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, increment, arginfo_phalcon_storage_adapter_abstractadapter_increment, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, set, arginfo_phalcon_storage_adapter_abstractadapter_set, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer, arginfo_phalcon_storage_adapter_abstractadapter_setdefaultserializer, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, doGet, arginfo_phalcon_storage_adapter_abstractadapter_doget, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys, arginfo_phalcon_storage_adapter_abstractadapter_getfilteredkeys, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey, arginfo_phalcon_storage_adapter_abstractadapter_getprefixedkey, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData, arginfo_phalcon_storage_adapter_abstractadapter_getserializeddata, ZEND_ACC_PROTECTED) @@ -1225,6 +1303,8 @@ static PHP_METHOD(Phalcon_Support_Collection, serialize); static PHP_METHOD(Phalcon_Support_Collection, toArray); static PHP_METHOD(Phalcon_Support_Collection, toJson); static PHP_METHOD(Phalcon_Support_Collection, unserialize); +static PHP_METHOD(Phalcon_Support_Collection, __serialize); +static PHP_METHOD(Phalcon_Support_Collection, __unserialize); static PHP_METHOD(Phalcon_Support_Collection, setData); static PHP_METHOD(Phalcon_Support_Collection, phpJsonEncode); static PHP_METHOD(Phalcon_Support_Collection, processKey); @@ -1300,7 +1380,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offse ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() @@ -1336,9 +1420,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_tojso ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif - ZEND_ARG_INFO(0, serialized) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_setdata, 0, 2, IS_VOID, 0) @@ -1385,6 +1482,8 @@ ZEPHIR_INIT_FUNCS(phalcon_support_collection_method_entry) { PHP_ME(Phalcon_Support_Collection, toArray, arginfo_phalcon_support_collection_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, toJson, arginfo_phalcon_support_collection_tojson, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, unserialize, arginfo_phalcon_support_collection_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Support_Collection, __serialize, arginfo_phalcon_support_collection___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Support_Collection, __unserialize, arginfo_phalcon_support_collection___unserialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, setData, arginfo_phalcon_support_collection_setdata, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Support_Collection, phpJsonEncode, arginfo_phalcon_support_collection_phpjsonencode, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Support_Collection, processKey, arginfo_phalcon_support_collection_processkey, ZEND_ACC_PROTECTED) @@ -1407,6 +1506,36 @@ ZEPHIR_INIT_FUNCS(phalcon_support_helper_arr_abstractarr_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_storage_serializer_none_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None); + +static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize); +static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize); + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif + +ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_none_method_entry) { + PHP_ME(Phalcon_Storage_Serializer_None, serialize, arginfo_phalcon_storage_serializer_none_serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_None, unserialize, arginfo_phalcon_storage_serializer_none_unserialize, ZEND_ACC_PUBLIC) + PHP_FE_END +}; + zend_class_entry *phalcon_dispatcher_dispatcherinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Dispatcher_DispatcherInterface); @@ -1623,24 +1752,6 @@ ZEPHIR_INIT_FUNCS(phalcon_filter_validation_validator_file_abstractfile_method_e PHP_FE_END }; -zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_serializerinterface_getdata, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_serializerinterface_setdata, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_serializerinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Storage_Serializer_SerializerInterface, getData, arginfo_phalcon_storage_serializer_serializerinterface_getdata) - PHP_ABSTRACT_ME(Phalcon_Storage_Serializer_SerializerInterface, setData, arginfo_phalcon_storage_serializer_serializerinterface_setdata) - PHP_FE_END -}; - zend_class_entry *phalcon_assets_assetinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Assets_AssetInterface); @@ -1709,36 +1820,6 @@ ZEPHIR_INIT_FUNCS(phalcon_config_configinterface_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_message_abstractcommon_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractCommon); - -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, cloneInstance); -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, checkStringParameter); -static PHP_METHOD(Phalcon_Http_Message_AbstractCommon, processWith); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractcommon_cloneinstance, 0, 0, 2) - ZEND_ARG_INFO(0, element) - ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractcommon_checkstringparameter, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractcommon_processwith, 0, 0, 2) - ZEND_ARG_INFO(0, element) - ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractcommon_method_entry) { - PHP_ME(Phalcon_Http_Message_AbstractCommon, cloneInstance, arginfo_phalcon_http_message_abstractcommon_cloneinstance, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractCommon, checkStringParameter, arginfo_phalcon_http_message_abstractcommon_checkstringparameter, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractCommon, processWith, arginfo_phalcon_http_message_abstractcommon_processwith, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; - zend_class_entry *phalcon_mvc_model_metadatainterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaDataInterface); @@ -1900,43 +1981,6 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_metadatainterface_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer); - -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct); -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable); -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData); -static PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___construct, 0, 0, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_isserializable, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_getdata, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_setdata, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_abstractserializer_method_entry) { - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __construct, arginfo_phalcon_storage_serializer_abstractserializer___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable, arginfo_phalcon_storage_serializer_abstractserializer_isserializable, ZEND_ACC_PROTECTED) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, arginfo_phalcon_storage_serializer_abstractserializer_getdata, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, setData, arginfo_phalcon_storage_serializer_abstractserializer_setdata, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - zend_class_entry *phalcon_cache_adapter_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cache_Adapter_AdapterInterface); @@ -2533,11 +2577,6 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_adapterinterface_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_message_requestmethodinterface_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface); - - zend_class_entry *phalcon_mvc_model_metadata_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData); @@ -2781,12 +2820,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapt ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getconstant, 0, 2, Phalcon\\Annotations\\Collection, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, constantName, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethods, 0, 1, IS_ARRAY, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getconstants, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -2799,6 +2838,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adap ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethods, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() @@ -2808,10 +2856,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapter_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, get, arginfo_phalcon_annotations_adapter_adapterinterface_get) - PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethod, arginfo_phalcon_annotations_adapter_adapterinterface_getmethod) - PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethods, arginfo_phalcon_annotations_adapter_adapterinterface_getmethods) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getConstant, arginfo_phalcon_annotations_adapter_adapterinterface_getconstant) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getConstants, arginfo_phalcon_annotations_adapter_adapterinterface_getconstants) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getProperty, arginfo_phalcon_annotations_adapter_adapterinterface_getproperty) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getProperties, arginfo_phalcon_annotations_adapter_adapterinterface_getproperties) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethod, arginfo_phalcon_annotations_adapter_adapterinterface_getmethod) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethods, arginfo_phalcon_annotations_adapter_adapterinterface_getmethods) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getReader, arginfo_phalcon_annotations_adapter_adapterinterface_getreader) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, setReader, arginfo_phalcon_annotations_adapter_adapterinterface_setreader) PHP_FE_END @@ -3575,147 +3625,44 @@ ZEPHIR_INIT_FUNCS(phalcon_html_helper_abstractseries_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_message_abstractmessage_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractMessage); - -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getBody); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getProtocolVersion); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUri); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeader); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderLine); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaders); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, hasHeader); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withAddedHeader); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withBody); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withHeader); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withProtocolVersion); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withoutHeader); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderHost); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderName); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderValue); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderValue); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUriHost); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processBody); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processHeaders); -static PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processProtocol); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getbody, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getprotocolversion, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_geturi, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheaderline, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheaders, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_hasheader, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withaddedheader, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withbody, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, body, Psr\\Http\\Message\\StreamInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withheader, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withprotocolversion, 0, 0, 1) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO() +zend_class_entry *phalcon_html_link_interfaces_linkinterface_ce; -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withoutheader, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkInterface); -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheaderhost, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Support\\Collection\\CollectionInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_getattributes, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheadername, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, name) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_gethref, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheadervalue, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, value) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_getrels, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheadervalue, 0, 1, IS_ARRAY, 0) - ZEND_ARG_INFO(0, values) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_istemplated, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_geturihost, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0) -ZEND_END_ARG_INFO() +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_linkinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getAttributes, arginfo_phalcon_html_link_interfaces_linkinterface_getattributes) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getHref, arginfo_phalcon_html_link_interfaces_linkinterface_gethref) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getRels, arginfo_phalcon_html_link_interfaces_linkinterface_getrels) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, isTemplated, arginfo_phalcon_html_link_interfaces_linkinterface_istemplated) + PHP_FE_END +}; -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_populateheadercollection, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, headers, 0) -ZEND_END_ARG_INFO() +zend_class_entry *phalcon_html_link_interfaces_linkproviderinterface_ce; -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processbody, 0, 0, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_INFO(0, body) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkProviderInterface); -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processheaders, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_INFO(0, headers) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinks, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processprotocol, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, protocol) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinksbyrel, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractmessage_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractMessage, getBody, arginfo_phalcon_http_message_abstractmessage_getbody, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_AbstractMessage, getBody, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_AbstractMessage, getProtocolVersion, arginfo_phalcon_http_message_abstractmessage_getprotocolversion, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUri, arginfo_phalcon_http_message_abstractmessage_geturi, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUri, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeader, arginfo_phalcon_http_message_abstractmessage_getheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaderLine, arginfo_phalcon_http_message_abstractmessage_getheaderline, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaders, arginfo_phalcon_http_message_abstractmessage_getheaders, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, hasHeader, arginfo_phalcon_http_message_abstractmessage_hasheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withAddedHeader, arginfo_phalcon_http_message_abstractmessage_withaddedheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withBody, arginfo_phalcon_http_message_abstractmessage_withbody, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withHeader, arginfo_phalcon_http_message_abstractmessage_withheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withProtocolVersion, arginfo_phalcon_http_message_abstractmessage_withprotocolversion, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withoutHeader, arginfo_phalcon_http_message_abstractmessage_withoutheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderHost, arginfo_phalcon_http_message_abstractmessage_checkheaderhost, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderName, arginfo_phalcon_http_message_abstractmessage_checkheadername, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderValue, arginfo_phalcon_http_message_abstractmessage_checkheadervalue, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaderValue, arginfo_phalcon_http_message_abstractmessage_getheadervalue, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUriHost, arginfo_phalcon_http_message_abstractmessage_geturihost, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection, arginfo_phalcon_http_message_abstractmessage_populateheadercollection, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processBody, arginfo_phalcon_http_message_abstractmessage_processbody, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processHeaders, arginfo_phalcon_http_message_abstractmessage_processheaders, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processProtocol, arginfo_phalcon_http_message_abstractmessage_processprotocol, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_linkproviderinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinks, arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinks) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinksByRel, arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinksbyrel) PHP_FE_END }; @@ -3779,7 +3726,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinter ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getcache, 0, 0, Psr\\SimpleCache\\CacheInterface, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getcache, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getfirst, 0, 0, 0) @@ -3897,10 +3844,12 @@ zend_class_entry *phalcon_annotations_adapter_abstractadapter_ce; ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AbstractAdapter); static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get); -static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod); -static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods); +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant); +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants); static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty); static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties); +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod); +static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods); static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getReader); static PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, setReader); zend_object *zephir_init_properties_Phalcon_Annotations_Adapter_AbstractAdapter(zend_class_entry *class_type); @@ -3909,12 +3858,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstr ZEND_ARG_INFO(0, className) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getconstant, 0, 2, Phalcon\\Annotations\\Collection, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, constantName, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, 0, 1, IS_ARRAY, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getconstants, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -3927,6 +3876,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abst ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() @@ -3939,10 +3897,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, get, arginfo_phalcon_annotations_adapter_abstractadapter_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod, arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods, arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant, arginfo_phalcon_annotations_adapter_abstractadapter_getconstant, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants, arginfo_phalcon_annotations_adapter_abstractadapter_getconstants, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty, arginfo_phalcon_annotations_adapter_abstractadapter_getproperty, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties, arginfo_phalcon_annotations_adapter_abstractadapter_getproperties, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod, arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods, arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getReader, arginfo_phalcon_annotations_adapter_abstractadapter_getreader, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, setReader, arginfo_phalcon_annotations_adapter_abstractadapter_setreader, ZEND_ACC_PUBLIC) PHP_FE_END @@ -5021,152 +4981,6 @@ ZEPHIR_INIT_FUNCS(phalcon_html_helper_abstractlist_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_message_stream_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream); - -static PHP_METHOD(Phalcon_Http_Message_Stream, __construct); -static PHP_METHOD(Phalcon_Http_Message_Stream, __destruct); -static PHP_METHOD(Phalcon_Http_Message_Stream, __toString); -static PHP_METHOD(Phalcon_Http_Message_Stream, close); -static PHP_METHOD(Phalcon_Http_Message_Stream, detach); -static PHP_METHOD(Phalcon_Http_Message_Stream, eof); -static PHP_METHOD(Phalcon_Http_Message_Stream, getContents); -static PHP_METHOD(Phalcon_Http_Message_Stream, getMetadata); -static PHP_METHOD(Phalcon_Http_Message_Stream, getSize); -static PHP_METHOD(Phalcon_Http_Message_Stream, isReadable); -static PHP_METHOD(Phalcon_Http_Message_Stream, isSeekable); -static PHP_METHOD(Phalcon_Http_Message_Stream, isWritable); -static PHP_METHOD(Phalcon_Http_Message_Stream, read); -static PHP_METHOD(Phalcon_Http_Message_Stream, rewind); -static PHP_METHOD(Phalcon_Http_Message_Stream, seek); -static PHP_METHOD(Phalcon_Http_Message_Stream, setStream); -static PHP_METHOD(Phalcon_Http_Message_Stream, tell); -static PHP_METHOD(Phalcon_Http_Message_Stream, write); -static PHP_METHOD(Phalcon_Http_Message_Stream, checkHandle); -static PHP_METHOD(Phalcon_Http_Message_Stream, checkReadable); -static PHP_METHOD(Phalcon_Http_Message_Stream, checkSeekable); -static PHP_METHOD(Phalcon_Http_Message_Stream, checkWritable); -static PHP_METHOD(Phalcon_Http_Message_Stream, getArrVal); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream___construct, 0, 0, 1) - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream___destruct, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_close, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_detach, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_eof, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_getcontents, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_getmetadata, 0, 0, 0) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_getsize, 0, 0, IS_LONG, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_isreadable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_isseekable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_iswritable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_rewind, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_seek, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, whence) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_setstream, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_tell, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_write, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkhandle, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkreadable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkseekable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkwritable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_getarrval, 0, 0, 2) - ZEND_ARG_ARRAY_INFO(0, collection, 0) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream, __construct, arginfo_phalcon_http_message_stream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream, __destruct, arginfo_phalcon_http_message_stream___destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) -#else - PHP_ME(Phalcon_Http_Message_Stream, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) -#endif - PHP_ME(Phalcon_Http_Message_Stream, __toString, arginfo_phalcon_http_message_stream___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, close, arginfo_phalcon_http_message_stream_close, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream, detach, arginfo_phalcon_http_message_stream_detach, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_Stream, detach, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_Stream, eof, arginfo_phalcon_http_message_stream_eof, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getContents, arginfo_phalcon_http_message_stream_getcontents, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getMetadata, arginfo_phalcon_http_message_stream_getmetadata, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getSize, arginfo_phalcon_http_message_stream_getsize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isReadable, arginfo_phalcon_http_message_stream_isreadable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isSeekable, arginfo_phalcon_http_message_stream_isseekable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isWritable, arginfo_phalcon_http_message_stream_iswritable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, read, arginfo_phalcon_http_message_stream_read, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, rewind, arginfo_phalcon_http_message_stream_rewind, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, seek, arginfo_phalcon_http_message_stream_seek, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, setStream, arginfo_phalcon_http_message_stream_setstream, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, tell, arginfo_phalcon_http_message_stream_tell, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, write, arginfo_phalcon_http_message_stream_write, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, checkHandle, arginfo_phalcon_http_message_stream_checkhandle, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkReadable, arginfo_phalcon_http_message_stream_checkreadable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkSeekable, arginfo_phalcon_http_message_stream_checkseekable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkWritable, arginfo_phalcon_http_message_stream_checkwritable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, getArrVal, arginfo_phalcon_http_message_stream_getarrval, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - zend_class_entry *phalcon_image_adapter_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AdapterInterface); @@ -5362,7 +5176,7 @@ zend_class_entry *phalcon_logger_formatter_formatterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_FormatterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_formatterinterface_format, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_formatterinterface_format, 0, 1, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, item, Phalcon\\Logger\\Item, 0) ZEND_END_ARG_INFO() @@ -5581,7 +5395,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstra ZEND_ARG_INFO(0, translateKey) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, translateKey) ZEND_END_ARG_INFO() @@ -6068,6 +5886,58 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_inline_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_cache_cacheinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_clear, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_delete, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_deletemultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cacheinterface_get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cacheinterface_getmultiple, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_has, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_set, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_setmultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, values) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_cache_cacheinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, clear, arginfo_phalcon_cache_cacheinterface_clear) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, delete, arginfo_phalcon_cache_cacheinterface_delete) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, deleteMultiple, arginfo_phalcon_cache_cacheinterface_deletemultiple) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, get, arginfo_phalcon_cache_cacheinterface_get) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, getMultiple, arginfo_phalcon_cache_cacheinterface_getmultiple) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, has, arginfo_phalcon_cache_cacheinterface_has) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, set, arginfo_phalcon_cache_cacheinterface_set) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, setMultiple, arginfo_phalcon_cache_cacheinterface_setmultiple) + PHP_FE_END +}; + zend_class_entry *phalcon_datamapper_pdo_connection_abstractconnection_ce; ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Connection_AbstractConnection); @@ -6473,7 +6343,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_has, 0, 1, _IS_BOO ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() @@ -7065,69 +6939,135 @@ ZEPHIR_INIT_FUNCS(phalcon_flash_abstractflash_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_message_abstractrequest_ce; +zend_class_entry *phalcon_html_link_abstractlink_ce; -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractRequest); +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLink); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getMethod); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getUri); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getRequestTarget); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withMethod); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withRequestTarget); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withUri); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processMethod); -static PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processUri); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, __construct); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetAttributes); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetHref); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetRels); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doIsTemplated); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, hrefIsTemplated); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithAttribute); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithHref); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithRel); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutAttribute); +static PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutRel); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_getmethod, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, attributes, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_geturi, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogetattributes, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_getrequesttarget, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogethref, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withmethod, 0, 0, 1) - ZEND_ARG_INFO(0, method) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogetrels, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_doistemplated, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withrequesttarget, 0, 0, 1) - ZEND_ARG_INFO(0, requestTarget) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_hrefistemplated, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withuri, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_INFO(0, preserveHost) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithattribute, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_processmethod, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, method) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithhref, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractrequest_processuri, 0, 1, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_INFO(0, uri) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithrel, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractrequest_method_entry) { - PHP_ME(Phalcon_Http_Message_AbstractRequest, getMethod, arginfo_phalcon_http_message_abstractrequest_getmethod, ZEND_ACC_PUBLIC) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithoutattribute, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithoutrel, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_abstractlink_method_entry) { + PHP_ME(Phalcon_Html_Link_AbstractLink, __construct, arginfo_phalcon_html_link_abstractlink___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetAttributes, arginfo_phalcon_html_link_abstractlink_dogetattributes, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetHref, arginfo_phalcon_html_link_abstractlink_dogethref, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetRels, arginfo_phalcon_html_link_abstractlink_dogetrels, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doIsTemplated, arginfo_phalcon_html_link_abstractlink_doistemplated, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, hrefIsTemplated, arginfo_phalcon_html_link_abstractlink_hrefistemplated, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithAttribute, arginfo_phalcon_html_link_abstractlink_dowithattribute, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithHref, arginfo_phalcon_html_link_abstractlink_dowithhref, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithRel, arginfo_phalcon_html_link_abstractlink_dowithrel, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithoutAttribute, arginfo_phalcon_html_link_abstractlink_dowithoutattribute, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithoutRel, arginfo_phalcon_html_link_abstractlink_dowithoutrel, ZEND_ACC_PROTECTED) + PHP_FE_END +}; + +zend_class_entry *phalcon_html_link_abstractlinkprovider_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLinkProvider); + +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, __construct); +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks); +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel); +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithLink); +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink); +static PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, getKey); +zend_object *zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider(zend_class_entry *class_type); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider___construct, 0, 0, 0) #if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractRequest, getUri, arginfo_phalcon_http_message_abstractrequest_geturi, ZEND_ACC_PUBLIC) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, links, IS_ARRAY, 0, "[]") #else - PHP_ME(Phalcon_Http_Message_AbstractRequest, getUri, NULL, ZEND_ACC_PUBLIC) + ZEND_ARG_ARRAY_INFO(0, links, 0) #endif - PHP_ME(Phalcon_Http_Message_AbstractRequest, getRequestTarget, arginfo_phalcon_http_message_abstractrequest_getrequesttarget, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withMethod, arginfo_phalcon_http_message_abstractrequest_withmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withRequestTarget, arginfo_phalcon_http_message_abstractrequest_withrequesttarget, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withUri, arginfo_phalcon_http_message_abstractrequest_withuri, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, processMethod, arginfo_phalcon_http_message_abstractrequest_processmethod, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractRequest, processUri, arginfo_phalcon_http_message_abstractrequest_processuri, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; +ZEND_END_ARG_INFO() -zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dogetlinks, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface); +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dogetlinksbyrel, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dowithlink, 0, 0, 1) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dowithoutlink, 0, 0, 1) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_getkey, 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_zephir_init_properties_phalcon_html_link_abstractlinkprovider, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_abstractlinkprovider_method_entry) { + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, __construct, arginfo_phalcon_html_link_abstractlinkprovider___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks, arginfo_phalcon_html_link_abstractlinkprovider_dogetlinks, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel, arginfo_phalcon_html_link_abstractlinkprovider_dogetlinksbyrel, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doWithLink, arginfo_phalcon_html_link_abstractlinkprovider_dowithlink, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink, arginfo_phalcon_html_link_abstractlinkprovider_dowithoutlink, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, getKey, arginfo_phalcon_html_link_abstractlinkprovider_getkey, ZEND_ACC_PROTECTED) + PHP_FE_END +}; zend_class_entry *phalcon_image_adapter_abstractadapter_ce; @@ -7306,94 +7246,219 @@ ZEPHIR_INIT_FUNCS(phalcon_logger_formatter_abstractformatter_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_mvc_entityinterface_ce; +zend_class_entry *phalcon_logger_loggerinterface_ce; -ZEPHIR_INIT_CLASS(Phalcon_Mvc_EntityInterface); +ZEPHIR_INIT_CLASS(Phalcon_Logger_LoggerInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_readattribute, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_alert, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_writeattribute, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) - ZEND_ARG_INFO(0, value) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_mvc_entityinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_EntityInterface, readAttribute, arginfo_phalcon_mvc_entityinterface_readattribute) - PHP_ABSTRACT_ME(Phalcon_Mvc_EntityInterface, writeAttribute, arginfo_phalcon_mvc_entityinterface_writeattribute) - PHP_FE_END -}; - -zend_class_entry *phalcon_mvc_model_behavior_ce; +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_critical, 0, 1, IS_VOID, 0) -ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior); + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() -static PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct); -static PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions); -static PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod); -static PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction); -static PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify); +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_debug, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else - ZEND_ARG_ARRAY_INFO(0, options, 0) + ZEND_ARG_ARRAY_INFO(0, context, 0) #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_getoptions, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 1) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_emergency, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_missingmethod, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arguments, IS_ARRAY, 0, "[]") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else - ZEND_ARG_ARRAY_INFO(0, arguments, 0) + ZEND_ARG_ARRAY_INFO(0, context, 0) #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_error, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_notify, 0, 0, 2) - ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_mvc_model_behavior_method_entry) { - PHP_ME(Phalcon_Mvc_Model_Behavior, __construct, arginfo_phalcon_mvc_model_behavior___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_Model_Behavior, getOptions, arginfo_phalcon_mvc_model_behavior_getoptions, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model_Behavior, missingMethod, arginfo_phalcon_mvc_model_behavior_missingmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Behavior, mustTakeAction, arginfo_phalcon_mvc_model_behavior_musttakeaction, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model_Behavior, notify, arginfo_phalcon_mvc_model_behavior_notify, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_mvc_model_metadata_strategy_strategyinterface_ce; +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_loggerinterface_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() -ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface); +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getcolumnmaps, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getloglevel, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getmetadata, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getname, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_mvc_model_metadata_strategy_strategyinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface, getColumnMaps, arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getcolumnmaps) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface, getMetaData, arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getmetadata) - PHP_FE_END -}; +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_info, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_log, 0, 2, IS_VOID, 0) + + ZEND_ARG_INFO(0, level) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_notice, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_warning, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_logger_loggerinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, alert, arginfo_phalcon_logger_loggerinterface_alert) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, critical, arginfo_phalcon_logger_loggerinterface_critical) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, debug, arginfo_phalcon_logger_loggerinterface_debug) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, emergency, arginfo_phalcon_logger_loggerinterface_emergency) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, error, arginfo_phalcon_logger_loggerinterface_error) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getAdapter, arginfo_phalcon_logger_loggerinterface_getadapter) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getAdapters, arginfo_phalcon_logger_loggerinterface_getadapters) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getLogLevel, arginfo_phalcon_logger_loggerinterface_getloglevel) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getName, arginfo_phalcon_logger_loggerinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, info, arginfo_phalcon_logger_loggerinterface_info) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, log, arginfo_phalcon_logger_loggerinterface_log) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, notice, arginfo_phalcon_logger_loggerinterface_notice) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, warning, arginfo_phalcon_logger_loggerinterface_warning) + PHP_FE_END +}; + +zend_class_entry *phalcon_mvc_entityinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Mvc_EntityInterface); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_readattribute, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_writeattribute, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_mvc_entityinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Mvc_EntityInterface, readAttribute, arginfo_phalcon_mvc_entityinterface_readattribute) + PHP_ABSTRACT_ME(Phalcon_Mvc_EntityInterface, writeAttribute, arginfo_phalcon_mvc_entityinterface_writeattribute) + PHP_FE_END +}; + +zend_class_entry *phalcon_mvc_model_behavior_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior); + +static PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct); +static PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions); +static PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod); +static PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction); +static PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_getoptions, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_missingmethod, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arguments, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, arguments, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_notify, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_mvc_model_behavior_method_entry) { + PHP_ME(Phalcon_Mvc_Model_Behavior, __construct, arginfo_phalcon_mvc_model_behavior___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Mvc_Model_Behavior, getOptions, arginfo_phalcon_mvc_model_behavior_getoptions, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Model_Behavior, missingMethod, arginfo_phalcon_mvc_model_behavior_missingmethod, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Behavior, mustTakeAction, arginfo_phalcon_mvc_model_behavior_musttakeaction, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Model_Behavior, notify, arginfo_phalcon_mvc_model_behavior_notify, ZEND_ACC_PUBLIC) + PHP_FE_END +}; + +zend_class_entry *phalcon_mvc_model_metadata_strategy_strategyinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getcolumnmaps, 0, 2, IS_ARRAY, 0) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) + ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getmetadata, 0, 2, IS_ARRAY, 0) + ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) + ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_mvc_model_metadata_strategy_strategyinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface, getColumnMaps, arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getcolumnmaps) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface, getMetaData, arginfo_phalcon_mvc_model_metadata_strategy_strategyinterface_getmetadata) + PHP_FE_END +}; zend_class_entry *phalcon_mvc_model_resultinterface_ce; @@ -7440,7 +7505,7 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Model_Resultset(zend_class_entry ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset___construct, 0, 0, 1) ZEND_ARG_INFO(0, result) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_count, 0, 0, IS_LONG, 0) @@ -7454,7 +7519,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_filt ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, Psr\\SimpleCache\\CacheInterface, 1) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, Phalcon\\Cache\\CacheInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_getfirst, 0, 0, 0) @@ -7484,7 +7549,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_next, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -7774,15 +7843,25 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstract ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_INFO(0, maxlifetime) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_open, 0, 2, _IS_BOOL, 0) @@ -7791,7 +7870,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstract ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -7926,6 +8005,97 @@ ZEPHIR_INIT_FUNCS(phalcon_annotations_readerinterface_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_cache_abstractcache_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Cache_AbstractCache); + +static PHP_METHOD(Phalcon_Cache_AbstractCache, __construct); +static PHP_METHOD(Phalcon_Cache_AbstractCache, getAdapter); +static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKey); +static PHP_METHOD(Phalcon_Cache_AbstractCache, checkKeys); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doClear); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doDelete); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doDeleteMultiple); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doGet); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doGetMultiple); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doHas); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doSet); +static PHP_METHOD(Phalcon_Cache_AbstractCache, doSetMultiple); +static PHP_METHOD(Phalcon_Cache_AbstractCache, getExceptionClass); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache___construct, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_abstractcache_getadapter, 0, 0, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_checkkey, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_checkkeys, 0, 1, IS_VOID, 0) + + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_doclear, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dodelete, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dodeletemultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache_dogetmultiple, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dohas, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_doset, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dosetmultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, values) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_getexceptionclass, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_cache_abstractcache_method_entry) { + PHP_ME(Phalcon_Cache_AbstractCache, __construct, arginfo_phalcon_cache_abstractcache___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Cache_AbstractCache, getAdapter, arginfo_phalcon_cache_abstractcache_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_AbstractCache, checkKey, arginfo_phalcon_cache_abstractcache_checkkey, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, checkKeys, arginfo_phalcon_cache_abstractcache_checkkeys, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doClear, arginfo_phalcon_cache_abstractcache_doclear, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doDelete, arginfo_phalcon_cache_abstractcache_dodelete, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doDeleteMultiple, arginfo_phalcon_cache_abstractcache_dodeletemultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doGet, arginfo_phalcon_cache_abstractcache_doget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doGetMultiple, arginfo_phalcon_cache_abstractcache_dogetmultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doHas, arginfo_phalcon_cache_abstractcache_dohas, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doSet, arginfo_phalcon_cache_abstractcache_doset, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doSetMultiple, arginfo_phalcon_cache_abstractcache_dosetmultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, getExceptionClass, arginfo_phalcon_cache_abstractcache_getexceptionclass, ZEND_ACC_ABSTRACT|ZEND_ACC_PROTECTED) + PHP_FE_END +}; + zend_class_entry *phalcon_cli_dispatcherinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cli_DispatcherInterface); @@ -8107,7 +8277,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_ #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogger, 0, 0, Psr\\Log\\LoggerInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogger, 0, 0, Phalcon\\Logger\\LoggerInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogformat, 0, 0, IS_STRING, 0) @@ -8886,66 +9056,84 @@ ZEPHIR_INIT_FUNCS(phalcon_html_helper_style_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withhref, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withattribute, 0, 2, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutattribute, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_evolvablelinkinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withHref, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withhref) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withRel, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withrel) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutRel, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutrel) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withAttribute, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withattribute) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutAttribute, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutattribute) + PHP_FE_END +}; + +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withoutlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_evolvablelinkproviderinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withLink, arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withlink) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withoutLink, arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withoutlink) + PHP_FE_END +}; + zend_class_entry *phalcon_html_link_link_ce; ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Link); -static PHP_METHOD(Phalcon_Html_Link_Link, __construct); static PHP_METHOD(Phalcon_Html_Link_Link, getAttributes); static PHP_METHOD(Phalcon_Html_Link_Link, getHref); static PHP_METHOD(Phalcon_Html_Link_Link, getRels); static PHP_METHOD(Phalcon_Html_Link_Link, isTemplated); -static PHP_METHOD(Phalcon_Html_Link_Link, hrefIsTemplated); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, attributes, 0) -#endif -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_getattributes, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_getattributes, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_gethref, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_gethref, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_getrels, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_getrels, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_istemplated, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_hrefistemplated, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_istemplated, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_link_method_entry) { - PHP_ME(Phalcon_Html_Link_Link, __construct, arginfo_phalcon_html_link_link___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getAttributes, arginfo_phalcon_html_link_link_getattributes, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getAttributes, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getHref, arginfo_phalcon_html_link_link_gethref, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getHref, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getRels, arginfo_phalcon_html_link_link_getrels, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getRels, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, isTemplated, arginfo_phalcon_html_link_link_istemplated, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, isTemplated, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Html_Link_Link, hrefIsTemplated, arginfo_phalcon_html_link_link_hrefistemplated, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -8953,43 +9141,19 @@ zend_class_entry *phalcon_html_link_linkprovider_ce; ZEPHIR_INIT_CLASS(Phalcon_Html_Link_LinkProvider); -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, __construct); static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks); static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel); -static PHP_METHOD(Phalcon_Html_Link_LinkProvider, getKey); -zend_object *zephir_init_properties_Phalcon_Html_Link_LinkProvider(zend_class_entry *class_type); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider___construct, 0, 0, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, links, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, links, 0) -#endif -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinks, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinks, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinksbyrel, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinksbyrel, 0, 1, IS_ARRAY, 0) ZEND_ARG_INFO(0, rel) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getkey, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_zephir_init_properties_phalcon_html_link_linkprovider, 0, 0, 0) -ZEND_END_ARG_INFO() - ZEPHIR_INIT_FUNCS(phalcon_html_link_linkprovider_method_entry) { - PHP_ME(Phalcon_Html_Link_LinkProvider, __construct, arginfo_phalcon_html_link_linkprovider___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_LinkProvider, getLinks, arginfo_phalcon_html_link_linkprovider_getlinks, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_LinkProvider, getLinks, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Html_Link_LinkProvider, getLinksByRel, arginfo_phalcon_html_link_linkprovider_getlinksbyrel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Html_Link_LinkProvider, getKey, arginfo_phalcon_html_link_linkprovider_getkey, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -9100,6 +9264,16 @@ ZEPHIR_INIT_FUNCS(phalcon_http_cookie_cookieinterface_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_http_message_requestmethodinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestMethodInterface); + + +zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseStatusCodeInterface); + + zend_class_entry *phalcon_http_request_fileinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface); @@ -9584,6 +9758,110 @@ ZEPHIR_INIT_FUNCS(phalcon_http_responseinterface_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_logger_abstractlogger_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Logger_AbstractLogger); + +static PHP_METHOD(Phalcon_Logger_AbstractLogger, __construct); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, addAdapter); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, excludeAdapters); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapter); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapters); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLogLevel); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getName); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, removeAdapter); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, setAdapters); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, setLogLevel); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, addMessage); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevelNumber); +static PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevels); +zend_object *zephir_init_properties_Phalcon_Logger_AbstractLogger(zend_class_entry *class_type); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_abstractlogger___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +#endif + ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_addadapter, 0, 2, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_excludeadapters, 0, 0, Phalcon\\Logger\\AbstractLogger, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getloglevel, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getname, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_removeadapter, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_setadapters, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_setloglevel, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_addmessage, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getlevelnumber, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, level) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getlevels, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_abstractlogger_zephir_init_properties_phalcon_logger_abstractlogger, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_logger_abstractlogger_method_entry) { + PHP_ME(Phalcon_Logger_AbstractLogger, __construct, arginfo_phalcon_logger_abstractlogger___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Logger_AbstractLogger, addAdapter, arginfo_phalcon_logger_abstractlogger_addadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, excludeAdapters, arginfo_phalcon_logger_abstractlogger_excludeadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getAdapter, arginfo_phalcon_logger_abstractlogger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getAdapters, arginfo_phalcon_logger_abstractlogger_getadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getLogLevel, arginfo_phalcon_logger_abstractlogger_getloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getName, arginfo_phalcon_logger_abstractlogger_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, removeAdapter, arginfo_phalcon_logger_abstractlogger_removeadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, setAdapters, arginfo_phalcon_logger_abstractlogger_setadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, setLogLevel, arginfo_phalcon_logger_abstractlogger_setloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, addMessage, arginfo_phalcon_logger_abstractlogger_addmessage, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Logger_AbstractLogger, getLevelNumber, arginfo_phalcon_logger_abstractlogger_getlevelnumber, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Logger_AbstractLogger, getLevels, arginfo_phalcon_logger_abstractlogger_getlevels, ZEND_ACC_PROTECTED) + PHP_FE_END +}; + zend_class_entry *phalcon_messages_messageinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Messages_MessageInterface); @@ -9998,7 +10276,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmany, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -10006,7 +10288,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasone, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -10014,7 +10300,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasonethrough, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -10025,7 +10315,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmanytomany, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -10036,7 +10330,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_createbuilder, 0, 0, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) @@ -11800,15 +12098,25 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_clo ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_INFO(0, maxlifetime) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_open, 0, 2, _IS_BOOL, 0) @@ -11817,7 +12125,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_ope ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -11840,6 +12148,76 @@ ZEPHIR_INIT_FUNCS(phalcon_session_adapter_noop_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_session_baginterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface___get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___isset, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___set, 0, 2, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___unset, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_init, 0, 0, IS_VOID, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, data, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface_get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) + ZEND_ARG_TYPE_INFO(0, cast, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_set, 0, 2, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_has, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_remove, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_clear, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_session_baginterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __get, arginfo_phalcon_session_baginterface___get) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __isset, arginfo_phalcon_session_baginterface___isset) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __set, arginfo_phalcon_session_baginterface___set) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __unset, arginfo_phalcon_session_baginterface___unset) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, init, arginfo_phalcon_session_baginterface_init) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, get, arginfo_phalcon_session_baginterface_get) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, set, arginfo_phalcon_session_baginterface_set) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, has, arginfo_phalcon_session_baginterface_has) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, remove, arginfo_phalcon_session_baginterface_remove) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, clear, arginfo_phalcon_session_baginterface_clear) + PHP_FE_END +}; + zend_class_entry *phalcon_session_managerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Session_ManagerInterface); @@ -11907,7 +12285,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_setid, 0, 1, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_setname, 0, 1, Phalcon\\Session\\ManagerInterface, 0) @@ -11926,7 +12304,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_managerinterface ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_regenerateid, 0, 0, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_INFO(0, deleteOldSession) + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_managerinterface_method_entry) { @@ -11962,12 +12340,19 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, __construct); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete); -static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set); static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, doGet); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDec); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDelete); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuExists); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuInc); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuFetch); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuIterator); +static PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuStore); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, factory, Phalcon\\Storage\\SerializerFactory, 0) @@ -11990,11 +12375,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_del ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_getkeys, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -12019,17 +12399,65 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_set ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcudec, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, step, IS_LONG, 0) + ZEND_ARG_INFO(0, success) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcudelete, 0, 0, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuexists, 0, 0, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuinc, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, step, IS_LONG, 0) + ZEND_ARG_INFO(0, success) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcufetch, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, success) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuiterator, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcustore, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, payload) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_apcu_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Apcu, __construct, arginfo_phalcon_storage_adapter_apcu___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Storage_Adapter_Apcu, clear, arginfo_phalcon_storage_adapter_apcu_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, decrement, arginfo_phalcon_storage_adapter_apcu_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, delete, arginfo_phalcon_storage_adapter_apcu_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Apcu, get, arginfo_phalcon_storage_adapter_apcu_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, getKeys, arginfo_phalcon_storage_adapter_apcu_getkeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, has, arginfo_phalcon_storage_adapter_apcu_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, increment, arginfo_phalcon_storage_adapter_apcu_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, set, arginfo_phalcon_storage_adapter_apcu_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, setForever, arginfo_phalcon_storage_adapter_apcu_setforever, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_Apcu, doGet, arginfo_phalcon_storage_adapter_apcu_doget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuDec, arginfo_phalcon_storage_adapter_apcu_phpapcudec, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuDelete, arginfo_phalcon_storage_adapter_apcu_phpapcudelete, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuExists, arginfo_phalcon_storage_adapter_apcu_phpapcuexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuInc, arginfo_phalcon_storage_adapter_apcu_phpapcuinc, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuFetch, arginfo_phalcon_storage_adapter_apcu_phpapcufetch, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuIterator, arginfo_phalcon_storage_adapter_apcu_phpapcuiterator, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuStore, arginfo_phalcon_storage_adapter_apcu_phpapcustore, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -12041,7 +12469,6 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, __construct); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, clear); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, decrement); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete); -static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getKeys); static PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, has); @@ -12074,11 +12501,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_libmemca ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_libmemcached_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_libmemcached_getadapter, 0, 0, 0) ZEND_END_ARG_INFO() @@ -12132,7 +12554,6 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_libmemcached_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Libmemcached, clear, arginfo_phalcon_storage_adapter_libmemcached_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Libmemcached, decrement, arginfo_phalcon_storage_adapter_libmemcached_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Libmemcached, delete, arginfo_phalcon_storage_adapter_libmemcached_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Libmemcached, get, arginfo_phalcon_storage_adapter_libmemcached_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_Libmemcached, getAdapter, arginfo_phalcon_storage_adapter_libmemcached_getadapter, ZEND_ACC_PUBLIC) #else @@ -12158,12 +12579,12 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Memory, __construct); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete); -static PHP_METHOD(Phalcon_Storage_Adapter_Memory, get); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, has); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, set); static PHP_METHOD(Phalcon_Storage_Adapter_Memory, setForever); +static PHP_METHOD(Phalcon_Storage_Adapter_Memory, doGet); zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory___construct, 0, 0, 1) @@ -12187,11 +12608,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_d ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_getkeys, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -12216,6 +12632,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_s ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_zephir_init_properties_phalcon_storage_adapter_memory, 0, 0, 0) ZEND_END_ARG_INFO() @@ -12224,12 +12644,12 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_memory_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Memory, clear, arginfo_phalcon_storage_adapter_memory_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, decrement, arginfo_phalcon_storage_adapter_memory_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, delete, arginfo_phalcon_storage_adapter_memory_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Memory, get, arginfo_phalcon_storage_adapter_memory_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, getKeys, arginfo_phalcon_storage_adapter_memory_getkeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, has, arginfo_phalcon_storage_adapter_memory_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, increment, arginfo_phalcon_storage_adapter_memory_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, set, arginfo_phalcon_storage_adapter_memory_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, setForever, arginfo_phalcon_storage_adapter_memory_setforever, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_Memory, doGet, arginfo_phalcon_storage_adapter_memory_doget, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -12241,7 +12661,6 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Redis, __construct); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, clear); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, decrement); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete); -static PHP_METHOD(Phalcon_Storage_Adapter_Redis, get); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, getKeys); static PHP_METHOD(Phalcon_Storage_Adapter_Redis, has); @@ -12274,11 +12693,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_redis_de ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_redis_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_redis_getadapter, 0, 0, 0) ZEND_END_ARG_INFO() @@ -12328,7 +12742,6 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_redis_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Redis, clear, arginfo_phalcon_storage_adapter_redis_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Redis, decrement, arginfo_phalcon_storage_adapter_redis_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Redis, delete, arginfo_phalcon_storage_adapter_redis_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Redis, get, arginfo_phalcon_storage_adapter_redis_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_Redis, getAdapter, arginfo_phalcon_storage_adapter_redis_getadapter, ZEND_ACC_PUBLIC) #else @@ -12366,6 +12779,11 @@ static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator); static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload); static PHP_METHOD(Phalcon_Storage_Adapter_Stream, isExpired); static PHP_METHOD(Phalcon_Storage_Adapter_Stream, storePayload); +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileExists); +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileGetContents); +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFilePutContents); +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFopen); +static PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpUnlink); static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile); static PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirSeparator); @@ -12444,6 +12862,30 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_s ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfileexists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfilegetcontents, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfileputcontents, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfopen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpunlink, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_getdirfromfile, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -12469,11 +12911,64 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_stream_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Stream, getPayload, arginfo_phalcon_storage_adapter_stream_getpayload, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, isExpired, arginfo_phalcon_storage_adapter_stream_isexpired, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, storePayload, arginfo_phalcon_storage_adapter_stream_storepayload, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFileExists, arginfo_phalcon_storage_adapter_stream_phpfileexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFileGetContents, arginfo_phalcon_storage_adapter_stream_phpfilegetcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFilePutContents, arginfo_phalcon_storage_adapter_stream_phpfileputcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFopen, arginfo_phalcon_storage_adapter_stream_phpfopen, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpUnlink, arginfo_phalcon_storage_adapter_stream_phpunlink, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_Stream, getDirFromFile, arginfo_phalcon_storage_adapter_stream_getdirfromfile, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, getDirSeparator, arginfo_phalcon_storage_adapter_stream_getdirseparator, ZEND_ACC_PRIVATE) PHP_FE_END }; +zend_class_entry *phalcon_storage_serializer_igbinary_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary); + +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doSerialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_serialize, 0, 0, 0) +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_phpigbinaryserialize, 0, 1, IS_STRING, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_doserialize, 0, 1, IS_STRING, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_dounserialize, 0, 0, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_igbinary_method_entry) { +#if PHP_VERSION_ID >= 80000 + PHP_ME(Phalcon_Storage_Serializer_Igbinary, serialize, arginfo_phalcon_storage_serializer_igbinary_serialize, ZEND_ACC_PUBLIC) +#else + PHP_ME(Phalcon_Storage_Serializer_Igbinary, serialize, NULL, ZEND_ACC_PUBLIC) +#endif + PHP_ME(Phalcon_Storage_Serializer_Igbinary, unserialize, arginfo_phalcon_storage_serializer_igbinary_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize, arginfo_phalcon_storage_serializer_igbinary_phpigbinaryserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, doSerialize, arginfo_phalcon_storage_serializer_igbinary_doserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, doUnserialize, arginfo_phalcon_storage_serializer_igbinary_dounserialize, ZEND_ACC_PROTECTED) + PHP_FE_END +}; + zend_class_entry *phalcon_acl_adapter_memory_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_Memory); @@ -12975,7 +13470,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_collection_get, 0, 1, Phalcon\\Annotations\\Annotation, 0) @@ -13008,11 +13507,7 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_collection_method_entry) { PHP_ME(Phalcon_Annotations_Collection, __construct, arginfo_phalcon_annotations_collection___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Annotations_Collection, count, arginfo_phalcon_annotations_collection_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Annotations_Collection, current, arginfo_phalcon_annotations_collection_current, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Annotations_Collection, current, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Annotations_Collection, get, arginfo_phalcon_annotations_collection_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, getAll, arginfo_phalcon_annotations_collection_getall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, getAnnotations, arginfo_phalcon_annotations_collection_getannotations, ZEND_ACC_PUBLIC) @@ -13058,8 +13553,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection); static PHP_METHOD(Phalcon_Annotations_Reflection, __construct); static PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations); -static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations); +static PHP_METHOD(Phalcon_Annotations_Reflection, getConstantsAnnotations); static PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations); +static PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations); static PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData); zend_object *zephir_init_properties_Phalcon_Annotations_Reflection(zend_class_entry *class_type); @@ -13074,12 +13570,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getclassannotations, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getmethodsannotations, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getconstantsannotations, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getpropertiesannotations, 0, 0, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getmethodsannotations, 0, 0, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reflection_getreflectiondata, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -13094,14 +13593,19 @@ ZEPHIR_INIT_FUNCS(phalcon_annotations_reflection_method_entry) { PHP_ME(Phalcon_Annotations_Reflection, getClassAnnotations, NULL, ZEND_ACC_PUBLIC) #endif #if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, arginfo_phalcon_annotations_reflection_getmethodsannotations, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Reflection, getConstantsAnnotations, arginfo_phalcon_annotations_reflection_getconstantsannotations, ZEND_ACC_PUBLIC) #else - PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Reflection, getConstantsAnnotations, NULL, ZEND_ACC_PUBLIC) #endif #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Annotations_Reflection, getPropertiesAnnotations, arginfo_phalcon_annotations_reflection_getpropertiesannotations, ZEND_ACC_PUBLIC) #else PHP_ME(Phalcon_Annotations_Reflection, getPropertiesAnnotations, NULL, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80000 + PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, arginfo_phalcon_annotations_reflection_getmethodsannotations, ZEND_ACC_PUBLIC) +#else + PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, NULL, ZEND_ACC_PUBLIC) #endif PHP_ME(Phalcon_Annotations_Reflection, getReflectionData, arginfo_phalcon_annotations_reflection_getreflectiondata, ZEND_ACC_PUBLIC) PHP_FE_END @@ -13294,7 +13798,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_getiterator, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_getiterator, 0, 0, Traversable, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_getrealtargetpath, 0, 1, IS_STRING, 0) @@ -13411,11 +13915,7 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_collection_method_entry) { PHP_ME(Phalcon_Assets_Collection, addInlineJs, arginfo_phalcon_assets_collection_addinlinejs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, addJs, arginfo_phalcon_assets_collection_addjs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, count, arginfo_phalcon_assets_collection_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Assets_Collection, getIterator, arginfo_phalcon_assets_collection_getiterator, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Assets_Collection, getIterator, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Assets_Collection, getRealTargetPath, arginfo_phalcon_assets_collection_getrealtargetpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, has, arginfo_phalcon_assets_collection_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, isAutoVersion, arginfo_phalcon_assets_collection_isautoversion, ZEND_ACC_PUBLIC) @@ -14068,8 +14568,6 @@ zend_class_entry *phalcon_cache_cache_ce; ZEPHIR_INIT_CLASS(Phalcon_Cache_Cache); -static PHP_METHOD(Phalcon_Cache_Cache, getAdapter); -static PHP_METHOD(Phalcon_Cache_Cache, __construct); static PHP_METHOD(Phalcon_Cache_Cache, clear); static PHP_METHOD(Phalcon_Cache_Cache, delete); static PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple); @@ -14078,21 +14576,13 @@ static PHP_METHOD(Phalcon_Cache_Cache, getMultiple); static PHP_METHOD(Phalcon_Cache_Cache, has); static PHP_METHOD(Phalcon_Cache_Cache, set); static PHP_METHOD(Phalcon_Cache_Cache, setMultiple); -static PHP_METHOD(Phalcon_Cache_Cache, checkKey); -static PHP_METHOD(Phalcon_Cache_Cache, checkKeys); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_getadapter, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) -ZEND_END_ARG_INFO() +static PHP_METHOD(Phalcon_Cache_Cache, getExceptionClass); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_clear, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_delete, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_deletemultiple, 0, 1, _IS_BOOL, 0) @@ -14100,7 +14590,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_deletemultip ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_get, 0, 0, 1) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() @@ -14110,11 +14600,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_getmultiple, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_has, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_set, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() @@ -14124,23 +14614,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_setmultiple, ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_checkkey, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_checkkeys, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, keys) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_getexceptionclass, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_cache_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Cache_Cache, getAdapter, arginfo_phalcon_cache_cache_getadapter, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Cache_Cache, getAdapter, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Cache_Cache, __construct, arginfo_phalcon_cache_cache___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Cache_Cache, clear, arginfo_phalcon_cache_cache_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, delete, arginfo_phalcon_cache_cache_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, deleteMultiple, arginfo_phalcon_cache_cache_deletemultiple, ZEND_ACC_PUBLIC) @@ -14149,8 +14626,7 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_cache_method_entry) { PHP_ME(Phalcon_Cache_Cache, has, arginfo_phalcon_cache_cache_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, set, arginfo_phalcon_cache_cache_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, setMultiple, arginfo_phalcon_cache_cache_setmultiple, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Cache, checkKey, arginfo_phalcon_cache_cache_checkkey, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Cache_Cache, checkKeys, arginfo_phalcon_cache_cache_checkkeys, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_Cache, getExceptionClass, arginfo_phalcon_cache_cache_getexceptionclass, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -14167,11 +14643,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cachefactory___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, factory, Phalcon\\Cache\\AdapterFactory, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_load, 0, 1, Psr\\SimpleCache\\CacheInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_load, 0, 1, Phalcon\\Cache\\CacheInterface, 0) ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_newinstance, 0, 1, Psr\\SimpleCache\\CacheInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_newinstance, 0, 1, Phalcon\\Cache\\CacheInterface, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") @@ -14905,33 +15381,6 @@ zend_class_entry *phalcon_config_exception_ce; ZEPHIR_INIT_CLASS(Phalcon_Config_Exception); -zend_class_entry *phalcon_container_container_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Container_Container); - -static PHP_METHOD(Phalcon_Container_Container, __construct); -static PHP_METHOD(Phalcon_Container_Container, get); -static PHP_METHOD(Phalcon_Container_Container, has); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container_container___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container_container_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_container_container_has, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_container_container_method_entry) { - PHP_ME(Phalcon_Container_Container, __construct, arginfo_phalcon_container_container___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Container_Container, get, arginfo_phalcon_container_container_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Container_Container, has, arginfo_phalcon_container_container_has, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - zend_class_entry *phalcon_datamapper_pdo_connection_ce; ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Connection); @@ -15092,23 +15541,25 @@ zend_class_entry *phalcon_datamapper_pdo_profiler_memorylogger_ce; ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger); -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages); -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency); static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert); static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency); static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error); -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning); -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName); static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info); -static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice); +static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning); static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log); zend_object *zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_MemoryLogger(zend_class_entry *class_type); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, 0, 0, 1) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15116,8 +15567,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emer #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15125,8 +15577,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_aler #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15134,8 +15587,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_crit #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15143,8 +15597,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_erro #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15152,8 +15607,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warn #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getloglevel, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getname, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15161,8 +15633,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_noti #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15170,8 +15643,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15179,9 +15653,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debu #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, level) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -15193,15 +15668,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_zeph ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_datamapper_pdo_profiler_memorylogger_method_entry) { - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -15224,7 +15703,7 @@ static PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, encode); zend_object *zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_Profiler(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler___construct, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, logger, Psr\\Log\\LoggerInterface, 1) + ZEND_ARG_OBJ_INFO(0, logger, Phalcon\\Logger\\LoggerInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_finish, 0, 0, IS_VOID, 0) @@ -15240,7 +15719,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogformat, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogger, 0, 0, Psr\\Log\\LoggerInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogger, 0, 0, Phalcon\\Logger\\LoggerInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getloglevel, 0, 0, IS_STRING, 0) @@ -16972,15 +17451,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdoresult_exec ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetch, 0, 0, 0) - ZEND_ARG_INFO(0, fetchStyle) - ZEND_ARG_INFO(0, cursorOrientation) - ZEND_ARG_INFO(0, cursorOffset) + ZEND_ARG_TYPE_INFO(0, fetchStyle, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, cursorOrientation, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, cursorOffset, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetchall, 0, 0, IS_ARRAY, 0) - ZEND_ARG_INFO(0, fetchStyle) - ZEND_ARG_INFO(0, fetchArgument) - ZEND_ARG_INFO(0, ctorArgs) + ZEND_ARG_TYPE_INFO(0, fetchStyle, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, fetchArgument, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, ctorArgs, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetcharray, 0, 0, 0) @@ -17041,6 +17520,18 @@ ZEPHIR_INIT_FUNCS(phalcon_di_factorydefault_cli_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_di_initializationawareinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Di_InitializationAwareInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_initializationawareinterface_initialize, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_di_initializationawareinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Di_InitializationAwareInterface, initialize, arginfo_phalcon_di_initializationawareinterface_initialize) + PHP_FE_END +}; + zend_class_entry *phalcon_di_service_ce; ZEPHIR_INIT_CLASS(Phalcon_Di_Service); @@ -17307,6 +17798,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getAvailableHashAlgorithms); static PHP_METHOD(Phalcon_Encryption_Crypt, getHashAlgorithm); static PHP_METHOD(Phalcon_Encryption_Crypt, getCipher); static PHP_METHOD(Phalcon_Encryption_Crypt, getKey); +static PHP_METHOD(Phalcon_Encryption_Crypt, isValidDecryptLength); static PHP_METHOD(Phalcon_Encryption_Crypt, setAuthData); static PHP_METHOD(Phalcon_Encryption_Crypt, setAuthTag); static PHP_METHOD(Phalcon_Encryption_Crypt, setAuthTagLength); @@ -17328,6 +17820,7 @@ static PHP_METHOD(Phalcon_Encryption_Crypt, getBlockSize); static PHP_METHOD(Phalcon_Encryption_Crypt, getIvLength); static PHP_METHOD(Phalcon_Encryption_Crypt, getMode); static PHP_METHOD(Phalcon_Encryption_Crypt, phpFunctionExists); +static PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength); static PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes); zend_object *zephir_init_properties_Phalcon_Encryption_Crypt(zend_class_entry *class_type); @@ -17383,6 +17876,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_getkey, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_isvaliddecryptlength, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_encryption_crypt_setauthdata, 0, 1, Phalcon\\Encryption\\Crypt\\CryptInterface, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -17484,6 +17981,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_phpfunc ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_encryption_crypt_phpopensslcipherivlength, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_encryption_crypt_phpopensslrandompseudobytes, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -17505,6 +18006,7 @@ ZEPHIR_INIT_FUNCS(phalcon_encryption_crypt_method_entry) { PHP_ME(Phalcon_Encryption_Crypt, getHashAlgorithm, arginfo_phalcon_encryption_crypt_gethashalgorithm, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, getCipher, arginfo_phalcon_encryption_crypt_getcipher, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, getKey, arginfo_phalcon_encryption_crypt_getkey, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Encryption_Crypt, isValidDecryptLength, arginfo_phalcon_encryption_crypt_isvaliddecryptlength, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthData, arginfo_phalcon_encryption_crypt_setauthdata, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthTag, arginfo_phalcon_encryption_crypt_setauthtag, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthTagLength, arginfo_phalcon_encryption_crypt_setauthtaglength, ZEND_ACC_PUBLIC) @@ -17526,6 +18028,7 @@ ZEPHIR_INIT_FUNCS(phalcon_encryption_crypt_method_entry) { PHP_ME(Phalcon_Encryption_Crypt, getIvLength, arginfo_phalcon_encryption_crypt_getivlength, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Encryption_Crypt, getMode, arginfo_phalcon_encryption_crypt_getmode, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Encryption_Crypt, phpFunctionExists, arginfo_phalcon_encryption_crypt_phpfunctionexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength, arginfo_phalcon_encryption_crypt_phpopensslcipherivlength, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes, arginfo_phalcon_encryption_crypt_phpopensslrandompseudobytes, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -20373,7 +20876,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_get, 0, 1, Phalcon\\Forms\\Element\\ElementInterface, 0) @@ -20518,11 +21025,7 @@ ZEPHIR_INIT_FUNCS(phalcon_forms_form_method_entry) { PHP_ME(Phalcon_Forms_Form, bind, arginfo_phalcon_forms_form_bind, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, clear, arginfo_phalcon_forms_form_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, count, arginfo_phalcon_forms_form_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Forms_Form, current, arginfo_phalcon_forms_form_current, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Forms_Form, current, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Forms_Form, get, arginfo_phalcon_forms_form_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getAction, arginfo_phalcon_forms_form_getaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getAttributes, arginfo_phalcon_forms_form_getattributes, ZEND_ACC_PUBLIC) @@ -21471,25 +21974,25 @@ static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel); static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute); static PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withattribute, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withattribute, 0, 2, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) ZEND_ARG_INFO(0, attribute) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withhref, 0, 0, 1) - ZEND_ARG_INFO(0, href) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withhref, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withrel, 0, 0, 1) - ZEND_ARG_INFO(0, rel) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutattribute, 0, 0, 1) - ZEND_ARG_INFO(0, attribute) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutattribute, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutrel, 0, 0, 1) - ZEND_ARG_INFO(0, rel) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_evolvablelink_method_entry) { @@ -21508,12 +22011,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLinkProvider); static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink); static PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withlink, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withoutlink, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withoutlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_evolvablelinkprovider_method_entry) { @@ -21641,923 +22144,138 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") #else ZEND_ARG_ARRAY_INFO(0, options, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_delete, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getdomain, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getexpiration, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_gethttponly, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getname, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getoptions, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getpath, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getsecure, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_getvalue, 0, 0, 0) - ZEND_ARG_INFO(0, filters) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_isusingencryption, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_restore, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_send, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setdomain, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setexpiration, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_sethttponly, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setoptions, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_ARRAY_INFO(0, options, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setpath, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsecure, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsignkey, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setvalue, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_useencryption, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) - ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_assertsignkeyislongenough, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_getarrval, 0, 0, 2) - ZEND_ARG_ARRAY_INFO(0, collection, 0) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_zephir_init_properties_phalcon_http_cookie, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_cookie_method_entry) { - PHP_ME(Phalcon_Http_Cookie, __construct, arginfo_phalcon_http_cookie___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Cookie, __toString, arginfo_phalcon_http_cookie___tostring, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Cookie, delete, arginfo_phalcon_http_cookie_delete, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Cookie, delete, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Cookie, getDomain, arginfo_phalcon_http_cookie_getdomain, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getExpiration, arginfo_phalcon_http_cookie_getexpiration, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getHttpOnly, arginfo_phalcon_http_cookie_gethttponly, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getName, arginfo_phalcon_http_cookie_getname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getOptions, arginfo_phalcon_http_cookie_getoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getPath, arginfo_phalcon_http_cookie_getpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getSecure, arginfo_phalcon_http_cookie_getsecure, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getValue, arginfo_phalcon_http_cookie_getvalue, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, isUsingEncryption, arginfo_phalcon_http_cookie_isusingencryption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, restore, arginfo_phalcon_http_cookie_restore, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, send, arginfo_phalcon_http_cookie_send, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setDomain, arginfo_phalcon_http_cookie_setdomain, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setExpiration, arginfo_phalcon_http_cookie_setexpiration, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setHttpOnly, arginfo_phalcon_http_cookie_sethttponly, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setOptions, arginfo_phalcon_http_cookie_setoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setPath, arginfo_phalcon_http_cookie_setpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setSecure, arginfo_phalcon_http_cookie_setsecure, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setSignKey, arginfo_phalcon_http_cookie_setsignkey, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, setValue, arginfo_phalcon_http_cookie_setvalue, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, useEncryption, arginfo_phalcon_http_cookie_useencryption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, assertSignKeyIsLongEnough, arginfo_phalcon_http_cookie_assertsignkeyislongenough, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Cookie, getArrVal, arginfo_phalcon_http_cookie_getarrval, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_cookie_exception_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception); - - -zend_class_entry *phalcon_http_message_exception_invalidargumentexception_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Exception_InvalidArgumentException); - - -zend_class_entry *phalcon_http_message_request_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Request); - -static PHP_METHOD(Phalcon_Http_Message_Request, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_request___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) - ZEND_ARG_INFO(0, body) - ZEND_ARG_INFO(0, headers) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_request_method_entry) { - PHP_ME(Phalcon_Http_Message_Request, __construct, arginfo_phalcon_http_message_request___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_requestfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestFactory); - -static PHP_METHOD(Phalcon_Http_Message_RequestFactory, createRequest); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_requestfactory_createrequest, 0, 2, Psr\\Http\\Message\\RequestInterface, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_requestfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_RequestFactory, createRequest, arginfo_phalcon_http_message_requestfactory_createrequest, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_response_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Response); - -static PHP_METHOD(Phalcon_Http_Message_Response, getReasonPhrase); -static PHP_METHOD(Phalcon_Http_Message_Response, getStatusCode); -static PHP_METHOD(Phalcon_Http_Message_Response, __construct); -static PHP_METHOD(Phalcon_Http_Message_Response, withStatus); -static PHP_METHOD(Phalcon_Http_Message_Response, getPhrases); -static PHP_METHOD(Phalcon_Http_Message_Response, processCode); -static PHP_METHOD(Phalcon_Http_Message_Response, checkCodeType); -static PHP_METHOD(Phalcon_Http_Message_Response, checkCodeValue); -static PHP_METHOD(Phalcon_Http_Message_Response, isBetween); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getreasonphrase, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getstatuscode, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_response___construct, 0, 0, 0) - ZEND_ARG_INFO(0, body) - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, headers, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, headers, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_response_withstatus, 0, 1, Phalcon\\Http\\Message\\Response, 0) - ZEND_ARG_INFO(0, code) - ZEND_ARG_INFO(0, reasonPhrase) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getphrases, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_processcode, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, code) - ZEND_ARG_INFO(0, phrase) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_checkcodetype, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, code) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_checkcodevalue, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_isbetween, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, from, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, to, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_response_method_entry) { - PHP_ME(Phalcon_Http_Message_Response, getReasonPhrase, arginfo_phalcon_http_message_response_getreasonphrase, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, getStatusCode, arginfo_phalcon_http_message_response_getstatuscode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, __construct, arginfo_phalcon_http_message_response___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_Response, withStatus, arginfo_phalcon_http_message_response_withstatus, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, getPhrases, arginfo_phalcon_http_message_response_getphrases, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_Response, processCode, arginfo_phalcon_http_message_response_processcode, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_Response, checkCodeType, arginfo_phalcon_http_message_response_checkcodetype, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Response, checkCodeValue, arginfo_phalcon_http_message_response_checkcodevalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Response, isBetween, arginfo_phalcon_http_message_response_isbetween, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_responsefactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseFactory); - -static PHP_METHOD(Phalcon_Http_Message_ResponseFactory, createResponse); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_responsefactory_createresponse, 0, 0, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, reasonPhrase, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_responsefactory_method_entry) { - PHP_ME(Phalcon_Http_Message_ResponseFactory, createResponse, arginfo_phalcon_http_message_responsefactory_createresponse, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_serverrequest_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequest); - -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getCookieParams); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getParsedBody); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getQueryParams); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getServerParams); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getUploadedFiles); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, __construct); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttribute); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttributes); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withAttribute); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withCookieParams); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withParsedBody); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withQueryParams); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withUploadedFiles); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, withoutAttribute); -static PHP_METHOD(Phalcon_Http_Message_ServerRequest, checkUploadedFiles); -zend_object *zephir_init_properties_Phalcon_Http_Message_ServerRequest(zend_class_entry *class_type); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getcookieparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_getparsedbody, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getqueryparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getserverparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getuploadedfiles, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serverParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, serverParams, 0) -#endif - ZEND_ARG_INFO(0, body) - ZEND_ARG_INFO(0, headers) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookies, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, cookies, 0) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, queryParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, queryParams, 0) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uploadFiles, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, uploadFiles, 0) -#endif - ZEND_ARG_INFO(0, parsedBody) - ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_getattribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getattributes, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withattribute, 0, 2, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withcookieparams, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, cookies, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withparsedbody, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withqueryparams, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, query, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withuploadedfiles, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, uploadedFiles, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withoutattribute, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_checkuploadedfiles, 0, 1, IS_VOID, 0) - - ZEND_ARG_ARRAY_INFO(0, files, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_zephir_init_properties_phalcon_http_message_serverrequest, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_serverrequest_method_entry) { - PHP_ME(Phalcon_Http_Message_ServerRequest, getCookieParams, arginfo_phalcon_http_message_serverrequest_getcookieparams, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_ServerRequest, getParsedBody, arginfo_phalcon_http_message_serverrequest_getparsedbody, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_ServerRequest, getParsedBody, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_ServerRequest, getQueryParams, arginfo_phalcon_http_message_serverrequest_getqueryparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getServerParams, arginfo_phalcon_http_message_serverrequest_getserverparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getUploadedFiles, arginfo_phalcon_http_message_serverrequest_getuploadedfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, __construct, arginfo_phalcon_http_message_serverrequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_ServerRequest, getAttribute, arginfo_phalcon_http_message_serverrequest_getattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getAttributes, arginfo_phalcon_http_message_serverrequest_getattributes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withAttribute, arginfo_phalcon_http_message_serverrequest_withattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withCookieParams, arginfo_phalcon_http_message_serverrequest_withcookieparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withParsedBody, arginfo_phalcon_http_message_serverrequest_withparsedbody, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withQueryParams, arginfo_phalcon_http_message_serverrequest_withqueryparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withUploadedFiles, arginfo_phalcon_http_message_serverrequest_withuploadedfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withoutAttribute, arginfo_phalcon_http_message_serverrequest_withoutattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, checkUploadedFiles, arginfo_phalcon_http_message_serverrequest_checkuploadedfiles, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_serverrequestfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequestFactory); - -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createServerRequest); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, load); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeaders); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, checkNullArray); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeader); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseHeaders); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseProtocol); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseServer); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles); -static PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUri); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_createserverrequest, 0, 2, Psr\\Http\\Message\\ServerRequestInterface, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serverParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, serverParams, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_load, 0, 0, Phalcon\\Http\\Message\\ServerRequest, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, server, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, server, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, get, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, post, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, post, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookies, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, cookies, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, files, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, files, 1) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_getheaders, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurihost, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurihostfromheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateuripath, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateuriquery, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurischeme, 0, 2, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_checknullarray, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, source) - ZEND_ARG_ARRAY_INFO(0, super, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_createuploadedfile, 0, 1, Phalcon\\Http\\Message\\UploadedFile, 0) - ZEND_ARG_ARRAY_INFO(0, file, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_getheader, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parsecookieheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, cookieHeader, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseheaders, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseprotocol, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseserver, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, server, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseuploadedfiles, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, files, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseuri, 0, 2, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_serverrequestfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, createServerRequest, arginfo_phalcon_http_message_serverrequestfactory_createserverrequest, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, load, arginfo_phalcon_http_message_serverrequestfactory_load, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeaders, arginfo_phalcon_http_message_serverrequestfactory_getheaders, ZEND_ACC_PROTECTED) -#else - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeaders, NULL, ZEND_ACC_PROTECTED) -#endif - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost, arginfo_phalcon_http_message_serverrequestfactory_calculateurihost, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader, arginfo_phalcon_http_message_serverrequestfactory_calculateurihostfromheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath, arginfo_phalcon_http_message_serverrequestfactory_calculateuripath, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery, arginfo_phalcon_http_message_serverrequestfactory_calculateuriquery, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme, arginfo_phalcon_http_message_serverrequestfactory_calculateurischeme, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, checkNullArray, arginfo_phalcon_http_message_serverrequestfactory_checknullarray, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile, arginfo_phalcon_http_message_serverrequestfactory_createuploadedfile, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeader, arginfo_phalcon_http_message_serverrequestfactory_getheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader, arginfo_phalcon_http_message_serverrequestfactory_parsecookieheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseHeaders, arginfo_phalcon_http_message_serverrequestfactory_parseheaders, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseProtocol, arginfo_phalcon_http_message_serverrequestfactory_parseprotocol, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseServer, arginfo_phalcon_http_message_serverrequestfactory_parseserver, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles, arginfo_phalcon_http_message_serverrequestfactory_parseuploadedfiles, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseUri, arginfo_phalcon_http_message_serverrequestfactory_parseuri, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_stream_input_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Input); - -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, __construct); -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, __toString); -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, getContents); -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, isWritable); -static PHP_METHOD(Phalcon_Http_Message_Stream_Input, read); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_input___construct, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_getcontents, 0, 0, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_iswritable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_input_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream_Input, __construct, arginfo_phalcon_http_message_stream_input___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#else - PHP_ME(Phalcon_Http_Message_Stream_Input, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#endif - PHP_ME(Phalcon_Http_Message_Stream_Input, __toString, arginfo_phalcon_http_message_stream_input___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, getContents, arginfo_phalcon_http_message_stream_input_getcontents, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, isWritable, arginfo_phalcon_http_message_stream_input_iswritable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, read, arginfo_phalcon_http_message_stream_input_read, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_stream_memory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Memory); - -static PHP_METHOD(Phalcon_Http_Message_Stream_Memory, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_memory___construct, 0, 0, 0) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_memory_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream_Memory, __construct, arginfo_phalcon_http_message_stream_memory___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_stream_temp_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Temp); - -static PHP_METHOD(Phalcon_Http_Message_Stream_Temp, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_temp___construct, 0, 0, 0) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_temp_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream_Temp, __construct, arginfo_phalcon_http_message_stream_temp___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_streamfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_StreamFactory); - -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStream); -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromFile); -static PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromResource); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstream, 0, 0, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstreamfromfile, 0, 1, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstreamfromresource, 0, 1, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_INFO(0, phpResource) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_streamfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_StreamFactory, createStream, arginfo_phalcon_http_message_streamfactory_createstream, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_StreamFactory, createStreamFromFile, arginfo_phalcon_http_message_streamfactory_createstreamfromfile, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_StreamFactory, createStreamFromResource, arginfo_phalcon_http_message_streamfactory_createstreamfromresource, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_uploadedfile_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFile); - -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientFilename); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientMediaType); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getError); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getSize); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, __construct); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getStream); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, moveTo); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkError); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkStream); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, getErrorDescription); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, storeFile); -static PHP_METHOD(Phalcon_Http_Message_UploadedFile, isBetween); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getclientfilename, 0, 0, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getclientmediatype, 0, 0, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_geterror, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getsize, 0, 0, IS_LONG, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uploadedfile___construct, 0, 0, 1) - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, clientFilename, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, clientMediaType, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getstream, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_moveto, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, targetPath) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_checkerror, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_checkstream, 0, 2, IS_VOID, 0) - - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_geterrordescription, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_storefile, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, targetPath, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_isbetween, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, from, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, to, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_uploadedfile_method_entry) { - PHP_ME(Phalcon_Http_Message_UploadedFile, getClientFilename, arginfo_phalcon_http_message_uploadedfile_getclientfilename, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getClientMediaType, arginfo_phalcon_http_message_uploadedfile_getclientmediatype, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getError, arginfo_phalcon_http_message_uploadedfile_geterror, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getSize, arginfo_phalcon_http_message_uploadedfile_getsize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, __construct, arginfo_phalcon_http_message_uploadedfile___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_UploadedFile, getStream, arginfo_phalcon_http_message_uploadedfile_getstream, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_UploadedFile, getStream, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_UploadedFile, moveTo, arginfo_phalcon_http_message_uploadedfile_moveto, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, checkError, arginfo_phalcon_http_message_uploadedfile_checkerror, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, checkStream, arginfo_phalcon_http_message_uploadedfile_checkstream, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, getErrorDescription, arginfo_phalcon_http_message_uploadedfile_geterrordescription, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, storeFile, arginfo_phalcon_http_message_uploadedfile_storefile, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, isBetween, arginfo_phalcon_http_message_uploadedfile_isbetween, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_uploadedfilefactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFileFactory); - -static PHP_METHOD(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uploadedfilefactory_createuploadedfile, 0, 1, Psr\\Http\\Message\\UploadedFileInterface, 0) - ZEND_ARG_OBJ_INFO(0, stream, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, clientFilename, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, clientMediaType, IS_STRING, 1) +#endif ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_http_message_uploadedfilefactory_method_entry) { - PHP_ME(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile, arginfo_phalcon_http_message_uploadedfilefactory_createuploadedfile, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_uri_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Uri); - -static PHP_METHOD(Phalcon_Http_Message_Uri, getFragment); -static PHP_METHOD(Phalcon_Http_Message_Uri, getHost); -static PHP_METHOD(Phalcon_Http_Message_Uri, getPath); -static PHP_METHOD(Phalcon_Http_Message_Uri, getPort); -static PHP_METHOD(Phalcon_Http_Message_Uri, getQuery); -static PHP_METHOD(Phalcon_Http_Message_Uri, getScheme); -static PHP_METHOD(Phalcon_Http_Message_Uri, __construct); -static PHP_METHOD(Phalcon_Http_Message_Uri, __toString); -static PHP_METHOD(Phalcon_Http_Message_Uri, getAuthority); -static PHP_METHOD(Phalcon_Http_Message_Uri, getUserInfo); -static PHP_METHOD(Phalcon_Http_Message_Uri, withFragment); -static PHP_METHOD(Phalcon_Http_Message_Uri, withPath); -static PHP_METHOD(Phalcon_Http_Message_Uri, withPort); -static PHP_METHOD(Phalcon_Http_Message_Uri, withQuery); -static PHP_METHOD(Phalcon_Http_Message_Uri, withScheme); -static PHP_METHOD(Phalcon_Http_Message_Uri, withUserInfo); -static PHP_METHOD(Phalcon_Http_Message_Uri, withHost); -static PHP_METHOD(Phalcon_Http_Message_Uri, checkValue); -static PHP_METHOD(Phalcon_Http_Message_Uri, filterFragment); -static PHP_METHOD(Phalcon_Http_Message_Uri, filterPath); -static PHP_METHOD(Phalcon_Http_Message_Uri, filterPort); -static PHP_METHOD(Phalcon_Http_Message_Uri, filterQuery); -static PHP_METHOD(Phalcon_Http_Message_Uri, filterScheme); -static PHP_METHOD(Phalcon_Http_Message_Uri, splitQueryValue); -static PHP_METHOD(Phalcon_Http_Message_Uri, getArrVal); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getfragment, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie___tostring, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_gethost, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_delete, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getpath, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getdomain, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getport, 0, 0, IS_LONG, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getexpiration, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getquery, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_gethttponly, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getscheme, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getname, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uri___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getoptions, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri___tostring, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getpath, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getauthority, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getsecure, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getuserinfo, 0, 0, IS_STRING, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_getvalue, 0, 0, 0) + ZEND_ARG_INFO(0, filters) + ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withfragment, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, fragment) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_isusingencryption, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withpath, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, path) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_restore, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withport, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, port) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_send, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withquery, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, query) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setdomain, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withscheme, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, scheme) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setexpiration, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withuserinfo, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, user) - ZEND_ARG_INFO(0, password) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_sethttponly, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withhost, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, host) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setoptions, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_checkvalue, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, suffix, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setpath, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterfragment, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, fragment, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsecure, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterpath, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsignkey, 0, 0, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterport, 0, 1, IS_LONG, 1) - ZEND_ARG_INFO(0, port) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setvalue, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterquery, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_useencryption, 0, 1, Phalcon\\Http\\Cookie\\CookieInterface, 0) + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterscheme, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, scheme, IS_STRING, 0) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_assertsignkeyislongenough, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_splitqueryvalue, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uri_getarrval, 0, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_getarrval, 0, 0, 2) ZEND_ARG_ARRAY_INFO(0, collection, 0) ZEND_ARG_INFO(0, index) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_http_message_uri_method_entry) { - PHP_ME(Phalcon_Http_Message_Uri, getFragment, arginfo_phalcon_http_message_uri_getfragment, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getHost, arginfo_phalcon_http_message_uri_gethost, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getPath, arginfo_phalcon_http_message_uri_getpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getPort, arginfo_phalcon_http_message_uri_getport, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getQuery, arginfo_phalcon_http_message_uri_getquery, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getScheme, arginfo_phalcon_http_message_uri_getscheme, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, __construct, arginfo_phalcon_http_message_uri___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_Uri, __toString, arginfo_phalcon_http_message_uri___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getAuthority, arginfo_phalcon_http_message_uri_getauthority, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getUserInfo, arginfo_phalcon_http_message_uri_getuserinfo, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withFragment, arginfo_phalcon_http_message_uri_withfragment, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withPath, arginfo_phalcon_http_message_uri_withpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withPort, arginfo_phalcon_http_message_uri_withport, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withQuery, arginfo_phalcon_http_message_uri_withquery, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withScheme, arginfo_phalcon_http_message_uri_withscheme, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withUserInfo, arginfo_phalcon_http_message_uri_withuserinfo, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withHost, arginfo_phalcon_http_message_uri_withhost, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, checkValue, arginfo_phalcon_http_message_uri_checkvalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterFragment, arginfo_phalcon_http_message_uri_filterfragment, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterPath, arginfo_phalcon_http_message_uri_filterpath, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterPort, arginfo_phalcon_http_message_uri_filterport, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterQuery, arginfo_phalcon_http_message_uri_filterquery, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterScheme, arginfo_phalcon_http_message_uri_filterscheme, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, splitQueryValue, arginfo_phalcon_http_message_uri_splitqueryvalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, getArrVal, arginfo_phalcon_http_message_uri_getarrval, ZEND_ACC_PRIVATE) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_message_urifactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UriFactory); - -static PHP_METHOD(Phalcon_Http_Message_UriFactory, createUri); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_urifactory_createuri, 0, 0, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_zephir_init_properties_phalcon_http_cookie, 0, 0, 0) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_http_message_urifactory_method_entry) { - PHP_ME(Phalcon_Http_Message_UriFactory, createUri, arginfo_phalcon_http_message_urifactory_createuri, ZEND_ACC_PUBLIC) +ZEPHIR_INIT_FUNCS(phalcon_http_cookie_method_entry) { + PHP_ME(Phalcon_Http_Cookie, __construct, arginfo_phalcon_http_cookie___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Http_Cookie, __toString, arginfo_phalcon_http_cookie___tostring, ZEND_ACC_PUBLIC) +#if PHP_VERSION_ID >= 80000 + PHP_ME(Phalcon_Http_Cookie, delete, arginfo_phalcon_http_cookie_delete, ZEND_ACC_PUBLIC) +#else + PHP_ME(Phalcon_Http_Cookie, delete, NULL, ZEND_ACC_PUBLIC) +#endif + PHP_ME(Phalcon_Http_Cookie, getDomain, arginfo_phalcon_http_cookie_getdomain, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getExpiration, arginfo_phalcon_http_cookie_getexpiration, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getHttpOnly, arginfo_phalcon_http_cookie_gethttponly, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getName, arginfo_phalcon_http_cookie_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getOptions, arginfo_phalcon_http_cookie_getoptions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getPath, arginfo_phalcon_http_cookie_getpath, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getSecure, arginfo_phalcon_http_cookie_getsecure, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getValue, arginfo_phalcon_http_cookie_getvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, isUsingEncryption, arginfo_phalcon_http_cookie_isusingencryption, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, restore, arginfo_phalcon_http_cookie_restore, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, send, arginfo_phalcon_http_cookie_send, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setDomain, arginfo_phalcon_http_cookie_setdomain, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setExpiration, arginfo_phalcon_http_cookie_setexpiration, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setHttpOnly, arginfo_phalcon_http_cookie_sethttponly, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setOptions, arginfo_phalcon_http_cookie_setoptions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setPath, arginfo_phalcon_http_cookie_setpath, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setSecure, arginfo_phalcon_http_cookie_setsecure, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setSignKey, arginfo_phalcon_http_cookie_setsignkey, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, setValue, arginfo_phalcon_http_cookie_setvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, useEncryption, arginfo_phalcon_http_cookie_useencryption, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, assertSignKeyIsLongEnough, arginfo_phalcon_http_cookie_assertsignkeyislongenough, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Http_Cookie, getArrVal, arginfo_phalcon_http_cookie_getarrval, ZEND_ACC_PRIVATE) PHP_FE_END }; +zend_class_entry *phalcon_http_cookie_exception_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Http_Cookie_Exception); + + zend_class_entry *phalcon_http_request_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_Request); @@ -23477,37 +23195,6 @@ ZEPHIR_INIT_FUNCS(phalcon_http_response_headers_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_http_server_abstractmiddleware_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractMiddleware); - -static PHP_METHOD(Phalcon_Http_Server_AbstractMiddleware, process); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_server_abstractmiddleware_process, 0, 2, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) - ZEND_ARG_OBJ_INFO(0, handler, Psr\\Http\\Server\\RequestHandlerInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_server_abstractmiddleware_method_entry) { - PHP_ME(Phalcon_Http_Server_AbstractMiddleware, process, arginfo_phalcon_http_server_abstractmiddleware_process, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_http_server_abstractrequesthandler_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractRequestHandler); - -static PHP_METHOD(Phalcon_Http_Server_AbstractRequestHandler, handle); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_server_abstractrequesthandler_handle, 0, 1, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_server_abstractrequesthandler_method_entry) { - PHP_ME(Phalcon_Http_Server_AbstractRequestHandler, handle, arginfo_phalcon_http_server_abstractrequesthandler_handle, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_FE_END -}; - zend_class_entry *phalcon_image_adapter_gd_ce; ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Gd); @@ -24041,6 +23728,11 @@ ZEPHIR_INIT_FUNCS(phalcon_logger_adapterfactory_method_entry) { PHP_FE_END }; +zend_class_entry *phalcon_logger_enum_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Logger_Enum); + + zend_class_entry *phalcon_logger_exception_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_Exception); @@ -24160,57 +23852,19 @@ zend_class_entry *phalcon_logger_logger_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_Logger); -static PHP_METHOD(Phalcon_Logger_Logger, getAdapters); -static PHP_METHOD(Phalcon_Logger_Logger, getLogLevel); -static PHP_METHOD(Phalcon_Logger_Logger, getName); -static PHP_METHOD(Phalcon_Logger_Logger, __construct); -static PHP_METHOD(Phalcon_Logger_Logger, addAdapter); static PHP_METHOD(Phalcon_Logger_Logger, alert); static PHP_METHOD(Phalcon_Logger_Logger, critical); static PHP_METHOD(Phalcon_Logger_Logger, debug); -static PHP_METHOD(Phalcon_Logger_Logger, error); static PHP_METHOD(Phalcon_Logger_Logger, emergency); -static PHP_METHOD(Phalcon_Logger_Logger, excludeAdapters); -static PHP_METHOD(Phalcon_Logger_Logger, getAdapter); +static PHP_METHOD(Phalcon_Logger_Logger, error); static PHP_METHOD(Phalcon_Logger_Logger, info); static PHP_METHOD(Phalcon_Logger_Logger, log); static PHP_METHOD(Phalcon_Logger_Logger, notice); -static PHP_METHOD(Phalcon_Logger_Logger, removeAdapter); -static PHP_METHOD(Phalcon_Logger_Logger, setAdapters); -static PHP_METHOD(Phalcon_Logger_Logger, setLogLevel); static PHP_METHOD(Phalcon_Logger_Logger, warning); -static PHP_METHOD(Phalcon_Logger_Logger, addMessage); -static PHP_METHOD(Phalcon_Logger_Logger, getLevels); -static PHP_METHOD(Phalcon_Logger_Logger, getLevelNumber); -zend_object *zephir_init_properties_Phalcon_Logger_Logger(zend_class_entry *class_type); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger_getadapters, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getloglevel, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getname, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -#endif - ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_addadapter, 0, 2, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) -ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_alert, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24220,7 +23874,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_critical, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24230,7 +23884,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_debug, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24238,9 +23892,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_debug, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, 1, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24248,9 +23902,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, 0, 1, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24258,21 +23912,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_excludeadapters, 0, 0, Phalcon\\Logger\\Logger, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_info, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24283,7 +23925,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_log, 0, 2, IS_VOID, 0) ZEND_ARG_INFO(0, level) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24293,7 +23935,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_notice, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -24301,30 +23943,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_notice, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_removeadapter, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_setadapters, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_setloglevel, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_warning, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, context, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_addmessage, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") @@ -24333,43 +23953,16 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_addmessage #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getlevels, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getlevelnumber, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, level) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger_zephir_init_properties_phalcon_logger_logger, 0, 0, 0) -ZEND_END_ARG_INFO() - ZEPHIR_INIT_FUNCS(phalcon_logger_logger_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Logger_Logger, getAdapters, arginfo_phalcon_logger_logger_getadapters, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Logger_Logger, getAdapters, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Logger_Logger, getLogLevel, arginfo_phalcon_logger_logger_getloglevel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, getName, arginfo_phalcon_logger_logger_getname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, __construct, arginfo_phalcon_logger_logger___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Logger_Logger, addAdapter, arginfo_phalcon_logger_logger_addadapter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, alert, arginfo_phalcon_logger_logger_alert, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, critical, arginfo_phalcon_logger_logger_critical, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, debug, arginfo_phalcon_logger_logger_debug, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, error, arginfo_phalcon_logger_logger_error, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, emergency, arginfo_phalcon_logger_logger_emergency, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, excludeAdapters, arginfo_phalcon_logger_logger_excludeadapters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, getAdapter, arginfo_phalcon_logger_logger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Logger, error, arginfo_phalcon_logger_logger_error, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, info, arginfo_phalcon_logger_logger_info, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, log, arginfo_phalcon_logger_logger_log, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, notice, arginfo_phalcon_logger_logger_notice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, removeAdapter, arginfo_phalcon_logger_logger_removeadapter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, setAdapters, arginfo_phalcon_logger_logger_setadapters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, setLogLevel, arginfo_phalcon_logger_logger_setloglevel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, warning, arginfo_phalcon_logger_logger_warning, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, addMessage, arginfo_phalcon_logger_logger_addmessage, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Logger_Logger, getLevels, arginfo_phalcon_logger_logger_getlevels, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Logger_Logger, getLevelNumber, arginfo_phalcon_logger_logger_getlevelnumber, ZEND_ACC_PRIVATE) PHP_FE_END }; @@ -24575,7 +24168,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offset ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -24909,22 +24506,26 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_notfound, 0, 1, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetexists, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 0, 1) - ZEND_ARG_INFO(0, alias) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 1, IS_NULL, 0) +#endif + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetset, 0, 2, IS_VOID, 0) - ZEND_ARG_INFO(0, alias) - ZEND_ARG_INFO(0, definition) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetunset, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_options, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) @@ -25134,12 +24735,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_setp ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_addmap, 0, 4, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_addmap, 0, 3, IS_VOID, 0) ZEND_ARG_INFO(0, method) ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) ZEND_ARG_INFO(0, handler) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_zephir_init_properties_phalcon_mvc_micro_collection, 0, 0, 0) @@ -25324,6 +24925,8 @@ static PHP_METHOD(Phalcon_Mvc_Model, useDynamicUpdate); static PHP_METHOD(Phalcon_Mvc_Model, validate); static PHP_METHOD(Phalcon_Mvc_Model, validationHasFailed); static PHP_METHOD(Phalcon_Mvc_Model, caseInsensitiveColumnMap); +static PHP_METHOD(Phalcon_Mvc_Model, __serialize); +static PHP_METHOD(Phalcon_Mvc_Model, __unserialize); zend_object *zephir_init_properties_Phalcon_Mvc_Model(zend_class_entry *class_type); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_gettransaction, 0, 0, IS_NULL, 1) @@ -25532,9 +25135,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 0, 1) - ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setconnectionservice, 0, 1, IS_VOID, 0) @@ -25683,7 +25292,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_belongsto, 0, 3 ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getpreparedquery, 0, 1, Phalcon\\Mvc\\Model\\QueryInterface, 0) @@ -25695,7 +25308,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmany, 0, 3, ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, 0, 6, Phalcon\\Mvc\\Model\\Relation, 0) @@ -25705,14 +25322,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasone, 0, 3, Phalcon\\Mvc\\Model\\Relation, 0) ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasonethrough, 0, 6, Phalcon\\Mvc\\Model\\Relation, 0) @@ -25722,7 +25347,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasonethrough, ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_keepsnapshots, 0, 1, IS_VOID, 0) @@ -25769,6 +25398,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_caseinsensitiv ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_zephir_init_properties_phalcon_mvc_model, 0, 0, 0) ZEND_END_ARG_INFO() @@ -25876,6 +25513,8 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, validate, arginfo_phalcon_mvc_model_validate, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, validationHasFailed, arginfo_phalcon_mvc_model_validationhasfailed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, caseInsensitiveColumnMap, arginfo_phalcon_mvc_model_caseinsensitivecolumnmap, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Mvc_Model, __serialize, arginfo_phalcon_mvc_model___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, __unserialize, arginfo_phalcon_mvc_model___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -26509,7 +26148,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhaso ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasonethrough, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -26520,7 +26163,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhaso ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelongsto, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -26528,7 +26175,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelo ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmany, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -26536,7 +26187,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasm ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmanytomany, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -26547,7 +26202,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasm ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existsbelongsto, 0, 2, _IS_BOOL, 0) @@ -27988,14 +27647,20 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize); +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __serialize); +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___construct, 0, 0, 1) ZEND_ARG_INFO(0, columnTypes) ZEND_ARG_OBJ_INFO(0, result, Phalcon\\Db\\ResultInterface, 1) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_toarray, 0, 0, IS_ARRAY, 0) @@ -28009,16 +27674,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_comp ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_complex_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __construct, arginfo_phalcon_mvc_model_resultset_complex___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, current, arginfo_phalcon_mvc_model_resultset_complex_current, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, current, NULL, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, toArray, arginfo_phalcon_mvc_model_resultset_complex_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, serialize, arginfo_phalcon_mvc_model_resultset_complex_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, unserialize, arginfo_phalcon_mvc_model_resultset_complex_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __serialize, arginfo_phalcon_mvc_model_resultset_complex___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __unserialize, arginfo_phalcon_mvc_model_resultset_complex___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -28031,12 +27702,14 @@ static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, current); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize); static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize); +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __serialize); +static PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___construct, 0, 0, 3) ZEND_ARG_INFO(0, columnMap) ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, result) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_ARG_TYPE_INFO(0, keepSnapshots, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -28055,12 +27728,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simp ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_simple_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __construct, arginfo_phalcon_mvc_model_resultset_simple___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, current, arginfo_phalcon_mvc_model_resultset_simple_current, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, toArray, arginfo_phalcon_mvc_model_resultset_simple_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, serialize, arginfo_phalcon_mvc_model_resultset_simple_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, unserialize, arginfo_phalcon_mvc_model_resultset_simple_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __serialize, arginfo_phalcon_mvc_model_resultset_simple___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __unserialize, arginfo_phalcon_mvc_model_resultset_simple___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -28081,7 +27764,11 @@ static PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_jsonserialize, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -30175,7 +29862,14 @@ static PHP_METHOD(Phalcon_Session_Adapter_Stream, gc); static PHP_METHOD(Phalcon_Session_Adapter_Stream, open); static PHP_METHOD(Phalcon_Session_Adapter_Stream, read); static PHP_METHOD(Phalcon_Session_Adapter_Stream, write); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, getArrVal); static PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileExists); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileGetContents); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFilePutContents); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFopen); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIniGet); +static PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream___construct, 0, 0, 0) #if PHP_VERSION_ID >= 80000 @@ -30186,12 +29880,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream___construct, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_INFO(0, maxlifetime) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_open, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, savePath) @@ -30199,18 +29903,53 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_o ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_getarrval, 0, 0, 2) + ZEND_ARG_ARRAY_INFO(0, collection, 0) + ZEND_ARG_INFO(0, index) + ZEND_ARG_INFO(0, defaultValue) + ZEND_ARG_TYPE_INFO(0, cast, IS_STRING, 1) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_getdirseparator, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfileexists, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfilegetcontents, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfileputcontents, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfopen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_phpiniget, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, varname, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_phpiswritable, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_session_adapter_stream_method_entry) { PHP_ME(Phalcon_Session_Adapter_Stream, __construct, arginfo_phalcon_session_adapter_stream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Session_Adapter_Stream, destroy, arginfo_phalcon_session_adapter_stream_destroy, ZEND_ACC_PUBLIC) @@ -30218,7 +29957,14 @@ ZEPHIR_INIT_FUNCS(phalcon_session_adapter_stream_method_entry) { PHP_ME(Phalcon_Session_Adapter_Stream, open, arginfo_phalcon_session_adapter_stream_open, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Stream, read, arginfo_phalcon_session_adapter_stream_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Stream, write, arginfo_phalcon_session_adapter_stream_write, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Stream, getArrVal, arginfo_phalcon_session_adapter_stream_getarrval, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Session_Adapter_Stream, getDirSeparator, arginfo_phalcon_session_adapter_stream_getdirseparator, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFileExists, arginfo_phalcon_session_adapter_stream_phpfileexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFileGetContents, arginfo_phalcon_session_adapter_stream_phpfilegetcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFilePutContents, arginfo_phalcon_session_adapter_stream_phpfileputcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFopen, arginfo_phalcon_session_adapter_stream_phpfopen, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpIniGet, arginfo_phalcon_session_adapter_stream_phpiniget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpIsWritable, arginfo_phalcon_session_adapter_stream_phpiswritable, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -30234,9 +29980,9 @@ static PHP_METHOD(Phalcon_Session_Bag, remove); static PHP_METHOD(Phalcon_Session_Bag, set); static PHP_METHOD(Phalcon_Session_Bag, setDI); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___construct, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, session, Phalcon\\Session\\ManagerInterface, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_clear, 0, 0, IS_VOID, 0) @@ -30312,6 +30058,7 @@ static PHP_METHOD(Phalcon_Session_Manager, setName); static PHP_METHOD(Phalcon_Session_Manager, setOptions); static PHP_METHOD(Phalcon_Session_Manager, start); static PHP_METHOD(Phalcon_Session_Manager, status); +static PHP_METHOD(Phalcon_Session_Manager, phpHeadersSent); static PHP_METHOD(Phalcon_Session_Manager, getUniqueKey); static PHP_METHOD(Phalcon_Session_Manager, getArrVal); zend_object *zephir_init_properties_Phalcon_Session_Manager(zend_class_entry *class_type); @@ -30372,7 +30119,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_getoptio ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_regenerateid, 0, 0, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_INFO(0, deleteOldSession) + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_remove, 0, 1, IS_VOID, 0) @@ -30391,7 +30138,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setadapte ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setid, 0, 1, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setname, 0, 1, Phalcon\\Session\\ManagerInterface, 0) @@ -30409,6 +30156,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_status, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_phpheaderssent, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_getuniquekey, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -30445,6 +30195,7 @@ ZEPHIR_INIT_FUNCS(phalcon_session_manager_method_entry) { PHP_ME(Phalcon_Session_Manager, setOptions, arginfo_phalcon_session_manager_setoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Manager, start, arginfo_phalcon_session_manager_start, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Manager, status, arginfo_phalcon_session_manager_status, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Manager, phpHeadersSent, arginfo_phalcon_session_manager_phpheaderssent, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Session_Manager, getUniqueKey, arginfo_phalcon_session_manager_getuniquekey, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Session_Manager, getArrVal, arginfo_phalcon_session_manager_getarrval, ZEND_ACC_PRIVATE) PHP_FE_END @@ -30502,43 +30253,30 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Base64); static PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize); static PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Base64, phpBase64Decode); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_base64_phpbase64decode, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_base64_method_entry) { PHP_ME(Phalcon_Storage_Serializer_Base64, serialize, arginfo_phalcon_storage_serializer_base64_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Serializer_Base64, unserialize, arginfo_phalcon_storage_serializer_base64_unserialize, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -zend_class_entry *phalcon_storage_serializer_igbinary_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary); - -static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize); -static PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_serialize, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_igbinary_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Storage_Serializer_Igbinary, serialize, arginfo_phalcon_storage_serializer_igbinary_serialize, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Storage_Serializer_Igbinary, serialize, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Storage_Serializer_Igbinary, unserialize, arginfo_phalcon_storage_serializer_igbinary_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_Base64, phpBase64Decode, arginfo_phalcon_storage_serializer_base64_phpbase64decode, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -30554,10 +30292,15 @@ static PHP_METHOD(Phalcon_Storage_Serializer_Json, getEncode); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_json_serialize, 0, 0, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_json_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_json_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_json_getdecode, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) @@ -30584,45 +30327,39 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_json_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_storage_serializer_msgpack_ce; +zend_class_entry *phalcon_storage_serializer_memcachedigbinary_ce; -ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack); +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedIgbinary); -static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize); -static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_serialize, 0, 0, IS_STRING, 1) -ZEND_END_ARG_INFO() +zend_class_entry *phalcon_storage_serializer_memcachedjson_ce; -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_unserialize, 0, 1, IS_VOID, 0) +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedJson); - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_msgpack_method_entry) { - PHP_ME(Phalcon_Storage_Serializer_Msgpack, serialize, arginfo_phalcon_storage_serializer_msgpack_serialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Serializer_Msgpack, unserialize, arginfo_phalcon_storage_serializer_msgpack_unserialize, ZEND_ACC_PUBLIC) - PHP_FE_END -}; +zend_class_entry *phalcon_storage_serializer_memcachedphp_ce; -zend_class_entry *phalcon_storage_serializer_none_ce; +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedPhp); -ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None); -static PHP_METHOD(Phalcon_Storage_Serializer_None, serialize); -static PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize); +zend_class_entry *phalcon_storage_serializer_msgpack_ce; -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_unserialize, 0, 1, IS_VOID, 0) +static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doSerialize); +static PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doUnserialize); - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_doserialize, 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_none_method_entry) { - PHP_ME(Phalcon_Storage_Serializer_None, serialize, arginfo_phalcon_storage_serializer_none_serialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Serializer_None, unserialize, arginfo_phalcon_storage_serializer_none_unserialize, ZEND_ACC_PUBLIC) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_dounserialize, 0, 0, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_msgpack_method_entry) { + PHP_ME(Phalcon_Storage_Serializer_Msgpack, doSerialize, arginfo_phalcon_storage_serializer_msgpack_doserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Msgpack, doUnserialize, arginfo_phalcon_storage_serializer_msgpack_dounserialize, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -30632,35 +30369,66 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Php); static PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize); static PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize); -static PHP_METHOD(Phalcon_Storage_Serializer_Php, processSerializable); -static PHP_METHOD(Phalcon_Storage_Serializer_Php, processNotSerializable); +static PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_processserializable, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() +#endif -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_processnotserializable, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_phpunserialize, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_phpunserialize, 0, 1, IS_NULL, 0) +#endif + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_php_method_entry) { PHP_ME(Phalcon_Storage_Serializer_Php, serialize, arginfo_phalcon_storage_serializer_php_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Serializer_Php, unserialize, arginfo_phalcon_storage_serializer_php_unserialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Serializer_Php, processSerializable, arginfo_phalcon_storage_serializer_php_processserializable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Storage_Serializer_Php, processNotSerializable, arginfo_phalcon_storage_serializer_php_processnotserializable, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Storage_Serializer_Php, phpUnserialize, arginfo_phalcon_storage_serializer_php_phpunserialize, ZEND_ACC_PRIVATE) PHP_FE_END }; +zend_class_entry *phalcon_storage_serializer_redisigbinary_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary); + + +zend_class_entry *phalcon_storage_serializer_redisjson_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson); + + +zend_class_entry *phalcon_storage_serializer_redismsgpack_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack); + + +zend_class_entry *phalcon_storage_serializer_redisnone_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone); + + +zend_class_entry *phalcon_storage_serializer_redisphp_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp); + + zend_class_entry *phalcon_storage_serializerfactory_ce; ZEPHIR_INIT_CLASS(Phalcon_Storage_SerializerFactory); @@ -32154,7 +31922,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsete ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() @@ -32693,6 +32465,7 @@ static PHP_METHOD(Phalcon_Translate_Adapter_Csv, exists); static PHP_METHOD(Phalcon_Translate_Adapter_Csv, has); static PHP_METHOD(Phalcon_Translate_Adapter_Csv, query); static PHP_METHOD(Phalcon_Translate_Adapter_Csv, load); +static PHP_METHOD(Phalcon_Translate_Adapter_Csv, toArray); static PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen); zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type); @@ -32726,6 +32499,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_csv_lo ZEND_ARG_TYPE_INFO(0, enclosure, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_csv_toarray, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_csv_phpfopen, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) @@ -32740,6 +32516,7 @@ ZEPHIR_INIT_FUNCS(phalcon_translate_adapter_csv_method_entry) { PHP_ME(Phalcon_Translate_Adapter_Csv, has, arginfo_phalcon_translate_adapter_csv_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, query, arginfo_phalcon_translate_adapter_csv_query, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, load, arginfo_phalcon_translate_adapter_csv_load, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Translate_Adapter_Csv, toArray, arginfo_phalcon_translate_adapter_csv_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, phpFopen, arginfo_phalcon_translate_adapter_csv_phpfopen, ZEND_ACC_PROTECTED) PHP_FE_END }; @@ -32884,6 +32661,7 @@ static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists); static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, has); static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound); static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query); +static PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, toArray); zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_nativearray___construct, 0, 0, 2) @@ -32912,6 +32690,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_native #endif ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_nativearray_toarray, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_nativearray_zephir_init_properties_phalcon_translate_adapter_nativearray, 0, 0, 0) ZEND_END_ARG_INFO() @@ -32921,6 +32702,7 @@ ZEPHIR_INIT_FUNCS(phalcon_translate_adapter_nativearray_method_entry) { PHP_ME(Phalcon_Translate_Adapter_NativeArray, has, arginfo_phalcon_translate_adapter_nativearray_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_NativeArray, notFound, arginfo_phalcon_translate_adapter_nativearray_notfound, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_NativeArray, query, arginfo_phalcon_translate_adapter_nativearray_query, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Translate_Adapter_NativeArray, toArray, arginfo_phalcon_translate_adapter_nativearray_toarray, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -33057,11 +32839,8 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure); static PHP_METHOD(phalcon_0__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_0__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_0__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_0__closure_method_entry) { @@ -33075,12 +32854,11 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure); static PHP_METHOD(phalcon_1__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_1__closure___invoke, 0, 0, 5) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_1__closure___invoke, 0, 0, 4) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, file) ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_1__closure_method_entry) { @@ -33094,8 +32872,12 @@ ZEPHIR_INIT_CLASS(phalcon_2__closure); static PHP_METHOD(phalcon_2__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_2__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_2__closure___invoke, 0, 0, 5) + ZEND_ARG_INFO(0, number) + ZEND_ARG_INFO(0, message) + ZEND_ARG_INFO(0, file) + ZEND_ARG_INFO(0, line) + ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_2__closure_method_entry) { @@ -33280,11 +33062,8 @@ ZEPHIR_INIT_CLASS(phalcon_13__closure); static PHP_METHOD(phalcon_13__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_13__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_13__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_13__closure_method_entry) { @@ -33298,12 +33077,8 @@ ZEPHIR_INIT_CLASS(phalcon_14__closure); static PHP_METHOD(phalcon_14__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_14__closure___invoke, 0, 0, 5) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_14__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_14__closure_method_entry) { @@ -33311,71 +33086,4 @@ ZEPHIR_INIT_FUNCS(phalcon_14__closure_method_entry) { PHP_FE_END }; -zend_class_entry *phalcon_15__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_15__closure); - -static PHP_METHOD(phalcon_15__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_15__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_15__closure_method_entry) { - PHP_ME(phalcon_15__closure, __invoke, arginfo_phalcon_15__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; - -zend_class_entry *phalcon_16__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_16__closure); - -static PHP_METHOD(phalcon_16__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_16__closure___invoke, 0, 0, 5) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_16__closure_method_entry) { - PHP_ME(phalcon_16__closure, __invoke, arginfo_phalcon_16__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; - -zend_class_entry *phalcon_17__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_17__closure); - -static PHP_METHOD(phalcon_17__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_17__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_17__closure_method_entry) { - PHP_ME(phalcon_17__closure, __invoke, arginfo_phalcon_17__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; - -zend_class_entry *phalcon_18__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_18__closure); - -static PHP_METHOD(phalcon_18__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_18__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_18__closure_method_entry) { - PHP_ME(phalcon_18__closure, __invoke, arginfo_phalcon_18__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; - #endif \ No newline at end of file diff --git a/build/phalcon/php_phalcon.h b/build/phalcon/php_phalcon.h index 1248e844a27..441ad16f97a 100644 --- a/build/phalcon/php_phalcon.h +++ b/build/phalcon/php_phalcon.h @@ -103,10 +103,10 @@ typedef zend_function zephir_fcall_cache_entry; #define PHP_PHALCON_NAME "phalcon" -#define PHP_PHALCON_VERSION "5.0.0beta3" +#define PHP_PHALCON_VERSION "5.0.0RC1" #define PHP_PHALCON_EXTNAME "phalcon" #define PHP_PHALCON_AUTHOR "Phalcon Team and contributors" -#define PHP_PHALCON_ZEPVERSION "0.15.2-5828ae2" +#define PHP_PHALCON_ZEPVERSION "0.16.0-4fac47b" #define PHP_PHALCON_DESCRIPTION "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance." typedef struct _zephir_struct_db { diff --git a/composer.json b/composer.json index d2ac917cb95..433add2571c 100644 --- a/composer.json +++ b/composer.json @@ -1,101 +1,93 @@ { - "name": "phalcon/cphalcon", - "description": "Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.", - "keywords": [ - "extension", - "phalcon", - "framework", - "high load", - "mvc", - "psr-3", - "psr-4", - "psr-7", - "psr-11", - "psr-13", - "psr-14", - "psr-15", - "psr-16", - "psr-17", - "psr-18" - ], - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Phalcon Team", - "email": "team@phalcon.io", - "homepage": "https://phalcon.io/en/team" - }, - { - "name": "Contributors", - "homepage": "https://github.com/phalcon/cphalcon/graphs/contributors" - } - ], - "require": { - "php": ">=7.4" + "name": "phalcon/cphalcon", + "description": "Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.", + "keywords": [ + "extension", + "phalcon", + "framework", + "high load", + "mvc" + ], + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Phalcon Team", + "email": "team@phalcon.io", + "homepage": "https://phalcon.io/en/team" }, - "require-dev": { - "ext-apcu": "*", - "ext-dom": "*", - "ext-gd": "*", - "ext-iconv": "*", - "ext-igbinary": "*", - "ext-imagick": "*", - "ext-intl": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-msgpack": "*", - "ext-pdo": "*", - "ext-psr": "^1.0", - "ext-redis": "*", - "ext-sqlite3": "*", - "ext-xml": "*", - "codeception/codeception": "^4.0", - "codeception/module-apc": "^1.0.0", - "codeception/module-asserts": "^1.0.0", - "codeception/module-cli": "^1.0.0", - "codeception/module-db": "^1.0.0", - "codeception/module-filesystem": "^1.0.0", - "codeception/module-phalcon5": "^1.0.0", - "codeception/module-redis": "^1.0.0", - "friendsofphp/php-cs-fixer": "~3.0", - "mustache/mustache": "^2.14.1", - "phalcon/ide-stubs": "^4.1", - "phpunit/phpunit": "^8.5", - "predis/predis": "^1.1", - "squizlabs/php_codesniffer": "^3.4", - "twig/twig": "~1.36", - "vimeo/psalm": "^4.7", - "vlucas/phpdotenv": "^2.5" - }, - "config": { - "optimize-autoloader": true, - "preferred-install": "dist", - "sort-packages": true, - "allow-plugins": { - "composer/package-versions-deprecated": true - } - }, - "autoload-dev": { - "psr-4": { - "Zephir\\Optimizers\\FunctionCall\\": "optimizers/", - "Phalcon\\Tests\\Unit\\": "tests/unit/", - "Phalcon\\Tests\\Integration\\": "tests/integration/", - "Phalcon\\Tests\\Database\\": "tests/database/", - "Phalcon\\Tests\\Controllers\\": "tests/_data/fixtures/controllers/", - "Phalcon\\Tests\\Fixtures\\": "tests/_data/fixtures/", - "Phalcon\\Tests\\Models\\": "tests/_data/fixtures/models/", - "Phalcon\\Tests\\Module\\": "tests/_support/Module/", - "Phalcon\\Tests\\Listener\\": "tests/_data/listener/", - "Phalcon\\Tests\\Db\\": "tests/_data/db/" - } - }, - "support": { - "email": "support@phalcon.io", - "issues": "https://github.com/phalcon/cphalcon/issues", - "forum": "https://phalcon.io/forum/", - "source": "https://github.com/phalcon/cphalcon", - "docs": "https://phalcon.io/docs/", - "rss": "https://blog.phalcon.io/rss" + { + "name": "Contributors", + "homepage": "https://github.com/phalcon/cphalcon/graphs/contributors" + } + ], + "require": { + "php": ">=7.4" + }, + "require-dev": { + "ext-apcu": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-igbinary": "*", + "ext-imagick": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-msgpack": "*", + "ext-pdo": "*", + "ext-redis": "*", + "ext-sqlite3": "*", + "ext-xml": "*", + "codeception/codeception": "^4.0", + "codeception/module-apc": "^1.0.0", + "codeception/module-asserts": "^1.0.0", + "codeception/module-cli": "^1.0.0", + "codeception/module-db": "^1.0.0", + "codeception/module-filesystem": "^1.0.0", + "codeception/module-memcache": "^2.0", + "codeception/module-phalcon5": "^1.0.0", + "codeception/module-redis": "^1.0.0", + "friendsofphp/php-cs-fixer": "~3.0", + "mustache/mustache": "^2.14.1", + "phalcon/ide-stubs": "^4.1", + "phalcon/zephir": "^0.16.0", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "squizlabs/php_codesniffer": "^3.4", + "twig/twig": "~1.36", + "vimeo/psalm": "^4.7", + "vlucas/phpdotenv": "^v5.4" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": { + "composer/package-versions-deprecated": true + } + }, + "autoload-dev": { + "psr-4": { + "Zephir\\Optimizers\\FunctionCall\\": "optimizers/", + "Phalcon\\Tests\\Cli\\": "tests/cli/", + "Phalcon\\Tests\\Unit\\": "tests/unit/", + "Phalcon\\Tests\\Integration\\": "tests/integration/", + "Phalcon\\Tests\\Database\\": "tests/database/", + "Phalcon\\Tests\\Controllers\\": "tests/_data/fixtures/controllers/", + "Phalcon\\Tests\\Fixtures\\": "tests/_data/fixtures/", + "Phalcon\\Tests\\Models\\": "tests/_data/fixtures/models/", + "Phalcon\\Tests\\Module\\": "tests/_support/Module/", + "Phalcon\\Tests\\Listener\\": "tests/_data/listener/", + "Phalcon\\Tests\\Db\\": "tests/_data/db/" } + }, + "support": { + "email": "support@phalcon.io", + "issues": "https://github.com/phalcon/cphalcon/issues", + "forum": "https://phalcon.io/forum/", + "source": "https://github.com/phalcon/cphalcon", + "docs": "https://phalcon.io/docs/", + "rss": "https://blog.phalcon.io/rss" + } } diff --git a/composer.lock b/composer.lock index 3aba3e89049..67d911a2443 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1015ca3bf5ff3a28b2526b2caabd21c5", + "content-hash": "cadb55c7b26af4d96bb0dc98963cd5be", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae" + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", "shasum": "" }, "require": { @@ -40,13 +40,13 @@ } }, "autoload": { - "psr-4": { - "Amp\\": "lib" - }, "files": [ "lib/functions.php", "lib/Internal/functions.php" - ] + ], + "psr-4": { + "Amp\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -71,7 +71,7 @@ } ], "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", + "homepage": "https://amphp.org/amp", "keywords": [ "async", "asynchronous", @@ -86,7 +86,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.1" + "source": "https://github.com/amphp/amp/tree/v2.6.2" }, "funding": [ { @@ -94,7 +94,7 @@ "type": "github" } ], - "time": "2021-09-23T18:43:08+00:00" + "time": "2022-02-20T17:52:18+00:00" }, { "name": "amphp/byte-stream", @@ -129,12 +129,12 @@ } }, "autoload": { - "psr-4": { - "Amp\\ByteStream\\": "lib" - }, "files": [ "lib/functions.php" - ] + ], + "psr-4": { + "Amp\\ByteStream\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -238,16 +238,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.28", + "version": "4.1.31", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "e9bc22a3819f9d356068c0e372193ebcc9b06014" + "reference": "15524571ae0686a7facc2eb1f40f600e5bbce9e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/e9bc22a3819f9d356068c0e372193ebcc9b06014", - "reference": "e9bc22a3819f9d356068c0e372193ebcc9b06014", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/15524571ae0686a7facc2eb1f40f600e5bbce9e5", + "reference": "15524571ae0686a7facc2eb1f40f600e5bbce9e5", "shasum": "" }, "require": { @@ -294,13 +294,13 @@ "branch-alias": [] }, "autoload": { + "files": [ + "functions.php" + ], "psr-4": { "Codeception\\": "src/Codeception", "Codeception\\Extension\\": "ext" - }, - "files": [ - "functions.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -324,7 +324,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.1.28" + "source": "https://github.com/Codeception/Codeception/tree/4.1.31" }, "funding": [ { @@ -332,7 +332,7 @@ "type": "open_collective" } ], - "time": "2022-01-05T16:41:25+00:00" + "time": "2022-03-13T17:07:08+00:00" }, { "name": "codeception/lib-asserts", @@ -602,16 +602,16 @@ }, { "name": "codeception/module-db", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-db.git", - "reference": "8c8076cd05d4db95798acd7dba2a56578210982c" + "reference": "04c3e66fbd3a3ced17fcccc49627f6393a97b04b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-db/zipball/8c8076cd05d4db95798acd7dba2a56578210982c", - "reference": "8c8076cd05d4db95798acd7dba2a56578210982c", + "url": "https://api.github.com/repos/Codeception/module-db/zipball/04c3e66fbd3a3ced17fcccc49627f6393a97b04b", + "reference": "04c3e66fbd3a3ced17fcccc49627f6393a97b04b", "shasum": "" }, "require": { @@ -648,9 +648,9 @@ ], "support": { "issues": "https://github.com/Codeception/module-db/issues", - "source": "https://github.com/Codeception/module-db/tree/1.1.0" + "source": "https://github.com/Codeception/module-db/tree/1.2.0" }, - "time": "2020-12-20T13:37:07+00:00" + "time": "2022-03-05T19:38:40+00:00" }, { "name": "codeception/module-filesystem", @@ -704,6 +704,55 @@ }, "time": "2020-10-24T14:46:40+00:00" }, + { + "name": "codeception/module-memcache", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-memcache.git", + "reference": "614237ba47d3ae75b51e0d12fcda0e3b982ecfbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-memcache/zipball/614237ba47d3ae75b51e0d12fcda0e3b982ecfbb", + "reference": "614237ba47d3ae75b51e0d12fcda0e3b982ecfbb", + "shasum": "" + }, + "require": { + "codeception/codeception": "^4.0", + "php": "^7.4 | ^8.0" + }, + "require-dev": { + "ext-memcache": "*", + "ext-memcached": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk" + } + ], + "description": "Memcache module for Codeception", + "homepage": "https://codeception.com/", + "keywords": [ + "codeception", + "memcache" + ], + "support": { + "issues": "https://github.com/Codeception/module-memcache/issues", + "source": "https://github.com/Codeception/module-memcache/tree/2.0.1" + }, + "time": "2022-05-27T05:35:21+00:00" + }, { "name": "codeception/module-phalcon5", "version": "v1.0.1", @@ -770,20 +819,20 @@ }, { "name": "codeception/module-phpbrowser", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/Codeception/module-phpbrowser.git", - "reference": "770a6be4160a5c0c08d100dd51bff35f6056bbf1" + "reference": "8ba6bede11d0914e74d98691f427fd8f397f192e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-phpbrowser/zipball/770a6be4160a5c0c08d100dd51bff35f6056bbf1", - "reference": "770a6be4160a5c0c08d100dd51bff35f6056bbf1", + "url": "https://api.github.com/repos/Codeception/module-phpbrowser/zipball/8ba6bede11d0914e74d98691f427fd8f397f192e", + "reference": "8ba6bede11d0914e74d98691f427fd8f397f192e", "shasum": "" }, "require": { - "codeception/codeception": "^4.0", + "codeception/codeception": "^4.1", "codeception/lib-innerbrowser": "^1.3", "guzzlehttp/guzzle": "^6.3|^7.0", "php": ">=5.6.0 <9.0" @@ -824,9 +873,9 @@ ], "support": { "issues": "https://github.com/Codeception/module-phpbrowser/issues", - "source": "https://github.com/Codeception/module-phpbrowser/tree/1.0.2" + "source": "https://github.com/Codeception/module-phpbrowser/tree/1.0.3" }, - "time": "2020-10-24T15:29:28+00:00" + "time": "2022-05-21T13:50:41+00:00" }, { "name": "codeception/module-redis", @@ -882,16 +931,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "8.1.4", + "version": "8.1.6", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "f41335f0b4dd17cf7bbc63e87943b3ae72a8bbc3" + "reference": "7d3479bab7e2b6349044db8af11cd05d57809f9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/f41335f0b4dd17cf7bbc63e87943b3ae72a8bbc3", - "reference": "f41335f0b4dd17cf7bbc63e87943b3ae72a8bbc3", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/7d3479bab7e2b6349044db8af11cd05d57809f9c", + "reference": "7d3479bab7e2b6349044db8af11cd05d57809f9c", "shasum": "" }, "require": { @@ -924,27 +973,27 @@ "description": "PHPUnit classes used by Codeception", "support": { "issues": "https://github.com/Codeception/phpunit-wrapper/issues", - "source": "https://github.com/Codeception/phpunit-wrapper/tree/8.1.4" + "source": "https://github.com/Codeception/phpunit-wrapper/tree/8.1.6" }, - "time": "2020-12-28T14:00:08+00:00" + "time": "2022-05-23T06:22:33+00:00" }, { "name": "codeception/stub", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/Codeception/Stub.git", - "reference": "ce0a9e418c775ca8b737d50c2b4ac1132f3990d8" + "reference": "18a148dacd293fc7b044042f5aa63a82b08bff5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/ce0a9e418c775ca8b737d50c2b4ac1132f3990d8", - "reference": "ce0a9e418c775ca8b737d50c2b4ac1132f3990d8", + "url": "https://api.github.com/repos/Codeception/Stub/zipball/18a148dacd293fc7b044042f5aa63a82b08bff5d", + "reference": "18a148dacd293fc7b044042f5aa63a82b08bff5d", "shasum": "" }, "require": { "php": "^7.4 | ^8.0", - "phpunit/phpunit": "^8.4 | ^9.0" + "phpunit/phpunit": "^8.4 | ^9.0 | ^10.0 | 10.0.x-dev" }, "require-dev": { "consolidation/robo": "^3.0" @@ -962,9 +1011,9 @@ "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", "support": { "issues": "https://github.com/Codeception/Stub/issues", - "source": "https://github.com/Codeception/Stub/tree/4.0.1" + "source": "https://github.com/Codeception/Stub/tree/4.0.2" }, - "time": "2022-01-08T09:35:36+00:00" + "time": "2022-01-31T19:25:15+00:00" }, { "name": "composer/package-versions-deprecated", @@ -1041,30 +1090,30 @@ }, { "name": "composer/pcre", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" + "symfony/phpunit-bridge": "^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1092,7 +1141,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" + "source": "https://github.com/composer/pcre/tree/3.0.0" }, "funding": [ { @@ -1108,27 +1157,27 @@ "type": "tidelift" } ], - "time": "2022-01-21T20:24:37+00:00" + "time": "2022-02-25T20:21:48+00:00" }, { "name": "composer/semver", - "version": "3.2.7", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", + "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", + "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -1173,7 +1222,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.7" + "source": "https://github.com/composer/semver/tree/3.3.2" }, "funding": [ { @@ -1189,24 +1238,24 @@ "type": "tidelift" } ], - "time": "2022-01-04T09:57:54+00:00" + "time": "2022-04-01T19:23:25+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "12f1b79476638a5615ed00ea6adbb269cec96fd8" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/12f1b79476638a5615ed00ea6adbb269cec96fd8", - "reference": "12f1b79476638a5615ed00ea6adbb269cec96fd8", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "composer/pcre": "^1", + "composer/pcre": "^1 || ^2 || ^3", "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, @@ -1239,7 +1288,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.1" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -1255,7 +1304,7 @@ "type": "tidelift" } ], - "time": "2022-01-04T18:29:42+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -1368,29 +1417,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -1417,7 +1467,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" }, "funding": [ { @@ -1433,20 +1483,20 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-03-03T08:28:38+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", "shasum": "" }, "require": { @@ -1454,7 +1504,7 @@ }, "require-dev": { "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "1.3", + "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "vimeo/psalm": "^4.11" }, @@ -1493,7 +1543,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.2" + "source": "https://github.com/doctrine/lexer/tree/1.2.3" }, "funding": [ { @@ -1509,7 +1559,7 @@ "type": "tidelift" } ], - "time": "2022-01-12T08:27:12+00:00" + "time": "2022-02-28T11:07:21+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -1558,16 +1608,16 @@ }, { "name": "felixfbecker/language-server-protocol", - "version": "1.5.1", + "version": "v1.5.2", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", - "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", + "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", "shasum": "" }, "require": { @@ -1608,27 +1658,27 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" }, - "time": "2021-02-22T14:02:09+00:00" + "time": "2022-03-02T22:36:06+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.5.0", + "version": "v3.8.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "333f15e07c866e33e2765e84ba1e0b88e6a3af3b" + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/333f15e07c866e33e2765e84ba1e0b88e6a3af3b", - "reference": "333f15e07c866e33e2765e84ba1e0b88e6a3af3b", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", "shasum": "" }, "require": { "composer/semver": "^3.2", - "composer/xdebug-handler": "^3.0", + "composer/xdebug-handler": "^3.0.3", "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", @@ -1640,8 +1690,8 @@ "symfony/finder": "^5.4 || ^6.0", "symfony/options-resolver": "^5.4 || ^6.0", "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.23", - "symfony/polyfill-php81": "^1.23", + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", "symfony/process": "^5.4 || ^6.0", "symfony/stopwatch": "^5.4 || ^6.0" }, @@ -1691,7 +1741,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.5.0" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" }, "funding": [ { @@ -1699,20 +1749,82 @@ "type": "github" } ], - "time": "2022-01-14T00:29:20+00:00" + "time": "2022-03-18T17:20:59+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "0690bde05318336c7221785f2a932467f98b64ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", + "reference": "0690bde05318336c7221785f2a932467f98b64ca", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2021-11-21T21:41:47+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.1", + "version": "7.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", "shasum": "" }, "require": { @@ -1745,12 +1857,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1807,7 +1919,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + "source": "https://github.com/guzzle/guzzle/tree/7.4.3" }, "funding": [ { @@ -1823,7 +1935,7 @@ "type": "tidelift" } ], - "time": "2021-12-06T18:43:05+00:00" + "time": "2022-05-25T13:24:33+00:00" }, { "name": "guzzlehttp/promises", @@ -1852,12 +1964,12 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1911,16 +2023,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", "shasum": "" }, "require": { @@ -1944,7 +2056,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -2006,7 +2118,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.2.1" }, "funding": [ { @@ -2022,7 +2134,111 @@ "type": "tidelift" } ], - "time": "2021-10-06T17:43:30+00:00" + "time": "2022-03-20T21:55:58+00:00" + }, + { + "name": "monolog/monolog", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "247918972acd74356b0a91dfaa5adcaec069b6c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/247918972acd74356b0a91dfaa5adcaec069b6c0", + "reference": "247918972acd74356b0a91dfaa5adcaec069b6c0", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.15", + "phpstan/phpstan": "^0.12.91", + "phpunit/phpunit": "^8.5.14", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": "^7", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.6.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-05-10T09:36:00+00:00" }, { "name": "mustache/mustache", @@ -2076,34 +2292,38 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2119,7 +2339,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" }, "funding": [ { @@ -2127,7 +2347,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-03-03T13:19:32+00:00" }, { "name": "netresearch/jsonmapper", @@ -2356,6 +2576,94 @@ ], "time": "2020-11-13T10:58:11+00:00" }, + { + "name": "phalcon/zephir", + "version": "0.16.0", + "source": { + "type": "git", + "url": "https://github.com/zephir-lang/zephir.git", + "reference": "4fac47bacac2fac3c23548b409ea952c556c1c2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zephir-lang/zephir/zipball/4fac47bacac2fac3c23548b409ea952c556c1c2d", + "reference": "4fac47bacac2fac3c23548b409ea952c556c1c2d", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-pcre": "*", + "ext-xml": "*", + "ext-zlib": "*", + "monolog/monolog": "^2.3", + "php": ">=7.4.1", + "symfony/console": "^5.2", + "symfony/event-dispatcher": "^5.3" + }, + "require-dev": { + "ext-gmp": "*", + "ext-pdo": "*", + "ext-pdo_sqlite": "*", + "ext-zip": "*", + "phpunit/phpunit": "^9.5", + "psr/log": "1.1.*" + }, + "bin": [ + "zephir" + ], + "type": "library", + "autoload": { + "files": [ + "Library/functions.php" + ], + "psr-4": { + "Zephir\\": "Library" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Phalcon Team", + "email": "team@zephir-lang.com", + "homepage": "https://zephir-lang.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/zephir-lang/zephir/graphs/contributors" + } + ], + "description": "Zephir is a compiled high level language aimed to the creation of C-extensions for PHP", + "homepage": "https://zephir-lang.com", + "keywords": [ + "extension", + "internals", + "phalcon", + "zephir" + ], + "support": { + "docs": "https://docs.zephir-lang.com", + "irc": "irc://irc.freenode.net/zephir", + "issues": "https://github.com/zephir-lang/zephir/issues?state=open", + "source": "https://github.com/zephir-lang/zephir" + }, + "funding": [ + { + "url": "https://opencollective.com/phalcon", + "type": "custom" + }, + { + "url": "https://github.com/phalcon", + "type": "github" + } + ], + "time": "2022-03-21T09:31:27+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -2418,16 +2726,16 @@ }, { "name": "phar-io/version", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { @@ -2463,9 +2771,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "php-cs-fixer/diff", @@ -2631,16 +2939,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + "reference": "77a32518733312af16a44300404e945338981de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", "shasum": "" }, "require": { @@ -2675,9 +2983,80 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + }, + "time": "2022-03-15T21:29:03+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.8.1" }, - "time": "2022-01-04T19:58:01+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2021-12-04T23:24:31+00:00" }, { "name": "phpspec/prophecy", @@ -3045,16 +3424,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.23", + "version": "8.5.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "efb20ff3623b9d09bf190a68fdfe574538a8d496" + "reference": "ef117c59fc4c54a979021b26d08a3373e386606d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/efb20ff3623b9d09bf190a68fdfe574538a8d496", - "reference": "efb20ff3623b9d09bf190a68fdfe574538a8d496", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef117c59fc4c54a979021b26d08a3373e386606d", + "reference": "ef117c59fc4c54a979021b26d08a3373e386606d", "shasum": "" }, "require": { @@ -3126,7 +3505,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.23" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.26" }, "funding": [ { @@ -3138,7 +3517,7 @@ "type": "github" } ], - "time": "2022-01-21T05:50:34+00:00" + "time": "2022-04-01T12:34:39+00:00" }, { "name": "predis/predis", @@ -3944,16 +4323,16 @@ }, { "name": "sebastian/global-state", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" + "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", + "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", "shasum": "" }, "require": { @@ -3996,7 +4375,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" }, "funding": [ { @@ -4004,7 +4383,7 @@ "type": "github" } ], - "time": "2020-11-30T07:43:24+00:00" + "time": "2022-02-10T06:55:38+00:00" }, { "name": "sebastian/object-enumerator", @@ -4394,16 +4773,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "1fb93b0aab42392aa0a742db205173b49afaf80f" + "reference": "18e73179c6a33d520de1b644941eba108dd811ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/1fb93b0aab42392aa0a742db205173b49afaf80f", - "reference": "1fb93b0aab42392aa0a742db205173b49afaf80f", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/18e73179c6a33d520de1b644941eba108dd811ad", + "reference": "18e73179c6a33d520de1b644941eba108dd811ad", "shasum": "" }, "require": { @@ -4446,7 +4825,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.2" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.3" }, "funding": [ { @@ -4462,20 +4841,20 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:58:21+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/console", - "version": "v5.4.2", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", + "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", "shasum": "" }, "require": { @@ -4545,7 +4924,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.2" + "source": "https://github.com/symfony/console/tree/v5.4.9" }, "funding": [ { @@ -4561,20 +4940,20 @@ "type": "tidelift" } ], - "time": "2021-12-20T16:11:12+00:00" + "time": "2022-05-18T06:17:34+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "cfcbee910e159df402603502fe387e8b677c22fd" + "reference": "b0a190285cd95cb019237851205b8140ef6e368e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/cfcbee910e159df402603502fe387e8b677c22fd", - "reference": "cfcbee910e159df402603502fe387e8b677c22fd", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e", + "reference": "b0a190285cd95cb019237851205b8140ef6e368e", "shasum": "" }, "require": { @@ -4611,7 +4990,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.2" + "source": "https://github.com/symfony/css-selector/tree/v5.4.3" }, "funding": [ { @@ -4627,20 +5006,20 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:58:21+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { @@ -4678,7 +5057,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -4694,20 +5073,20 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.4.2", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "bb3bc3699779fc6d9646270789026a7e2cec7ec7" + "reference": "a213cbc80382320b0efdccdcdce232f191fafe3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/bb3bc3699779fc6d9646270789026a7e2cec7ec7", - "reference": "bb3bc3699779fc6d9646270789026a7e2cec7ec7", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/a213cbc80382320b0efdccdcdce232f191fafe3a", + "reference": "a213cbc80382320b0efdccdcdce232f191fafe3a", "shasum": "" }, "require": { @@ -4753,7 +5132,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.2" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.9" }, "funding": [ { @@ -4769,20 +5148,20 @@ "type": "tidelift" } ], - "time": "2021-12-28T17:15:56+00:00" + "time": "2022-05-04T14:46:32+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.0", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", "shasum": "" }, "require": { @@ -4838,7 +5217,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" }, "funding": [ { @@ -4854,20 +5233,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-05-05T16:45:39+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", "shasum": "" }, "require": { @@ -4917,7 +5296,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.1" }, "funding": [ { @@ -4933,20 +5312,20 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.0", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba", + "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba", "shasum": "" }, "require": { @@ -4981,7 +5360,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + "source": "https://github.com/symfony/filesystem/tree/v5.4.9" }, "funding": [ { @@ -4997,20 +5376,20 @@ "type": "tidelift" } ], - "time": "2021-10-28T13:39:27+00:00" + "time": "2022-05-20T13:55:35+00:00" }, { "name": "symfony/finder", - "version": "v5.4.2", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e77046c252be48c48a40816187ed527703c8f76c" + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", - "reference": "e77046c252be48c48a40816187ed527703c8f76c", + "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", + "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", "shasum": "" }, "require": { @@ -5044,7 +5423,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.2" + "source": "https://github.com/symfony/finder/tree/v5.4.8" }, "funding": [ { @@ -5060,20 +5439,20 @@ "type": "tidelift" } ], - "time": "2021-12-15T11:06:13+00:00" + "time": "2022-04-15T08:07:45+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.0", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847" + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8", + "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8", "shasum": "" }, "require": { @@ -5113,7 +5492,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.3" }, "funding": [ { @@ -5129,11 +5508,11 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -5165,12 +5544,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5195,7 +5574,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -5215,7 +5594,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -5244,12 +5623,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5276,7 +5655,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -5296,7 +5675,7 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -5325,12 +5704,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -5360,7 +5739,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -5380,7 +5759,7 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", @@ -5412,12 +5791,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5443,7 +5822,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -5463,7 +5842,7 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -5489,12 +5868,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -5522,7 +5901,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" }, "funding": [ { @@ -5542,16 +5921,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -5568,12 +5947,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -5605,7 +5984,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -5621,11 +6000,11 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:33+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.24.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", @@ -5651,12 +6030,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -5684,7 +6063,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" }, "funding": [ { @@ -5704,16 +6083,16 @@ }, { "name": "symfony/process", - "version": "v5.4.2", + "version": "v5.4.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", + "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3", "shasum": "" }, "require": { @@ -5746,7 +6125,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.2" + "source": "https://github.com/symfony/process/tree/v5.4.8" }, "funding": [ { @@ -5762,26 +6141,26 @@ "type": "tidelift" } ], - "time": "2021-12-27T21:01:00+00:00" + "time": "2022-04-08T05:07:18+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -5829,7 +6208,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" }, "funding": [ { @@ -5845,20 +6224,20 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2022-03-13T20:07:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.0", + "version": "v5.4.5", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", + "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30", "shasum": "" }, "require": { @@ -5891,7 +6270,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.5" }, "funding": [ { @@ -5907,20 +6286,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2022-02-18T16:06:09+00:00" }, { "name": "symfony/string", - "version": "v5.4.2", + "version": "v5.4.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", "shasum": "" }, "require": { @@ -5942,12 +6321,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -5977,7 +6356,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.2" + "source": "https://github.com/symfony/string/tree/v5.4.9" }, "funding": [ { @@ -5993,20 +6372,20 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:52:00+00:00" + "time": "2022-04-19T10:40:37+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58" + "reference": "e80f87d2c9495966768310fc531b487ce64237a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b9eb163846a61bb32dfc147f7859e274fab38b58", - "reference": "b9eb163846a61bb32dfc147f7859e274fab38b58", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", + "reference": "e80f87d2c9495966768310fc531b487ce64237a2", "shasum": "" }, "require": { @@ -6052,7 +6431,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.2" + "source": "https://github.com/symfony/yaml/tree/v5.4.3" }, "funding": [ { @@ -6068,7 +6447,7 @@ "type": "tidelift" } ], - "time": "2021-12-16T21:58:21+00:00" + "time": "2022-01-26T16:32:32+00:00" }, { "name": "theseer/tokenizer", @@ -6200,16 +6579,16 @@ }, { "name": "vimeo/psalm", - "version": "4.18.1", + "version": "4.23.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb" + "reference": "f1fe6ff483bf325c803df9f510d09a03fd796f88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", - "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/f1fe6ff483bf325c803df9f510d09a03fd796f88", + "reference": "f1fe6ff483bf325c803df9f510d09a03fd796f88", "shasum": "" }, "require": { @@ -6234,6 +6613,7 @@ "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.25", "webmozart/path-util": "^2.3" }, "provide": { @@ -6275,13 +6655,13 @@ } }, "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - }, "files": [ "src/functions.php", "src/spl_object_id.php" - ] + ], + "psr-4": { + "Psalm\\": "src/Psalm/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6300,41 +6680,45 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.18.1" + "source": "https://github.com/vimeo/psalm/tree/4.23.0" }, - "time": "2022-01-08T21:21:26+00:00" + "time": "2022-04-28T17:35:49+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v2.6.9", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141" + "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141", - "reference": "2e93cc98e2e8e869f8d9cfa61bb3a99ba4fc4141", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f", + "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f", "shasum": "" }, "require": { - "php": "^5.3.9 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.17" + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "ext-pcre": "*", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21" + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" }, "suggest": { - "ext-filter": "Required to use the boolean validator.", - "ext-pcre": "Required to use most of the library." + "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -6366,7 +6750,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v2.6.9" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1" }, "funding": [ { @@ -6378,7 +6762,7 @@ "type": "tidelift" } ], - "time": "2021-12-12T22:59:22+00:00" + "time": "2021-12-12T23:22:04+00:00" }, { "name": "webmozart/assert", @@ -6511,7 +6895,6 @@ "ext-mbstring": "*", "ext-msgpack": "*", "ext-pdo": "*", - "ext-psr": "^1.0", "ext-redis": "*", "ext-sqlite3": "*", "ext-xml": "*" diff --git a/config.json b/config.json index a73b4ec7f76..c17a17c4797 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "name": "phalcon", "description": "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance.", "author": "Phalcon Team and contributors", - "version": "5.0.0beta3", + "version": "5.0.0RC1", "verbose": false, "stubs": { "path": "ide\/%version%\/%namespace%\/", @@ -20,8 +20,7 @@ "SPL", "standard", "hash", - "json", - "psr" + "json" ] }, diff --git a/docker-compose-local.yml b/docker-compose-local.yml index c3f808322b6..5622be28068 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -19,6 +19,14 @@ services: volumes: - .:/srv + cphalcon-8.1: + container_name: cphalcon-8.1 + hostname: cphalcon-81 + build: docker/8.1 + working_dir: /srv + volumes: + - .:/srv + mysql: container_name: cphalcon-mysql image: mysql:5.7 diff --git a/docker-compose.yml b/docker-compose.yml index a446d1a3e96..3c780fc7d56 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,11 +19,19 @@ services: volumes: - .:/srv + cphalcon-8.1: + container_name: cphalcon-8.1 + hostname: cphalcon-81 + build: docker/8.1 + working_dir: /srv + volumes: + - .:/srv + mysql: container_name: cphalcon-mysql image: mysql:5.7 ports: - - 3306:3306 + - "3306:3306" environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_USER=phalcon @@ -34,7 +42,7 @@ services: container_name: cphalcon-postgres image: postgres:12-alpine ports: - - 5432:5432 + - "5432:5432" environment: - POSTGRES_PASSWORD=secret - POSTGRES_USER=phalcon @@ -44,10 +52,8 @@ services: container_name: cphalcon-redis image: redis:5-alpine ports: - - 6379:6379 + - "6379:6379" memcached: container_name: cphalcon-memcached image: memcached:1.5-alpine -# ports: -# - 11211:11211 diff --git a/docker/7.4/.bashrc b/docker/7.4/.bashrc index 345094d1019..377b2785780 100644 --- a/docker/7.4/.bashrc +++ b/docker/7.4/.bashrc @@ -1,6 +1,6 @@ #!/bin/bash -ZEPHIR_VERSION="0.15.2" +ZEPHIR_VERSION="0.16.0" # Easier navigation: .., ..., ...., ....., ~ and - alias ..="cd .." @@ -89,3 +89,12 @@ alias phpcs='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcs ' alias phpcbf='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcbf ' alias psalm='php ./vendor/bin/psalm ' +alias test-unit='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit' +alias test-cli='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli' +alias test-integration='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration' +alias test-db-common='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common' +alias test-db-mysql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql' +alias test-db-pgsql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql' +alias test-db-sqlite='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite' +alias test-db='test-db-common && test-db-mysql && test-db-pgsql && test-db-sqlite' +alias test-all='test-unit && test-cli && test-integration && test-db' diff --git a/docker/7.4/Dockerfile b/docker/7.4/Dockerfile index 1eb20af9b7d..a6edf645c15 100644 --- a/docker/7.4/Dockerfile +++ b/docker/7.4/Dockerfile @@ -13,7 +13,6 @@ ENV MY_USER="phalcon" \ MY_UID="1000" \ MY_GID="1000" \ PHP_VERSION="7.4" \ - PSR_VERSION="1.1.0" \ LANG=en_US.UTF-8 \ LANGUAGE=en_US.UTF-8 \ LC_ALL=en_US.UTF-8 @@ -45,8 +44,7 @@ RUN apt update -y && \ # PECL Packages RUN pecl install -o -f redis && \ - pecl install psr-${PSR_VERSION} \ - igbinary \ + pecl install igbinary \ msgpack \ apcu \ yaml \ @@ -78,7 +76,6 @@ RUN docker-php-ext-install \ # Install PHP extensions RUN docker-php-ext-enable \ - psr \ gettext \ redis \ igbinary \ diff --git a/docker/8.0/.bashrc b/docker/8.0/.bashrc index a8c943aeccb..377b2785780 100644 --- a/docker/8.0/.bashrc +++ b/docker/8.0/.bashrc @@ -1,6 +1,6 @@ #!/bin/bash -ZEPHIR_VERSION="0.15.2" +ZEPHIR_VERSION="0.16.0" # Easier navigation: .., ..., ...., ....., ~ and - alias ..="cd .." @@ -88,3 +88,13 @@ alias codecept='php -d extension=ext/modules/phalcon.so ./vendor/bin/codecept ' alias phpcs='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcs ' alias phpcbf='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcbf ' alias psalm='php ./vendor/bin/psalm ' + +alias test-unit='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit' +alias test-cli='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli' +alias test-integration='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration' +alias test-db-common='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common' +alias test-db-mysql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql' +alias test-db-pgsql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql' +alias test-db-sqlite='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite' +alias test-db='test-db-common && test-db-mysql && test-db-pgsql && test-db-sqlite' +alias test-all='test-unit && test-cli && test-integration && test-db' diff --git a/docker/8.0/Dockerfile b/docker/8.0/Dockerfile index 32f0305b2f5..de851823954 100644 --- a/docker/8.0/Dockerfile +++ b/docker/8.0/Dockerfile @@ -13,7 +13,6 @@ ENV MY_USER="phalcon" \ MY_UID="1000" \ MY_GID="1000" \ PHP_VERSION="8.0" \ - PSR_VERSION="1.1.0" \ LANG=en_US.UTF-8 \ LANGUAGE=en_US.UTF-8 \ LC_ALL=en_US.UTF-8 @@ -45,8 +44,7 @@ RUN apt update -y && \ # PECL Packages RUN pecl install -o -f redis && \ - pecl install psr-${PSR_VERSION} \ - igbinary \ + pecl install igbinary \ msgpack \ apcu \ yaml \ @@ -55,13 +53,6 @@ RUN pecl install -o -f redis && \ xdebug \ zephir_parser -# Remove this RUN when imagick will be available via pecl -RUN cd /opt && \ - git clone https://github.com/Jeckerson/imagick.git && \ - cd imagick && \ - phpize && ./configure && \ - make && make install - # Locale RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \ sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \ @@ -85,7 +76,6 @@ RUN docker-php-ext-install \ # Install PHP extensions RUN docker-php-ext-enable \ - psr \ gettext \ redis \ igbinary \ diff --git a/docker/8.1/.bashrc b/docker/8.1/.bashrc new file mode 100644 index 00000000000..a4915d97793 --- /dev/null +++ b/docker/8.1/.bashrc @@ -0,0 +1,100 @@ +#!/bin/bash + +ZEPHIR_VERSION="0.15.2" + +# Easier navigation: .., ..., ...., ....., ~ and - +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ~="cd ~" # `cd` is probably faster to type though +alias -- -="cd -" + +# Shortcuts +alias g="git" +alias h="history" + +# Detect which `ls` flavor is in use +if ls --color > /dev/null 2>&1; then # GNU `ls` + colorflag="--color" +else # OS X `ls` + colorflag="-G" +fi + +# List all files colorized in long format +# shellcheck disable=SC2139 +alias l="ls -lF ${colorflag}" + +# List all files colorized in long format, including dot files +# shellcheck disable=SC2139 +alias la="ls -laF ${colorflag}" + +# List only directories +# shellcheck disable=SC2139 +alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" + +# See: https://superuser.com/a/656746/280737 +alias ll='LC_ALL="C.UTF-8" ls -alF' + +# Always use color output for `ls` +# shellcheck disable=SC2139 +alias ls="command ls ${colorflag}" +export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' + +# Always enable colored `grep` output +alias grep='grep --color=auto ' + +# Enable aliases to be sudo’ed +alias sudo='sudo ' + +# Get week number +alias week='date +%V' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +# Canonical hex dump; some systems have this symlinked +command -v hd > /dev/null || alias hd="hexdump -C" + +# vhosts +alias hosts='sudo nano /etc/hosts' + +# copy working directory +alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' + +# copy file interactive +alias cp='cp -i' + +# move file interactive +alias mv='mv -i' + +# untar +alias untar='tar xvf' + +# Zephir related +alias untar='tar xvf' + +if [ ! -f ./zephir ]; then + wget --no-clobber -O ./zephir https://github.com/phalcon/zephir/releases/download/$ZEPHIR_VERSION/zephir.phar + chmod +x ./zephir +fi + +alias zephir='./zephir ' +alias zf='./zephir fullclean' +alias zg='./zephir generate' +alias zs='./zephir stubs' +alias cpl='zf && zg && cd ext/ && ./install && ..' +alias codecept='php -d extension=ext/modules/phalcon.so ./vendor/bin/codecept ' +alias phpcs='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcs ' +alias phpcbf='php -d extension=ext/modules/phalcon.so ./vendor/bin/phpcbf ' +alias psalm='php ./vendor/bin/psalm ' + +alias test-unit='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit' +alias test-cli='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli' +alias test-integration='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration' +alias test-db-common='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common' +alias test-db-mysql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql' +alias test-db-pgsql='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql' +alias test-db-sqlite='php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite' +alias test-db='test-db-common && test-db-mysql && test-db-pgsql && test-db-sqlite' +alias test-all='test-unit && test-cli && test-integration && test-db' diff --git a/docker/8.1/Dockerfile b/docker/8.1/Dockerfile new file mode 100644 index 00000000000..b9fb4d8dec9 --- /dev/null +++ b/docker/8.1/Dockerfile @@ -0,0 +1,95 @@ +FROM composer:latest as composer +FROM php:8.1-fpm + +# Compilation parameters +RUN CPU_CORES="$(getconf _NPROCESSORS_ONLN)"; +ENV MAKEFLAGS="-j${CPU_CORES}" + +ADD ./extra.ini /usr/local/etc/php/conf.d/ + +# User/Group globals +ENV MY_USER="phalcon" \ + MY_GROUP="phalcon" \ + MY_UID="1000" \ + MY_GID="1000" \ + PHP_VERSION="8.1" \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + LC_ALL=en_US.UTF-8 + +# User and Group +RUN set -eux && \ + groupadd -g ${MY_GID} -r ${MY_GROUP} && \ + useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} + +# Update +RUN apt update -y && \ + apt install -y \ + apt-utils \ + gettext \ + git \ + libgmp-dev \ + libicu-dev \ + libmagickwand-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libyaml-dev \ + libzip-dev \ + locales \ + nano \ + sudo \ + wget \ + zip + +# PECL Packages +RUN pecl install -o -f redis && \ + pecl install igbinary \ + msgpack \ + apcu \ + yaml \ + imagick \ + memcached \ + xdebug \ + zephir_parser + +# Locale +RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \ + sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \ + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \ + sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales && \ + update-locale LANG=en_US.UTF-8 + +# Install PHP extensions +RUN docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd + +RUN docker-php-ext-install \ + gd \ + gettext \ + gmp \ + intl \ + pdo_mysql \ + pdo_pgsql \ + zip + +# Install PHP extensions +RUN docker-php-ext-enable \ + redis \ + igbinary \ + msgpack \ + apcu \ + imagick \ + yaml \ + memcached \ + xdebug \ + zephir_parser + +# Composer +COPY --from=composer /usr/bin/composer /usr/local/bin/composer +# Bash script with helper aliases +COPY ./.bashrc /root/.bashrc +COPY ./.bashrc /home/phalcon/.bashrc + +CMD ["php-fpm"] diff --git a/docker/8.1/extra.ini b/docker/8.1/extra.ini new file mode 100644 index 00000000000..24836dbb58b --- /dev/null +++ b/docker/8.1/extra.ini @@ -0,0 +1,3 @@ +memory_limit=512M +apc.enable_cli="On" +session.save_path="/tmp" diff --git a/ext/config.m4 b/ext/config.m4 index 57c80081f53..5a9d629271c 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -20,6 +20,8 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/di/abstractinjectionaware.zep.c phalcon/storage/adapter/adapterinterface.zep.c phalcon/factory/abstractfactory.zep.c + phalcon/storage/serializer/serializerinterface.zep.c + phalcon/storage/serializer/abstractserializer.zep.c phalcon/di/injectable.zep.c phalcon/forms/element/elementinterface.zep.c phalcon/forms/element/abstractelement.zep.c @@ -27,27 +29,25 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/storage/adapter/abstractadapter.zep.c phalcon/support/collection.zep.c phalcon/support/helper/arr/abstractarr.zep.c + phalcon/storage/serializer/none.zep.c phalcon/dispatcher/dispatcherinterface.zep.c phalcon/encryption/crypt/padding/padinterface.zep.c phalcon/filter/validation/validator/file/abstractfile.zep.c - phalcon/storage/serializer/serializerinterface.zep.c phalcon/assets/assetinterface.zep.c phalcon/config/configinterface.zep.c - phalcon/http/message/abstractcommon.zep.c phalcon/mvc/model/metadatainterface.zep.c - phalcon/storage/serializer/abstractserializer.zep.c phalcon/cache/adapter/adapterinterface.zep.c phalcon/config/config.zep.c phalcon/datamapper/query/abstractquery.zep.c phalcon/db/adapter/adapterinterface.zep.c - phalcon/http/message/requestmethodinterface.zep.c phalcon/mvc/model/metadata.zep.c phalcon/annotations/adapter/adapterinterface.zep.c phalcon/datamapper/pdo/connection/pdointerface.zep.c phalcon/db/adapter/abstractadapter.zep.c phalcon/db/dialectinterface.zep.c phalcon/html/helper/abstractseries.zep.c - phalcon/http/message/abstractmessage.zep.c + phalcon/html/link/interfaces/linkinterface.zep.c + phalcon/html/link/interfaces/linkproviderinterface.zep.c phalcon/logger/adapter/adapterinterface.zep.c phalcon/mvc/model/resultsetinterface.zep.c phalcon/paginator/adapter/adapterinterface.zep.c @@ -64,7 +64,6 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/filter/validation/validatorcompositeinterface.zep.c phalcon/flash/flashinterface.zep.c phalcon/html/helper/abstractlist.zep.c - phalcon/http/message/stream.zep.c phalcon/image/adapter/adapterinterface.zep.c phalcon/logger/adapter/abstractadapter.zep.c phalcon/logger/formatter/formatterinterface.zep.c @@ -80,6 +79,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/application/exception.zep.c phalcon/assets/asset.zep.c phalcon/assets/inline.zep.c + phalcon/cache/cacheinterface.zep.c phalcon/datamapper/pdo/connection/abstractconnection.zep.c phalcon/datamapper/pdo/exception/exception.zep.c phalcon/di/di.zep.c @@ -90,10 +90,11 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/encryption/security/jwt/token/abstractitem.zep.c phalcon/filter/validation/abstractvalidatorcomposite.zep.c phalcon/flash/abstractflash.zep.c - phalcon/http/message/abstractrequest.zep.c - phalcon/http/message/responsestatuscodeinterface.zep.c + phalcon/html/link/abstractlink.zep.c + phalcon/html/link/abstractlinkprovider.zep.c phalcon/image/adapter/abstractadapter.zep.c phalcon/logger/formatter/abstractformatter.zep.c + phalcon/logger/loggerinterface.zep.c phalcon/mvc/entityinterface.zep.c phalcon/mvc/model/behavior.zep.c phalcon/mvc/model/metadata/strategy/strategyinterface.zep.c @@ -107,6 +108,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/acl/componentinterface.zep.c phalcon/acl/roleinterface.zep.c phalcon/annotations/readerinterface.zep.c + phalcon/cache/abstractcache.zep.c phalcon/cli/dispatcherinterface.zep.c phalcon/cli/router/routeinterface.zep.c phalcon/cli/taskinterface.zep.c @@ -134,15 +136,20 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/html/helper/input/checkbox.zep.c phalcon/html/helper/ol.zep.c phalcon/html/helper/style.zep.c + phalcon/html/link/interfaces/evolvablelinkinterface.zep.c + phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.c phalcon/html/link/link.zep.c phalcon/html/link/linkprovider.zep.c phalcon/html/link/serializer/serializerinterface.zep.c phalcon/http/cookie/cookieinterface.zep.c + phalcon/http/message/requestmethodinterface.zep.c + phalcon/http/message/responsestatuscodeinterface.zep.c phalcon/http/request/fileinterface.zep.c phalcon/http/requestinterface.zep.c phalcon/http/response/cookiesinterface.zep.c phalcon/http/response/headersinterface.zep.c phalcon/http/responseinterface.zep.c + phalcon/logger/abstractlogger.zep.c phalcon/messages/messageinterface.zep.c phalcon/mvc/controllerinterface.zep.c phalcon/mvc/dispatcherinterface.zep.c @@ -166,12 +173,14 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/mvc/viewinterface.zep.c phalcon/paginator/repositoryinterface.zep.c phalcon/session/adapter/noop.zep.c + phalcon/session/baginterface.zep.c phalcon/session/managerinterface.zep.c phalcon/storage/adapter/apcu.zep.c phalcon/storage/adapter/libmemcached.zep.c phalcon/storage/adapter/memory.zep.c phalcon/storage/adapter/redis.zep.c phalcon/storage/adapter/stream.zep.c + phalcon/storage/serializer/igbinary.zep.c phalcon/acl/adapter/memory.zep.c phalcon/acl/component.zep.c phalcon/acl/componentawareinterface.zep.c @@ -226,7 +235,6 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/config/adapter/yaml.zep.c phalcon/config/configfactory.zep.c phalcon/config/exception.zep.c - phalcon/container/container.zep.c phalcon/datamapper/pdo/connection.zep.c phalcon/datamapper/pdo/connection/decorated.zep.c phalcon/datamapper/pdo/connectionlocator.zep.c @@ -259,6 +267,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/db/result/pdoresult.zep.c phalcon/di/exception/serviceresolutionexception.zep.c phalcon/di/factorydefault/cli.zep.c + phalcon/di/initializationawareinterface.zep.c phalcon/di/service.zep.c phalcon/di/service/builder.zep.c phalcon/di/serviceproviderinterface.zep.c @@ -418,21 +427,6 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/html/tagfactory.zep.c phalcon/http/cookie.zep.c phalcon/http/cookie/exception.zep.c - phalcon/http/message/exception/invalidargumentexception.zep.c - phalcon/http/message/request.zep.c - phalcon/http/message/requestfactory.zep.c - phalcon/http/message/response.zep.c - phalcon/http/message/responsefactory.zep.c - phalcon/http/message/serverrequest.zep.c - phalcon/http/message/serverrequestfactory.zep.c - phalcon/http/message/stream/input.zep.c - phalcon/http/message/stream/memory.zep.c - phalcon/http/message/stream/temp.zep.c - phalcon/http/message/streamfactory.zep.c - phalcon/http/message/uploadedfile.zep.c - phalcon/http/message/uploadedfilefactory.zep.c - phalcon/http/message/uri.zep.c - phalcon/http/message/urifactory.zep.c phalcon/http/request.zep.c phalcon/http/request/exception.zep.c phalcon/http/request/file.zep.c @@ -440,8 +434,6 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/http/response/cookies.zep.c phalcon/http/response/exception.zep.c phalcon/http/response/headers.zep.c - phalcon/http/server/abstractmiddleware.zep.c - phalcon/http/server/abstractrequesthandler.zep.c phalcon/image/adapter/gd.zep.c phalcon/image/adapter/imagick.zep.c phalcon/image/enum.zep.c @@ -451,6 +443,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/logger/adapter/stream.zep.c phalcon/logger/adapter/syslog.zep.c phalcon/logger/adapterfactory.zep.c + phalcon/logger/enum.zep.c phalcon/logger/exception.zep.c phalcon/logger/formatter/json.zep.c phalcon/logger/formatter/line.zep.c @@ -525,11 +518,17 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/storage/adapterfactory.zep.c phalcon/storage/exception.zep.c phalcon/storage/serializer/base64.zep.c - phalcon/storage/serializer/igbinary.zep.c phalcon/storage/serializer/json.zep.c + phalcon/storage/serializer/memcachedigbinary.zep.c + phalcon/storage/serializer/memcachedjson.zep.c + phalcon/storage/serializer/memcachedphp.zep.c phalcon/storage/serializer/msgpack.zep.c - phalcon/storage/serializer/none.zep.c phalcon/storage/serializer/php.zep.c + phalcon/storage/serializer/redisigbinary.zep.c + phalcon/storage/serializer/redisjson.zep.c + phalcon/storage/serializer/redismsgpack.zep.c + phalcon/storage/serializer/redisnone.zep.c + phalcon/storage/serializer/redisphp.zep.c phalcon/storage/serializerfactory.zep.c phalcon/support/collection/exception.zep.c phalcon/support/collection/readonlycollection.zep.c @@ -624,11 +623,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/11__closure.zep.c phalcon/12__closure.zep.c phalcon/13__closure.zep.c - phalcon/14__closure.zep.c - phalcon/15__closure.zep.c - phalcon/16__closure.zep.c - phalcon/17__closure.zep.c - phalcon/18__closure.zep.c phalcon/annotations/scanner.c + phalcon/14__closure.zep.c phalcon/annotations/scanner.c phalcon/annotations/parser.c phalcon/mvc/model/orm.c phalcon/mvc/model/query/scanner.c @@ -638,7 +633,7 @@ if test "$PHP_PHALCON" = "yes"; then phalcon/mvc/url/utils.c" PHP_NEW_EXTENSION(phalcon, $phalcon_sources, $ext_shared,, ) PHP_ADD_BUILD_DIR([$ext_builddir/kernel/]) - for dir in "phalcon phalcon/acl phalcon/acl/adapter phalcon/annotations phalcon/annotations/adapter phalcon/application phalcon/assets phalcon/assets/asset phalcon/assets/filters phalcon/assets/inline phalcon/autoload phalcon/cache phalcon/cache/adapter phalcon/cache/exception phalcon/cli phalcon/cli/console phalcon/cli/dispatcher phalcon/cli/router phalcon/config phalcon/config/adapter phalcon/container phalcon/datamapper/pdo phalcon/datamapper/pdo/connection phalcon/datamapper/pdo/exception phalcon/datamapper/pdo/profiler phalcon/datamapper/query phalcon/db phalcon/db/adapter phalcon/db/adapter/pdo phalcon/db/dialect phalcon/db/profiler phalcon/db/result phalcon/di phalcon/di/exception phalcon/di/factorydefault phalcon/di/service phalcon/dispatcher phalcon/domain/payload phalcon/encryption phalcon/encryption/crypt phalcon/encryption/crypt/exception phalcon/encryption/crypt/padding phalcon/encryption/security phalcon/encryption/security/jwt phalcon/encryption/security/jwt/exceptions phalcon/encryption/security/jwt/signer phalcon/encryption/security/jwt/token phalcon/events phalcon/factory phalcon/filter phalcon/filter/sanitize phalcon/filter/validation phalcon/filter/validation/validator phalcon/filter/validation/validator/file phalcon/filter/validation/validator/file/resolution phalcon/filter/validation/validator/file/size phalcon/filter/validation/validator/stringlength phalcon/flash phalcon/forms phalcon/forms/element phalcon/html phalcon/html/attributes phalcon/html/escaper phalcon/html/helper phalcon/html/helper/input phalcon/html/link phalcon/html/link/serializer phalcon/http phalcon/http/cookie phalcon/http/message phalcon/http/message/exception phalcon/http/message/stream phalcon/http/request phalcon/http/response phalcon/http/server phalcon/image phalcon/image/adapter phalcon/logger phalcon/logger/adapter phalcon/logger/formatter phalcon/messages phalcon/mvc phalcon/mvc/application phalcon/mvc/controller phalcon/mvc/dispatcher phalcon/mvc/micro phalcon/mvc/model phalcon/mvc/model/behavior phalcon/mvc/model/binder phalcon/mvc/model/metadata phalcon/mvc/model/metadata/strategy phalcon/mvc/model/query phalcon/mvc/model/resultset phalcon/mvc/model/transaction phalcon/mvc/router phalcon/mvc/url phalcon/mvc/view phalcon/mvc/view/engine phalcon/mvc/view/engine/volt phalcon/paginator phalcon/paginator/adapter phalcon/session phalcon/session/adapter phalcon/storage phalcon/storage/adapter phalcon/storage/serializer phalcon/support phalcon/support/collection phalcon/support/debug phalcon/support/helper phalcon/support/helper/arr phalcon/support/helper/file phalcon/support/helper/json phalcon/support/helper/number phalcon/support/helper/str phalcon/tag phalcon/translate phalcon/translate/adapter phalcon/translate/interpolator"; do + for dir in "phalcon phalcon/acl phalcon/acl/adapter phalcon/annotations phalcon/annotations/adapter phalcon/application phalcon/assets phalcon/assets/asset phalcon/assets/filters phalcon/assets/inline phalcon/autoload phalcon/cache phalcon/cache/adapter phalcon/cache/exception phalcon/cli phalcon/cli/console phalcon/cli/dispatcher phalcon/cli/router phalcon/config phalcon/config/adapter phalcon/datamapper/pdo phalcon/datamapper/pdo/connection phalcon/datamapper/pdo/exception phalcon/datamapper/pdo/profiler phalcon/datamapper/query phalcon/db phalcon/db/adapter phalcon/db/adapter/pdo phalcon/db/dialect phalcon/db/profiler phalcon/db/result phalcon/di phalcon/di/exception phalcon/di/factorydefault phalcon/di/service phalcon/dispatcher phalcon/domain/payload phalcon/encryption phalcon/encryption/crypt phalcon/encryption/crypt/exception phalcon/encryption/crypt/padding phalcon/encryption/security phalcon/encryption/security/jwt phalcon/encryption/security/jwt/exceptions phalcon/encryption/security/jwt/signer phalcon/encryption/security/jwt/token phalcon/events phalcon/factory phalcon/filter phalcon/filter/sanitize phalcon/filter/validation phalcon/filter/validation/validator phalcon/filter/validation/validator/file phalcon/filter/validation/validator/file/resolution phalcon/filter/validation/validator/file/size phalcon/filter/validation/validator/stringlength phalcon/flash phalcon/forms phalcon/forms/element phalcon/html phalcon/html/attributes phalcon/html/escaper phalcon/html/helper phalcon/html/helper/input phalcon/html/link phalcon/html/link/interfaces phalcon/html/link/serializer phalcon/http phalcon/http/cookie phalcon/http/message phalcon/http/request phalcon/http/response phalcon/image phalcon/image/adapter phalcon/logger phalcon/logger/adapter phalcon/logger/formatter phalcon/messages phalcon/mvc phalcon/mvc/application phalcon/mvc/controller phalcon/mvc/dispatcher phalcon/mvc/micro phalcon/mvc/model phalcon/mvc/model/behavior phalcon/mvc/model/binder phalcon/mvc/model/metadata phalcon/mvc/model/metadata/strategy phalcon/mvc/model/query phalcon/mvc/model/resultset phalcon/mvc/model/transaction phalcon/mvc/router phalcon/mvc/url phalcon/mvc/view phalcon/mvc/view/engine phalcon/mvc/view/engine/volt phalcon/paginator phalcon/paginator/adapter phalcon/session phalcon/session/adapter phalcon/storage phalcon/storage/adapter phalcon/storage/serializer phalcon/support phalcon/support/collection phalcon/support/debug phalcon/support/helper phalcon/support/helper/arr phalcon/support/helper/file phalcon/support/helper/json phalcon/support/helper/number phalcon/support/helper/str phalcon/tag phalcon/translate phalcon/translate/adapter phalcon/translate/interpolator"; do PHP_ADD_BUILD_DIR([$ext_builddir/$dir]) done PHP_SUBST(PHALCON_SHARED_LIBADD) diff --git a/ext/config.w32 b/ext/config.w32 index 66bfd187bde..0cbef8ac38f 100644 --- a/ext/config.w32 +++ b/ext/config.w32 @@ -14,7 +14,7 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/model/query", "scanner.c parser.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/view/engine/volt", "parser.c scanner.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/url", "utils.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/di", "injectionawareinterface.zep.c abstractinjectionaware.zep.c injectable.zep.c diinterface.zep.c di.zep.c exception.zep.c factorydefault.zep.c serviceinterface.zep.c service.zep.c serviceproviderinterface.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/di", "injectionawareinterface.zep.c abstractinjectionaware.zep.c injectable.zep.c diinterface.zep.c di.zep.c exception.zep.c factorydefault.zep.c serviceinterface.zep.c initializationawareinterface.zep.c service.zep.c serviceproviderinterface.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html/helper", "abstracthelper.zep.c abstractseries.zep.c abstractlist.zep.c ol.zep.c style.zep.c anchor.zep.c base.zep.c body.zep.c button.zep.c close.zep.c doctype.zep.c element.zep.c form.zep.c img.zep.c label.zep.c link.zep.c meta.zep.c script.zep.c title.zep.c ul.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/filter/validation", "validatorinterface.zep.c abstractvalidator.zep.c validatorcompositeinterface.zep.c abstractvalidatorcomposite.zep.c abstractcombinedfieldsvalidator.zep.c validationinterface.zep.c exception.zep.c validatorfactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html/helper/input", "abstractinput.zep.c checkbox.zep.c color.zep.c date.zep.c datetime.zep.c datetimelocal.zep.c email.zep.c file.zep.c hidden.zep.c image.zep.c input.zep.c month.zep.c numeric.zep.c password.zep.c radio.zep.c range.zep.c search.zep.c select.zep.c submit.zep.c tel.zep.c text.zep.c textarea.zep.c time.zep.c url.zep.c week.zep.c", "phalcon"); @@ -22,6 +22,7 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/factory", "abstractconfigfactory.zep.c abstractfactory.zep.c exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/support/collection", "collectioninterface.zep.c exception.zep.c readonlycollection.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/storage/adapter", "adapterinterface.zep.c abstractadapter.zep.c apcu.zep.c libmemcached.zep.c memory.zep.c redis.zep.c stream.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/storage/serializer", "serializerinterface.zep.c abstractserializer.zep.c none.zep.c igbinary.zep.c base64.zep.c json.zep.c memcachedigbinary.zep.c memcachedjson.zep.c memcachedphp.zep.c msgpack.zep.c php.zep.c redisigbinary.zep.c redisjson.zep.c redismsgpack.zep.c redisnone.zep.c redisphp.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/forms/element", "elementinterface.zep.c abstractelement.zep.c check.zep.c date.zep.c email.zep.c file.zep.c hidden.zep.c numeric.zep.c password.zep.c radio.zep.c select.zep.c submit.zep.c text.zep.c textarea.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/support/helper/str", "abstractstr.zep.c pascalcase.zep.c camelize.zep.c concat.zep.c countvowels.zep.c decapitalize.zep.c decrement.zep.c dirfromfile.zep.c dirseparator.zep.c dynamic.zep.c endswith.zep.c firstbetween.zep.c friendly.zep.c humanize.zep.c includes.zep.c increment.zep.c interpolate.zep.c isanagram.zep.c islower.zep.c ispalindrome.zep.c isupper.zep.c kebabcase.zep.c len.zep.c lower.zep.c prefix.zep.c random.zep.c reduceslashes.zep.c snakecase.zep.c startswith.zep.c suffix.zep.c ucwords.zep.c uncamelize.zep.c underscore.zep.c upper.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/support", "collection.zep.c debug.zep.c exception.zep.c helperfactory.zep.c registry.zep.c version.zep.c", "phalcon"); @@ -29,10 +30,8 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/dispatcher", "dispatcherinterface.zep.c abstractdispatcher.zep.c exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/encryption/crypt/padding", "padinterface.zep.c ansi.zep.c iso10126.zep.c isoiek.zep.c noop.zep.c pkcs7.zep.c space.zep.c zero.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/filter/validation/validator/file", "abstractfile.zep.c mimetype.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/storage/serializer", "serializerinterface.zep.c abstractserializer.zep.c base64.zep.c igbinary.zep.c json.zep.c msgpack.zep.c none.zep.c php.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/assets", "assetinterface.zep.c filterinterface.zep.c asset.zep.c inline.zep.c collection.zep.c exception.zep.c manager.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/config", "configinterface.zep.c config.zep.c configfactory.zep.c exception.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/http/message", "abstractcommon.zep.c requestmethodinterface.zep.c abstractmessage.zep.c stream.zep.c abstractrequest.zep.c responsestatuscodeinterface.zep.c request.zep.c requestfactory.zep.c response.zep.c responsefactory.zep.c serverrequest.zep.c serverrequestfactory.zep.c streamfactory.zep.c uploadedfile.zep.c uploadedfilefactory.zep.c uri.zep.c urifactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/model", "metadatainterface.zep.c metadata.zep.c resultsetinterface.zep.c behaviorinterface.zep.c exception.zep.c behavior.zep.c resultinterface.zep.c resultset.zep.c binderinterface.zep.c criteriainterface.zep.c managerinterface.zep.c queryinterface.zep.c relationinterface.zep.c transactioninterface.zep.c binder.zep.c criteria.zep.c manager.zep.c query.zep.c relation.zep.c row.zep.c transaction.zep.c validationfailed.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/cache/adapter", "adapterinterface.zep.c apcu.zep.c libmemcached.zep.c memory.zep.c redis.zep.c stream.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/datamapper/query", "abstractquery.zep.c abstractconditions.zep.c bind.zep.c delete.zep.c insert.zep.c queryfactory.zep.c select.zep.c update.zep.c", "phalcon"); @@ -40,6 +39,7 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/annotations/adapter", "adapterinterface.zep.c abstractadapter.zep.c apcu.zep.c memory.zep.c stream.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/datamapper/pdo/connection", "pdointerface.zep.c connectioninterface.zep.c abstractconnection.zep.c decorated.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/db", "dialectinterface.zep.c dialect.zep.c columninterface.zep.c indexinterface.zep.c referenceinterface.zep.c resultinterface.zep.c abstractdb.zep.c column.zep.c enum.zep.c exception.zep.c index.zep.c profiler.zep.c rawvalue.zep.c reference.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/html/link/interfaces", "linkinterface.zep.c linkproviderinterface.zep.c evolvablelinkinterface.zep.c evolvablelinkproviderinterface.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/logger/adapter", "adapterinterface.zep.c abstractadapter.zep.c noop.zep.c stream.zep.c syslog.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/paginator/adapter", "adapterinterface.zep.c abstractadapter.zep.c model.zep.c nativearray.zep.c querybuilder.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/translate/adapter", "adapterinterface.zep.c abstractadapter.zep.c csv.zep.c gettext.zep.c nativearray.zep.c", "phalcon"); @@ -52,9 +52,12 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/mvc", "viewbaseinterface.zep.c entityinterface.zep.c routerinterface.zep.c controllerinterface.zep.c dispatcherinterface.zep.c modelinterface.zep.c router.zep.c viewinterface.zep.c application.zep.c controller.zep.c dispatcher.zep.c micro.zep.c model.zep.c moduledefinitioninterface.zep.c url.zep.c view.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/acl/adapter", "adapterinterface.zep.c abstractadapter.zep.c memory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/application", "abstractapplication.zep.c exception.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/cache", "cacheinterface.zep.c abstractcache.zep.c adapterfactory.zep.c cache.zep.c cachefactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/datamapper/pdo/exception", "exception.zep.c cannotdisconnect.zep.c connectionnotfound.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/domain/payload", "readableinterface.zep.c writeableinterface.zep.c payloadinterface.zep.c payload.zep.c payloadfactory.zep.c status.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/encryption/security/jwt/token", "abstractitem.zep.c enum.zep.c item.zep.c parser.zep.c signature.zep.c token.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/html/link", "abstractlink.zep.c abstractlinkprovider.zep.c link.zep.c linkprovider.zep.c evolvablelink.zep.c evolvablelinkprovider.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/logger", "loggerinterface.zep.c abstractlogger.zep.c adapterfactory.zep.c enum.zep.c exception.zep.c item.zep.c logger.zep.c loggerfactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/model/metadata/strategy", "strategyinterface.zep.c annotations.zep.c introspection.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/session/adapter", "abstractadapter.zep.c noop.zep.c libmemcached.zep.c redis.zep.c stream.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/translate/interpolator", "interpolatorinterface.zep.c associativearray.zep.c indexedarray.zep.c", "phalcon"); @@ -69,9 +72,9 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/filter", "filterinterface.zep.c exception.zep.c filter.zep.c filterfactory.zep.c validation.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html/attributes", "attributesinterface.zep.c renderinterface.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html/escaper", "escaperinterface.zep.c exception.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/html/link", "link.zep.c linkprovider.zep.c evolvablelink.zep.c evolvablelinkprovider.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html/link/serializer", "serializerinterface.zep.c header.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/http/cookie", "cookieinterface.zep.c exception.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/http/message", "requestmethodinterface.zep.c responsestatuscodeinterface.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/http/request", "fileinterface.zep.c exception.zep.c file.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/http", "requestinterface.zep.c responseinterface.zep.c cookie.zep.c request.zep.c response.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/http/response", "cookiesinterface.zep.c headersinterface.zep.c cookies.zep.c exception.zep.c headers.zep.c", "phalcon"); @@ -83,17 +86,15 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/url", "urlinterface.zep.c exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/view", "exception.zep.c simple.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/paginator", "repositoryinterface.zep.c exception.zep.c paginatorfactory.zep.c repository.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/session", "managerinterface.zep.c bag.zep.c exception.zep.c manager.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon/session", "baginterface.zep.c managerinterface.zep.c bag.zep.c exception.zep.c manager.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/assets/asset", "css.zep.c js.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/assets/filters", "cssmin.zep.c jsmin.zep.c none.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/assets/inline", "css.zep.c js.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/autoload", "exception.zep.c loader.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/cache", "adapterfactory.zep.c cache.zep.c cachefactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/cache/exception", "exception.zep.c invalidargumentexception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/cli/console", "exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/cli/dispatcher", "exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/config/adapter", "grouped.zep.c ini.zep.c json.zep.c php.zep.c yaml.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/container", "container.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/db/dialect", "mysql.zep.c postgresql.zep.c sqlite.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/db/profiler", "item.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/db/result", "pdoresult.zep.c", "phalcon"); @@ -111,11 +112,7 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/filter/validation/validator/stringlength", "max.zep.c min.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/forms", "exception.zep.c form.zep.c manager.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/html", "attributes.zep.c breadcrumbs.zep.c escaper.zep.c escaperfactory.zep.c exception.zep.c tagfactory.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/http/message/exception", "invalidargumentexception.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/http/message/stream", "input.zep.c memory.zep.c temp.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/http/server", "abstractmiddleware.zep.c abstractrequesthandler.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/image", "enum.zep.c exception.zep.c imagefactory.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon/logger", "adapterfactory.zep.c exception.zep.c item.zep.c logger.zep.c loggerfactory.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/application", "exception.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/controller", "bindmodelinterface.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/mvc/dispatcher", "exception.zep.c", "phalcon"); @@ -130,7 +127,7 @@ if (PHP_PHALCON != "no") { ADD_SOURCES(configure_module_dirname + "/phalcon/support/helper/file", "basename.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/support/helper/json", "decode.zep.c encode.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/support/helper/number", "isbetween.zep.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/phalcon", "tag.zep.c 0__closure.zep.c 1__closure.zep.c 2__closure.zep.c 3__closure.zep.c 4__closure.zep.c 5__closure.zep.c 6__closure.zep.c 7__closure.zep.c 8__closure.zep.c 9__closure.zep.c 10__closure.zep.c 11__closure.zep.c 12__closure.zep.c 13__closure.zep.c 14__closure.zep.c 15__closure.zep.c 16__closure.zep.c 17__closure.zep.c 18__closure.zep.c", "phalcon"); + ADD_SOURCES(configure_module_dirname + "/phalcon", "tag.zep.c 0__closure.zep.c 1__closure.zep.c 2__closure.zep.c 3__closure.zep.c 4__closure.zep.c 5__closure.zep.c 6__closure.zep.c 7__closure.zep.c 8__closure.zep.c 9__closure.zep.c 10__closure.zep.c 11__closure.zep.c 12__closure.zep.c 13__closure.zep.c 14__closure.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/tag", "exception.zep.c select.zep.c", "phalcon"); ADD_SOURCES(configure_module_dirname + "/phalcon/translate", "exception.zep.c interpolatorfactory.zep.c translatefactory.zep.c", "phalcon"); ADD_FLAG("CFLAGS_PHALCON", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); diff --git a/ext/kernel/file.c b/ext/kernel/file.c index a0540f7d837..83237c4faef 100644 --- a/ext/kernel/file.c +++ b/ext/kernel/file.c @@ -65,7 +65,13 @@ int zephir_file_exists(zval *filename) return FAILURE; } +#if PHP_VERSION_ID >= 80100 + zend_string *file = zend_string_init(Z_STRVAL_P(filename), Z_STRLEN_P(filename), 0); + php_stat(file, FS_EXISTS, &return_value); + zval_ptr_dtor(file); +#else php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_EXISTS, &return_value); +#endif if (Z_TYPE(return_value) != IS_TRUE) { return FAILURE; @@ -288,7 +294,13 @@ void zephir_file_put_contents(zval *return_value, zval *filename, zval *data) void zephir_filemtime(zval *return_value, zval *path) { if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { +#if PHP_VERSION_ID >= 80100 + zend_string *file = zend_string_init(Z_STRVAL_P(path), Z_STRLEN_P(path), 0); + php_stat(file, FS_MTIME, return_value); + zval_ptr_dtor(file); +#else php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_MTIME, return_value); +#endif } else { ZVAL_FALSE(return_value); } diff --git a/ext/kernel/main.c b/ext/kernel/main.c index 8014a651454..95eba881d15 100644 --- a/ext/kernel/main.c +++ b/ext/kernel/main.c @@ -151,7 +151,7 @@ void zephir_fast_count(zval *result, zval *value) } } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else @@ -201,7 +201,7 @@ int zephir_fast_count_ev(zval *value) return (int) count > 0; } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else @@ -249,7 +249,7 @@ int zephir_fast_count_int(zval *value) return (int) count; } - if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { #if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); #else diff --git a/ext/kernel/require.c b/ext/kernel/require.c index 96160ba4ef3..98125c93847 100644 --- a/ext/kernel/require.c +++ b/ext/kernel/require.c @@ -45,14 +45,22 @@ int zephir_require_ret(zval *return_value_ptr, const char *require_path) } #endif - ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#if PHP_VERSION_ID >= 80100 + zend_string *zend_string_path = zend_string_init(require_path, strlen(require_path), 0); + + zend_stream_init_filename_ex(&file_handle, zend_string_path); + ret = php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); + + zval_ptr_dtor(zend_string_path); +#else + ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#endif if (ret != SUCCESS) { return FAILURE; } new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); if (new_op_array) { - if (file_handle.handle.stream.handle) { ZVAL_NULL(&dummy); if (!file_handle.opened_path) { @@ -110,7 +118,16 @@ int zephir_require_once_ret(zval *return_value_ptr, const char *require_path) } #endif - ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#if PHP_VERSION_ID >= 80100 + zend_string *zend_string_path = zend_string_init(require_path, strlen(require_path), 0); + + zend_stream_init_filename_ex(&file_handle, zend_string_path); + ret = php_stream_open_for_zend_ex(&file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); + + zval_ptr_dtor(zend_string_path); +#else + ret = php_stream_open_for_zend_ex(require_path, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE); +#endif if (ret != SUCCESS) { return FAILURE; } diff --git a/ext/phalcon.c b/ext/phalcon.c index 63bac23b81d..5bfeeaec1f2 100644 --- a/ext/phalcon.c +++ b/ext/phalcon.c @@ -29,19 +29,20 @@ zend_class_entry *phalcon_filter_validation_validatorinterface_ce; zend_class_entry *phalcon_events_eventsawareinterface_ce; zend_class_entry *phalcon_support_collection_collectioninterface_ce; zend_class_entry *phalcon_storage_adapter_adapterinterface_ce; +zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; zend_class_entry *phalcon_forms_element_elementinterface_ce; zend_class_entry *phalcon_dispatcher_dispatcherinterface_ce; zend_class_entry *phalcon_encryption_crypt_padding_padinterface_ce; -zend_class_entry *phalcon_storage_serializer_serializerinterface_ce; zend_class_entry *phalcon_assets_assetinterface_ce; zend_class_entry *phalcon_config_configinterface_ce; zend_class_entry *phalcon_mvc_model_metadatainterface_ce; zend_class_entry *phalcon_cache_adapter_adapterinterface_ce; zend_class_entry *phalcon_db_adapter_adapterinterface_ce; -zend_class_entry *phalcon_http_message_requestmethodinterface_ce; zend_class_entry *phalcon_annotations_adapter_adapterinterface_ce; zend_class_entry *phalcon_datamapper_pdo_connection_pdointerface_ce; zend_class_entry *phalcon_db_dialectinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_linkinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_linkproviderinterface_ce; zend_class_entry *phalcon_logger_adapter_adapterinterface_ce; zend_class_entry *phalcon_mvc_model_resultsetinterface_ce; zend_class_entry *phalcon_paginator_adapter_adapterinterface_ce; @@ -58,9 +59,10 @@ zend_class_entry *phalcon_mvc_model_behaviorinterface_ce; zend_class_entry *phalcon_mvc_view_engine_engineinterface_ce; zend_class_entry *phalcon_mvc_viewbaseinterface_ce; zend_class_entry *phalcon_acl_adapter_adapterinterface_ce; +zend_class_entry *phalcon_cache_cacheinterface_ce; zend_class_entry *phalcon_domain_payload_readableinterface_ce; zend_class_entry *phalcon_domain_payload_writeableinterface_ce; -zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; +zend_class_entry *phalcon_logger_loggerinterface_ce; zend_class_entry *phalcon_mvc_entityinterface_ce; zend_class_entry *phalcon_mvc_model_metadata_strategy_strategyinterface_ce; zend_class_entry *phalcon_mvc_model_resultinterface_ce; @@ -88,8 +90,12 @@ zend_class_entry *phalcon_filter_validation_validationinterface_ce; zend_class_entry *phalcon_html_attributes_attributesinterface_ce; zend_class_entry *phalcon_html_attributes_renderinterface_ce; zend_class_entry *phalcon_html_escaper_escaperinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkinterface_ce; +zend_class_entry *phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce; zend_class_entry *phalcon_html_link_serializer_serializerinterface_ce; zend_class_entry *phalcon_http_cookie_cookieinterface_ce; +zend_class_entry *phalcon_http_message_requestmethodinterface_ce; +zend_class_entry *phalcon_http_message_responsestatuscodeinterface_ce; zend_class_entry *phalcon_http_request_fileinterface_ce; zend_class_entry *phalcon_http_requestinterface_ce; zend_class_entry *phalcon_http_response_cookiesinterface_ce; @@ -114,10 +120,12 @@ zend_class_entry *phalcon_mvc_router_routeinterface_ce; zend_class_entry *phalcon_mvc_url_urlinterface_ce; zend_class_entry *phalcon_mvc_viewinterface_ce; zend_class_entry *phalcon_paginator_repositoryinterface_ce; +zend_class_entry *phalcon_session_baginterface_ce; zend_class_entry *phalcon_session_managerinterface_ce; zend_class_entry *phalcon_acl_componentawareinterface_ce; zend_class_entry *phalcon_acl_roleawareinterface_ce; zend_class_entry *phalcon_cli_routerinterface_ce; +zend_class_entry *phalcon_di_initializationawareinterface_ce; zend_class_entry *phalcon_di_serviceproviderinterface_ce; zend_class_entry *phalcon_mvc_controller_bindmodelinterface_ce; zend_class_entry *phalcon_mvc_micro_middlewareinterface_ce; @@ -129,28 +137,26 @@ zend_class_entry *phalcon_html_helper_input_abstractinput_ce; zend_class_entry *phalcon_factory_abstractconfigfactory_ce; zend_class_entry *phalcon_di_abstractinjectionaware_ce; zend_class_entry *phalcon_factory_abstractfactory_ce; +zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; zend_class_entry *phalcon_di_injectable_ce; zend_class_entry *phalcon_forms_element_abstractelement_ce; zend_class_entry *phalcon_support_helper_str_abstractstr_ce; zend_class_entry *phalcon_storage_adapter_abstractadapter_ce; zend_class_entry *phalcon_support_collection_ce; zend_class_entry *phalcon_support_helper_arr_abstractarr_ce; +zend_class_entry *phalcon_storage_serializer_none_ce; zend_class_entry *phalcon_filter_validation_validator_file_abstractfile_ce; -zend_class_entry *phalcon_http_message_abstractcommon_ce; -zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; zend_class_entry *phalcon_config_config_ce; zend_class_entry *phalcon_datamapper_query_abstractquery_ce; zend_class_entry *phalcon_mvc_model_metadata_ce; zend_class_entry *phalcon_db_adapter_abstractadapter_ce; zend_class_entry *phalcon_html_helper_abstractseries_ce; -zend_class_entry *phalcon_http_message_abstractmessage_ce; zend_class_entry *phalcon_annotations_adapter_abstractadapter_ce; zend_class_entry *phalcon_datamapper_query_abstractconditions_ce; zend_class_entry *phalcon_db_adapter_pdo_abstractpdo_ce; zend_class_entry *phalcon_db_dialect_ce; zend_class_entry *phalcon_events_abstracteventsaware_ce; zend_class_entry *phalcon_html_helper_abstractlist_ce; -zend_class_entry *phalcon_http_message_stream_ce; zend_class_entry *phalcon_logger_adapter_abstractadapter_ce; zend_class_entry *phalcon_mvc_model_exception_ce; zend_class_entry *phalcon_paginator_adapter_abstractadapter_ce; @@ -168,7 +174,8 @@ zend_class_entry *phalcon_dispatcher_exception_ce; zend_class_entry *phalcon_encryption_security_jwt_token_abstractitem_ce; zend_class_entry *phalcon_filter_validation_abstractvalidatorcomposite_ce; zend_class_entry *phalcon_flash_abstractflash_ce; -zend_class_entry *phalcon_http_message_abstractrequest_ce; +zend_class_entry *phalcon_html_link_abstractlink_ce; +zend_class_entry *phalcon_html_link_abstractlinkprovider_ce; zend_class_entry *phalcon_image_adapter_abstractadapter_ce; zend_class_entry *phalcon_logger_formatter_abstractformatter_ce; zend_class_entry *phalcon_mvc_model_behavior_ce; @@ -176,6 +183,7 @@ zend_class_entry *phalcon_mvc_model_resultset_ce; zend_class_entry *phalcon_mvc_view_engine_abstractengine_ce; zend_class_entry *phalcon_session_adapter_abstractadapter_ce; zend_class_entry *phalcon_acl_adapter_abstractadapter_ce; +zend_class_entry *phalcon_cache_abstractcache_ce; zend_class_entry *phalcon_di_exception_ce; zend_class_entry *phalcon_di_factorydefault_ce; zend_class_entry *phalcon_encryption_crypt_exception_exception_ce; @@ -186,6 +194,7 @@ zend_class_entry *phalcon_html_helper_ol_ce; zend_class_entry *phalcon_html_helper_style_ce; zend_class_entry *phalcon_html_link_link_ce; zend_class_entry *phalcon_html_link_linkprovider_ce; +zend_class_entry *phalcon_logger_abstractlogger_ce; zend_class_entry *phalcon_mvc_model_transaction_exception_ce; zend_class_entry *phalcon_mvc_router_ce; zend_class_entry *phalcon_mvc_view_exception_ce; @@ -195,16 +204,13 @@ zend_class_entry *phalcon_storage_adapter_libmemcached_ce; zend_class_entry *phalcon_storage_adapter_memory_ce; zend_class_entry *phalcon_storage_adapter_redis_ce; zend_class_entry *phalcon_storage_adapter_stream_ce; +zend_class_entry *phalcon_storage_serializer_igbinary_ce; zend_class_entry *phalcon_0__closure_ce; zend_class_entry *phalcon_10__closure_ce; zend_class_entry *phalcon_11__closure_ce; zend_class_entry *phalcon_12__closure_ce; zend_class_entry *phalcon_13__closure_ce; zend_class_entry *phalcon_14__closure_ce; -zend_class_entry *phalcon_15__closure_ce; -zend_class_entry *phalcon_16__closure_ce; -zend_class_entry *phalcon_17__closure_ce; -zend_class_entry *phalcon_18__closure_ce; zend_class_entry *phalcon_1__closure_ce; zend_class_entry *phalcon_2__closure_ce; zend_class_entry *phalcon_3__closure_ce; @@ -265,7 +271,6 @@ zend_class_entry *phalcon_config_adapter_php_ce; zend_class_entry *phalcon_config_adapter_yaml_ce; zend_class_entry *phalcon_config_configfactory_ce; zend_class_entry *phalcon_config_exception_ce; -zend_class_entry *phalcon_container_container_ce; zend_class_entry *phalcon_datamapper_pdo_connection_ce; zend_class_entry *phalcon_datamapper_pdo_connection_decorated_ce; zend_class_entry *phalcon_datamapper_pdo_connectionlocator_ce; @@ -456,21 +461,6 @@ zend_class_entry *phalcon_html_link_serializer_header_ce; zend_class_entry *phalcon_html_tagfactory_ce; zend_class_entry *phalcon_http_cookie_ce; zend_class_entry *phalcon_http_cookie_exception_ce; -zend_class_entry *phalcon_http_message_exception_invalidargumentexception_ce; -zend_class_entry *phalcon_http_message_request_ce; -zend_class_entry *phalcon_http_message_requestfactory_ce; -zend_class_entry *phalcon_http_message_response_ce; -zend_class_entry *phalcon_http_message_responsefactory_ce; -zend_class_entry *phalcon_http_message_serverrequest_ce; -zend_class_entry *phalcon_http_message_serverrequestfactory_ce; -zend_class_entry *phalcon_http_message_stream_input_ce; -zend_class_entry *phalcon_http_message_stream_memory_ce; -zend_class_entry *phalcon_http_message_stream_temp_ce; -zend_class_entry *phalcon_http_message_streamfactory_ce; -zend_class_entry *phalcon_http_message_uploadedfile_ce; -zend_class_entry *phalcon_http_message_uploadedfilefactory_ce; -zend_class_entry *phalcon_http_message_uri_ce; -zend_class_entry *phalcon_http_message_urifactory_ce; zend_class_entry *phalcon_http_request_ce; zend_class_entry *phalcon_http_request_exception_ce; zend_class_entry *phalcon_http_request_file_ce; @@ -478,8 +468,6 @@ zend_class_entry *phalcon_http_response_ce; zend_class_entry *phalcon_http_response_cookies_ce; zend_class_entry *phalcon_http_response_exception_ce; zend_class_entry *phalcon_http_response_headers_ce; -zend_class_entry *phalcon_http_server_abstractmiddleware_ce; -zend_class_entry *phalcon_http_server_abstractrequesthandler_ce; zend_class_entry *phalcon_image_adapter_gd_ce; zend_class_entry *phalcon_image_adapter_imagick_ce; zend_class_entry *phalcon_image_enum_ce; @@ -489,6 +477,7 @@ zend_class_entry *phalcon_logger_adapter_noop_ce; zend_class_entry *phalcon_logger_adapter_stream_ce; zend_class_entry *phalcon_logger_adapter_syslog_ce; zend_class_entry *phalcon_logger_adapterfactory_ce; +zend_class_entry *phalcon_logger_enum_ce; zend_class_entry *phalcon_logger_exception_ce; zend_class_entry *phalcon_logger_formatter_json_ce; zend_class_entry *phalcon_logger_formatter_line_ce; @@ -559,11 +548,17 @@ zend_class_entry *phalcon_session_manager_ce; zend_class_entry *phalcon_storage_adapterfactory_ce; zend_class_entry *phalcon_storage_exception_ce; zend_class_entry *phalcon_storage_serializer_base64_ce; -zend_class_entry *phalcon_storage_serializer_igbinary_ce; zend_class_entry *phalcon_storage_serializer_json_ce; +zend_class_entry *phalcon_storage_serializer_memcachedigbinary_ce; +zend_class_entry *phalcon_storage_serializer_memcachedjson_ce; +zend_class_entry *phalcon_storage_serializer_memcachedphp_ce; zend_class_entry *phalcon_storage_serializer_msgpack_ce; -zend_class_entry *phalcon_storage_serializer_none_ce; zend_class_entry *phalcon_storage_serializer_php_ce; +zend_class_entry *phalcon_storage_serializer_redisigbinary_ce; +zend_class_entry *phalcon_storage_serializer_redisjson_ce; +zend_class_entry *phalcon_storage_serializer_redismsgpack_ce; +zend_class_entry *phalcon_storage_serializer_redisnone_ce; +zend_class_entry *phalcon_storage_serializer_redisphp_ce; zend_class_entry *phalcon_storage_serializerfactory_ce; zend_class_entry *phalcon_support_collection_exception_ce; zend_class_entry *phalcon_support_collection_readonlycollection_ce; @@ -682,19 +677,20 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Events_EventsAwareInterface); ZEPHIR_INIT(Phalcon_Support_Collection_CollectionInterface); ZEPHIR_INIT(Phalcon_Storage_Adapter_AdapterInterface); + ZEPHIR_INIT(Phalcon_Storage_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Forms_Element_ElementInterface); ZEPHIR_INIT(Phalcon_Dispatcher_DispatcherInterface); ZEPHIR_INIT(Phalcon_Encryption_Crypt_Padding_PadInterface); - ZEPHIR_INIT(Phalcon_Storage_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Assets_AssetInterface); ZEPHIR_INIT(Phalcon_Config_ConfigInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaDataInterface); ZEPHIR_INIT(Phalcon_Cache_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_Db_Adapter_AdapterInterface); - ZEPHIR_INIT(Phalcon_Http_Message_RequestMethodInterface); ZEPHIR_INIT(Phalcon_Annotations_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection_PdoInterface); ZEPHIR_INIT(Phalcon_Db_DialectInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_LinkInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_LinkProviderInterface); ZEPHIR_INIT(Phalcon_Logger_Adapter_AdapterInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_ResultsetInterface); ZEPHIR_INIT(Phalcon_Paginator_Adapter_AdapterInterface); @@ -711,9 +707,10 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_ViewBaseInterface); ZEPHIR_INIT(Phalcon_Mvc_View_Engine_EngineInterface); ZEPHIR_INIT(Phalcon_Acl_Adapter_AdapterInterface); + ZEPHIR_INIT(Phalcon_Cache_CacheInterface); ZEPHIR_INIT(Phalcon_Domain_Payload_ReadableInterface); ZEPHIR_INIT(Phalcon_Domain_Payload_WriteableInterface); - ZEPHIR_INIT(Phalcon_Http_Message_ResponseStatusCodeInterface); + ZEPHIR_INIT(Phalcon_Logger_LoggerInterface); ZEPHIR_INIT(Phalcon_Mvc_EntityInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaData_Strategy_StrategyInterface); ZEPHIR_INIT(Phalcon_Mvc_Model_ResultInterface); @@ -741,8 +738,12 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_Attributes_AttributesInterface); ZEPHIR_INIT(Phalcon_Html_Attributes_RenderInterface); ZEPHIR_INIT(Phalcon_Html_Escaper_EscaperInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface); + ZEPHIR_INIT(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface); ZEPHIR_INIT(Phalcon_Html_Link_Serializer_SerializerInterface); ZEPHIR_INIT(Phalcon_Http_Cookie_CookieInterface); + ZEPHIR_INIT(Phalcon_Http_Message_RequestMethodInterface); + ZEPHIR_INIT(Phalcon_Http_Message_ResponseStatusCodeInterface); ZEPHIR_INIT(Phalcon_Http_RequestInterface); ZEPHIR_INIT(Phalcon_Http_Request_FileInterface); ZEPHIR_INIT(Phalcon_Http_ResponseInterface); @@ -767,10 +768,12 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_Url_UrlInterface); ZEPHIR_INIT(Phalcon_Mvc_ViewInterface); ZEPHIR_INIT(Phalcon_Paginator_RepositoryInterface); + ZEPHIR_INIT(Phalcon_Session_BagInterface); ZEPHIR_INIT(Phalcon_Session_ManagerInterface); ZEPHIR_INIT(Phalcon_Acl_ComponentAwareInterface); ZEPHIR_INIT(Phalcon_Acl_RoleAwareInterface); ZEPHIR_INIT(Phalcon_Cli_RouterInterface); + ZEPHIR_INIT(Phalcon_Di_InitializationAwareInterface); ZEPHIR_INIT(Phalcon_Di_ServiceProviderInterface); ZEPHIR_INIT(Phalcon_Mvc_Controller_BindModelInterface); ZEPHIR_INIT(Phalcon_Mvc_Micro_MiddlewareInterface); @@ -782,28 +785,26 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Factory_AbstractConfigFactory); ZEPHIR_INIT(Phalcon_Di_AbstractInjectionAware); ZEPHIR_INIT(Phalcon_Factory_AbstractFactory); + ZEPHIR_INIT(Phalcon_Storage_Serializer_AbstractSerializer); ZEPHIR_INIT(Phalcon_Di_Injectable); ZEPHIR_INIT(Phalcon_Forms_Element_AbstractElement); ZEPHIR_INIT(Phalcon_Support_Helper_Str_AbstractStr); ZEPHIR_INIT(Phalcon_Storage_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Support_Collection); ZEPHIR_INIT(Phalcon_Support_Helper_Arr_AbstractArr); + ZEPHIR_INIT(Phalcon_Storage_Serializer_None); ZEPHIR_INIT(Phalcon_Filter_Validation_Validator_File_AbstractFile); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractCommon); - ZEPHIR_INIT(Phalcon_Storage_Serializer_AbstractSerializer); ZEPHIR_INIT(Phalcon_Config_Config); ZEPHIR_INIT(Phalcon_DataMapper_Query_AbstractQuery); ZEPHIR_INIT(Phalcon_Mvc_Model_MetaData); ZEPHIR_INIT(Phalcon_Db_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Html_Helper_AbstractSeries); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractMessage); ZEPHIR_INIT(Phalcon_Annotations_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_DataMapper_Query_AbstractConditions); ZEPHIR_INIT(Phalcon_Db_Adapter_Pdo_AbstractPdo); ZEPHIR_INIT(Phalcon_Db_Dialect); ZEPHIR_INIT(Phalcon_Events_AbstractEventsAware); ZEPHIR_INIT(Phalcon_Html_Helper_AbstractList); - ZEPHIR_INIT(Phalcon_Http_Message_Stream); ZEPHIR_INIT(Phalcon_Logger_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Mvc_Model_Exception); ZEPHIR_INIT(Phalcon_Paginator_Adapter_AbstractAdapter); @@ -821,7 +822,8 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Encryption_Security_JWT_Token_AbstractItem); ZEPHIR_INIT(Phalcon_Filter_Validation_AbstractValidatorComposite); ZEPHIR_INIT(Phalcon_Flash_AbstractFlash); - ZEPHIR_INIT(Phalcon_Http_Message_AbstractRequest); + ZEPHIR_INIT(Phalcon_Html_Link_AbstractLink); + ZEPHIR_INIT(Phalcon_Html_Link_AbstractLinkProvider); ZEPHIR_INIT(Phalcon_Image_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Logger_Formatter_AbstractFormatter); ZEPHIR_INIT(Phalcon_Mvc_Model_Behavior); @@ -829,6 +831,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Mvc_View_Engine_AbstractEngine); ZEPHIR_INIT(Phalcon_Session_Adapter_AbstractAdapter); ZEPHIR_INIT(Phalcon_Acl_Adapter_AbstractAdapter); + ZEPHIR_INIT(Phalcon_Cache_AbstractCache); ZEPHIR_INIT(Phalcon_Di_Exception); ZEPHIR_INIT(Phalcon_Di_FactoryDefault); ZEPHIR_INIT(Phalcon_Encryption_Crypt_Exception_Exception); @@ -839,6 +842,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_Helper_Style); ZEPHIR_INIT(Phalcon_Html_Link_Link); ZEPHIR_INIT(Phalcon_Html_Link_LinkProvider); + ZEPHIR_INIT(Phalcon_Logger_AbstractLogger); ZEPHIR_INIT(Phalcon_Mvc_Model_Transaction_Exception); ZEPHIR_INIT(Phalcon_Mvc_Router); ZEPHIR_INIT(Phalcon_Mvc_View_Exception); @@ -848,6 +852,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Storage_Adapter_Memory); ZEPHIR_INIT(Phalcon_Storage_Adapter_Redis); ZEPHIR_INIT(Phalcon_Storage_Adapter_Stream); + ZEPHIR_INIT(Phalcon_Storage_Serializer_Igbinary); ZEPHIR_INIT(Phalcon_Acl_Adapter_Memory); ZEPHIR_INIT(Phalcon_Acl_Component); ZEPHIR_INIT(Phalcon_Acl_Enum); @@ -899,7 +904,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Config_Adapter_Yaml); ZEPHIR_INIT(Phalcon_Config_ConfigFactory); ZEPHIR_INIT(Phalcon_Config_Exception); - ZEPHIR_INIT(Phalcon_Container_Container); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_ConnectionLocator); ZEPHIR_INIT(Phalcon_DataMapper_Pdo_Connection_Decorated); @@ -1090,21 +1094,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Html_TagFactory); ZEPHIR_INIT(Phalcon_Http_Cookie); ZEPHIR_INIT(Phalcon_Http_Cookie_Exception); - ZEPHIR_INIT(Phalcon_Http_Message_Exception_InvalidArgumentException); - ZEPHIR_INIT(Phalcon_Http_Message_Request); - ZEPHIR_INIT(Phalcon_Http_Message_RequestFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Response); - ZEPHIR_INIT(Phalcon_Http_Message_ResponseFactory); - ZEPHIR_INIT(Phalcon_Http_Message_ServerRequest); - ZEPHIR_INIT(Phalcon_Http_Message_ServerRequestFactory); - ZEPHIR_INIT(Phalcon_Http_Message_StreamFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Input); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Memory); - ZEPHIR_INIT(Phalcon_Http_Message_Stream_Temp); - ZEPHIR_INIT(Phalcon_Http_Message_UploadedFile); - ZEPHIR_INIT(Phalcon_Http_Message_UploadedFileFactory); - ZEPHIR_INIT(Phalcon_Http_Message_Uri); - ZEPHIR_INIT(Phalcon_Http_Message_UriFactory); ZEPHIR_INIT(Phalcon_Http_Request); ZEPHIR_INIT(Phalcon_Http_Request_Exception); ZEPHIR_INIT(Phalcon_Http_Request_File); @@ -1112,8 +1101,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Http_Response_Cookies); ZEPHIR_INIT(Phalcon_Http_Response_Exception); ZEPHIR_INIT(Phalcon_Http_Response_Headers); - ZEPHIR_INIT(Phalcon_Http_Server_AbstractMiddleware); - ZEPHIR_INIT(Phalcon_Http_Server_AbstractRequestHandler); ZEPHIR_INIT(Phalcon_Image_Adapter_Gd); ZEPHIR_INIT(Phalcon_Image_Adapter_Imagick); ZEPHIR_INIT(Phalcon_Image_Enum); @@ -1123,6 +1110,7 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Logger_Adapter_Noop); ZEPHIR_INIT(Phalcon_Logger_Adapter_Stream); ZEPHIR_INIT(Phalcon_Logger_Adapter_Syslog); + ZEPHIR_INIT(Phalcon_Logger_Enum); ZEPHIR_INIT(Phalcon_Logger_Exception); ZEPHIR_INIT(Phalcon_Logger_Formatter_Json); ZEPHIR_INIT(Phalcon_Logger_Formatter_Line); @@ -1194,11 +1182,17 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(Phalcon_Storage_Exception); ZEPHIR_INIT(Phalcon_Storage_SerializerFactory); ZEPHIR_INIT(Phalcon_Storage_Serializer_Base64); - ZEPHIR_INIT(Phalcon_Storage_Serializer_Igbinary); ZEPHIR_INIT(Phalcon_Storage_Serializer_Json); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedIgbinary); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedJson); + ZEPHIR_INIT(Phalcon_Storage_Serializer_MemcachedPhp); ZEPHIR_INIT(Phalcon_Storage_Serializer_Msgpack); - ZEPHIR_INIT(Phalcon_Storage_Serializer_None); ZEPHIR_INIT(Phalcon_Storage_Serializer_Php); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisIgbinary); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisJson); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisMsgpack); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisNone); + ZEPHIR_INIT(Phalcon_Storage_Serializer_RedisPhp); ZEPHIR_INIT(Phalcon_Support_Collection_Exception); ZEPHIR_INIT(Phalcon_Support_Collection_ReadOnlyCollection); ZEPHIR_INIT(Phalcon_Support_Debug); @@ -1284,10 +1278,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(phalcon_12__closure); ZEPHIR_INIT(phalcon_13__closure); ZEPHIR_INIT(phalcon_14__closure); - ZEPHIR_INIT(phalcon_15__closure); - ZEPHIR_INIT(phalcon_16__closure); - ZEPHIR_INIT(phalcon_17__closure); - ZEPHIR_INIT(phalcon_18__closure); ZEPHIR_INIT(phalcon_1__closure); ZEPHIR_INIT(phalcon_2__closure); ZEPHIR_INIT(phalcon_3__closure); @@ -1426,7 +1416,6 @@ static const zend_module_dep php_phalcon_deps[] = { ZEND_MOD_REQUIRED("standard") ZEND_MOD_REQUIRED("hash") ZEND_MOD_REQUIRED("json") - ZEND_MOD_REQUIRED("psr") ZEND_MOD_END }; diff --git a/ext/phalcon.h b/ext/phalcon.h index ff934ab88d6..211d9790d64 100644 --- a/ext/phalcon.h +++ b/ext/phalcon.h @@ -15,6 +15,8 @@ #include "phalcon/di/abstractinjectionaware.zep.h" #include "phalcon/storage/adapter/adapterinterface.zep.h" #include "phalcon/factory/abstractfactory.zep.h" +#include "phalcon/storage/serializer/serializerinterface.zep.h" +#include "phalcon/storage/serializer/abstractserializer.zep.h" #include "phalcon/di/injectable.zep.h" #include "phalcon/forms/element/elementinterface.zep.h" #include "phalcon/forms/element/abstractelement.zep.h" @@ -22,27 +24,25 @@ #include "phalcon/storage/adapter/abstractadapter.zep.h" #include "phalcon/support/collection.zep.h" #include "phalcon/support/helper/arr/abstractarr.zep.h" +#include "phalcon/storage/serializer/none.zep.h" #include "phalcon/dispatcher/dispatcherinterface.zep.h" #include "phalcon/encryption/crypt/padding/padinterface.zep.h" #include "phalcon/filter/validation/validator/file/abstractfile.zep.h" -#include "phalcon/storage/serializer/serializerinterface.zep.h" #include "phalcon/assets/assetinterface.zep.h" #include "phalcon/config/configinterface.zep.h" -#include "phalcon/http/message/abstractcommon.zep.h" #include "phalcon/mvc/model/metadatainterface.zep.h" -#include "phalcon/storage/serializer/abstractserializer.zep.h" #include "phalcon/cache/adapter/adapterinterface.zep.h" #include "phalcon/config/config.zep.h" #include "phalcon/datamapper/query/abstractquery.zep.h" #include "phalcon/db/adapter/adapterinterface.zep.h" -#include "phalcon/http/message/requestmethodinterface.zep.h" #include "phalcon/mvc/model/metadata.zep.h" #include "phalcon/annotations/adapter/adapterinterface.zep.h" #include "phalcon/datamapper/pdo/connection/pdointerface.zep.h" #include "phalcon/db/adapter/abstractadapter.zep.h" #include "phalcon/db/dialectinterface.zep.h" #include "phalcon/html/helper/abstractseries.zep.h" -#include "phalcon/http/message/abstractmessage.zep.h" +#include "phalcon/html/link/interfaces/linkinterface.zep.h" +#include "phalcon/html/link/interfaces/linkproviderinterface.zep.h" #include "phalcon/logger/adapter/adapterinterface.zep.h" #include "phalcon/mvc/model/resultsetinterface.zep.h" #include "phalcon/paginator/adapter/adapterinterface.zep.h" @@ -59,7 +59,6 @@ #include "phalcon/filter/validation/validatorcompositeinterface.zep.h" #include "phalcon/flash/flashinterface.zep.h" #include "phalcon/html/helper/abstractlist.zep.h" -#include "phalcon/http/message/stream.zep.h" #include "phalcon/image/adapter/adapterinterface.zep.h" #include "phalcon/logger/adapter/abstractadapter.zep.h" #include "phalcon/logger/formatter/formatterinterface.zep.h" @@ -75,6 +74,7 @@ #include "phalcon/application/exception.zep.h" #include "phalcon/assets/asset.zep.h" #include "phalcon/assets/inline.zep.h" +#include "phalcon/cache/cacheinterface.zep.h" #include "phalcon/datamapper/pdo/connection/abstractconnection.zep.h" #include "phalcon/datamapper/pdo/exception/exception.zep.h" #include "phalcon/di/di.zep.h" @@ -85,10 +85,11 @@ #include "phalcon/encryption/security/jwt/token/abstractitem.zep.h" #include "phalcon/filter/validation/abstractvalidatorcomposite.zep.h" #include "phalcon/flash/abstractflash.zep.h" -#include "phalcon/http/message/abstractrequest.zep.h" -#include "phalcon/http/message/responsestatuscodeinterface.zep.h" +#include "phalcon/html/link/abstractlink.zep.h" +#include "phalcon/html/link/abstractlinkprovider.zep.h" #include "phalcon/image/adapter/abstractadapter.zep.h" #include "phalcon/logger/formatter/abstractformatter.zep.h" +#include "phalcon/logger/loggerinterface.zep.h" #include "phalcon/mvc/entityinterface.zep.h" #include "phalcon/mvc/model/behavior.zep.h" #include "phalcon/mvc/model/metadata/strategy/strategyinterface.zep.h" @@ -102,6 +103,7 @@ #include "phalcon/acl/componentinterface.zep.h" #include "phalcon/acl/roleinterface.zep.h" #include "phalcon/annotations/readerinterface.zep.h" +#include "phalcon/cache/abstractcache.zep.h" #include "phalcon/cli/dispatcherinterface.zep.h" #include "phalcon/cli/router/routeinterface.zep.h" #include "phalcon/cli/taskinterface.zep.h" @@ -129,15 +131,20 @@ #include "phalcon/html/helper/input/checkbox.zep.h" #include "phalcon/html/helper/ol.zep.h" #include "phalcon/html/helper/style.zep.h" +#include "phalcon/html/link/interfaces/evolvablelinkinterface.zep.h" +#include "phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.h" #include "phalcon/html/link/link.zep.h" #include "phalcon/html/link/linkprovider.zep.h" #include "phalcon/html/link/serializer/serializerinterface.zep.h" #include "phalcon/http/cookie/cookieinterface.zep.h" +#include "phalcon/http/message/requestmethodinterface.zep.h" +#include "phalcon/http/message/responsestatuscodeinterface.zep.h" #include "phalcon/http/request/fileinterface.zep.h" #include "phalcon/http/requestinterface.zep.h" #include "phalcon/http/response/cookiesinterface.zep.h" #include "phalcon/http/response/headersinterface.zep.h" #include "phalcon/http/responseinterface.zep.h" +#include "phalcon/logger/abstractlogger.zep.h" #include "phalcon/messages/messageinterface.zep.h" #include "phalcon/mvc/controllerinterface.zep.h" #include "phalcon/mvc/dispatcherinterface.zep.h" @@ -161,12 +168,14 @@ #include "phalcon/mvc/viewinterface.zep.h" #include "phalcon/paginator/repositoryinterface.zep.h" #include "phalcon/session/adapter/noop.zep.h" +#include "phalcon/session/baginterface.zep.h" #include "phalcon/session/managerinterface.zep.h" #include "phalcon/storage/adapter/apcu.zep.h" #include "phalcon/storage/adapter/libmemcached.zep.h" #include "phalcon/storage/adapter/memory.zep.h" #include "phalcon/storage/adapter/redis.zep.h" #include "phalcon/storage/adapter/stream.zep.h" +#include "phalcon/storage/serializer/igbinary.zep.h" #include "phalcon/acl/adapter/memory.zep.h" #include "phalcon/acl/component.zep.h" #include "phalcon/acl/componentawareinterface.zep.h" @@ -221,7 +230,6 @@ #include "phalcon/config/adapter/yaml.zep.h" #include "phalcon/config/configfactory.zep.h" #include "phalcon/config/exception.zep.h" -#include "phalcon/container/container.zep.h" #include "phalcon/datamapper/pdo/connection.zep.h" #include "phalcon/datamapper/pdo/connection/decorated.zep.h" #include "phalcon/datamapper/pdo/connectionlocator.zep.h" @@ -254,6 +262,7 @@ #include "phalcon/db/result/pdoresult.zep.h" #include "phalcon/di/exception/serviceresolutionexception.zep.h" #include "phalcon/di/factorydefault/cli.zep.h" +#include "phalcon/di/initializationawareinterface.zep.h" #include "phalcon/di/service.zep.h" #include "phalcon/di/service/builder.zep.h" #include "phalcon/di/serviceproviderinterface.zep.h" @@ -413,21 +422,6 @@ #include "phalcon/html/tagfactory.zep.h" #include "phalcon/http/cookie.zep.h" #include "phalcon/http/cookie/exception.zep.h" -#include "phalcon/http/message/exception/invalidargumentexception.zep.h" -#include "phalcon/http/message/request.zep.h" -#include "phalcon/http/message/requestfactory.zep.h" -#include "phalcon/http/message/response.zep.h" -#include "phalcon/http/message/responsefactory.zep.h" -#include "phalcon/http/message/serverrequest.zep.h" -#include "phalcon/http/message/serverrequestfactory.zep.h" -#include "phalcon/http/message/stream/input.zep.h" -#include "phalcon/http/message/stream/memory.zep.h" -#include "phalcon/http/message/stream/temp.zep.h" -#include "phalcon/http/message/streamfactory.zep.h" -#include "phalcon/http/message/uploadedfile.zep.h" -#include "phalcon/http/message/uploadedfilefactory.zep.h" -#include "phalcon/http/message/uri.zep.h" -#include "phalcon/http/message/urifactory.zep.h" #include "phalcon/http/request.zep.h" #include "phalcon/http/request/exception.zep.h" #include "phalcon/http/request/file.zep.h" @@ -435,8 +429,6 @@ #include "phalcon/http/response/cookies.zep.h" #include "phalcon/http/response/exception.zep.h" #include "phalcon/http/response/headers.zep.h" -#include "phalcon/http/server/abstractmiddleware.zep.h" -#include "phalcon/http/server/abstractrequesthandler.zep.h" #include "phalcon/image/adapter/gd.zep.h" #include "phalcon/image/adapter/imagick.zep.h" #include "phalcon/image/enum.zep.h" @@ -446,6 +438,7 @@ #include "phalcon/logger/adapter/stream.zep.h" #include "phalcon/logger/adapter/syslog.zep.h" #include "phalcon/logger/adapterfactory.zep.h" +#include "phalcon/logger/enum.zep.h" #include "phalcon/logger/exception.zep.h" #include "phalcon/logger/formatter/json.zep.h" #include "phalcon/logger/formatter/line.zep.h" @@ -520,11 +513,17 @@ #include "phalcon/storage/adapterfactory.zep.h" #include "phalcon/storage/exception.zep.h" #include "phalcon/storage/serializer/base64.zep.h" -#include "phalcon/storage/serializer/igbinary.zep.h" #include "phalcon/storage/serializer/json.zep.h" +#include "phalcon/storage/serializer/memcachedigbinary.zep.h" +#include "phalcon/storage/serializer/memcachedjson.zep.h" +#include "phalcon/storage/serializer/memcachedphp.zep.h" #include "phalcon/storage/serializer/msgpack.zep.h" -#include "phalcon/storage/serializer/none.zep.h" #include "phalcon/storage/serializer/php.zep.h" +#include "phalcon/storage/serializer/redisigbinary.zep.h" +#include "phalcon/storage/serializer/redisjson.zep.h" +#include "phalcon/storage/serializer/redismsgpack.zep.h" +#include "phalcon/storage/serializer/redisnone.zep.h" +#include "phalcon/storage/serializer/redisphp.zep.h" #include "phalcon/storage/serializerfactory.zep.h" #include "phalcon/support/collection/exception.zep.h" #include "phalcon/support/collection/readonlycollection.zep.h" @@ -620,9 +619,5 @@ #include "phalcon/12__closure.zep.h" #include "phalcon/13__closure.zep.h" #include "phalcon/14__closure.zep.h" -#include "phalcon/15__closure.zep.h" -#include "phalcon/16__closure.zep.h" -#include "phalcon/17__closure.zep.h" -#include "phalcon/18__closure.zep.h" #endif \ No newline at end of file diff --git a/ext/phalcon/0__closure.zep.c b/ext/phalcon/0__closure.zep.c index b2065d74011..e973509f373 100644 --- a/ext/phalcon/0__closure.zep.c +++ b/ext/phalcon/0__closure.zep.c @@ -12,7 +12,9 @@ #include #include "kernel/main.h" +#include "kernel/string.h" #include "kernel/memory.h" +#include "kernel/fcall.h" #include "kernel/object.h" @@ -25,28 +27,28 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure) PHP_METHOD(phalcon_0__closure, __invoke) { - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *element, element_sub, _0; zval *this_ptr = getThis(); - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&element_sub); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_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_START(1, 1) + Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); + ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, element); + zephir_check_call_status(); + zephir_ucfirst(return_value, &_0); + RETURN_MM(); } diff --git a/ext/phalcon/0__closure.zep.h b/ext/phalcon/0__closure.zep.h index d60a891bff2..5c7747be989 100644 --- a/ext/phalcon/0__closure.zep.h +++ b/ext/phalcon/0__closure.zep.h @@ -5,11 +5,8 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure); PHP_METHOD(phalcon_0__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_0__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_0__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_0__closure_method_entry) { diff --git a/ext/phalcon/13__closure.zep.c b/ext/phalcon/13__closure.zep.c index e9eac76c408..41392cea2d4 100644 --- a/ext/phalcon/13__closure.zep.c +++ b/ext/phalcon/13__closure.zep.c @@ -25,28 +25,26 @@ ZEPHIR_INIT_CLASS(phalcon_13__closure) PHP_METHOD(phalcon_13__closure, __invoke) { - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; + zend_bool _0; + zval *element, element_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&element_sub); #if PHP_VERSION_ID >= 80000 bool is_null_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_START(1, 1) + Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); + zephir_fetch_params_without_memory_grow(1, 0, &element); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); + _0 = Z_TYPE_P(element) == IS_LONG; + if (!(_0)) { + _0 = Z_TYPE_P(element) == IS_STRING; + } + RETURN_BOOL(_0); } diff --git a/ext/phalcon/13__closure.zep.h b/ext/phalcon/13__closure.zep.h index e37103b8a77..c72d27423df 100644 --- a/ext/phalcon/13__closure.zep.h +++ b/ext/phalcon/13__closure.zep.h @@ -5,11 +5,8 @@ ZEPHIR_INIT_CLASS(phalcon_13__closure); PHP_METHOD(phalcon_13__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_13__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_13__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_13__closure_method_entry) { diff --git a/ext/phalcon/14__closure.zep.c b/ext/phalcon/14__closure.zep.c index d6cd97546c9..c1e941f9357 100644 --- a/ext/phalcon/14__closure.zep.c +++ b/ext/phalcon/14__closure.zep.c @@ -25,30 +25,26 @@ ZEPHIR_INIT_CLASS(phalcon_14__closure) PHP_METHOD(phalcon_14__closure, __invoke) { - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; + zend_bool _0; + zval *element, element_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&element_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); + zephir_fetch_params_without_memory_grow(1, 0, &element); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); + _0 = Z_TYPE_P(element) == IS_LONG; + if (!(_0)) { + _0 = Z_TYPE_P(element) == IS_STRING; + } + RETURN_BOOL(_0); } diff --git a/ext/phalcon/14__closure.zep.h b/ext/phalcon/14__closure.zep.h index f21e4a4087e..0e75268111d 100644 --- a/ext/phalcon/14__closure.zep.h +++ b/ext/phalcon/14__closure.zep.h @@ -5,12 +5,8 @@ ZEPHIR_INIT_CLASS(phalcon_14__closure); PHP_METHOD(phalcon_14__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_14__closure___invoke, 0, 0, 5) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_14__closure___invoke, 0, 0, 1) + ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_14__closure_method_entry) { diff --git a/ext/phalcon/15__closure.zep.c b/ext/phalcon/15__closure.zep.c deleted file mode 100644 index 414bf9aa736..00000000000 --- a/ext/phalcon/15__closure.zep.c +++ /dev/null @@ -1,52 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -ZEPHIR_INIT_CLASS(phalcon_15__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 15__closure, phalcon, 15__closure, phalcon_15__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -PHP_METHOD(phalcon_15__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_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(); -#endif - - - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); -} - diff --git a/ext/phalcon/15__closure.zep.h b/ext/phalcon/15__closure.zep.h deleted file mode 100644 index dea68db8b76..00000000000 --- a/ext/phalcon/15__closure.zep.h +++ /dev/null @@ -1,18 +0,0 @@ - -extern zend_class_entry *phalcon_15__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_15__closure); - -PHP_METHOD(phalcon_15__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_15__closure___invoke, 0, 0, 4) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_15__closure_method_entry) { - PHP_ME(phalcon_15__closure, __invoke, arginfo_phalcon_15__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; diff --git a/ext/phalcon/16__closure.zep.c b/ext/phalcon/16__closure.zep.c deleted file mode 100644 index 9c5afcdea3c..00000000000 --- a/ext/phalcon/16__closure.zep.c +++ /dev/null @@ -1,54 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -ZEPHIR_INIT_CLASS(phalcon_16__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 16__closure, phalcon, 16__closure, phalcon_16__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -PHP_METHOD(phalcon_16__closure, __invoke) -{ - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&number_sub); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&file_sub); - ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); - ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) - Z_PARAM_ZVAL(number) - Z_PARAM_ZVAL(message) - Z_PARAM_ZVAL(file) - Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); -} - diff --git a/ext/phalcon/16__closure.zep.h b/ext/phalcon/16__closure.zep.h deleted file mode 100644 index 38c0c885102..00000000000 --- a/ext/phalcon/16__closure.zep.h +++ /dev/null @@ -1,19 +0,0 @@ - -extern zend_class_entry *phalcon_16__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_16__closure); - -PHP_METHOD(phalcon_16__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_16__closure___invoke, 0, 0, 5) - ZEND_ARG_INFO(0, number) - ZEND_ARG_INFO(0, message) - ZEND_ARG_INFO(0, file) - ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_16__closure_method_entry) { - PHP_ME(phalcon_16__closure, __invoke, arginfo_phalcon_16__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; diff --git a/ext/phalcon/17__closure.zep.c b/ext/phalcon/17__closure.zep.c deleted file mode 100644 index 8064a97f953..00000000000 --- a/ext/phalcon/17__closure.zep.c +++ /dev/null @@ -1,50 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -ZEPHIR_INIT_CLASS(phalcon_17__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 17__closure, phalcon, 17__closure, phalcon_17__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -PHP_METHOD(phalcon_17__closure, __invoke) -{ - zend_bool _0; - zval *element, element_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &element); - - - _0 = Z_TYPE_P(element) == IS_LONG; - if (!(_0)) { - _0 = Z_TYPE_P(element) == IS_STRING; - } - RETURN_BOOL(_0); -} - diff --git a/ext/phalcon/17__closure.zep.h b/ext/phalcon/17__closure.zep.h deleted file mode 100644 index 83882688b28..00000000000 --- a/ext/phalcon/17__closure.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_17__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_17__closure); - -PHP_METHOD(phalcon_17__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_17__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_17__closure_method_entry) { - PHP_ME(phalcon_17__closure, __invoke, arginfo_phalcon_17__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; diff --git a/ext/phalcon/18__closure.zep.c b/ext/phalcon/18__closure.zep.c deleted file mode 100644 index b839a8e13c9..00000000000 --- a/ext/phalcon/18__closure.zep.c +++ /dev/null @@ -1,50 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../ext_config.h" -#endif - -#include -#include "../php_ext.h" -#include "../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -ZEPHIR_INIT_CLASS(phalcon_18__closure) -{ - ZEPHIR_REGISTER_CLASS(phalcon, 18__closure, phalcon, 18__closure, phalcon_18__closure_method_entry, ZEND_ACC_FINAL_CLASS); - - return SUCCESS; -} - -PHP_METHOD(phalcon_18__closure, __invoke) -{ - zend_bool _0; - zval *element, element_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &element); - - - _0 = Z_TYPE_P(element) == IS_LONG; - if (!(_0)) { - _0 = Z_TYPE_P(element) == IS_STRING; - } - RETURN_BOOL(_0); -} - diff --git a/ext/phalcon/18__closure.zep.h b/ext/phalcon/18__closure.zep.h deleted file mode 100644 index 03a0d15e681..00000000000 --- a/ext/phalcon/18__closure.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_18__closure_ce; - -ZEPHIR_INIT_CLASS(phalcon_18__closure); - -PHP_METHOD(phalcon_18__closure, __invoke); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_18__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_18__closure_method_entry) { - PHP_ME(phalcon_18__closure, __invoke, arginfo_phalcon_18__closure___invoke, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_FE_END -}; diff --git a/ext/phalcon/1__closure.zep.c b/ext/phalcon/1__closure.zep.c index e3bd6b88447..18fe607f3ec 100644 --- a/ext/phalcon/1__closure.zep.c +++ b/ext/phalcon/1__closure.zep.c @@ -25,28 +25,26 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure) PHP_METHOD(phalcon_1__closure, __invoke) { - zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; + zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&file_sub); ZVAL_UNDEF(&line_sub); - ZVAL_UNDEF(&context_sub); ZVAL_BOOL(&__$true, 1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(5, 5) + ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) Z_PARAM_ZVAL(file) Z_PARAM_ZVAL(line) - Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); + zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); diff --git a/ext/phalcon/1__closure.zep.h b/ext/phalcon/1__closure.zep.h index f1ac1f76483..7de45086253 100644 --- a/ext/phalcon/1__closure.zep.h +++ b/ext/phalcon/1__closure.zep.h @@ -5,12 +5,11 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure); PHP_METHOD(phalcon_1__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_1__closure___invoke, 0, 0, 5) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_1__closure___invoke, 0, 0, 4) ZEND_ARG_INFO(0, number) ZEND_ARG_INFO(0, message) ZEND_ARG_INFO(0, file) ZEND_ARG_INFO(0, line) - ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_1__closure_method_entry) { diff --git a/ext/phalcon/2__closure.zep.c b/ext/phalcon/2__closure.zep.c index 2ddcffecdd8..95c5f9a2bba 100644 --- a/ext/phalcon/2__closure.zep.c +++ b/ext/phalcon/2__closure.zep.c @@ -12,9 +12,7 @@ #include #include "kernel/main.h" -#include "kernel/string.h" #include "kernel/memory.h" -#include "kernel/fcall.h" #include "kernel/object.h" @@ -27,28 +25,30 @@ ZEPHIR_INIT_CLASS(phalcon_2__closure) PHP_METHOD(phalcon_2__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, *context, context_sub, __$true; zval *this_ptr = getThis(); - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&number_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&file_sub); + ZVAL_UNDEF(&line_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_BOOL(&__$true, 1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) + ZEND_PARSE_PARAMETERS_START(5, 5) + Z_PARAM_ZVAL(number) + Z_PARAM_ZVAL(message) + Z_PARAM_ZVAL(file) + Z_PARAM_ZVAL(line) + Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); #endif - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &element); + zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, element); - zephir_check_call_status(); - zephir_ucfirst(return_value, &_0); - RETURN_MM(); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } diff --git a/ext/phalcon/2__closure.zep.h b/ext/phalcon/2__closure.zep.h index 98791d1ff5e..cad0b150dfc 100644 --- a/ext/phalcon/2__closure.zep.h +++ b/ext/phalcon/2__closure.zep.h @@ -5,8 +5,12 @@ ZEPHIR_INIT_CLASS(phalcon_2__closure); PHP_METHOD(phalcon_2__closure, __invoke); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_2__closure___invoke, 0, 0, 1) - ZEND_ARG_INFO(0, element) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_2__closure___invoke, 0, 0, 5) + ZEND_ARG_INFO(0, number) + ZEND_ARG_INFO(0, message) + ZEND_ARG_INFO(0, file) + ZEND_ARG_INFO(0, line) + ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_2__closure_method_entry) { diff --git a/ext/phalcon/acl/adapter/abstractadapter.zep.c b/ext/phalcon/acl/adapter/abstractadapter.zep.c index 0dcf1ed0ae5..475d8a238fb 100644 --- a/ext/phalcon/acl/adapter/abstractadapter.zep.c +++ b/ext/phalcon/acl/adapter/abstractadapter.zep.c @@ -121,7 +121,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, getDefaultAction) } /** - * Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY) + * Sets the default access level (Phalcon\Acl\Enum::ALLOW or Phalcon\Acl\Enum::DENY) */ PHP_METHOD(Phalcon_Acl_Adapter_AbstractAdapter, setDefaultAction) { diff --git a/ext/phalcon/acl/adapter/memory.zep.c b/ext/phalcon/acl/adapter/memory.zep.c index 226727605cc..7ec1ec89afc 100644 --- a/ext/phalcon/acl/adapter/memory.zep.c +++ b/ext/phalcon/acl/adapter/memory.zep.c @@ -299,10 +299,10 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponent) } else { ZEPHIR_INIT_NVAR(&componentObject); object_init_ex(&componentObject, phalcon_acl_component_ce); - ZEPHIR_CALL_METHOD(NULL, &componentObject, "__construct", NULL, 158, componentValue); + ZEPHIR_CALL_METHOD(NULL, &componentObject, "__construct", NULL, 137, componentValue); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 159); + ZEPHIR_CALL_METHOD(&componentName, &componentObject, "getname", NULL, 138); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_1, &componentName))) { @@ -359,7 +359,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addComponentAccess) zephir_read_property(&_0, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Component"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &componentName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &componentName, &_1); zephir_check_call_status(); _2 = Z_TYPE_P(accessList) != IS_ARRAY; if (_2) { @@ -510,7 +510,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZVAL_STRING(&_1, "Role"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "role list"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &roleName, &_1, &_2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &roleName, &_1, &_2); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("roleInherits"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_3, &roleName))) { @@ -552,7 +552,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_11$$10, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_12$$10); ZEPHIR_CONCAT_SVS(&_12$$10, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, &_11$$10, "__construct", &_13, 31, &_12$$10); + ZEPHIR_CALL_METHOD(NULL, &_11$$10, "__construct", &_13, 29, &_12$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$10, "phalcon/Acl/Adapter/Memory.zep", 317); ZEPHIR_MM_RESTORE(); @@ -574,7 +574,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _17$$12); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -590,7 +590,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_16$$12, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_16$$12, "next", NULL, 0); @@ -605,7 +605,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -617,7 +617,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_21$$17, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_22$$17); ZEPHIR_CONCAT_SVS(&_22$$17, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop"); - ZEPHIR_CALL_METHOD(NULL, &_21$$17, "__construct", &_13, 31, &_22$$17); + ZEPHIR_CALL_METHOD(NULL, &_21$$17, "__construct", &_13, 29, &_22$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$17, "phalcon/Acl/Adapter/Memory.zep", 349); ZEPHIR_MM_RESTORE(); @@ -634,7 +634,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _26$$18); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -650,7 +650,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_25$$18, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_25$$18, "next", NULL, 0); @@ -695,7 +695,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_32$$25, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_33$$25); ZEPHIR_CONCAT_SVS(&_33$$25, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, &_32$$25, "__construct", &_13, 31, &_33$$25); + ZEPHIR_CALL_METHOD(NULL, &_32$$25, "__construct", &_13, 29, &_33$$25); zephir_check_call_status(); zephir_throw_exception_debug(&_32$$25, "phalcon/Acl/Adapter/Memory.zep", 317); ZEPHIR_MM_RESTORE(); @@ -717,7 +717,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _37$$27); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -733,7 +733,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_36$$27, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_36$$27, "next", NULL, 0); @@ -748,7 +748,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_20, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -760,7 +760,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) object_init_ex(&_39$$32, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_40$$32); ZEPHIR_CONCAT_SVS(&_40$$32, "Role '", &roleInheritName, "' (to inherit) produces an infinite loop"); - ZEPHIR_CALL_METHOD(NULL, &_39$$32, "__construct", &_13, 31, &_40$$32); + ZEPHIR_CALL_METHOD(NULL, &_39$$32, "__construct", &_13, 29, &_40$$32); zephir_check_call_status(); zephir_throw_exception_debug(&_39$$32, "phalcon/Acl/Adapter/Memory.zep", 349); ZEPHIR_MM_RESTORE(); @@ -777,7 +777,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _44$$33); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -793,7 +793,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_43$$33, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_19, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_43$$33, "next", NULL, 0); @@ -867,13 +867,13 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole) } else if (Z_TYPE_P(role) == IS_STRING) { ZEPHIR_INIT_NVAR(&roleObject); object_init_ex(&roleObject, phalcon_acl_role_ce); - ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 162, role); + ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 141, role); zephir_check_call_status(); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role must be either a string or implement RoleInterface", "phalcon/Acl/Adapter/Memory.zep", 393); return; } - ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 163); + ZEPHIR_CALL_METHOD(&roleName, &roleObject, "getname", NULL, 142); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_1, &roleName)) { @@ -964,7 +964,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) ZEPHIR_INIT_NVAR(&role); ZVAL_COPY(&role, _2); ZVAL_LONG(&_4$$4, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_4$$4, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_4$$4, func); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -979,7 +979,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0); zephir_check_call_status(); ZVAL_LONG(&_6$$5, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_6$$5, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_6$$5, func); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0); zephir_check_call_status(); @@ -1066,7 +1066,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) ZEPHIR_INIT_NVAR(&role); ZVAL_COPY(&role, _2); ZVAL_LONG(&_4$$4, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_4$$4, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_4$$4, func); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -1081,7 +1081,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) ZEPHIR_CALL_METHOD(&role, &rolesArray, "current", NULL, 0); zephir_check_call_status(); ZVAL_LONG(&_6$$5, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 164, &role, &componentName, access, &_6$$5, func); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "allowordeny", &_5, 143, &role, &componentName, access, &_6$$5, func); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &rolesArray, "next", NULL, 0); zephir_check_call_status(); @@ -1405,7 +1405,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_1$$6, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_2$$6); ZEPHIR_CONCAT_SS(&_2$$6, "Object passed as roleName must implement ", "Phalcon\\Acl\\RoleAwareInterface or Phalcon\\Acl\\RoleInterface"); - ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 31, &_2$$6); + ZEPHIR_CALL_METHOD(NULL, &_1$$6, "__construct", NULL, 29, &_2$$6); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$6, "phalcon/Acl/Adapter/Memory.zep", 587); ZEPHIR_MM_RESTORE(); @@ -1426,7 +1426,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_4$$10, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_5$$10); ZEPHIR_CONCAT_SS(&_5$$10, "Object passed as componentName must implement ", "Phalcon\\Acl\\ComponentAwareInterface or Phalcon\\Acl\\ComponentInterface"); - ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 31, &_5$$10); + ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", NULL, 29, &_5$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$10, "phalcon/Acl/Adapter/Memory.zep", 601); ZEPHIR_MM_RESTORE(); @@ -1458,7 +1458,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_read_property(&_9$$12, this_ptr, ZEND_STRL("defaultAccess"), PH_NOISY_CC | PH_READONLY); RETURN_MM_BOOL((ZEPHIR_IS_LONG(&_9$$12, 1))); } - ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 165, roleName, componentName, &access); + ZEPHIR_CALL_METHOD(&accessKey, this_ptr, "canaccess", NULL, 144, roleName, componentName, &access); zephir_check_call_status(); _10 = Z_TYPE_P(&accessKey) != IS_NULL; if (_10) { @@ -1487,9 +1487,9 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) if (zephir_is_callable(&funcAccess)) { ZEPHIR_INIT_VAR(&reflectionFunction); object_init_ex(&reflectionFunction, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 166, &funcAccess); + ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 145, &funcAccess); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 167); + ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 146); zephir_check_call_status(); ZEPHIR_INIT_VAR(¶meterNumber); ZVAL_LONG(¶meterNumber, zephir_fast_count_int(&reflectionParameters)); @@ -1505,7 +1505,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) } ZEPHIR_INIT_VAR(¶metersForFunction); array_init(¶metersForFunction); - ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 168); + ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 147); zephir_check_call_status(); ZEPHIR_CPY_WRT(&userParametersSizeShouldBe, ¶meterNumber); zephir_is_iterable(&reflectionParameters, 0, "phalcon/Acl/Adapter/Memory.zep", 736); @@ -1575,7 +1575,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_32$$21); ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_32$$21, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_29$$21, " , Class in defined function: ", &_31$$21, "."); - ZEPHIR_CALL_METHOD(NULL, &_28$$21, "__construct", NULL, 31, &_32$$21); + ZEPHIR_CALL_METHOD(NULL, &_28$$21, "__construct", NULL, 29, &_32$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$21, "phalcon/Acl/Adapter/Memory.zep", 723); ZEPHIR_MM_RESTORE(); @@ -1659,7 +1659,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$27); ZEPHIR_CONCAT_SSSVSVSVSVSVS(&_49$$27, "Your passed parameter doesn't have the ", "same class as the parameter in defined function ", "when checking if ", roleName, " can ", &access, " ", componentName, ". Class passed: ", &_46$$27, " , Class in defined function: ", &_48$$27, "."); - ZEPHIR_CALL_METHOD(NULL, &_45$$27, "__construct", NULL, 31, &_49$$27); + ZEPHIR_CALL_METHOD(NULL, &_45$$27, "__construct", NULL, 29, &_49$$27); zephir_check_call_status(); zephir_throw_exception_debug(&_45$$27, "phalcon/Acl/Adapter/Memory.zep", 723); ZEPHIR_MM_RESTORE(); @@ -1719,7 +1719,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) object_init_ex(&_60$$15, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_61$$15); ZEPHIR_CONCAT_SSVSVSVS(&_61$$15, "You did not provide all necessary parameters for the ", "defined function when checking if '", roleName, "' can '", &access, "' for '", componentName, "'."); - ZEPHIR_CALL_METHOD(NULL, &_60$$15, "__construct", NULL, 31, &_61$$15); + ZEPHIR_CALL_METHOD(NULL, &_60$$15, "__construct", NULL, 29, &_61$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_60$$15, "phalcon/Acl/Adapter/Memory.zep", 777); ZEPHIR_MM_RESTORE(); @@ -1874,12 +1874,12 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) zephir_read_property(&_0, this_ptr, ZEND_STRL("roles"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Role"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_0, &roleName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_0, &roleName, &_1); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("componentsNames"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Component"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 160, &_2, &componentName, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkexists", NULL, 139, &_2, &componentName, &_1); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("accessList"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&accessList, &_3); @@ -1897,7 +1897,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_6$$5, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVSVS(&_7$$5, "Access '", &accessName, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", &_8, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", &_8, 29, &_7$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$5, "phalcon/Acl/Adapter/Memory.zep", 829); ZEPHIR_MM_RESTORE(); @@ -1922,7 +1922,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_9$$7, phalcon_acl_exception_ce); ZEPHIR_INIT_NVAR(&_10$$7); ZEPHIR_CONCAT_SVSVS(&_10$$7, "Access '", &accessName, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 31, &_10$$7); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 29, &_10$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$7, "phalcon/Acl/Adapter/Memory.zep", 829); ZEPHIR_MM_RESTORE(); @@ -1977,7 +1977,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allowOrDeny) object_init_ex(&_13$$14, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_14$$14); ZEPHIR_CONCAT_SVSVS(&_14$$14, "Access '", access, "' does not exist in component '", &componentName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 31, &_14$$14); + ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 29, &_14$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_13$$14, "phalcon/Acl/Adapter/Memory.zep", 849); ZEPHIR_MM_RESTORE(); @@ -2075,7 +2075,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _3$$6); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -2091,7 +2091,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_2$$6, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_2$$6, "next", NULL, 0); @@ -2106,7 +2106,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) break; } ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 23, &checkRoleToInherits); + ZEPHIR_CALL_FUNCTION(&checkRoleToInherit, "array_shift", &_6, 21, &checkRoleToInherits); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); if (zephir_array_isset(&usedRoleToInherits, &checkRoleToInherit)) { @@ -2142,7 +2142,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_INIT_NVAR(&usedRoleToInherit); ZVAL_COPY(&usedRoleToInherit, _13$$14); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); @@ -2158,7 +2158,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, canAccess) ZEPHIR_CALL_METHOD(&usedRoleToInherit, &_12$$14, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&checkRoleToInherits); - ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 161, &checkRoleToInherits, &usedRoleToInherit); + ZEPHIR_CALL_FUNCTION(NULL, "array_push", &_5, 140, &checkRoleToInherits, &usedRoleToInherit); ZEPHIR_UNREF(&checkRoleToInherits); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_12$$14, "next", NULL, 0); @@ -2225,7 +2225,7 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, checkExists) object_init_ex(&_0$$3, phalcon_acl_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_VSVSV(&_1$$3, &elementName, " '", &element, "' does not exist in the ", &suffix); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Acl/Adapter/Memory.zep", 985); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/annotations/adapter/abstractadapter.zep.c b/ext/phalcon/annotations/adapter/abstractadapter.zep.c index 9d2365c61c8..2f56baa6ac9 100644 --- a/ext/phalcon/annotations/adapter/abstractadapter.zep.c +++ b/ext/phalcon/annotations/adapter/abstractadapter.zep.c @@ -104,7 +104,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&classAnnotations); object_init_ex(&classAnnotations, phalcon_annotations_reflection_ce); - ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 46, &parsedAnnotations); + ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 33, &parsedAnnotations); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("annotations"), &realClassName, &classAnnotations); ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &realClassName, &classAnnotations); @@ -114,101 +114,50 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get) } /** - * Returns the annotations found in a specific method + * Returns the annotations found in a specific constant */ -PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod) +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant) { - zend_string *_3$$3; - zend_ulong _2$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$3, _1$$3, _4$$4, _6$$6; - zval className, methodName; + zval *className_param = NULL, *constantName_param = NULL, constants, constant; + zval className, constantName; zval *this_ptr = getThis(); ZVAL_UNDEF(&className); - ZVAL_UNDEF(&methodName); - ZVAL_UNDEF(&classAnnotations); - ZVAL_UNDEF(&methods); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&methodKey); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&constantName); + ZVAL_UNDEF(&constants); + ZVAL_UNDEF(&constant); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(className) - Z_PARAM_STR(methodName) + Z_PARAM_STR(constantName) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &className_param, &methodName_param); + zephir_fetch_params(1, 2, 0, &className_param, &constantName_param); zephir_get_strval(&className, className_param); - zephir_get_strval(&methodName, methodName_param); + zephir_get_strval(&constantName, constantName_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&constants, this_ptr, "getconstants", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(&methods) == IS_ARRAY) { - zephir_is_iterable(&methods, 0, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 94); - if (Z_TYPE_P(&methods) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _2$$3, _3$$3, _0$$3) - { - ZEPHIR_INIT_NVAR(&methodKey); - if (_3$$3 != NULL) { - ZVAL_STR_COPY(&methodKey, _3$$3); - } else { - ZVAL_LONG(&methodKey, _2$$3); - } - ZEPHIR_INIT_NVAR(&method); - ZVAL_COPY(&method, _0$$3); - ZEPHIR_CALL_FUNCTION(&_4$$4, "strcasecmp", &_5, 47, &methodKey, &methodName); - zephir_check_call_status(); - if (!(zephir_is_true(&_4$$4))) { - RETURN_CCTOR(&method); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1$$3, &methods, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&methodKey, &methods, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$6, "strcasecmp", &_5, 47, &methodKey, &methodName); - zephir_check_call_status(); - if (!(zephir_is_true(&_6$$6))) { - RETURN_CCTOR(&method); - } - ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&method); - ZEPHIR_INIT_NVAR(&methodKey); + if (!(zephir_array_isset_fetch(&constant, &constants, &constantName, 1))) { + object_init_ex(return_value, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); + zephir_check_call_status(); + RETURN_MM(); } - object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48); - zephir_check_call_status(); - RETURN_MM(); + RETURN_CTOR(&constant); } /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' constants */ -PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; @@ -233,7 +182,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getconstantsannotations", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -275,7 +224,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty) zephir_check_call_status(); if (!(zephir_array_isset_fetch(&property, &properties, &propertyName, 1))) { object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 48); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); zephir_check_call_status(); RETURN_MM(); } @@ -283,7 +232,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty) } /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' properties */ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties) { @@ -315,6 +264,131 @@ PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties) RETURN_MM(); } +/** + * Returns the annotations found in a specific method + */ +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod) +{ + zend_string *_3$$3; + zend_ulong _2$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_5 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$3, _1$$3, _4$$4, _6$$6; + zval className, methodName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&methodKey); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(className) + Z_PARAM_STR(methodName) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &className_param, &methodName_param); + zephir_get_strval(&className, className_param); + zephir_get_strval(&methodName, methodName_param); + + + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&methods) == IS_ARRAY) { + zephir_is_iterable(&methods, 0, "phalcon/Annotations/Adapter/AbstractAdapter.zep", 167); + if (Z_TYPE_P(&methods) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _2$$3, _3$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&methodKey); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&methodKey, _3$$3); + } else { + ZVAL_LONG(&methodKey, _2$$3); + } + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _0$$3); + ZEPHIR_CALL_FUNCTION(&_4$$4, "strcasecmp", &_5, 35, &methodKey, &methodName); + zephir_check_call_status(); + if (!(zephir_is_true(&_4$$4))) { + RETURN_CCTOR(&method); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1$$3, &methods, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1$$3)) { + break; + } + ZEPHIR_CALL_METHOD(&methodKey, &methods, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(&_6$$6, "strcasecmp", &_5, 35, &methodKey, &methodName); + zephir_check_call_status(); + if (!(zephir_is_true(&_6$$6))) { + RETURN_CCTOR(&method); + } + ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_INIT_NVAR(&methodKey); + } + object_init_ex(return_value, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Returns the annotations found in all the class' methods + */ +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *className_param = NULL, classAnnotations; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&classAnnotations); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(className) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &className_param); + zephir_get_strval(&className, className_param); + + + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + /** * Returns the annotation reader */ diff --git a/ext/phalcon/annotations/adapter/abstractadapter.zep.h b/ext/phalcon/annotations/adapter/abstractadapter.zep.h index 23962a2f9e6..4b4c7bf8439 100644 --- a/ext/phalcon/annotations/adapter/abstractadapter.zep.h +++ b/ext/phalcon/annotations/adapter/abstractadapter.zep.h @@ -4,10 +4,12 @@ extern zend_class_entry *phalcon_annotations_adapter_abstractadapter_ce; ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AbstractAdapter); PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, get); -PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod); -PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods); +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant); +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants); PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty); PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties); +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod); +PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods); PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, getReader); PHP_METHOD(Phalcon_Annotations_Adapter_AbstractAdapter, setReader); zend_object *zephir_init_properties_Phalcon_Annotations_Adapter_AbstractAdapter(zend_class_entry *class_type); @@ -16,12 +18,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstr ZEND_ARG_INFO(0, className) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getconstant, 0, 2, Phalcon\\Annotations\\Collection, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, constantName, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, 0, 1, IS_ARRAY, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getconstants, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -34,6 +36,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abst ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_abstractadapter_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() @@ -46,10 +57,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, get, arginfo_phalcon_annotations_adapter_abstractadapter_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod, arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods, arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getConstant, arginfo_phalcon_annotations_adapter_abstractadapter_getconstant, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getConstants, arginfo_phalcon_annotations_adapter_abstractadapter_getconstants, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getProperty, arginfo_phalcon_annotations_adapter_abstractadapter_getproperty, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getProperties, arginfo_phalcon_annotations_adapter_abstractadapter_getproperties, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethod, arginfo_phalcon_annotations_adapter_abstractadapter_getmethod, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getMethods, arginfo_phalcon_annotations_adapter_abstractadapter_getmethods, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, getReader, arginfo_phalcon_annotations_adapter_abstractadapter_getreader, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter_AbstractAdapter, setReader, arginfo_phalcon_annotations_adapter_abstractadapter_setreader, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/annotations/adapter/adapterinterface.zep.c b/ext/phalcon/annotations/adapter/adapterinterface.zep.c index cab387efe79..6e75781855a 100644 --- a/ext/phalcon/annotations/adapter/adapterinterface.zep.c +++ b/ext/phalcon/annotations/adapter/adapterinterface.zep.c @@ -35,13 +35,13 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_AdapterInterface) */ ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, get); /** - * Returns the annotations found in a specific method + * Returns the annotations found in a specific constant */ -ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethod); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getConstant); /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' constants */ -ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethods); +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getConstants); /** * Returns the annotations found in a specific property */ @@ -50,6 +50,14 @@ ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperty); * Returns the annotations found in all the class' methods */ ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getProperties); +/** + * Returns the annotations found in a specific method + */ +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethod); +/** + * Returns the annotations found in all the class' methods + */ +ZEPHIR_DOC_METHOD(Phalcon_Annotations_Adapter_AdapterInterface, getMethods); /** * Returns the annotation reader */ diff --git a/ext/phalcon/annotations/adapter/adapterinterface.zep.h b/ext/phalcon/annotations/adapter/adapterinterface.zep.h index 72b78c5de53..6eac6ad18fb 100644 --- a/ext/phalcon/annotations/adapter/adapterinterface.zep.h +++ b/ext/phalcon/annotations/adapter/adapterinterface.zep.h @@ -7,12 +7,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapt ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getconstant, 0, 2, Phalcon\\Annotations\\Collection, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, constantName, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethods, 0, 1, IS_ARRAY, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getconstants, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -25,6 +25,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adap ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getmethods, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_adapterinterface_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() @@ -34,10 +43,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapter_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, get, arginfo_phalcon_annotations_adapter_adapterinterface_get) - PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethod, arginfo_phalcon_annotations_adapter_adapterinterface_getmethod) - PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethods, arginfo_phalcon_annotations_adapter_adapterinterface_getmethods) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getConstant, arginfo_phalcon_annotations_adapter_adapterinterface_getconstant) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getConstants, arginfo_phalcon_annotations_adapter_adapterinterface_getconstants) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getProperty, arginfo_phalcon_annotations_adapter_adapterinterface_getproperty) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getProperties, arginfo_phalcon_annotations_adapter_adapterinterface_getproperties) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethod, arginfo_phalcon_annotations_adapter_adapterinterface_getmethod) + PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getMethods, arginfo_phalcon_annotations_adapter_adapterinterface_getmethods) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, getReader, arginfo_phalcon_annotations_adapter_adapterinterface_getreader) PHP_ABSTRACT_ME(Phalcon_Annotations_Adapter_AdapterInterface, setReader, arginfo_phalcon_annotations_adapter_adapterinterface_setreader) PHP_FE_END diff --git a/ext/phalcon/annotations/adapter/apcu.zep.c b/ext/phalcon/annotations/adapter/apcu.zep.c index fd5fc9c3c94..274c76d96cc 100644 --- a/ext/phalcon/annotations/adapter/apcu.zep.c +++ b/ext/phalcon/annotations/adapter/apcu.zep.c @@ -142,7 +142,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, read) ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); zephir_fast_strtolower(&_0, &_2); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 128, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 102, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -192,7 +192,7 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, write) ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); zephir_fast_strtolower(&_0, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("ttl"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 131, &_0, data, &_3); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 103, &_0, data, &_3); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/annotations/adapter/stream.zep.c b/ext/phalcon/annotations/adapter/stream.zep.c index 2ce6c99f722..6214d0d5fdb 100644 --- a/ext/phalcon/annotations/adapter/stream.zep.c +++ b/ext/phalcon/annotations/adapter/stream.zep.c @@ -154,33 +154,33 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Stream, read) RETURN_MM_BOOL(0); } ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "8.0"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ">="); - ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 88, &version, &_4, &_5); + ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 128, &version, &_4, &_5); zephir_check_call_status(); if (zephir_is_true(&_6)) { ZEPHIR_INIT_VAR(&_7$$5); ZEPHIR_INIT_NVAR(&_7$$5); zephir_create_closure_ex(&_7$$5, NULL, phalcon_5__closure_ce, SL("__invoke")); ZVAL_LONG(&_8$$5, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_7$$5, &_8$$5); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_7$$5, &_8$$5); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_9$$6); ZEPHIR_INIT_NVAR(&_9$$6); zephir_create_closure_ex(&_9$$6, NULL, phalcon_6__closure_ce, SL("__invoke")); ZVAL_LONG(&_10$$6, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_9$$6, &_10$$6); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_9$$6, &_10$$6); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_11, "unserialize", NULL, 16, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_11); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Cannot read annotation data", "phalcon/Annotations/Adapter/Stream.zep", 102); diff --git a/ext/phalcon/annotations/annotation.zep.c b/ext/phalcon/annotations/annotation.zep.c index bdde84568b6..fd8db2bc452 100644 --- a/ext/phalcon/annotations/annotation.zep.c +++ b/ext/phalcon/annotations/annotation.zep.c @@ -276,7 +276,7 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) ZEPHIR_INIT_NVAR(&item); ZVAL_COPY(&item, _1$$7); zephir_array_fetch_string(&_3$$8, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139); - ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 169, &_3$$8); + ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 148, &_3$$8); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) { @@ -297,7 +297,7 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) ZEPHIR_CALL_METHOD(&item, &_0$$7, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_5$$11, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Annotations/Annotation.zep", 139); - ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 169, &_5$$11); + ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_4, 148, &_5$$11); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) { @@ -314,7 +314,7 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) } if (ZEPHIR_IS_LONG(&type, 300)) { object_init_ex(return_value, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 170, &expr); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 149, &expr); zephir_check_call_status(); RETURN_MM(); } @@ -322,7 +322,7 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) object_init_ex(&_6$$15, phalcon_annotations_exception_ce); ZEPHIR_INIT_VAR(&_7$$15); ZEPHIR_CONCAT_SVS(&_7$$15, "The expression ", &type, " is unknown"); - ZEPHIR_CALL_METHOD(NULL, &_6$$15, "__construct", NULL, 31, &_7$$15); + ZEPHIR_CALL_METHOD(NULL, &_6$$15, "__construct", NULL, 29, &_7$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$15, "phalcon/Annotations/Annotation.zep", 154); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/annotations/annotationsfactory.zep.c b/ext/phalcon/annotations/annotationsfactory.zep.c index 889c6bb73fb..307fe646f87 100644 --- a/ext/phalcon/annotations/annotationsfactory.zep.c +++ b/ext/phalcon/annotations/annotationsfactory.zep.c @@ -136,7 +136,7 @@ PHP_METHOD(Phalcon_Annotations_AnnotationsFactory, load) array_init(&_2); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "options"); - ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 171, config, &_3, &_2); + ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 150, config, &_3, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); diff --git a/ext/phalcon/annotations/collection.zep.c b/ext/phalcon/annotations/collection.zep.c index c0673ce72fa..dfc7cf93cf6 100644 --- a/ext/phalcon/annotations/collection.zep.c +++ b/ext/phalcon/annotations/collection.zep.c @@ -110,7 +110,7 @@ PHP_METHOD(Phalcon_Annotations_Collection, __construct) ZVAL_COPY(&annotationData, _0); ZEPHIR_INIT_NVAR(&_2$$3); object_init_ex(&_2$$3, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 170, &annotationData); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 149, &annotationData); zephir_check_call_status(); zephir_array_append(&annotations, &_2$$3, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55); } ZEND_HASH_FOREACH_END(); @@ -127,7 +127,7 @@ PHP_METHOD(Phalcon_Annotations_Collection, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_4$$4); object_init_ex(&_4$$4, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", &_3, 170, &annotationData); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", &_3, 149, &annotationData); zephir_check_call_status(); zephir_array_append(&annotations, &_4$$4, PH_SEPARATE, "phalcon/Annotations/Collection.zep", 55); ZEPHIR_CALL_METHOD(NULL, &reflectionData, "next", NULL, 0); @@ -249,7 +249,7 @@ PHP_METHOD(Phalcon_Annotations_Collection, get) object_init_ex(&_5, phalcon_annotations_exception_ce); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVS(&_6, "Collection doesn't have an annotation called '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 31, &_6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 29, &_6); zephir_check_call_status(); zephir_throw_exception_debug(&_5, "phalcon/Annotations/Collection.zep", 100); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/annotations/collection.zep.h b/ext/phalcon/annotations/collection.zep.h index ee68286f306..82c2ec4e30e 100644 --- a/ext/phalcon/annotations/collection.zep.h +++ b/ext/phalcon/annotations/collection.zep.h @@ -26,7 +26,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_collection_get, 0, 1, Phalcon\\Annotations\\Annotation, 0) @@ -59,11 +63,7 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_collection_method_entry) { PHP_ME(Phalcon_Annotations_Collection, __construct, arginfo_phalcon_annotations_collection___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Annotations_Collection, count, arginfo_phalcon_annotations_collection_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Annotations_Collection, current, arginfo_phalcon_annotations_collection_current, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Annotations_Collection, current, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Annotations_Collection, get, arginfo_phalcon_annotations_collection_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, getAll, arginfo_phalcon_annotations_collection_getall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, getAnnotations, arginfo_phalcon_annotations_collection_getannotations, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/annotations/reader.zep.c b/ext/phalcon/annotations/reader.zep.c index 5a0ccb8f662..68b13dba0ad 100644 --- a/ext/phalcon/annotations/reader.zep.c +++ b/ext/phalcon/annotations/reader.zep.c @@ -47,39 +47,51 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) { zval annotations; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, line = 0; - zval *className_param = NULL, reflection, comment, properties, methods, property, method, classAnnotations, annotationsProperties, propertyAnnotations, annotationsMethods, methodAnnotations, _0$$3, _1$$3, *_2$$5, _3$$5, _4$$7, _5$$7, _6$$8, _7$$10, _8$$10, _9$$11, *_10$$13, _11$$13, _12$$15, _13$$15, _14$$16, _15$$18, _16$$18, _17$$19; + zval *className_param = NULL, reflection, comment, arrayKeys, classAnnotations, properties, property, annotationsProperties, propertyAnnotations, methods, method, annotationsMethods, methodAnnotations, constants, constant, anotationsConstants, constantAnnotations, constantReflection, _0$$3, _1$$3, *_2$$5, _3$$5, _5$$7, _6$$7, _7$$10, _8$$10, *_9$$13, _10$$13, _11$$15, _12$$15, _13$$16, _14$$18, _15$$18, _16$$19, *_17$$21, _18$$21, _19$$23, _20$$23, _21$$24, _22$$26, _23$$26, _24$$27; zval className; zval *this_ptr = getThis(); ZVAL_UNDEF(&className); ZVAL_UNDEF(&reflection); ZVAL_UNDEF(&comment); + ZVAL_UNDEF(&arrayKeys); + ZVAL_UNDEF(&classAnnotations); ZVAL_UNDEF(&properties); - ZVAL_UNDEF(&methods); ZVAL_UNDEF(&property); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&classAnnotations); ZVAL_UNDEF(&annotationsProperties); ZVAL_UNDEF(&propertyAnnotations); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&method); ZVAL_UNDEF(&annotationsMethods); ZVAL_UNDEF(&methodAnnotations); + ZVAL_UNDEF(&constants); + ZVAL_UNDEF(&constant); + ZVAL_UNDEF(&anotationsConstants); + ZVAL_UNDEF(&constantAnnotations); + ZVAL_UNDEF(&constantReflection); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_4$$7); ZVAL_UNDEF(&_5$$7); - ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_6$$7); ZVAL_UNDEF(&_7$$10); ZVAL_UNDEF(&_8$$10); - ZVAL_UNDEF(&_9$$11); - ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_11$$15); ZVAL_UNDEF(&_12$$15); - ZVAL_UNDEF(&_13$$15); - ZVAL_UNDEF(&_14$$16); + ZVAL_UNDEF(&_13$$16); + ZVAL_UNDEF(&_14$$18); ZVAL_UNDEF(&_15$$18); - ZVAL_UNDEF(&_16$$18); - ZVAL_UNDEF(&_17$$19); + ZVAL_UNDEF(&_16$$19); + ZVAL_UNDEF(&_18$$21); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$23); + ZVAL_UNDEF(&_21$$24); + ZVAL_UNDEF(&_22$$26); + ZVAL_UNDEF(&_23$$26); + ZVAL_UNDEF(&_24$$27); ZVAL_UNDEF(&annotations); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -98,15 +110,15 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) array_init(&annotations); ZEPHIR_INIT_VAR(&reflection); object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 172, &className); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 151, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 173); + ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 152); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_VAR(&classAnnotations); - ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 175); + ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 154); zephir_check_call_status(); ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&classAnnotations, &comment, &_0$$3, &_1$$3); zephir_check_call_status(); @@ -114,31 +126,96 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_array_update_string(&annotations, SL("class"), &classAnnotations, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 176); + ZEPHIR_CALL_METHOD(&constants, &reflection, "getconstants", NULL, 155); + zephir_check_call_status(); + if (zephir_fast_count_int(&constants)) { + line = 1; + ZEPHIR_INIT_VAR(&arrayKeys); + zephir_array_keys(&arrayKeys, &constants); + ZEPHIR_INIT_VAR(&anotationsConstants); + array_init(&anotationsConstants); + zephir_is_iterable(&arrayKeys, 0, "phalcon/Annotations/Reader.zep", 93); + if (Z_TYPE_P(&arrayKeys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arrayKeys), _2$$5) + { + ZEPHIR_INIT_NVAR(&constant); + ZVAL_COPY(&constant, _2$$5); + ZEPHIR_CALL_METHOD(&constantReflection, &reflection, "getreflectionconstant", &_4, 156, &constant); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&comment, &constantReflection, "getdoccomment", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&constantAnnotations); + ZEPHIR_CALL_METHOD(&_5$$7, &reflection, "getfilename", NULL, 153); + zephir_check_call_status(); + ZVAL_LONG(&_6$$7, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&constantAnnotations, &comment, &_5$$7, &_6$$7); + zephir_check_call_status(); + if (Z_TYPE_P(&constantAnnotations) == IS_ARRAY) { + zephir_array_update_zval(&anotationsConstants, &constant, &constantAnnotations, PH_COPY | PH_SEPARATE); + } + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &arrayKeys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_3$$5, &arrayKeys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_3$$5)) { + break; + } + ZEPHIR_CALL_METHOD(&constant, &arrayKeys, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&constantReflection, &reflection, "getreflectionconstant", &_4, 156, &constant); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&comment, &constantReflection, "getdoccomment", NULL, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&constantAnnotations); + ZEPHIR_CALL_METHOD(&_7$$10, &reflection, "getfilename", NULL, 153); + zephir_check_call_status(); + ZVAL_LONG(&_8$$10, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&constantAnnotations, &comment, &_7$$10, &_8$$10); + zephir_check_call_status(); + if (Z_TYPE_P(&constantAnnotations) == IS_ARRAY) { + zephir_array_update_zval(&anotationsConstants, &constant, &constantAnnotations, PH_COPY | PH_SEPARATE); + } + } + ZEPHIR_CALL_METHOD(NULL, &arrayKeys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&constant); + if (zephir_fast_count_int(&anotationsConstants)) { + zephir_array_update_string(&annotations, SL("constants"), &anotationsConstants, PH_COPY | PH_SEPARATE); + } + } + ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 157); zephir_check_call_status(); if (zephir_fast_count_int(&properties)) { line = 1; ZEPHIR_INIT_VAR(&annotationsProperties); array_init(&annotationsProperties); - zephir_is_iterable(&properties, 0, "phalcon/Annotations/Reader.zep", 92); + zephir_is_iterable(&properties, 0, "phalcon/Annotations/Reader.zep", 132); if (Z_TYPE_P(&properties) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _2$$5) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _9$$13) { ZEPHIR_INIT_NVAR(&property); - ZVAL_COPY(&property, _2$$5); + ZVAL_COPY(&property, _9$$13); ZEPHIR_CALL_METHOD(&comment, &property, "getdoccomment", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&propertyAnnotations); - ZEPHIR_CALL_METHOD(&_4$$7, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_11$$15, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZVAL_LONG(&_5$$7, line); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_4$$7, &_5$$7); + ZVAL_LONG(&_12$$15, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_11$$15, &_12$$15); zephir_check_call_status(); if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_6$$8); - zephir_read_property(&_6$$8, &property, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, &_6$$8, &propertyAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$16); + zephir_read_property(&_13$$16, &property, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, &_13$$16, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } } ZEND_HASH_FOREACH_END(); @@ -146,9 +223,9 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) ZEPHIR_CALL_METHOD(NULL, &properties, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_3$$5, &properties, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$13, &properties, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_3$$5)) { + if (!zend_is_true(&_10$$13)) { break; } ZEPHIR_CALL_METHOD(&property, &properties, "current", NULL, 0); @@ -157,15 +234,15 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&propertyAnnotations); - ZEPHIR_CALL_METHOD(&_7$$10, &reflection, "getfilename", NULL, 174); + ZEPHIR_CALL_METHOD(&_14$$18, &reflection, "getfilename", NULL, 153); zephir_check_call_status(); - ZVAL_LONG(&_8$$10, line); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_7$$10, &_8$$10); + ZVAL_LONG(&_15$$18, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_14$$18, &_15$$18); zephir_check_call_status(); if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_9$$11); - zephir_read_property(&_9$$11, &property, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, &_9$$11, &propertyAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_16$$19); + zephir_read_property(&_16$$19, &property, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, &_16$$19, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_METHOD(NULL, &properties, "next", NULL, 0); @@ -177,31 +254,31 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_array_update_string(&annotations, SL("properties"), &annotationsProperties, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 177); + ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 158); zephir_check_call_status(); if (zephir_fast_count_int(&methods)) { ZEPHIR_INIT_VAR(&annotationsMethods); array_init(&annotationsMethods); - zephir_is_iterable(&methods, 0, "phalcon/Annotations/Reader.zep", 127); + zephir_is_iterable(&methods, 0, "phalcon/Annotations/Reader.zep", 167); if (Z_TYPE_P(&methods) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _10$$13) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _17$$21) { ZEPHIR_INIT_NVAR(&method); - ZVAL_COPY(&method, _10$$13); + ZVAL_COPY(&method, _17$$21); ZEPHIR_CALL_METHOD(&comment, &method, "getdoccomment", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&methodAnnotations); - ZEPHIR_CALL_METHOD(&_12$$15, &method, "getfilename", NULL, 0); + ZEPHIR_CALL_METHOD(&_19$$23, &method, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13$$15, &method, "getstartline", NULL, 0); + ZEPHIR_CALL_METHOD(&_20$$23, &method, "getstartline", NULL, 0); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_12$$15, &_13$$15); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_19$$23, &_20$$23); zephir_check_call_status(); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_14$$16); - zephir_read_property(&_14$$16, &method, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, &_14$$16, &methodAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_21$$24); + zephir_read_property(&_21$$24, &method, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, &_21$$24, &methodAnnotations, PH_COPY | PH_SEPARATE); } } } ZEND_HASH_FOREACH_END(); @@ -209,9 +286,9 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) ZEPHIR_CALL_METHOD(NULL, &methods, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_11$$13, &methods, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_18$$21, &methods, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_11$$13)) { + if (!zend_is_true(&_18$$21)) { break; } ZEPHIR_CALL_METHOD(&method, &methods, "current", NULL, 0); @@ -220,16 +297,16 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) zephir_check_call_status(); if (Z_TYPE_P(&comment) == IS_STRING) { ZEPHIR_INIT_NVAR(&methodAnnotations); - ZEPHIR_CALL_METHOD(&_15$$18, &method, "getfilename", NULL, 0); + ZEPHIR_CALL_METHOD(&_22$$26, &method, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$18, &method, "getstartline", NULL, 0); + ZEPHIR_CALL_METHOD(&_23$$26, &method, "getstartline", NULL, 0); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_15$$18, &_16$$18); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_22$$26, &_23$$26); zephir_check_call_status(); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(&_17$$19); - zephir_read_property(&_17$$19, &method, ZEND_STRL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, &_17$$19, &methodAnnotations, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_24$$27); + zephir_read_property(&_24$$27, &method, ZEND_STRL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, &_24$$27, &methodAnnotations, PH_COPY | PH_SEPARATE); } } ZEPHIR_CALL_METHOD(NULL, &methods, "next", NULL, 0); diff --git a/ext/phalcon/annotations/readerinterface.zep.c b/ext/phalcon/annotations/readerinterface.zep.c index 181240dab0e..5ff7800a3e9 100644 --- a/ext/phalcon/annotations/readerinterface.zep.c +++ b/ext/phalcon/annotations/readerinterface.zep.c @@ -31,7 +31,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_ReaderInterface) } /** - * Reads annotations from the class docblocks, its methods and/or properties + * Reads annotations from the class docblocks, its constants, properties and methods */ ZEPHIR_DOC_METHOD(Phalcon_Annotations_ReaderInterface, parse); /** diff --git a/ext/phalcon/annotations/reflection.zep.c b/ext/phalcon/annotations/reflection.zep.c index 19c20a1d37b..29e2caa7b59 100644 --- a/ext/phalcon/annotations/reflection.zep.c +++ b/ext/phalcon/annotations/reflection.zep.c @@ -58,12 +58,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection) * @var array * TODO: Make always array */ - zend_declare_property_null(phalcon_annotations_reflection_ce, SL("methodAnnotations"), ZEND_ACC_PROTECTED); + zend_declare_property_null(phalcon_annotations_reflection_ce, SL("constantAnnotations"), ZEND_ACC_PROTECTED); /** * @var array * TODO: Make always array */ zend_declare_property_null(phalcon_annotations_reflection_ce, SL("propertyAnnotations"), ZEND_ACC_PROTECTED); + /** + * @var array + * TODO: Make always array + */ + zend_declare_property_null(phalcon_annotations_reflection_ce, SL("methodAnnotations"), ZEND_ACC_PROTECTED); /** * @var array */ @@ -133,7 +138,7 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) if (zephir_array_isset_string_fetch(&reflectionClass, &_1$$3, SL("class"), 1)) { ZEPHIR_INIT_VAR(&_2$$4); object_init_ex(&_2$$4, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 48, &reflectionClass); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 34, &reflectionClass); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("classAnnotations"), &_2$$4); } else { @@ -148,23 +153,23 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) } /** - * Returns the annotations found in the methods' docblocks + * Returns the annotations found in the constants' docblocks */ -PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) +PHP_METHOD(Phalcon_Annotations_Reflection, getConstantsAnnotations) { zend_string *_6$$5; zend_ulong _5$$5; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval __$true, __$false, reflectionMethods, methodName, reflectionMethod, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; + zval __$true, __$false, reflectionConstants, constant, reflectionConstant, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; zephir_fcall_cache_entry *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_BOOL(&__$true, 1); ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&reflectionMethods); - ZVAL_UNDEF(&methodName); - ZVAL_UNDEF(&reflectionMethod); + ZVAL_UNDEF(&reflectionConstants); + ZVAL_UNDEF(&constant); + ZVAL_UNDEF(&reflectionConstant); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_2$$5); @@ -175,67 +180,67 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("methodAnnotations"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_0, this_ptr, ZEND_STRL("constantAnnotations"), PH_NOISY_CC | PH_READONLY); if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_OBS_VAR(&reflectionMethods); + ZEPHIR_OBS_VAR(&reflectionConstants); zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY); - if (zephir_array_isset_string_fetch(&reflectionMethods, &_1$$3, SL("methods"), 0)) { - if (zephir_fast_count_int(&reflectionMethods)) { + if (zephir_array_isset_string_fetch(&reflectionConstants, &_1$$3, SL("constants"), 0)) { + if (zephir_fast_count_int(&reflectionConstants)) { ZEPHIR_INIT_VAR(&_2$$5); array_init(&_2$$5); - zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &_2$$5); - zephir_is_iterable(&reflectionMethods, 0, "phalcon/Annotations/Reflection.zep", 100); - if (Z_TYPE_P(&reflectionMethods) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionMethods), _5$$5, _6$$5, _3$$5) + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &_2$$5); + zephir_is_iterable(&reflectionConstants, 0, "phalcon/Annotations/Reflection.zep", 106); + if (Z_TYPE_P(&reflectionConstants) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionConstants), _5$$5, _6$$5, _3$$5) { - ZEPHIR_INIT_NVAR(&methodName); + ZEPHIR_INIT_NVAR(&constant); if (_6$$5 != NULL) { - ZVAL_STR_COPY(&methodName, _6$$5); + ZVAL_STR_COPY(&constant, _6$$5); } else { - ZVAL_LONG(&methodName, _5$$5); + ZVAL_LONG(&constant, _5$$5); } - ZEPHIR_INIT_NVAR(&reflectionMethod); - ZVAL_COPY(&reflectionMethod, _3$$5); + ZEPHIR_INIT_NVAR(&reflectionConstant); + ZVAL_COPY(&reflectionConstant, _3$$5); ZEPHIR_INIT_NVAR(&_7$$6); object_init_ex(&_7$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionMethod); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionConstant); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_7$$6); + zephir_update_property_array(this_ptr, SL("constantAnnotations"), &constant, &_7$$6); } ZEND_HASH_FOREACH_END(); } else { - ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "rewind", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &reflectionConstants, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_4$$5, &reflectionMethods, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$5, &reflectionConstants, "valid", NULL, 0); zephir_check_call_status(); if (!zend_is_true(&_4$$5)) { break; } - ZEPHIR_CALL_METHOD(&methodName, &reflectionMethods, "key", NULL, 0); + ZEPHIR_CALL_METHOD(&constant, &reflectionConstants, "key", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&reflectionMethod, &reflectionMethods, "current", NULL, 0); + ZEPHIR_CALL_METHOD(&reflectionConstant, &reflectionConstants, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_9$$7); object_init_ex(&_9$$7, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionMethod); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionConstant); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_9$$7); - ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "next", NULL, 0); + zephir_update_property_array(this_ptr, SL("constantAnnotations"), &constant, &_9$$7); + ZEPHIR_CALL_METHOD(NULL, &reflectionConstants, "next", NULL, 0); zephir_check_call_status(); } } - ZEPHIR_INIT_NVAR(&reflectionMethod); - ZEPHIR_INIT_NVAR(&methodName); - RETURN_MM_MEMBER(getThis(), "methodAnnotations"); + ZEPHIR_INIT_NVAR(&reflectionConstant); + ZEPHIR_INIT_NVAR(&constant); + RETURN_MM_MEMBER(getThis(), "constantAnnotations"); } } if (0) { - zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$true); + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &__$true); } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$false); + zephir_update_property_zval(this_ptr, ZEND_STRL("constantAnnotations"), &__$false); } } - RETURN_MM_MEMBER(getThis(), "methodAnnotations"); + RETURN_MM_MEMBER(getThis(), "constantAnnotations"); } /** @@ -275,7 +280,7 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) ZEPHIR_INIT_VAR(&_2$$5); array_init(&_2$$5); zephir_update_property_zval(this_ptr, ZEND_STRL("propertyAnnotations"), &_2$$5); - zephir_is_iterable(&reflectionProperties, 0, "phalcon/Annotations/Reflection.zep", 128); + zephir_is_iterable(&reflectionProperties, 0, "phalcon/Annotations/Reflection.zep", 134); if (Z_TYPE_P(&reflectionProperties) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionProperties), _5$$5, _6$$5, _3$$5) { @@ -289,7 +294,7 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) ZVAL_COPY(&reflectionProperty, _3$$5); ZEPHIR_INIT_NVAR(&_7$$6); object_init_ex(&_7$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 48, &reflectionProperty); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionProperty); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_7$$6); } ZEND_HASH_FOREACH_END(); @@ -308,7 +313,7 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_9$$7); object_init_ex(&_9$$7, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 48, &reflectionProperty); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionProperty); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("propertyAnnotations"), &property, &_9$$7); ZEPHIR_CALL_METHOD(NULL, &reflectionProperties, "next", NULL, 0); @@ -329,6 +334,97 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) RETURN_MM_MEMBER(getThis(), "propertyAnnotations"); } +/** + * Returns the annotations found in the methods' docblocks + */ +PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) +{ + zend_string *_6$$5; + zend_ulong _5$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval __$true, __$false, reflectionMethods, methodName, reflectionMethod, _0, _1$$3, _2$$5, *_3$$5, _4$$5, _7$$6, _9$$7; + zephir_fcall_cache_entry *_8 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&reflectionMethods); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&reflectionMethod); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("methodAnnotations"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_OBS_VAR(&reflectionMethods); + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionMethods, &_1$$3, SL("methods"), 0)) { + if (zephir_fast_count_int(&reflectionMethods)) { + ZEPHIR_INIT_VAR(&_2$$5); + array_init(&_2$$5); + zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &_2$$5); + zephir_is_iterable(&reflectionMethods, 0, "phalcon/Annotations/Reflection.zep", 162); + if (Z_TYPE_P(&reflectionMethods) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionMethods), _5$$5, _6$$5, _3$$5) + { + ZEPHIR_INIT_NVAR(&methodName); + if (_6$$5 != NULL) { + ZVAL_STR_COPY(&methodName, _6$$5); + } else { + ZVAL_LONG(&methodName, _5$$5); + } + ZEPHIR_INIT_NVAR(&reflectionMethod); + ZVAL_COPY(&reflectionMethod, _3$$5); + ZEPHIR_INIT_NVAR(&_7$$6); + object_init_ex(&_7$$6, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 34, &reflectionMethod); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_7$$6); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_4$$5, &reflectionMethods, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_4$$5)) { + break; + } + ZEPHIR_CALL_METHOD(&methodName, &reflectionMethods, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&reflectionMethod, &reflectionMethods, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_9$$7); + object_init_ex(&_9$$7, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_9$$7, "__construct", &_8, 34, &reflectionMethod); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("methodAnnotations"), &methodName, &_9$$7); + ZEPHIR_CALL_METHOD(NULL, &reflectionMethods, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&reflectionMethod); + ZEPHIR_INIT_NVAR(&methodName); + RETURN_MM_MEMBER(getThis(), "methodAnnotations"); + } + } + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("methodAnnotations"), &__$false); + } + } + RETURN_MM_MEMBER(getThis(), "methodAnnotations"); +} + /** * Returns the raw parsing intermediate definitions used to construct the * reflection diff --git a/ext/phalcon/annotations/reflection.zep.h b/ext/phalcon/annotations/reflection.zep.h index cbad22fd75f..15d98e73d5e 100644 --- a/ext/phalcon/annotations/reflection.zep.h +++ b/ext/phalcon/annotations/reflection.zep.h @@ -5,8 +5,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection); PHP_METHOD(Phalcon_Annotations_Reflection, __construct); PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations); -PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations); +PHP_METHOD(Phalcon_Annotations_Reflection, getConstantsAnnotations); PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations); +PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations); PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData); zend_object *zephir_init_properties_Phalcon_Annotations_Reflection(zend_class_entry *class_type); @@ -21,12 +22,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getclassannotations, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getmethodsannotations, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getconstantsannotations, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getpropertiesannotations, 0, 0, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection_getmethodsannotations, 0, 0, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reflection_getreflectiondata, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -41,14 +45,19 @@ ZEPHIR_INIT_FUNCS(phalcon_annotations_reflection_method_entry) { PHP_ME(Phalcon_Annotations_Reflection, getClassAnnotations, NULL, ZEND_ACC_PUBLIC) #endif #if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, arginfo_phalcon_annotations_reflection_getmethodsannotations, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Reflection, getConstantsAnnotations, arginfo_phalcon_annotations_reflection_getconstantsannotations, ZEND_ACC_PUBLIC) #else - PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Reflection, getConstantsAnnotations, NULL, ZEND_ACC_PUBLIC) #endif #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Annotations_Reflection, getPropertiesAnnotations, arginfo_phalcon_annotations_reflection_getpropertiesannotations, ZEND_ACC_PUBLIC) #else PHP_ME(Phalcon_Annotations_Reflection, getPropertiesAnnotations, NULL, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80000 + PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, arginfo_phalcon_annotations_reflection_getmethodsannotations, ZEND_ACC_PUBLIC) +#else + PHP_ME(Phalcon_Annotations_Reflection, getMethodsAnnotations, NULL, ZEND_ACC_PUBLIC) #endif PHP_ME(Phalcon_Annotations_Reflection, getReflectionData, arginfo_phalcon_annotations_reflection_getreflectiondata, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/application/abstractapplication.zep.c b/ext/phalcon/application/abstractapplication.zep.c index 03c6be49c18..081b454d8c5 100644 --- a/ext/phalcon/application/abstractapplication.zep.c +++ b/ext/phalcon/application/abstractapplication.zep.c @@ -42,9 +42,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Application_AbstractApplication) */ zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("container"), ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_application_abstractapplication_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_application_abstractapplication_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); /** * @var ManagerInterface|null */ @@ -162,7 +162,7 @@ PHP_METHOD(Phalcon_Application_AbstractApplication, getModule) object_init_ex(&_1$$3, phalcon_application_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Module '", &name, "' is not registered in the application container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Application/AbstractApplication.zep", 83); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/asset.zep.c b/ext/phalcon/assets/asset.zep.c index f62a264d2a9..b8940158018 100644 --- a/ext/phalcon/assets/asset.zep.c +++ b/ext/phalcon/assets/asset.zep.c @@ -297,7 +297,7 @@ PHP_METHOD(Phalcon_Assets_Asset, getAssetKey) ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "sha256"); - ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 99, &_2, &key); + ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 68, &_2, &key); zephir_check_call_status(); RETURN_MM(); } @@ -361,7 +361,7 @@ PHP_METHOD(Phalcon_Assets_Asset, getContent) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "sourcePath"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkpath", NULL, 100, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkpath", NULL, 69, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&completePath); ZEPHIR_CONCAT_VV(&completePath, &basePath, &_0); @@ -373,13 +373,13 @@ PHP_METHOD(Phalcon_Assets_Asset, getContent) _3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_4); } if (_3) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 101, &completePath); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 70, &completePath); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&content, this_ptr, "phpfilegetcontents", NULL, 0, &completePath); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&content)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 101, &completePath); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwexception", NULL, 70, &completePath); zephir_check_call_status(); } RETURN_CCTOR(&content); @@ -427,13 +427,13 @@ PHP_METHOD(Phalcon_Assets_Asset, getRealSourcePath) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sourcePath"); - ZEPHIR_CALL_METHOD(&source, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&source, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VV(&_2$$3, &basePath, &source); - ZEPHIR_CALL_FUNCTION(&_3$$3, "realpath", NULL, 102, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "realpath", NULL, 71, &_2$$3); zephir_check_call_status(); zephir_cast_to_string(&_4$$3, &_3$$3); ZEPHIR_CPY_WRT(&source, &_4$$3); @@ -483,7 +483,7 @@ PHP_METHOD(Phalcon_Assets_Asset, getRealTargetPath) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "targetPath"); - ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_1)) { @@ -492,7 +492,7 @@ PHP_METHOD(Phalcon_Assets_Asset, getRealTargetPath) ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "phpfileexists", NULL, 0, &completePath); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_2$$3)) { - ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 102, &completePath); + ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 71, &completePath); zephir_check_call_status(); ZEPHIR_CPY_WRT(&completePath, &_3$$4); if (ZEPHIR_IS_FALSE_IDENTICAL(&completePath)) { @@ -533,7 +533,7 @@ PHP_METHOD(Phalcon_Assets_Asset, getRealTargetUri) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "targetUri"); - ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 100, &_0); + ZEPHIR_CALL_METHOD(&target, this_ptr, "checkpath", NULL, 69, &_0); zephir_check_call_status(); ZEPHIR_OBS_VAR(&ver); zephir_read_property(&ver, this_ptr, ZEND_STRL("version"), PH_NOISY_CC); @@ -991,7 +991,7 @@ PHP_METHOD(Phalcon_Assets_Asset, throwException) object_init_ex(&_0, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SVS(&_1, "Asset's content for '", &completePath, "' cannot be read"); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 31, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 29, &_1); zephir_check_call_status(); zephir_throw_exception_debug(&_0, "phalcon/Assets/Asset.zep", 441); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/collection.zep.c b/ext/phalcon/assets/collection.zep.c index 3e64453f662..f1abe9dae43 100644 --- a/ext/phalcon/assets/collection.zep.c +++ b/ext/phalcon/assets/collection.zep.c @@ -259,7 +259,7 @@ PHP_METHOD(Phalcon_Assets_Collection, add) zephir_fetch_params(1, 1, 0, &asset); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 178, asset); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 159, asset); zephir_check_call_status(); RETURN_THIS(); } @@ -348,7 +348,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addCss) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 179, &_0, &path, isLocal, &_1, &attributes, &version, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 160, &_0, &path, isLocal, &_1, &attributes, &version, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -404,7 +404,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addInline) zephir_fetch_params(1, 1, 0, &code); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 178, code); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addasset", NULL, 159, code); zephir_check_call_status(); RETURN_THIS(); } @@ -464,7 +464,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addInlineCss) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 180, &_0, &content, &_1, &attributes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 161, &_0, &content, &_1, &attributes); zephir_check_call_status(); RETURN_MM(); } @@ -524,7 +524,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addInlineJs) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 180, &_0, &content, &_1, &attributes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processaddinline", NULL, 161, &_0, &content, &_1, &attributes); zephir_check_call_status(); RETURN_MM(); } @@ -613,7 +613,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addJs) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 179, &_0, &path, isLocal, &_1, &attributes, &version, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processadd", NULL, 160, &_0, &path, isLocal, &_1, &attributes, &version, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -706,7 +706,7 @@ PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath) ZEPHIR_INIT_VAR(&completePath); ZEPHIR_CONCAT_VV(&completePath, &basePath, &_0); if (1 == (zephir_file_exists(&completePath) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 102, &completePath); + ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 71, &completePath); zephir_check_call_status(); RETURN_MM(); } @@ -1289,7 +1289,7 @@ PHP_METHOD(Phalcon_Assets_Collection, processAdd) ZEPHIR_CPY_WRT(&name, &_0); ZEPHIR_OBS_VAR(&flag); zephir_read_property(&flag, this_ptr, ZEND_STRL("isLocal"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 181, &attributes); + ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 162, &attributes); zephir_check_call_status(); if (Z_TYPE_P(isLocal) != IS_NULL) { ZEPHIR_INIT_NVAR(&flag); @@ -1378,7 +1378,7 @@ PHP_METHOD(Phalcon_Assets_Collection, processAddInline) ZEPHIR_INIT_VAR(&_0); ZEPHIR_CONCAT_SV(&_0, "Phalcon\\Assets\\Inline\\", &className); ZEPHIR_CPY_WRT(&name, &_0); - ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 181, &attributes); + ZEPHIR_CALL_METHOD(&attrs, this_ptr, "processattributes", NULL, 162, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&asset); zephir_fetch_safe_class(&_1, &name); diff --git a/ext/phalcon/assets/collection.zep.h b/ext/phalcon/assets/collection.zep.h index b28757ed01c..80b15faaaf2 100644 --- a/ext/phalcon/assets/collection.zep.h +++ b/ext/phalcon/assets/collection.zep.h @@ -138,7 +138,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_getiterator, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_getiterator, 0, 0, Traversable, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_getrealtargetpath, 0, 1, IS_STRING, 0) @@ -255,11 +255,7 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_collection_method_entry) { PHP_ME(Phalcon_Assets_Collection, addInlineJs, arginfo_phalcon_assets_collection_addinlinejs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, addJs, arginfo_phalcon_assets_collection_addjs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, count, arginfo_phalcon_assets_collection_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Assets_Collection, getIterator, arginfo_phalcon_assets_collection_getiterator, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Assets_Collection, getIterator, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Assets_Collection, getRealTargetPath, arginfo_phalcon_assets_collection_getrealtargetpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, has, arginfo_phalcon_assets_collection_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, isAutoVersion, arginfo_phalcon_assets_collection_isautoversion, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/assets/inline.zep.c b/ext/phalcon/assets/inline.zep.c index 6ed5d0df68d..aec3be5b521 100644 --- a/ext/phalcon/assets/inline.zep.c +++ b/ext/phalcon/assets/inline.zep.c @@ -185,7 +185,7 @@ PHP_METHOD(Phalcon_Assets_Inline, getAssetKey) ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "sha256"); - ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 99, &_2, &key); + ZEPHIR_RETURN_CALL_FUNCTION("hash", NULL, 68, &_2, &key); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/assets/manager.zep.c b/ext/phalcon/assets/manager.zep.c index 88477cdf998..d64b1ba9573 100644 --- a/ext/phalcon/assets/manager.zep.c +++ b/ext/phalcon/assets/manager.zep.c @@ -177,7 +177,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addAssetByType) } - ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 182, &type); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 163, &type); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &collection, "add", NULL, 0, asset); zephir_check_call_status(); @@ -282,7 +282,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addCss) } else { ZVAL_BOOL(&_3, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 183, &path, &_1, &_2, &attributes, &version, &_3); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 164, &path, &_1, &_2, &attributes, &version, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "css"); @@ -363,7 +363,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCodeByType) } - ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 182, &type); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "checkandcreatecollection", NULL, 163, &type); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &collection, "addinline", NULL, 0, code); zephir_check_call_status(); @@ -426,7 +426,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCss) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 184, &content, &_1, &attributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 165, &content, &_1, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "css"); @@ -491,7 +491,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineJs) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 185, &content, &_1, &attributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 166, &content, &_1, &attributes); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "js"); @@ -603,7 +603,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addJs) } else { ZVAL_BOOL(&_3, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 186, &path, &_1, &_2, &attributes, &version, &_3); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 167, &path, &_1, &_2, &attributes, &version, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "js"); @@ -639,7 +639,7 @@ PHP_METHOD(Phalcon_Assets_Manager, collection) zephir_get_strval(&name, name_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &name); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &name); zephir_check_call_status(); RETURN_MM(); } @@ -863,7 +863,7 @@ PHP_METHOD(Phalcon_Assets_Manager, getCss) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "css"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -887,7 +887,7 @@ PHP_METHOD(Phalcon_Assets_Manager, getJs) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "js"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 182, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkandcreatecollection", NULL, 163, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -1131,20 +1131,20 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_3$$9, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_4$$9); ZEPHIR_CONCAT_SVS(&_4$$9, "Path '", &completeTargetPath, "' is not a valid target path (1)"); - ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", NULL, 31, &_4$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", NULL, 29, &_4$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$9, "phalcon/Assets/Manager.zep", 462); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(&_5$$8, "is_dir", NULL, 155, &completeTargetPath); + ZEPHIR_CALL_FUNCTION(&_5$$8, "is_dir", NULL, 131, &completeTargetPath); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_5$$8)) { ZEPHIR_INIT_VAR(&_6$$10); object_init_ex(&_6$$10, phalcon_assets_exception_ce); ZEPHIR_INIT_VAR(&_7$$10); ZEPHIR_CONCAT_SVS(&_7$$10, "Path '", &completeTargetPath, "' is not a valid target path (2), it is a directory."); - ZEPHIR_CALL_METHOD(NULL, &_6$$10, "__construct", NULL, 31, &_7$$10); + ZEPHIR_CALL_METHOD(NULL, &_6$$10, "__construct", NULL, 29, &_7$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$10, "phalcon/Assets/Manager.zep", 468); ZEPHIR_MM_RESTORE(); @@ -1175,7 +1175,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_11$$14, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_12$$14); ZEPHIR_CONCAT_SVS(&_12$$14, "Asset '", &sourcePath, "' does not have a valid source path"); - ZEPHIR_CALL_METHOD(NULL, &_11$$14, "__construct", NULL, 31, &_12$$14); + ZEPHIR_CALL_METHOD(NULL, &_11$$14, "__construct", NULL, 29, &_12$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$14, "phalcon/Assets/Manager.zep", 498); ZEPHIR_MM_RESTORE(); @@ -1189,7 +1189,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_13$$15, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_14$$15); ZEPHIR_CONCAT_SVS(&_14$$15, "Asset '", &sourcePath, "' does not have a valid target path"); - ZEPHIR_CALL_METHOD(NULL, &_13$$15, "__construct", NULL, 31, &_14$$15); + ZEPHIR_CALL_METHOD(NULL, &_13$$15, "__construct", NULL, 29, &_14$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_13$$15, "phalcon/Assets/Manager.zep", 514); ZEPHIR_MM_RESTORE(); @@ -1203,7 +1203,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_16$$17, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_17$$17); ZEPHIR_CONCAT_SVS(&_17$$17, "Asset '", &targetPath, "' have the same source and target paths"); - ZEPHIR_CALL_METHOD(NULL, &_16$$17, "__construct", NULL, 31, &_17$$17); + ZEPHIR_CALL_METHOD(NULL, &_16$$17, "__construct", NULL, 29, &_17$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$17, "phalcon/Assets/Manager.zep", 524); ZEPHIR_MM_RESTORE(); @@ -1226,13 +1226,13 @@ PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_21$$21, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_20$$21, &_21$$21); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_20$$21, &_21$$21); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_23$$21, &asset, "getattributes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_24$$21, &asset, "islocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_23$$21, &prefixedPath, &_24$$21); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_23$$21, &prefixedPath, &_24$$21); zephir_check_call_status(); zephir_read_property(&_26$$21, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_26$$21)) { @@ -1309,12 +1309,12 @@ PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_31$$36, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_30$$36, &_31$$36); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_30$$36, &_31$$36); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_32$$36, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZVAL_BOOL(&_34$$36, 1); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_32$$36, &prefixedPath, &_34$$36); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_32$$36, &prefixedPath, &_34$$36); zephir_check_call_status(); zephir_read_property(&_34$$36, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_34$$36)) { @@ -1352,7 +1352,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_36$$42, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_37$$42); ZEPHIR_CONCAT_SVS(&_37$$42, "Asset '", &sourcePath, "' does not have a valid source path"); - ZEPHIR_CALL_METHOD(NULL, &_36$$42, "__construct", NULL, 31, &_37$$42); + ZEPHIR_CALL_METHOD(NULL, &_36$$42, "__construct", NULL, 29, &_37$$42); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$42, "phalcon/Assets/Manager.zep", 498); ZEPHIR_MM_RESTORE(); @@ -1366,7 +1366,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_38$$43, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_39$$43); ZEPHIR_CONCAT_SVS(&_39$$43, "Asset '", &sourcePath, "' does not have a valid target path"); - ZEPHIR_CALL_METHOD(NULL, &_38$$43, "__construct", NULL, 31, &_39$$43); + ZEPHIR_CALL_METHOD(NULL, &_38$$43, "__construct", NULL, 29, &_39$$43); zephir_check_call_status(); zephir_throw_exception_debug(&_38$$43, "phalcon/Assets/Manager.zep", 514); ZEPHIR_MM_RESTORE(); @@ -1380,7 +1380,7 @@ PHP_METHOD(Phalcon_Assets_Manager, output) object_init_ex(&_41$$45, phalcon_assets_exception_ce); ZEPHIR_INIT_NVAR(&_42$$45); ZEPHIR_CONCAT_SVS(&_42$$45, "Asset '", &targetPath, "' have the same source and target paths"); - ZEPHIR_CALL_METHOD(NULL, &_41$$45, "__construct", NULL, 31, &_42$$45); + ZEPHIR_CALL_METHOD(NULL, &_41$$45, "__construct", NULL, 29, &_42$$45); zephir_check_call_status(); zephir_throw_exception_debug(&_41$$45, "phalcon/Assets/Manager.zep", 524); ZEPHIR_MM_RESTORE(); @@ -1403,13 +1403,13 @@ PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_46$$49, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_45$$49, &_46$$49); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_45$$49, &_46$$49); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_47$$49, &asset, "getattributes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_48$$49, &asset, "islocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_47$$49, &prefixedPath, &_48$$49); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_47$$49, &prefixedPath, &_48$$49); zephir_check_call_status(); zephir_read_property(&_49$$49, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_49$$49)) { @@ -1486,12 +1486,12 @@ PHP_METHOD(Phalcon_Assets_Manager, output) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_54$$64, &asset, "getrealsourcepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_53$$64, &_54$$64); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_53$$64, &_54$$64); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_55$$64, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZVAL_BOOL(&_56$$64, 1); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_55$$64, &prefixedPath, &_56$$64); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_55$$64, &prefixedPath, &_56$$64); zephir_check_call_status(); zephir_read_property(&_56$$64, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_56$$64)) { @@ -1513,13 +1513,13 @@ PHP_METHOD(Phalcon_Assets_Manager, output) zephir_file_put_contents(NULL, &completeTargetPath, &filteredJoinedContent); ZEPHIR_CALL_METHOD(&_58$$67, collection, "gettargeturi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 187, collection, &_58$$67, &completeTargetPath); + ZEPHIR_CALL_METHOD(&prefixedPath, this_ptr, "calculateprefixedpath", &_22, 168, collection, &_58$$67, &completeTargetPath); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_59$$67, collection, "getattributes", &_33, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_60$$67, collection, "gettargetislocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 188, &callback, &_59$$67, &prefixedPath, &_60$$67); + ZEPHIR_CALL_METHOD(&html, this_ptr, "docallback", &_25, 169, &callback, &_59$$67, &prefixedPath, &_60$$67); zephir_check_call_status(); zephir_read_property(&_61$$67, this_ptr, ZEND_STRL("implicitOutput"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_61$$67)) { @@ -1656,7 +1656,7 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0); zephir_check_call_status(); if (1 != ZEPHIR_IS_EMPTY(&codes)) { - zephir_is_iterable(&codes, 0, "phalcon/Assets/Manager.zep", 770); + zephir_is_iterable(&codes, 0, "phalcon/Assets/Manager.zep", 769); if (Z_TYPE_P(&codes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&codes), _0$$3) { @@ -1666,14 +1666,14 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 758); + zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 757); if (Z_TYPE_P(&filters) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _2$$4) { ZEPHIR_INIT_NVAR(&filter); ZVAL_COPY(&filter, _2$$4); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_4$$5, &filter, "filter", NULL, 0, &content); @@ -1692,7 +1692,7 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_5$$7, &filter, "filter", NULL, 0, &content); @@ -1732,14 +1732,14 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 758); + zephir_is_iterable(&filters, 0, "phalcon/Assets/Manager.zep", 757); if (Z_TYPE_P(&filters) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _11$$11) { ZEPHIR_INIT_NVAR(&filter); ZVAL_COPY(&filter, _11$$11); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_13$$12, &filter, "filter", NULL, 0, &content); @@ -1758,7 +1758,7 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) ZEPHIR_CALL_METHOD(&filter, &filters, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filter) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The filter is not valid", "phalcon/Assets/Manager.zep", 747); return; } ZEPHIR_CALL_METHOD(&_14$$14, &filter, "filter", NULL, 0, &content); @@ -2184,7 +2184,7 @@ PHP_METHOD(Phalcon_Assets_Manager, checkAndCreateCollection) zephir_update_property_array(this_ptr, SL("collections"), &type, &_1$$3); } zephir_read_property(&_2, this_ptr, ZEND_STRL("collections"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_3, &_2, &type, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 934); + zephir_array_fetch(&_3, &_2, &type, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 933); RETURN_CTOR(&_3); } @@ -2245,7 +2245,7 @@ PHP_METHOD(Phalcon_Assets_Manager, cssLink) ZVAL_STRING(&_2, "text/css"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "href"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 189, parameters, &_0, &_1, &_2, &_3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 170, parameters, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_MM(); } @@ -2305,7 +2305,7 @@ PHP_METHOD(Phalcon_Assets_Manager, doCallback) } ZEPHIR_INIT_VAR(&_1); ZVAL_BOOL(&_1, local); - zephir_array_append(¶meters, &_1, PH_SEPARATE, "phalcon/Assets/Manager.zep", 982); + zephir_array_append(¶meters, &_1, PH_SEPARATE, "phalcon/Assets/Manager.zep", 981); ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, callback, ¶meters); zephir_check_call_status(); RETURN_MM(); @@ -2366,7 +2366,7 @@ PHP_METHOD(Phalcon_Assets_Manager, jsLink) ZVAL_STRING(&_2, "application/javascript"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "src"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 189, parameters, &_0, &_1, &_2, &_3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processparameters", NULL, 170, parameters, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_MM(); } @@ -2436,13 +2436,13 @@ PHP_METHOD(Phalcon_Assets_Manager, processParameters) } if (1 == zephir_array_isset_long(¶ms, 1)) { ZEPHIR_OBS_VAR(&_2$$4); - zephir_array_fetch_long(&_2$$4, ¶ms, 1, PH_NOISY, "phalcon/Assets/Manager.zep", 1026); + zephir_array_fetch_long(&_2$$4, ¶ms, 1, PH_NOISY, "phalcon/Assets/Manager.zep", 1025); local = zephir_get_boolval(&_2$$4); zephir_array_unset_long(¶ms, 1, PH_SEPARATE); } else { if (1 == zephir_array_isset_string(¶ms, SL("local"))) { ZEPHIR_OBS_VAR(&_3$$6); - zephir_array_fetch_string(&_3$$6, ¶ms, SL("local"), PH_NOISY, "phalcon/Assets/Manager.zep", 1030); + zephir_array_fetch_string(&_3$$6, ¶ms, SL("local"), PH_NOISY, "phalcon/Assets/Manager.zep", 1029); local = zephir_get_boolval(&_3$$6); zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } @@ -2462,13 +2462,13 @@ PHP_METHOD(Phalcon_Assets_Manager, processParameters) ZVAL_STRING(&_6$$9, ""); zephir_array_update_zval(¶ms, &name, &_6$$9, PH_COPY | PH_SEPARATE); if (1 == zephir_array_isset_long(¶ms, 0)) { - zephir_array_fetch_long(&_7$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 1050); + zephir_array_fetch_long(&_7$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/Assets/Manager.zep", 1049); zephir_array_update_zval(¶ms, &name, &_7$$10, PH_COPY | PH_SEPARATE); zephir_array_unset_long(¶ms, 0, PH_SEPARATE); } } ZEPHIR_OBS_VAR(&tag); - zephir_array_fetch(&tag, ¶ms, &name, PH_NOISY, "phalcon/Assets/Manager.zep", 1055); + zephir_array_fetch(&tag, ¶ms, &name, PH_NOISY, "phalcon/Assets/Manager.zep", 1054); zephir_array_unset(¶ms, &name, PH_SEPARATE); if (local) { ZEPHIR_INIT_VAR(&_8$$11); diff --git a/ext/phalcon/autoload/loader.zep.c b/ext/phalcon/autoload/loader.zep.c index eb564fbc1ee..61ab7f9a09b 100644 --- a/ext/phalcon/autoload/loader.zep.c +++ b/ext/phalcon/autoload/loader.zep.c @@ -139,7 +139,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, __construct) ZVAL_STRING(&_0, "sha256"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "php"); - ZEPHIR_CALL_FUNCTION(&_2, "hash", NULL, 99, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "hash", NULL, 68, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "php"); @@ -221,7 +221,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, addDirectory) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &directory); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &directory); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("directories"), &_1, &directory); RETURN_THIS(); @@ -260,7 +260,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, addExtension) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &extension); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &extension); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("extensions"), &_1, &extension); RETURN_THIS(); @@ -299,7 +299,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, addFile) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "sha256"); - ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 99, &_0, &file); + ZEPHIR_CALL_FUNCTION(&_1, "hash", NULL, 68, &_0, &file); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("files"), &_1, &file); RETURN_THIS(); @@ -369,7 +369,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, addNamespace) ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_VV(&_1, &_0, &nsSeparator); ZEPHIR_CPY_WRT(&nsName, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdirectories", NULL, 190, directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkdirectories", NULL, 171, directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(directories, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("namespaces"), PH_NOISY_CC | PH_READONLY); @@ -394,7 +394,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, addNamespace) } ZEPHIR_INIT_VAR(&_7); zephir_fast_array_merge(&_7, &source, &target); - ZEPHIR_CALL_FUNCTION(&_2, "array_unique", NULL, 191, &_7); + ZEPHIR_CALL_FUNCTION(&_2, "array_unique", NULL, 172, &_7); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("namespaces"), &nsName, &_2); RETURN_THIS(); @@ -445,40 +445,40 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoload) zephir_update_property_zval(this_ptr, ZEND_STRL("debug"), &_0); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SV(&_1, "Loading: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "loader:beforeCheckClass"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "firemanagerevent", NULL, 0, &_2, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "autoloadcheckclasses", NULL, 193, &className); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "autoloadcheckclasses", NULL, 174, &className); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_3)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, "Class: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "autoloadchecknamespaces", NULL, 194, &className); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "autoloadchecknamespaces", NULL, 175, &className); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_5)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SV(&_6, "Namespace: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_6); zephir_check_call_status(); zephir_read_property(&_8, this_ptr, ZEND_STRL("directories"), PH_NOISY_CC | PH_READONLY); ZVAL_BOOL(&_9, 1); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "autoloadcheckdirectories", NULL, 195, &_8, &className, &_9); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "autoloadcheckdirectories", NULL, 176, &_8, &className, &_9); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7)) { RETURN_MM_BOOL(1); } ZEPHIR_INIT_VAR(&_10); ZEPHIR_CONCAT_SV(&_10, "Directories: 404: ", &className); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_10); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_10); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "loader:afterCheckClass"); @@ -725,7 +725,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, register) ZVAL_STRING(&_2$$3, "autoload"); zephir_array_fast_append(&_1$$3, &_2$$3); ZVAL_BOOL(&_3$$3, (prepend ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 196, &_1$$3, &__$true, &_3$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 177, &_1$$3, &__$true, &_3$$3); zephir_check_call_status(); if (1) { zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true); @@ -875,7 +875,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, setDirectories) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 197, &directories, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 178, &directories, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -934,7 +934,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, setExtensions) ZVAL_STRING(&_1$$3, "sha256"); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "php"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "hash", NULL, 99, &_1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "hash", NULL, 68, &_1$$3, &_2$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, "php"); @@ -1081,7 +1081,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, setFiles) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 197, &files, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addtocollection", NULL, 178, &files, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -1153,7 +1153,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, setNamespaces) } ZEPHIR_INIT_NVAR(&directories); ZVAL_COPY(&directories, _1); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkdirectories", &_6, 190, &directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "checkdirectories", &_6, 171, &directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(&directories, &_5$$4); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories); @@ -1172,7 +1172,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, setNamespaces) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&directories, &namespaces, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "checkdirectories", &_6, 190, &directories, &dirSeparator); + ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "checkdirectories", &_6, 171, &directories, &dirSeparator); zephir_check_call_status(); ZEPHIR_CPY_WRT(&directories, &_8$$5); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addnamespace", &_7, 0, &name, &directories); @@ -1216,7 +1216,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, unregister) ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "autoload"); zephir_array_fast_append(&_1$$3, &_2$$3); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 198, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 179, &_1$$3); zephir_check_call_status(); if (0) { zephir_update_property_zval(this_ptr, ZEND_STRL("isRegistered"), &__$true); @@ -1262,7 +1262,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, requireFile) zephir_read_property(&_0, this_ptr, ZEND_STRL("fileCheckingCallback"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_1, "call_user_func", NULL, 199, &_0, &file); + ZEPHIR_CALL_FUNCTION(&_1, "call_user_func", NULL, 180, &_0, &file); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); @@ -1271,7 +1271,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, requireFile) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SV(&_3$$3, "Require: ", &file); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_3$$3); zephir_check_call_status(); if (zephir_require_once_zval(&file) == FAILURE) { RETURN_MM_NULL(); @@ -1280,7 +1280,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, requireFile) } ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, "Require: 404: ", &file); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_4); zephir_check_call_status(); RETURN_MM_BOOL(0); } @@ -1453,7 +1453,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckClasses) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SV(&_3$$3, "Class: load: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 192, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", NULL, 173, &_3$$3); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -1568,7 +1568,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_11$$6); ZEPHIR_CONCAT_SV(&_11$$6, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_11$$6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_11$$6); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -1598,7 +1598,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_15$$9); ZEPHIR_CONCAT_SV(&_15$$9, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_15$$9); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_15$$9); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -1643,7 +1643,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_21$$13); ZEPHIR_CONCAT_SV(&_21$$13, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_21$$13); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_21$$13); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -1673,7 +1673,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckDirectories) if (isDirectory) { ZEPHIR_INIT_NVAR(&_24$$16); ZEPHIR_CONCAT_SV(&_24$$16, "Directories: ", &filePath); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_24$$16); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_24$$16); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -1770,13 +1770,13 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckNamespaces) ZVAL_LONG(&_7$$3, zephir_fast_strlen_ev(&prefix)); ZEPHIR_INIT_NVAR(&fileName); zephir_substr(&fileName, &className, zephir_get_intval(&_7$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "autoloadcheckdirectories", &_9, 195, &directories, &fileName); + ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "autoloadcheckdirectories", &_9, 176, &directories, &fileName); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$3)) { zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$5); ZEPHIR_CONCAT_SVSV(&_11$$5, "Namespace: ", &prefix, " - ", &_10$$5); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_11$$5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_11$$5); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -1805,13 +1805,13 @@ PHP_METHOD(Phalcon_Autoload_Loader, autoloadCheckNamespaces) ZVAL_LONG(&_15$$6, zephir_fast_strlen_ev(&prefix)); ZEPHIR_INIT_NVAR(&fileName); zephir_substr(&fileName, &className, zephir_get_intval(&_15$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_16$$6, this_ptr, "autoloadcheckdirectories", &_9, 195, &directories, &fileName); + ZEPHIR_CALL_METHOD(&_16$$6, this_ptr, "autoloadcheckdirectories", &_9, 176, &directories, &fileName); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_16$$6)) { zephir_read_property(&_17$$8, this_ptr, ZEND_STRL("checkedPath"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_18$$8); ZEPHIR_CONCAT_SVSV(&_18$$8, "Namespace: ", &prefix, " - ", &_17$$8); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 192, &_18$$8); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "adddebug", &_12, 173, &_18$$8); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -1905,7 +1905,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, checkDirectories) ZEPHIR_CPY_WRT(&directory, &_5$$5); ZEPHIR_INIT_NVAR(&_6$$5); ZVAL_STRING(&_6$$5, "sha256"); - ZEPHIR_CALL_FUNCTION(&_7$$5, "hash", &_8, 99, &_6$$5, &directory); + ZEPHIR_CALL_FUNCTION(&_7$$5, "hash", &_8, 68, &_6$$5, &directory); zephir_check_call_status(); zephir_array_update_zval(&results, &_7$$5, &directory, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1927,7 +1927,7 @@ PHP_METHOD(Phalcon_Autoload_Loader, checkDirectories) ZEPHIR_CPY_WRT(&directory, &_10$$6); ZEPHIR_INIT_NVAR(&_11$$6); ZVAL_STRING(&_11$$6, "sha256"); - ZEPHIR_CALL_FUNCTION(&_12$$6, "hash", &_8, 99, &_11$$6, &directory); + ZEPHIR_CALL_FUNCTION(&_12$$6, "hash", &_8, 68, &_11$$6, &directory); zephir_check_call_status(); zephir_array_update_zval(&results, &_12$$6, &directory, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, directories, "next", NULL, 0); diff --git a/ext/phalcon/cache/abstractcache.zep.c b/ext/phalcon/cache/abstractcache.zep.c new file mode 100644 index 00000000000..90c9d0d2e9e --- /dev/null +++ b/ext/phalcon/cache/abstractcache.zep.c @@ -0,0 +1,671 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/object.h" +#include "kernel/memory.h" +#include "kernel/string.h" +#include "kernel/operators.h" +#include "kernel/fcall.h" +#include "kernel/exception.h" +#include "kernel/array.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * This component offers caching capabilities for your application. + * Phalcon\Cache implements PSR-16. + * + * @property AdapterInterface $adapter + */ +ZEPHIR_INIT_CLASS(Phalcon_Cache_AbstractCache) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, AbstractCache, phalcon, cache_abstractcache, phalcon_cache_abstractcache_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + /** + * The adapter + * + * @var AdapterInterface + */ + zend_declare_property_null(phalcon_cache_abstractcache_ce, SL("adapter"), ZEND_ACC_PROTECTED); + zend_class_implements(phalcon_cache_abstractcache_ce, 1, phalcon_cache_cacheinterface_ce); + return SUCCESS; +} + +/** + * Constructor. + * + * @param AdapterInterface $adapter The cache adapter + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, __construct) +{ + zval *adapter, adapter_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapter_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_cache_adapter_adapterinterface_ce) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, &adapter); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter); +} + +/** + * Returns the current adapter + * + * @return AdapterInterface + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, getAdapter) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "adapter"); +} + +/** + * Checks the key. If it contains invalid characters an exception is thrown + * + * @param mixed $key + * + * @throws InvalidArgumentException + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, checkKey) +{ + zend_class_entry *_6$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, exception, _0, _1, _2, _3, _4$$3, _5$$3, _7$$3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "/[^A-Za-z0-9-_.]/"); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "/[^A-Za-z0-9-_.]/"); + zephir_preg_match(&_2, &_3, &key, &_0, 0, 0 , 0 ); + if (zephir_is_true(&_2)) { + ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_4$$3); + zephir_fetch_safe_class(&_5$$3, &exception); + _6$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$3), Z_STRLEN_P(&_5$$3), ZEND_FETCH_CLASS_AUTO); + if(!_6$$3) { + RETURN_MM_NULL(); + } + object_init_ex(&_4$$3, _6$$3); + ZEPHIR_INIT_VAR(&_7$$3); + ZVAL_STRING(&_7$$3, "The key contains invalid characters"); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 0, &_7$$3); + zephir_check_call_status(); + zephir_throw_exception_debug(&_4$$3, "phalcon/Cache/AbstractCache.zep", 68); + ZEPHIR_MM_RESTORE(); + return; + } + ZEPHIR_MM_RESTORE(); +} + +/** + * Checks the key. If it contains invalid characters an exception is thrown + * + * @param mixed $keys + * + * @throws InvalidArgumentException + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, checkKeys) +{ + zend_class_entry *_3$$3; + zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, exception, _1$$3, _2$$3, _4$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(keys) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &keys); + + + _0 = Z_TYPE_P(keys) == IS_ARRAY; + if (!(_0)) { + _0 = zephir_zval_is_traversable(keys); + } + if (!(_0)) { + ZEPHIR_CALL_METHOD(&exception, this_ptr, "getexceptionclass", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_fetch_safe_class(&_2$$3, &exception); + _3$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_2$$3), Z_STRLEN_P(&_2$$3), ZEND_FETCH_CLASS_AUTO); + if(!_3$$3) { + RETURN_MM_NULL(); + } + object_init_ex(&_1$$3, _3$$3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "The keys need to be an array or instance of Traversable"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0, &_4$$3); + zephir_check_call_status(); + zephir_throw_exception_debug(&_1$$3, "phalcon/Cache/AbstractCache.zep", 87); + ZEPHIR_MM_RESTORE(); + return; + } + ZEPHIR_MM_RESTORE(); +} + +/** + * Wipes clean the entire cache's keys. + * + * @return bool True on success and false on failure. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doClear) +{ + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "clear", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Delete an item from the cache by its unique key. + * + * @param string $key The unique cache key of the item to delete. + * + * @return bool True if the item was successfully removed. False if there + * was an error. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doDelete) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "delete", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Deletes multiple cache items in a single operation. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doDeleteMultiple) +{ + zend_bool result = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, key, *_0, _1, _2$$3, _3$$3, _4$$5, _5$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(keys) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &keys); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + zephir_check_call_status(); + result = 1; + zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 135); + if (Z_TYPE_P(keys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) + { + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _0); + zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "delete", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3)) { + result = 0; + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$5, &_4$$5, "delete", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5$$5)) { + result = 0; + } + ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&key); + RETURN_MM_BOOL(result); +} + +/** + * Fetches a value from the cache. + * + * @param string $key The unique key of this item in the cache. + * @param mixed $defaultValue Default value to return if the key does not exist. + * + * @return mixed The value of the item from the cache, or $default in case + * of cache miss. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &key, defaultValue); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Obtains multiple cache items by their unique keys. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doGetMultiple) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null, element, results, *_0, _1, _2$$3, _4$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keys_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&results); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(keys) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &keys, &defaultValue); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&results); + array_init(&results); + zephir_is_iterable(keys, 0, "phalcon/Cache/AbstractCache.zep", 171); + if (Z_TYPE_P(keys) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) + { + ZEPHIR_INIT_NVAR(&element); + ZVAL_COPY(&element, _0); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "get", &_3, 0, &element, defaultValue); + zephir_check_call_status(); + zephir_array_update_zval(&results, &element, &_2$$3, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&element, keys, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "get", &_5, 0, &element, defaultValue); + zephir_check_call_status(); + zephir_array_update_zval(&results, &element, &_4$$4, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&element); + RETURN_CCTOR(&results); +} + +/** + * Determines whether an item is present in the cache. + * + * @param string $key The cache item key. + * + * @return bool + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doHas) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Persists data in the cache, uniquely referenced by a key with an optional + * expiration TTL time. + * + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store. + * Must be serializable. + * @param null|int|DateInterval $ttl Optional. The TTL value of this + * item. If no value is sent and the + * driver supports TTL then the library + * may set a default value for it or + * let the driver take care of that. + * + * @return bool True on success and false on failure. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is not + * a legal value. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doSet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&ttl_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STR(key) + Z_PARAM_ZVAL(value) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl); + zephir_get_strval(&key, key_param); + if (!ttl) { + ttl = &ttl_sub; + ttl = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, &key, value, ttl); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Persists a set of key => value pairs in the cache, with an optional TTL. + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, doSetMultiple) +{ + zend_string *_3; + zend_ulong _2; + zend_bool result = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *values, values_sub, *ttl = NULL, ttl_sub, __$null, key, value, *_0, _1, _4$$3, _6$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&values_sub); + ZVAL_UNDEF(&ttl_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$5); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(values) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &values, &ttl); + if (!ttl) { + ttl = &ttl_sub; + ttl = &__$null; + } + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, values); + zephir_check_call_status(); + result = 1; + zephir_is_iterable(values, 0, "phalcon/Cache/AbstractCache.zep", 232); + if (Z_TYPE_P(values) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _2, _3, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "set", &_5, 0, &key, &value, ttl); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_4$$3)) { + result = 0; + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, values, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&key, values, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_6$$5, this_ptr, "set", &_7, 0, &key, &value, ttl); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) { + result = 0; + } + ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_MM_BOOL(result); +} + +/** + * Returns the exception class that will be used for exceptions thrown + * + * @return string + */ +PHP_METHOD(Phalcon_Cache_AbstractCache, getExceptionClass) +{ +} + diff --git a/ext/phalcon/cache/abstractcache.zep.h b/ext/phalcon/cache/abstractcache.zep.h new file mode 100644 index 00000000000..f06290b7550 --- /dev/null +++ b/ext/phalcon/cache/abstractcache.zep.h @@ -0,0 +1,91 @@ + +extern zend_class_entry *phalcon_cache_abstractcache_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Cache_AbstractCache); + +PHP_METHOD(Phalcon_Cache_AbstractCache, __construct); +PHP_METHOD(Phalcon_Cache_AbstractCache, getAdapter); +PHP_METHOD(Phalcon_Cache_AbstractCache, checkKey); +PHP_METHOD(Phalcon_Cache_AbstractCache, checkKeys); +PHP_METHOD(Phalcon_Cache_AbstractCache, doClear); +PHP_METHOD(Phalcon_Cache_AbstractCache, doDelete); +PHP_METHOD(Phalcon_Cache_AbstractCache, doDeleteMultiple); +PHP_METHOD(Phalcon_Cache_AbstractCache, doGet); +PHP_METHOD(Phalcon_Cache_AbstractCache, doGetMultiple); +PHP_METHOD(Phalcon_Cache_AbstractCache, doHas); +PHP_METHOD(Phalcon_Cache_AbstractCache, doSet); +PHP_METHOD(Phalcon_Cache_AbstractCache, doSetMultiple); +PHP_METHOD(Phalcon_Cache_AbstractCache, getExceptionClass); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache___construct, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_abstractcache_getadapter, 0, 0, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_checkkey, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_checkkeys, 0, 1, IS_VOID, 0) + + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_doclear, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dodelete, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dodeletemultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_abstractcache_dogetmultiple, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dohas, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_doset, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_dosetmultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, values) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_abstractcache_getexceptionclass, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_cache_abstractcache_method_entry) { + PHP_ME(Phalcon_Cache_AbstractCache, __construct, arginfo_phalcon_cache_abstractcache___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Cache_AbstractCache, getAdapter, arginfo_phalcon_cache_abstractcache_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_AbstractCache, checkKey, arginfo_phalcon_cache_abstractcache_checkkey, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, checkKeys, arginfo_phalcon_cache_abstractcache_checkkeys, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doClear, arginfo_phalcon_cache_abstractcache_doclear, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doDelete, arginfo_phalcon_cache_abstractcache_dodelete, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doDeleteMultiple, arginfo_phalcon_cache_abstractcache_dodeletemultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doGet, arginfo_phalcon_cache_abstractcache_doget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doGetMultiple, arginfo_phalcon_cache_abstractcache_dogetmultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doHas, arginfo_phalcon_cache_abstractcache_dohas, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doSet, arginfo_phalcon_cache_abstractcache_doset, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, doSetMultiple, arginfo_phalcon_cache_abstractcache_dosetmultiple, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_AbstractCache, getExceptionClass, arginfo_phalcon_cache_abstractcache_getexceptionclass, ZEND_ACC_ABSTRACT|ZEND_ACC_PROTECTED) + PHP_FE_END +}; diff --git a/ext/phalcon/cache/cache.zep.c b/ext/phalcon/cache/cache.zep.c index f0288457aa1..d2a73e30275 100644 --- a/ext/phalcon/cache/cache.zep.c +++ b/ext/phalcon/cache/cache.zep.c @@ -12,13 +12,10 @@ #include #include "kernel/main.h" +#include "kernel/fcall.h" #include "kernel/object.h" #include "kernel/memory.h" -#include "kernel/fcall.h" #include "kernel/operators.h" -#include "kernel/array.h" -#include "kernel/string.h" -#include "kernel/exception.h" /** @@ -37,53 +34,9 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Cache_Cache) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Cache, Cache, phalcon, cache_cache, phalcon_cache_cache_method_entry, 0); - - /** - * The adapter - * - * @var AdapterInterface - */ - zend_declare_property_null(phalcon_cache_cache_ce, SL("adapter"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_cache_cache_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))); - return SUCCESS; -} - -/** - * The adapter - */ -PHP_METHOD(Phalcon_Cache_Cache, getAdapter) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "adapter"); -} - -/** - * Constructor. - * - * @param AdapterInterface $adapter The cache adapter - */ -PHP_METHOD(Phalcon_Cache_Cache, __construct) -{ - zval *adapter, adapter_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapter_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_cache_adapter_adapterinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &adapter); - + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache, Cache, phalcon, cache_cache, phalcon_cache_abstractcache_ce, phalcon_cache_cache_method_entry, 0); - zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), adapter); + return SUCCESS; } /** @@ -93,18 +46,15 @@ PHP_METHOD(Phalcon_Cache_Cache, __construct) */ PHP_METHOD(Phalcon_Cache_Cache, clear) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "clear", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doclear", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -122,65 +72,42 @@ PHP_METHOD(Phalcon_Cache_Cache, clear) */ PHP_METHOD(Phalcon_Cache_Cache, delete) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, _1; + zval *key_param = NULL; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&key); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "delete", NULL, 0, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodelete", NULL, 0, &key); zephir_check_call_status(); RETURN_MM(); } /** * Deletes multiple cache items in a single operation. - * - * @param iterable $keys A list of string-based keys to be deleted. - * - * @return bool True if the items were successfully removed. False if there - * was an error. - * - * @throws InvalidArgumentException MUST be thrown if $keys is neither an - * array nor a Traversable, or if any of - * the $keys are not a legal value. */ PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple) { - zend_bool result = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keys, keys_sub, key, *_0, _1, _2$$3, _3$$3, _4$$5, _5$$5; + zval *keys, keys_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&keys_sub); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_5$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -193,53 +120,16 @@ PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple) zephir_fetch_params(1, 1, 0, &keys); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dodeletemultiple", NULL, 0, keys); zephir_check_call_status(); - result = 1; - zephir_is_iterable(keys, 0, "phalcon/Cache/Cache.zep", 100); - if (Z_TYPE_P(keys) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) - { - ZEPHIR_INIT_NVAR(&key); - ZVAL_COPY(&key, _0); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "delete", NULL, 0, &key); - zephir_check_call_status(); - if (!(zephir_is_true(&_3$$3))) { - result = 0; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); - zephir_check_call_status(); - zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_5$$5, &_4$$5, "delete", NULL, 0, &key); - zephir_check_call_status(); - if (!(zephir_is_true(&_5$$5))) { - result = 0; - } - ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&key); - RETURN_MM_BOOL(result); + RETURN_MM(); } /** * Fetches a value from the cache. * * @param string $key The unique key of this item in the cache. - * @param mixed $defaultValue Default value to return if the key does - * not exist. + * @param mixed $defaultValue Default value to return if the key does not exist. * * @return mixed The value of the item from the cache, or $default in case * of cache miss. @@ -249,21 +139,19 @@ PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple) */ PHP_METHOD(Phalcon_Cache_Cache, get) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, *defaultValue = NULL, defaultValue_sub, __$null, _1; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(defaultValue) ZEND_PARSE_PARAMETERS_END(); @@ -271,55 +159,32 @@ PHP_METHOD(Phalcon_Cache_Cache, get) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key, &defaultValue); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); if (!defaultValue) { defaultValue = &defaultValue_sub; defaultValue = &__$null; } - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "get", NULL, 0, key, defaultValue); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doget", NULL, 0, &key, defaultValue); zephir_check_call_status(); RETURN_MM(); } /** * Obtains multiple cache items by their unique keys. - * - * @param iterable $keys A list of keys that can obtained in a - * single operation. - * @param mixed defaultValue Default value to return for keys that do - * not exist. - * - * @return iterable A list of key => value pairs. Cache - * keys that do not exist or are stale will have $default as value. - * - * @throws InvalidArgumentException MUST be thrown if $keys is neither an - * array nor a Traversable, or if any of the $keys are not a legal value. */ PHP_METHOD(Phalcon_Cache_Cache, getMultiple) { - zval results; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null, element, *_0, _1, _2$$3, _4$$4; + zval *keys, keys_sub, *defaultValue = NULL, defaultValue_sub, __$null; zval *this_ptr = getThis(); ZVAL_UNDEF(&keys_sub); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&element); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&results); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -338,40 +203,9 @@ PHP_METHOD(Phalcon_Cache_Cache, getMultiple) } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, keys); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetmultiple", NULL, 0, keys, defaultValue); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&results); - array_init(&results); - zephir_is_iterable(keys, 0, "phalcon/Cache/Cache.zep", 151); - if (Z_TYPE_P(keys) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _0) - { - ZEPHIR_INIT_NVAR(&element); - ZVAL_COPY(&element, _0); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "get", &_3, 0, &element, defaultValue); - zephir_check_call_status(); - zephir_array_update_zval(&results, &element, &_2$$3, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, keys, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, keys, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&element, keys, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "get", &_3, 0, &element, defaultValue); - zephir_check_call_status(); - zephir_array_update_zval(&results, &element, &_4$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&element); - RETURN_CTOR(&results); + RETURN_MM(); } /** @@ -386,34 +220,27 @@ PHP_METHOD(Phalcon_Cache_Cache, getMultiple) */ PHP_METHOD(Phalcon_Cache_Cache, has) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, _1; + zval *key_param = NULL; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&key); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "has", NULL, 0, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dohas", NULL, 0, &key); zephir_check_call_status(); RETURN_MM(); } @@ -438,22 +265,20 @@ PHP_METHOD(Phalcon_Cache_Cache, has) */ PHP_METHOD(Phalcon_Cache_Cache, set) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, *value, value_sub, *ttl = NULL, ttl_sub, __$null, _1; + zval *key_param = NULL, *value, value_sub, *ttl = NULL, ttl_sub, __$null; + zval key; zval *this_ptr = getThis(); - ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&key); ZVAL_UNDEF(&value_sub); ZVAL_UNDEF(&ttl_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ZVAL(key) + Z_PARAM_STR(key) Z_PARAM_ZVAL(value) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(ttl) @@ -462,60 +287,32 @@ PHP_METHOD(Phalcon_Cache_Cache, set) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &key, &value, &ttl); - ZEPHIR_SEPARATE_PARAM(key); + zephir_fetch_params(1, 2, 1, &key_param, &value, &ttl); + zephir_get_strval(&key, key_param); if (!ttl) { ttl = &ttl_sub; ttl = &__$null; } - zephir_cast_to_string(&_0, key); - ZEPHIR_CPY_WRT(key, &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkey", NULL, 0, key); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_1, "set", NULL, 0, key, value, ttl); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doset", NULL, 0, &key, value, ttl); zephir_check_call_status(); RETURN_MM(); } /** * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * @param iterable $values A list of key => value pairs for a - * multiple-set operation. - * @param null|int|DateInterval $ttl Optional. The TTL value of this - * item. If no value is sent and the - * driver supports TTL then the - * library may set a default value for - * it or let the driver take care of - * that. - * - * @return bool True on success and false on failure. - * - * @throws InvalidArgumentException MUST be thrown if $values is neither an - * array nor a Traversable, or if any of the $values are not a legal value. */ PHP_METHOD(Phalcon_Cache_Cache, setMultiple) { - zend_string *_3; - zend_ulong _2; - zend_bool result = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values, values_sub, *ttl = NULL, ttl_sub, __$null, key, value, *_0, _1, _4$$3, _6$$5; + zval *values, values_sub, *ttl = NULL, ttl_sub, __$null; zval *this_ptr = getThis(); ZVAL_UNDEF(&values_sub); ZVAL_UNDEF(&ttl_sub); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -534,132 +331,22 @@ PHP_METHOD(Phalcon_Cache_Cache, setMultiple) } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkkeys", NULL, 0, values); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dosetmultiple", NULL, 0, values, ttl); zephir_check_call_status(); - result = 1; - zephir_is_iterable(values, 0, "phalcon/Cache/Cache.zep", 231); - if (Z_TYPE_P(values) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "set", &_5, 0, &key, &value, ttl); - zephir_check_call_status(); - if (!(zephir_is_true(&_4$$3))) { - result = 0; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, values, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, values, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, values, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, values, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$5, this_ptr, "set", &_5, 0, &key, &value, ttl); - zephir_check_call_status(); - if (!(zephir_is_true(&_6$$5))) { - result = 0; - } - ZEPHIR_CALL_METHOD(NULL, values, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&key); - RETURN_MM_BOOL(result); -} - -/** - * Checks the key. If it contains invalid characters an exception is thrown - * - * @param mixed $key - * - * @throws InvalidArgumentException - */ -PHP_METHOD(Phalcon_Cache_Cache, checkKey) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *key_param = NULL, _0, _1, _2, _3; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &key_param); - zephir_get_strval(&key, key_param); - - - ZEPHIR_INIT_VAR(&_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "/[^A-Za-z0-9-_.]/"); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "/[^A-Za-z0-9-_.]/"); - zephir_preg_match(&_2, &_3, &key, &_0, 0, 0 , 0 ); - if (zephir_is_true(&_2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_invalidargumentexception_ce, "The key contains invalid characters", "phalcon/Cache/Cache.zep", 246); - return; - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } /** - * Checks the key. If it contains invalid characters an exception is thrown - * - * @param mixed $keys + * Returns the exception class that will be used for exceptions thrown * - * @throws InvalidArgumentException + * @return string */ -PHP_METHOD(Phalcon_Cache_Cache, checkKeys) +PHP_METHOD(Phalcon_Cache_Cache, getExceptionClass) { - zend_bool _0; - zval *keys, keys_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&keys_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(keys) - ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &keys); - - _0 = Z_TYPE_P(keys) == IS_ARRAY; - if (!(_0)) { - _0 = zephir_zval_is_traversable(keys); - } - if (!(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_cache_exception_invalidargumentexception_ce, "The keys need to be an array or instance of Traversable", "phalcon/Cache/Cache.zep", 262); - return; - } + RETURN_STRING("Phalcon\\Cache\\Exception\\InvalidArgumentException"); } diff --git a/ext/phalcon/cache/cache.zep.h b/ext/phalcon/cache/cache.zep.h index 62c25550f84..4e20ede19f2 100644 --- a/ext/phalcon/cache/cache.zep.h +++ b/ext/phalcon/cache/cache.zep.h @@ -3,8 +3,6 @@ extern zend_class_entry *phalcon_cache_cache_ce; ZEPHIR_INIT_CLASS(Phalcon_Cache_Cache); -PHP_METHOD(Phalcon_Cache_Cache, getAdapter); -PHP_METHOD(Phalcon_Cache_Cache, __construct); PHP_METHOD(Phalcon_Cache_Cache, clear); PHP_METHOD(Phalcon_Cache_Cache, delete); PHP_METHOD(Phalcon_Cache_Cache, deleteMultiple); @@ -13,21 +11,13 @@ PHP_METHOD(Phalcon_Cache_Cache, getMultiple); PHP_METHOD(Phalcon_Cache_Cache, has); PHP_METHOD(Phalcon_Cache_Cache, set); PHP_METHOD(Phalcon_Cache_Cache, setMultiple); -PHP_METHOD(Phalcon_Cache_Cache, checkKey); -PHP_METHOD(Phalcon_Cache_Cache, checkKeys); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_getadapter, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Cache\\Adapter\\AdapterInterface, 0) -ZEND_END_ARG_INFO() +PHP_METHOD(Phalcon_Cache_Cache, getExceptionClass); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_clear, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_delete, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_deletemultiple, 0, 1, _IS_BOOL, 0) @@ -35,7 +25,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_deletemultip ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_get, 0, 0, 1) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() @@ -45,11 +35,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cache_getmultiple, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_has, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_set, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() @@ -59,23 +49,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_setmultiple, ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_checkkey, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_checkkeys, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, keys) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cache_getexceptionclass, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_cache_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Cache_Cache, getAdapter, arginfo_phalcon_cache_cache_getadapter, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Cache_Cache, getAdapter, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Cache_Cache, __construct, arginfo_phalcon_cache_cache___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Cache_Cache, clear, arginfo_phalcon_cache_cache_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, delete, arginfo_phalcon_cache_cache_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, deleteMultiple, arginfo_phalcon_cache_cache_deletemultiple, ZEND_ACC_PUBLIC) @@ -84,7 +61,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_cache_method_entry) { PHP_ME(Phalcon_Cache_Cache, has, arginfo_phalcon_cache_cache_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, set, arginfo_phalcon_cache_cache_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Cache, setMultiple, arginfo_phalcon_cache_cache_setmultiple, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Cache, checkKey, arginfo_phalcon_cache_cache_checkkey, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Cache_Cache, checkKeys, arginfo_phalcon_cache_cache_checkkeys, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Cache_Cache, getExceptionClass, arginfo_phalcon_cache_cache_getexceptionclass, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/cache/cachefactory.zep.c b/ext/phalcon/cache/cachefactory.zep.c index 98b631587c3..0aa3f896d06 100644 --- a/ext/phalcon/cache/cachefactory.zep.c +++ b/ext/phalcon/cache/cachefactory.zep.c @@ -132,7 +132,7 @@ PHP_METHOD(Phalcon_Cache_CacheFactory, load) zephir_check_call_status(); ZEPHIR_CPY_WRT(config, &_0); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 76); + zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Cache/CacheFactory.zep", 75); ZEPHIR_OBS_VAR(&options); if (!(zephir_array_isset_string_fetch(&options, config, SL("options"), 0))) { ZEPHIR_INIT_NVAR(&options); @@ -217,7 +217,7 @@ PHP_METHOD(Phalcon_Cache_CacheFactory, newInstance) ZEPHIR_CALL_METHOD(&adapter, &_0, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); object_init_ex(return_value, phalcon_cache_cache_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 200, &adapter); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 181, &adapter); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/cache/cachefactory.zep.h b/ext/phalcon/cache/cachefactory.zep.h index 0aa215effe7..dd359eabc2f 100644 --- a/ext/phalcon/cache/cachefactory.zep.h +++ b/ext/phalcon/cache/cachefactory.zep.h @@ -12,11 +12,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cachefactory___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, factory, Phalcon\\Cache\\AdapterFactory, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_load, 0, 1, Psr\\SimpleCache\\CacheInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_load, 0, 1, Phalcon\\Cache\\CacheInterface, 0) ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_newinstance, 0, 1, Psr\\SimpleCache\\CacheInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_cachefactory_newinstance, 0, 1, Phalcon\\Cache\\CacheInterface, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") diff --git a/ext/phalcon/cache/cacheinterface.zep.c b/ext/phalcon/cache/cacheinterface.zep.c new file mode 100644 index 00000000000..e7dc7c7c652 --- /dev/null +++ b/ext/phalcon/cache/cacheinterface.zep.c @@ -0,0 +1,105 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Interface for Phalcon\Cache\Cache + */ +ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Cache, CacheInterface, phalcon, cache_cacheinterface, phalcon_cache_cacheinterface_method_entry); + + return SUCCESS; +} + +/** + * Wipes clean the entire cache's keys. + * + * @return bool True on success and false on failure. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, clear); +/** + * Delete an item from the cache by its unique key. + * + * @param string $key The unique cache key of the item to delete. + * + * @return bool True if the item was successfully removed. False if there + * was an error. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, delete); +/** + * Deletes multiple cache items in a single operation. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, deleteMultiple); +/** + * Fetches a value from the cache. + * + * @param string $key The unique key of this item in the cache. + * @param mixed $defaultValue Default value to return if the key does not exist. + * + * @return mixed The value of the item from the cache, or $default in case + * of cache miss. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, get); +/** + * Obtains multiple cache items by their unique keys. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, getMultiple); +/** + * Determines whether an item is present in the cache. + * + * @param string $key The cache item key. + * + * @return bool + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, has); +/** + * Persists data in the cache, uniquely referenced by a key with an optional + * expiration TTL time. + * + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store. + * Must be serializable. + * @param null|int|DateInterval $ttl Optional. The TTL value of this + * item. If no value is sent and the + * driver supports TTL then the library + * may set a default value for it or + * let the driver take care of that. + * + * @return bool True on success and false on failure. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is not + * a legal value. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, set); +/** + * Persists a set of key => value pairs in the cache, with an optional TTL. + */ +ZEPHIR_DOC_METHOD(Phalcon_Cache_CacheInterface, setMultiple); diff --git a/ext/phalcon/cache/cacheinterface.zep.h b/ext/phalcon/cache/cacheinterface.zep.h new file mode 100644 index 00000000000..61a2f57529e --- /dev/null +++ b/ext/phalcon/cache/cacheinterface.zep.h @@ -0,0 +1,52 @@ + +extern zend_class_entry *phalcon_cache_cacheinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Cache_CacheInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_clear, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_delete, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_deletemultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cacheinterface_get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_cacheinterface_getmultiple, 0, 0, 1) + ZEND_ARG_INFO(0, keys) + ZEND_ARG_INFO(0, defaultValue) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_has, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_set, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_cacheinterface_setmultiple, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, values) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_cache_cacheinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, clear, arginfo_phalcon_cache_cacheinterface_clear) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, delete, arginfo_phalcon_cache_cacheinterface_delete) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, deleteMultiple, arginfo_phalcon_cache_cacheinterface_deletemultiple) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, get, arginfo_phalcon_cache_cacheinterface_get) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, getMultiple, arginfo_phalcon_cache_cacheinterface_getmultiple) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, has, arginfo_phalcon_cache_cacheinterface_has) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, set, arginfo_phalcon_cache_cacheinterface_set) + PHP_ABSTRACT_ME(Phalcon_Cache_CacheInterface, setMultiple, arginfo_phalcon_cache_cacheinterface_setmultiple) + PHP_FE_END +}; diff --git a/ext/phalcon/cache/exception/exception.zep.c b/ext/phalcon/cache/exception/exception.zep.c index ee577ce63e6..2d4f8c71f9f 100644 --- a/ext/phalcon/cache/exception/exception.zep.c +++ b/ext/phalcon/cache/exception/exception.zep.c @@ -29,7 +29,6 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, Exception, phalcon, cache_exception_exception, zend_ce_exception, NULL, 0); - zend_class_implements(phalcon_cache_exception_exception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\cacheexception"))); return SUCCESS; } diff --git a/ext/phalcon/cache/exception/invalidargumentexception.zep.c b/ext/phalcon/cache/exception/invalidargumentexception.zep.c index 37fb795a6e4..e70275acf96 100644 --- a/ext/phalcon/cache/exception/invalidargumentexception.zep.c +++ b/ext/phalcon/cache/exception/invalidargumentexception.zep.c @@ -29,7 +29,6 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Exception_InvalidArgumentException) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Cache\\Exception, InvalidArgumentException, phalcon, cache_exception_invalidargumentexception, zend_ce_exception, NULL, 0); - zend_class_implements(phalcon_cache_exception_invalidargumentexception_ce, 1, zephir_get_internal_ce(SL("psr\\simplecache\\invalidargumentexception"))); return SUCCESS; } diff --git a/ext/phalcon/cli/console.zep.c b/ext/phalcon/cli/console.zep.c index cb999fbc9cc..6c2c11c5fc6 100644 --- a/ext/phalcon/cli/console.zep.c +++ b/ext/phalcon/cli/console.zep.c @@ -176,7 +176,7 @@ PHP_METHOD(Phalcon_Cli_Console, handle) object_init_ex(&_10$$12, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(&_11$$12); ZEPHIR_CONCAT_SVS(&_11$$12, "Module '", &moduleName, "' isn't registered in the console container"); - ZEPHIR_CALL_METHOD(NULL, &_10$$12, "__construct", NULL, 31, &_11$$12); + ZEPHIR_CALL_METHOD(NULL, &_10$$12, "__construct", NULL, 29, &_11$$12); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$12, "phalcon/Cli/Console.zep", 91); ZEPHIR_MM_RESTORE(); @@ -200,7 +200,7 @@ PHP_METHOD(Phalcon_Cli_Console, handle) object_init_ex(&_12$$16, phalcon_cli_console_exception_ce); ZEPHIR_INIT_VAR(&_13$$16); ZEPHIR_CONCAT_SVS(&_13$$16, "Module definition path '", &path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_12$$16, "__construct", NULL, 31, &_13$$16); + ZEPHIR_CALL_METHOD(NULL, &_12$$16, "__construct", NULL, 29, &_13$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$16, "phalcon/Cli/Console.zep", 108); ZEPHIR_MM_RESTORE(); @@ -386,7 +386,7 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) } if (_0) { ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 23, &arguments); + ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 21, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); } @@ -400,7 +400,7 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_3$$5); ZVAL_STRING(&_3$$5, "--"); ZVAL_LONG(&_4$$5, 2); - ZEPHIR_CALL_FUNCTION(&_5$$5, "strncmp", &_6, 201, &arg, &_3$$5, &_4$$5); + ZEPHIR_CALL_FUNCTION(&_5$$5, "strncmp", &_6, 182, &arg, &_3$$5, &_4$$5); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_5$$5, 0)) { ZEPHIR_INIT_NVAR(&_7$$6); @@ -432,7 +432,7 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_18$$9); ZVAL_STRING(&_18$$9, "-"); ZVAL_LONG(&_19$$9, 1); - ZEPHIR_CALL_FUNCTION(&_20$$9, "strncmp", &_6, 201, &arg, &_18$$9, &_19$$9); + ZEPHIR_CALL_FUNCTION(&_20$$9, "strncmp", &_6, 182, &arg, &_18$$9, &_19$$9); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_20$$9, 0)) { ZVAL_LONG(&_21$$10, 1); @@ -462,7 +462,7 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_23$$14); ZVAL_STRING(&_23$$14, "--"); ZVAL_LONG(&_24$$14, 2); - ZEPHIR_CALL_FUNCTION(&_25$$14, "strncmp", &_6, 201, &arg, &_23$$14, &_24$$14); + ZEPHIR_CALL_FUNCTION(&_25$$14, "strncmp", &_6, 182, &arg, &_23$$14, &_24$$14); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_25$$14, 0)) { ZEPHIR_INIT_NVAR(&_26$$15); @@ -494,7 +494,7 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) ZEPHIR_INIT_NVAR(&_37$$18); ZVAL_STRING(&_37$$18, "-"); ZVAL_LONG(&_38$$18, 1); - ZEPHIR_CALL_FUNCTION(&_39$$18, "strncmp", &_6, 201, &arg, &_37$$18, &_38$$18); + ZEPHIR_CALL_FUNCTION(&_39$$18, "strncmp", &_6, 182, &arg, &_37$$18, &_38$$18); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_39$$18, 0)) { ZVAL_LONG(&_40$$19, 1); @@ -522,14 +522,14 @@ PHP_METHOD(Phalcon_Cli_Console, setArgument) } else { if (zephir_fast_count_int(&args)) { ZEPHIR_MAKE_REF(&args); - ZEPHIR_CALL_FUNCTION(&_45$$24, "array_shift", NULL, 23, &args); + ZEPHIR_CALL_FUNCTION(&_45$$24, "array_shift", NULL, 21, &args); ZEPHIR_UNREF(&args); zephir_check_call_status(); zephir_array_update_string(&handleArgs, SL("task"), &_45$$24, PH_COPY | PH_SEPARATE); } if (zephir_fast_count_int(&args)) { ZEPHIR_MAKE_REF(&args); - ZEPHIR_CALL_FUNCTION(&_46$$25, "array_shift", NULL, 23, &args); + ZEPHIR_CALL_FUNCTION(&_46$$25, "array_shift", NULL, 21, &args); ZEPHIR_UNREF(&args); zephir_check_call_status(); zephir_array_update_string(&handleArgs, SL("action"), &_46$$25, PH_COPY | PH_SEPARATE); diff --git a/ext/phalcon/cli/dispatcher.zep.c b/ext/phalcon/cli/dispatcher.zep.c index 840c4a7560c..5f0573d5aa7 100644 --- a/ext/phalcon/cli/dispatcher.zep.c +++ b/ext/phalcon/cli/dispatcher.zep.c @@ -486,7 +486,7 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&exception); object_init_ex(&exception, phalcon_cli_dispatcher_exception_ce); ZVAL_LONG(&_0, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 31, &message, &_0); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 29, &message, &_0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "handleexception", NULL, 0, &exception); zephir_check_call_status(); diff --git a/ext/phalcon/cli/router.zep.c b/ext/phalcon/cli/router.zep.c index 3749fb8ce86..cff927f68e3 100644 --- a/ext/phalcon/cli/router.zep.c +++ b/ext/phalcon/cli/router.zep.c @@ -63,9 +63,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router) */ zend_declare_property_null(phalcon_cli_router_ce, SL("defaultAction"), ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_cli_router_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_cli_router_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); /** * @var array */ @@ -84,9 +84,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router) */ zend_declare_property_null(phalcon_cli_router_ce, SL("matches"), ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_cli_router_ce, SL("module"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_cli_router_ce, SL("module"), "", ZEND_ACC_PROTECTED); /** * @var array */ @@ -154,7 +154,7 @@ PHP_METHOD(Phalcon_Cli_Router, __construct) add_assoc_long_ex(&_1$$3, SL("task"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+)[:delimiter]{0,1}$#"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 202, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 183, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/Cli/Router.zep", 120); ZEPHIR_INIT_NVAR(&_2$$3); @@ -166,7 +166,7 @@ PHP_METHOD(Phalcon_Cli_Router, __construct) add_assoc_long_ex(&_3$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_4$$3); ZVAL_STRING(&_4$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+):delimiter([a-zA-Z0-9\\.\\_]+)(:delimiter.*)*$#"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 202, &_4$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 183, &_4$$3, &_3$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/Cli/Router.zep", 129); } @@ -224,7 +224,7 @@ PHP_METHOD(Phalcon_Cli_Router, add) ZEPHIR_INIT_VAR(&route); object_init_ex(&route, phalcon_cli_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 202, &pattern, paths); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 183, &pattern, paths); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("routes"), &route); RETURN_CCTOR(&route); diff --git a/ext/phalcon/cli/router/route.zep.c b/ext/phalcon/cli/router/route.zep.c index 13970fc1a22..e23e8a61071 100644 --- a/ext/phalcon/cli/router/route.zep.c +++ b/ext/phalcon/cli/router/route.zep.c @@ -753,7 +753,7 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getReversedPaths) ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 203, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 95, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/config/adapter/grouped.zep.c b/ext/phalcon/config/adapter/grouped.zep.c index 9aacdfd9150..bb0de010913 100644 --- a/ext/phalcon/config/adapter/grouped.zep.c +++ b/ext/phalcon/config/adapter/grouped.zep.c @@ -33,7 +33,7 @@ /** * Reads multiple files (or arrays) and merges them all together. * - * See `Phalcon\Config\Factory::load` To load Config Adapter class using 'adapter' option. + * See `Phalcon\Config\ConfigFactory::load` To load Config Adapter class using 'adapter' option. * * ```php * use Phalcon\Config\Adapter\Grouped; @@ -183,9 +183,9 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) if (ZEPHIR_IS_IDENTICAL(&_6$$5, &defaultAdapter)) { ZEPHIR_INIT_NVAR(&_7$$6); object_init_ex(&_7$$6, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$6, &_7$$6, "load", &_10, 205, &configName); + ZEPHIR_CALL_METHOD(&_9$$6, &_7$$6, "load", &_10, 185, &configName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &_9$$6); zephir_check_call_status(); @@ -208,7 +208,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) object_init_ex(&_14$$9, phalcon_config_exception_ce); ZEPHIR_INIT_NVAR(&_15$$9); ZEPHIR_CONCAT_SS(&_15$$9, "To use 'array' adapter you have to specify ", "the 'config' as an array."); - ZEPHIR_CALL_METHOD(NULL, &_14$$9, "__construct", &_16, 31, &_15$$9); + ZEPHIR_CALL_METHOD(NULL, &_14$$9, "__construct", &_16, 29, &_15$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_14$$9, "phalcon/Config/Adapter/Grouped.zep", 110); ZEPHIR_MM_RESTORE(); @@ -218,14 +218,14 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113); ZEPHIR_INIT_NVAR(&configInstance); object_init_ex(&configInstance, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 24, &configArray); + ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_18$$10); object_init_ex(&_18$$10, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_18$$10, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_18$$10, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_10, 205, &configInstance); + ZEPHIR_CALL_METHOD(&_19$$10, &_18$$10, "load", &_10, 185, &configInstance); zephir_check_call_status(); ZEPHIR_CPY_WRT(&configInstance, &_19$$10); } @@ -258,9 +258,9 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) if (ZEPHIR_IS_IDENTICAL(&_21$$13, &defaultAdapter)) { ZEPHIR_INIT_NVAR(&_22$$14); object_init_ex(&_22$$14, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_22$$14, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_22$$14, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_10, 205, &configName); + ZEPHIR_CALL_METHOD(&_23$$14, &_22$$14, "load", &_10, 185, &configName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "merge", &_5, 0, &_23$$14); zephir_check_call_status(); @@ -283,7 +283,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) object_init_ex(&_27$$17, phalcon_config_exception_ce); ZEPHIR_INIT_NVAR(&_28$$17); ZEPHIR_CONCAT_SS(&_28$$17, "To use 'array' adapter you have to specify ", "the 'config' as an array."); - ZEPHIR_CALL_METHOD(NULL, &_27$$17, "__construct", &_16, 31, &_28$$17); + ZEPHIR_CALL_METHOD(NULL, &_27$$17, "__construct", &_16, 29, &_28$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_27$$17, "phalcon/Config/Adapter/Grouped.zep", 110); ZEPHIR_MM_RESTORE(); @@ -293,14 +293,14 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/Config/Adapter/Grouped.zep", 113); ZEPHIR_INIT_NVAR(&configInstance); object_init_ex(&configInstance, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 24, &configArray); + ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_17, 22, &configArray); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_29$$18); object_init_ex(&_29$$18, phalcon_config_configfactory_ce); - ZEPHIR_CALL_METHOD(NULL, &_29$$18, "__construct", &_8, 204); + ZEPHIR_CALL_METHOD(NULL, &_29$$18, "__construct", &_8, 184); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_30$$18, &_29$$18, "load", &_10, 205, &configInstance); + ZEPHIR_CALL_METHOD(&_30$$18, &_29$$18, "load", &_10, 185, &configInstance); zephir_check_call_status(); ZEPHIR_CPY_WRT(&configInstance, &_30$$18); } diff --git a/ext/phalcon/config/adapter/ini.zep.c b/ext/phalcon/config/adapter/ini.zep.c index b8db9a0488b..5f5cc900add 100644 --- a/ext/phalcon/config/adapter/ini.zep.c +++ b/ext/phalcon/config/adapter/ini.zep.c @@ -161,7 +161,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) zephir_basename(&_3$$3, &filePath); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SVS(&_4$$3, "Configuration file ", &_3$$3, " cannot be loaded"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 31, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 29, &_4$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$3, "phalcon/Config/Adapter/Ini.zep", 79); ZEPHIR_MM_RESTORE(); @@ -542,7 +542,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, parseIniString) ZEPHIR_INIT_VAR(&_3); zephir_substr(&_3, &path, zephir_get_intval(&_2), 0, ZEPHIR_SUBSTR_NO_LENGTH); zephir_get_strval(&path, &_3); - ZEPHIR_CALL_METHOD(&result, this_ptr, "parseinistring", NULL, 206, &path, &castValue); + ZEPHIR_CALL_METHOD(&result, this_ptr, "parseinistring", NULL, 186, &path, &castValue); zephir_check_call_status(); zephir_create_array(return_value, 1, 0); zephir_array_update_zval(return_value, &key, &result, PH_COPY); @@ -592,7 +592,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, phpParseIniFile) ZVAL_BOOL(&_0, (processSections ? 1 : 0)); ZVAL_LONG(&_1, scannerMode); - ZEPHIR_RETURN_CALL_FUNCTION("parse_ini_file", NULL, 207, &filename, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("parse_ini_file", NULL, 187, &filename, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/config/adapter/json.zep.c b/ext/phalcon/config/adapter/json.zep.c index cba1eaf2f5b..1927cf9aa98 100644 --- a/ext/phalcon/config/adapter/json.zep.c +++ b/ext/phalcon/config/adapter/json.zep.c @@ -98,7 +98,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Json, __construct) ZEPHIR_INIT_VAR(&_2); zephir_file_get_contents(&_2, &filePath); ZVAL_BOOL(&_3, 1); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "decode", NULL, 208, &_2, &_3); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "decode", NULL, 188, &_2, &_3); zephir_check_call_status(); ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", &_0, 0, &_1); zephir_check_call_status(); @@ -171,16 +171,16 @@ PHP_METHOD(Phalcon_Config_Adapter_Json, decode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Config/Adapter/Json.zep", 68); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/config/adapter/yaml.zep.c b/ext/phalcon/config/adapter/yaml.zep.c index 1c585ccb43d..40022a3370d 100644 --- a/ext/phalcon/config/adapter/yaml.zep.c +++ b/ext/phalcon/config/adapter/yaml.zep.c @@ -150,7 +150,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct) zephir_basename(&_5$$6, &filePath); ZEPHIR_INIT_VAR(&_6$$6); ZEPHIR_CONCAT_SVS(&_6$$6, "Configuration file ", &_5$$6, " can't be loaded"); - ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 31, &_6$$6); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 29, &_6$$6); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$6, "phalcon/Config/Adapter/Yaml.zep", 76); ZEPHIR_MM_RESTORE(); @@ -207,7 +207,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpYamlParseFile) ZEPHIR_MAKE_REF(ndocs); - ZEPHIR_RETURN_CALL_FUNCTION("yaml_parse_file", NULL, 211, filename, pos, ndocs, callbacks); + ZEPHIR_RETURN_CALL_FUNCTION("yaml_parse_file", NULL, 192, filename, pos, ndocs, callbacks); ZEPHIR_UNREF(ndocs); zephir_check_call_status(); RETURN_MM(); @@ -235,7 +235,7 @@ PHP_METHOD(Phalcon_Config_Adapter_Yaml, phpExtensionLoaded) zephir_get_strval(&name, name_param); - ZEPHIR_RETURN_CALL_FUNCTION("extension_loaded", NULL, 212, &name); + ZEPHIR_RETURN_CALL_FUNCTION("extension_loaded", NULL, 193, &name); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/config/config.zep.c b/ext/phalcon/config/config.zep.c index af63aa8784d..42287f1771c 100644 --- a/ext/phalcon/config/config.zep.c +++ b/ext/phalcon/config/config.zep.c @@ -36,7 +36,7 @@ * code. * *```php - * $config = new \Phalcon\Config( + * $config = new \Phalcon\Config\Config( * [ * "database" => [ * "adapter" => "Mysql", @@ -88,7 +88,7 @@ PHP_METHOD(Phalcon_Config_Config, getPathDelimiter) * Merges a configuration into the current one * *```php - * $appConfig = new \Phalcon\Config( + * $appConfig = new \Phalcon\Config\Config( * [ * "database" => [ * "host" => "localhost", @@ -133,7 +133,7 @@ PHP_METHOD(Phalcon_Config_Config, merge) ZEPHIR_CALL_METHOD(NULL, this_ptr, "clear", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(toMerge) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 22, &source, toMerge); + ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 20, &source, toMerge); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result); zephir_check_call_status(); @@ -146,7 +146,7 @@ PHP_METHOD(Phalcon_Config_Config, merge) if (_0) { ZEPHIR_CALL_METHOD(&_1$$4, toMerge, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 22, &source, &_1$$4); + ZEPHIR_CALL_METHOD(&result, this_ptr, "internalmerge", NULL, 20, &source, &_1$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &result); zephir_check_call_status(); @@ -238,7 +238,7 @@ PHP_METHOD(Phalcon_Config_Config, path) break; } ZEPHIR_MAKE_REF(&keys); - ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_2, 23, &keys); + ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_2, 21, &keys); ZEPHIR_UNREF(&keys); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3$$5, &config, "has", NULL, 0, &key); @@ -462,7 +462,7 @@ PHP_METHOD(Phalcon_Config_Config, internalMerge) } if (_5$$3) { zephir_array_fetch(&_8$$4, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 226); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "internalmerge", &_9, 22, &_8$$4, &value); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "internalmerge", &_9, 20, &_8$$4, &value); zephir_check_call_status(); zephir_array_update_zval(&source, &key, &_7$$4, PH_COPY | PH_SEPARATE); continue; @@ -494,7 +494,7 @@ PHP_METHOD(Phalcon_Config_Config, internalMerge) } if (_11$$5) { zephir_array_fetch(&_14$$6, &source, &key, PH_NOISY | PH_READONLY, "phalcon/Config/Config.zep", 226); - ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "internalmerge", &_9, 22, &_14$$6, &value); + ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "internalmerge", &_9, 20, &_14$$6, &value); zephir_check_call_status(); zephir_array_update_zval(&source, &key, &_13$$6, PH_COPY | PH_SEPARATE); continue; @@ -559,7 +559,7 @@ PHP_METHOD(Phalcon_Config_Config, setData) if (Z_TYPE_P(value) == IS_ARRAY) { ZEPHIR_INIT_VAR(&_2$$3); object_init_ex(&_2$$3, phalcon_config_config_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 24, value); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 22, value); zephir_check_call_status(); zephir_array_update_zval(&data, element, &_2$$3, PH_COPY | PH_SEPARATE); } else { diff --git a/ext/phalcon/config/configfactory.zep.c b/ext/phalcon/config/configfactory.zep.c index 73d4ce13a7e..fb8b0269657 100644 --- a/ext/phalcon/config/configfactory.zep.c +++ b/ext/phalcon/config/configfactory.zep.c @@ -138,10 +138,10 @@ PHP_METHOD(Phalcon_Config_ConfigFactory, load) ZEPHIR_OBS_VAR(&filePath); zephir_array_fetch_string(&filePath, &configArray, SL("filePath"), PH_NOISY, "phalcon/Config/ConfigFactory.zep", 61); ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_FUNCTION(&_2, "pathinfo", NULL, 116, &filePath, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "pathinfo", NULL, 85, &filePath, &_1); zephir_check_call_status(); if (1 == ZEPHIR_IS_EMPTY(&_2)) { - ZEPHIR_CALL_FUNCTION(&_3$$3, "lcfirst", NULL, 104, &adapter); + ZEPHIR_CALL_FUNCTION(&_3$$3, "lcfirst", NULL, 73, &adapter); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SV(&_4$$3, ".", &_3$$3); @@ -310,7 +310,7 @@ PHP_METHOD(Phalcon_Config_ConfigFactory, parseConfig) if (Z_TYPE_P(config) == IS_STRING) { ZEPHIR_CPY_WRT(&oldConfig, config); ZVAL_LONG(&_0$$3, 4); - ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 116, config, &_0$$3); + ZEPHIR_CALL_FUNCTION(&extension, "pathinfo", NULL, 85, config, &_0$$3); zephir_check_call_status(); if (1 == ZEPHIR_IS_EMPTY(&extension)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "You need to provide the extension in the file path", "phalcon/Config/ConfigFactory.zep", 161); @@ -335,7 +335,7 @@ PHP_METHOD(Phalcon_Config_ConfigFactory, parseConfig) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Config must be array or Phalcon\\Config\\Config object", "phalcon/Config/ConfigFactory.zep", 177); return; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkconfigarray", NULL, 213, config); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkconfigarray", NULL, 194, config); zephir_check_call_status(); RETVAL_ZVAL(config, 1, 0); RETURN_MM(); diff --git a/ext/phalcon/config/configinterface.zep.c b/ext/phalcon/config/configinterface.zep.c index 5fab4b3da6c..d3fb9fff8b2 100644 --- a/ext/phalcon/config/configinterface.zep.c +++ b/ext/phalcon/config/configinterface.zep.c @@ -23,7 +23,7 @@ /** * Phalcon\Config\ConfigInterface * - * Interface for Phalcon\Config class + * Interface for Phalcon\Config\Config class */ ZEPHIR_INIT_CLASS(Phalcon_Config_ConfigInterface) { diff --git a/ext/phalcon/container/container.zep.c b/ext/phalcon/container/container.zep.c deleted file mode 100644 index e8bd3a23a11..00000000000 --- a/ext/phalcon/container/container.zep.c +++ /dev/null @@ -1,130 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../ext_config.h" -#endif - -#include -#include "../../php_ext.h" -#include "../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * PSR-11 Wrapper for `Phalcon\Di` - */ -ZEPHIR_INIT_CLASS(Phalcon_Container_Container) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Container, Container, phalcon, container_container, phalcon_container_container_method_entry, 0); - - /** - * @var DiInterface - */ - zend_declare_property_null(phalcon_container_container_ce, SL("container"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_container_container_ce, 1, zephir_get_internal_ce(SL("psr\\container\\containerinterface"))); - return SUCCESS; -} - -/** - * Phalcon\Container constructor - */ -PHP_METHOD(Phalcon_Container_Container, __construct) -{ - zval *container, container_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&container_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &container); - - - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container); -} - -/** - * Return the service - */ -PHP_METHOD(Phalcon_Container_Container, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "getshared", NULL, 0, &name); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Whether a service exists or not in the container - */ -PHP_METHOD(Phalcon_Container_Container, has) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, &name); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/container/container.zep.h b/ext/phalcon/container/container.zep.h deleted file mode 100644 index 6d00f6d3958..00000000000 --- a/ext/phalcon/container/container.zep.h +++ /dev/null @@ -1,27 +0,0 @@ - -extern zend_class_entry *phalcon_container_container_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Container_Container); - -PHP_METHOD(Phalcon_Container_Container, __construct); -PHP_METHOD(Phalcon_Container_Container, get); -PHP_METHOD(Phalcon_Container_Container, has); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container_container___construct, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_container_container_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_container_container_has, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_container_container_method_entry) { - PHP_ME(Phalcon_Container_Container, __construct, arginfo_phalcon_container_container___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Container_Container, get, arginfo_phalcon_container_container_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Container_Container, has, arginfo_phalcon_container_container_has, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/datamapper/pdo/connection.zep.c b/ext/phalcon/datamapper/pdo/connection.zep.c index 336c8d7cb68..718f1d9495d 100644 --- a/ext/phalcon/datamapper/pdo/connection.zep.c +++ b/ext/phalcon/datamapper/pdo/connection.zep.c @@ -158,7 +158,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Connection, __construct) zephir_array_fetch_long(&_2$$3, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Pdo/Connection.zep", 71); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVS(&_3$$3, "Driver not supported [", &_2$$3, "]"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 40, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 191, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/DataMapper/Pdo/Connection.zep", 72); ZEPHIR_MM_RESTORE(); @@ -180,7 +180,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Connection, __construct) if (Z_TYPE_P(profiler) == IS_NULL) { ZEPHIR_INIT_NVAR(profiler); object_init_ex(profiler, phalcon_datamapper_pdo_profiler_profiler_ce); - ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 214); + ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 195); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "setprofiler", NULL, 0, profiler); diff --git a/ext/phalcon/datamapper/pdo/connection/abstractconnection.zep.c b/ext/phalcon/datamapper/pdo/connection/abstractconnection.zep.c index 73a2ebeebe6..53c0a5ed317 100644 --- a/ext/phalcon/datamapper/pdo/connection/abstractconnection.zep.c +++ b/ext/phalcon/datamapper/pdo/connection/abstractconnection.zep.c @@ -110,7 +110,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Connection_AbstractConnection, __call) ZEPHIR_CONCAT_SVSVS(&message, "Class '", &className, "' does not have a method '", name, "'"); ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, spl_ce_BadMethodCallException); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 103, &message); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 72, &message); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/DataMapper/Pdo/Connection/AbstractConnection.zep", 62); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/datamapper/pdo/connection/decorated.zep.c b/ext/phalcon/datamapper/pdo/connection/decorated.zep.c index 1bf8d322d93..c0830209639 100644 --- a/ext/phalcon/datamapper/pdo/connection/decorated.zep.c +++ b/ext/phalcon/datamapper/pdo/connection/decorated.zep.c @@ -88,7 +88,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Connection_Decorated, __construct) if (Z_TYPE_P(profiler) == IS_NULL) { ZEPHIR_INIT_NVAR(profiler); object_init_ex(profiler, phalcon_datamapper_pdo_profiler_profiler_ce); - ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 214); + ZEPHIR_CALL_METHOD(NULL, profiler, "__construct", NULL, 195); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "setprofiler", NULL, 0, profiler); diff --git a/ext/phalcon/datamapper/pdo/connectionlocator.zep.c b/ext/phalcon/datamapper/pdo/connectionlocator.zep.c index 820a048fb16..21326a39656 100644 --- a/ext/phalcon/datamapper/pdo/connectionlocator.zep.c +++ b/ext/phalcon/datamapper/pdo/connectionlocator.zep.c @@ -472,7 +472,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_ConnectionLocator, getConnection) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); if (ZEPHIR_IS_IDENTICAL(&_1, &requested)) { - ZEPHIR_CALL_FUNCTION(&requested, "array_rand", NULL, 215, &collection); + ZEPHIR_CALL_FUNCTION(&requested, "array_rand", NULL, 196, &collection); zephir_check_call_status(); } if (!(zephir_array_isset(&collection, &requested))) { @@ -480,7 +480,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_ConnectionLocator, getConnection) object_init_ex(&_2$$5, phalcon_datamapper_pdo_exception_connectionnotfound_ce); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVSV(&_3$$5, "Connection not found: ", &type, ":", &requested); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 31, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 29, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$5, "phalcon/DataMapper/Pdo/ConnectionLocator.zep", 210); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.c b/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.c index c63aae1ce9f..572d8e9559a 100644 --- a/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.c +++ b/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.c @@ -12,10 +12,10 @@ #include #include "kernel/main.h" -#include "kernel/object.h" #include "kernel/fcall.h" -#include "kernel/memory.h" #include "kernel/operators.h" +#include "kernel/memory.h" +#include "kernel/object.h" #include "kernel/concat.h" #include "kernel/array.h" @@ -34,13 +34,13 @@ * @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md */ /** - * A naive memory-based logger. + * A memory-based logger. * * @property array $messages */ ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\DataMapper\\Pdo\\Profiler, MemoryLogger, phalcon, datamapper_pdo_profiler_memorylogger, zephir_get_internal_ce(SL("psr\\log\\abstractlogger")), phalcon_datamapper_pdo_profiler_memorylogger_method_entry, 0); + ZEPHIR_REGISTER_CLASS(Phalcon\\DataMapper\\Pdo\\Profiler, MemoryLogger, phalcon, datamapper_pdo_profiler_memorylogger, phalcon_datamapper_pdo_profiler_memorylogger_method_entry, 0); /** * @var array @@ -48,41 +48,30 @@ ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger) zend_declare_property_null(phalcon_datamapper_pdo_profiler_memorylogger_ce, SL("messages"), ZEND_ACC_PROTECTED); phalcon_datamapper_pdo_profiler_memorylogger_ce->create_object = zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_MemoryLogger; + zend_class_implements(phalcon_datamapper_pdo_profiler_memorylogger_ce, 1, phalcon_logger_loggerinterface_ce); return SUCCESS; } -/** - * Returns the logged messages. - * - * @return array - */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "messages"); -} - /** * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -90,7 +79,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -99,7 +89,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "emergency", NULL, 0, message, &context); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -108,20 +99,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -129,7 +122,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -138,7 +132,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "alert", NULL, 0, message, &context); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -147,20 +142,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -168,7 +165,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -177,7 +175,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "critical", NULL, 0, message, &context); + ZVAL_LONG(&_0, 7); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -186,20 +185,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -207,7 +208,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -216,7 +218,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "error", NULL, 0, message, &context); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -225,20 +228,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -246,7 +251,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -255,29 +261,123 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "warning", NULL, 0, message, &context); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } +/** + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + */ +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *name_param = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + object_init_ex(return_value, phalcon_logger_adapter_noop_ce); + if (zephir_has_constructor(return_value)) { + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0); + zephir_check_call_status(); + } + + RETURN_MM(); +} + +/** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters) +{ + zval *this_ptr = getThis(); + + + + array_init(return_value); + return; +} + +/** + * Returns the log level + */ +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel) +{ + zval *this_ptr = getThis(); + + + + RETURN_LONG(8); +} + +/** + * Returns the logged messages. + * + * @return array + */ +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "messages"); +} + +/** + * Returns the name of the logger + */ +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName) +{ + zval *this_ptr = getThis(); + + + + RETURN_STRING("memory logger"); +} + /** * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -285,7 +385,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -294,7 +395,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "notice", NULL, 0, message, &context); + ZVAL_LONG(&_0, 6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -303,20 +405,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -324,7 +428,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -333,7 +438,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "info", NULL, 0, message, &context); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -342,20 +448,22 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info) * @param string message * @param mixed[] context */ -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -363,7 +471,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -372,7 +481,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug) } - ZEPHIR_CALL_PARENT(NULL, phalcon_datamapper_pdo_profiler_memorylogger_ce, getThis(), "debug", NULL, 0, message, &context); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -391,24 +501,25 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context, replace; - zval *level, level_sub, *message, message_sub, *context_param = NULL, key, value, *_0, _1, _6, _4$$3, _5$$4; + zval message; + zval *level, level_sub, *message_param = NULL, *context_param = NULL, key, value, *_0, _1, _6, _4$$3, _5$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&key); ZVAL_UNDEF(&value); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_6); ZVAL_UNDEF(&_4$$3); ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&context); ZVAL_UNDEF(&replace); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_ZVAL(level) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -416,7 +527,8 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level, &message, &context_param); + zephir_fetch_params(1, 2, 1, &level, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -427,7 +539,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) ZEPHIR_INIT_VAR(&replace); array_init(&replace); - zephir_is_iterable(&context, 0, "phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep", 130); + zephir_is_iterable(&context, 0, "phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep", 172); if (Z_TYPE_P(&context) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&context), _2, _3, _0) { @@ -465,7 +577,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 5, message, &replace); + ZEPHIR_CALL_FUNCTION(&_6, "strtr", NULL, 5, &message, &replace); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("messages"), &_6); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.h b/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.h index cf0a6be7d3d..0bff7c4be8f 100644 --- a/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.h +++ b/ext/phalcon/datamapper/pdo/profiler/memorylogger.zep.h @@ -3,23 +3,25 @@ extern zend_class_entry *phalcon_datamapper_pdo_profiler_memorylogger_ce; ZEPHIR_INIT_CLASS(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger); -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages); -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency); PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert); PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency); PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error); -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning); -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName); PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info); -PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice); +PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning); PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log); zend_object *zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_MemoryLogger(zend_class_entry *class_type); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, 0, 1, IS_VOID, 0) -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, 0, 0, 1) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -27,8 +29,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emer #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -36,8 +39,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_aler #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -45,8 +49,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_crit #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -54,8 +59,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_erro #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -63,8 +69,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warn #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getloglevel, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getname, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -72,8 +95,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_noti #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -81,8 +105,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, 0, 0, 1) - ZEND_ARG_INFO(0, message) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -90,9 +115,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debu #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, level) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -104,15 +130,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_memorylogger_zeph ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_datamapper_pdo_profiler_memorylogger_method_entry) { - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, alert, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_alert, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, critical, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_critical, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, emergency, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_emergency, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, error, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_error, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapter, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getAdapters, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getLogLevel, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getMessages, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, getName, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, info, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_info, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, debug, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_debug, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, notice, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_notice, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, warning, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_warning, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_DataMapper_Pdo_Profiler_MemoryLogger, log, arginfo_phalcon_datamapper_pdo_profiler_memorylogger_log, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/datamapper/pdo/profiler/profiler.zep.c b/ext/phalcon/datamapper/pdo/profiler/profiler.zep.c index 566d9e052af..42c42c4a092 100644 --- a/ext/phalcon/datamapper/pdo/profiler/profiler.zep.c +++ b/ext/phalcon/datamapper/pdo/profiler/profiler.zep.c @@ -84,17 +84,18 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *logger = NULL, logger_sub, __$null, _0; + zval *logger = NULL, logger_sub, __$null, _0, _1; zval *this_ptr = getThis(); ZVAL_UNDEF(&logger_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(logger, zephir_get_internal_ce(SL("psr\\log\\loggerinterface"))) + Z_PARAM_OBJECT_OF_CLASS_OR_NULL(logger, phalcon_logger_loggerinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif @@ -122,9 +123,9 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, __construct) ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "{method} ({duration}s): {statement} {backtrace}"); zephir_update_property_zval(this_ptr, ZEND_STRL("logFormat"), &_0); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "debug"); - zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); + ZEPHIR_INIT_ZVAL_NREF(_1); + ZVAL_LONG(&_1, 7); + zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_1); zephir_update_property_zval(this_ptr, ZEND_STRL("logger"), logger); ZEPHIR_MM_RESTORE(); } @@ -193,11 +194,11 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, finish) if (UNEXPECTED(zephir_is_true(&_0))) { ZEPHIR_INIT_VAR(&ex); object_init_ex(&ex, phalcon_datamapper_pdo_exception_exception_ce); - ZEPHIR_CALL_METHOD(NULL, &ex, "__construct", NULL, 31); + ZEPHIR_CALL_METHOD(NULL, &ex, "__construct", NULL, 29); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&finish, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&finish, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, &ex, "gettraceasstring", NULL, 217); + ZEPHIR_CALL_METHOD(&_1$$3, &ex, "gettraceasstring", NULL, 198); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "backtrace"); @@ -220,7 +221,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, finish) ZEPHIR_INIT_NVAR(&_5$$3); ZVAL_STRING(&_5$$3, ""); } else { - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "encode", NULL, 218, &values); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "encode", NULL, 199, &values); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_9$$3); @@ -431,7 +432,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, start) ZEPHIR_INIT_VAR(&_1$$3); zephir_create_array(&_1$$3, 2, 0); zephir_array_update_string(&_1$$3, SL("method"), &method, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_2$$3, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&_2$$3, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("start"), &_2$$3, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("context"), &_1$$3); @@ -486,16 +487,16 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/DataMapper/Pdo/Profiler/Profiler.zep", 215); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/datamapper/pdo/profiler/profiler.zep.h b/ext/phalcon/datamapper/pdo/profiler/profiler.zep.h index f24a39abf80..b5a08fe8c99 100644 --- a/ext/phalcon/datamapper/pdo/profiler/profiler.zep.h +++ b/ext/phalcon/datamapper/pdo/profiler/profiler.zep.h @@ -17,7 +17,7 @@ PHP_METHOD(Phalcon_DataMapper_Pdo_Profiler_Profiler, encode); zend_object *zephir_init_properties_Phalcon_DataMapper_Pdo_Profiler_Profiler(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler___construct, 0, 0, 0) - ZEND_ARG_OBJ_INFO(0, logger, Psr\\Log\\LoggerInterface, 1) + ZEND_ARG_OBJ_INFO(0, logger, Phalcon\\Logger\\LoggerInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_finish, 0, 0, IS_VOID, 0) @@ -33,7 +33,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogformat, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogger, 0, 0, Psr\\Log\\LoggerInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getlogger, 0, 0, Phalcon\\Logger\\LoggerInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profiler_getloglevel, 0, 0, IS_STRING, 0) diff --git a/ext/phalcon/datamapper/pdo/profiler/profilerinterface.zep.h b/ext/phalcon/datamapper/pdo/profiler/profilerinterface.zep.h index 8ba333b23b8..2003194348b 100644 --- a/ext/phalcon/datamapper/pdo/profiler/profilerinterface.zep.h +++ b/ext/phalcon/datamapper/pdo/profiler/profilerinterface.zep.h @@ -13,7 +13,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_ #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogger, 0, 0, Psr\\Log\\LoggerInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogger, 0, 0, Phalcon\\Logger\\LoggerInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_datamapper_pdo_profiler_profilerinterface_getlogformat, 0, 0, IS_STRING, 0) diff --git a/ext/phalcon/datamapper/query/abstractconditions.zep.c b/ext/phalcon/datamapper/query/abstractconditions.zep.c index a36917226e2..c2419460019 100644 --- a/ext/phalcon/datamapper/query/abstractconditions.zep.c +++ b/ext/phalcon/datamapper/query/abstractconditions.zep.c @@ -937,7 +937,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_AbstractConditions, appendCondition) } zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_6, &_5, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 331); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_6); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_6); zephir_check_call_status(); zephir_read_property(&_7, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_8, &_7, &store, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/AbstractConditions.zep", 333); diff --git a/ext/phalcon/datamapper/query/insert.zep.c b/ext/phalcon/datamapper/query/insert.zep.c index 31193490fb6..0afa885b6f4 100644 --- a/ext/phalcon/datamapper/query/insert.zep.c +++ b/ext/phalcon/datamapper/query/insert.zep.c @@ -333,7 +333,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Insert, getStatement) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Insert.zep", 113); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 219); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 200); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildreturning", NULL, 0); zephir_check_call_status(); diff --git a/ext/phalcon/datamapper/query/queryfactory.zep.c b/ext/phalcon/datamapper/query/queryfactory.zep.c index 645e038e1e0..090260c18ec 100644 --- a/ext/phalcon/datamapper/query/queryfactory.zep.c +++ b/ext/phalcon/datamapper/query/queryfactory.zep.c @@ -142,7 +142,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newDelete) object_init_ex(return_value, phalcon_datamapper_query_delete_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 220, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 201, connection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -178,7 +178,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newInsert) object_init_ex(return_value, phalcon_datamapper_query_insert_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 221, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 202, connection, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -265,7 +265,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_QueryFactory, newUpdate) object_init_ex(return_value, phalcon_datamapper_query_update_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "newbind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 222, connection, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 203, connection, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/datamapper/query/select.zep.c b/ext/phalcon/datamapper/query/select.zep.c index b69b32ccfbd..03e9fe28ec3 100644 --- a/ext/phalcon/datamapper/query/select.zep.c +++ b/ext/phalcon/datamapper/query/select.zep.c @@ -157,7 +157,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, __call) object_init_ex(&_5, spl_ce_BadMethodCallException); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVS(&_6, "Unknown method: [", &method, "]"); - ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 103, &_6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 72, &_6); zephir_check_call_status(); zephir_throw_exception_debug(&_5, "phalcon/DataMapper/Query/Select.zep", 97); ZEPHIR_MM_RESTORE(); @@ -372,12 +372,12 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, appendJoin) } zephir_read_property(&_3, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_4, &_3, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 172); - ZEPHIR_CALL_FUNCTION(&end, "array_key_last", NULL, 49, &_4); + ZEPHIR_CALL_FUNCTION(&end, "array_key_last", NULL, 36, &_4); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_6, &_5, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 173); zephir_array_fetch(&_7, &_6, &end, PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 173); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_7); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_7); zephir_check_call_status(); zephir_read_property(&_8, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_9, &_8, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 175); @@ -813,7 +813,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, join) } zephir_read_property(&_19, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_20, &_19, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Select.zep", 330); - ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 49, &_20); + ZEPHIR_CALL_FUNCTION(&key, "array_key_last", NULL, 36, &_20); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_21); ZEPHIR_CONCAT_VSVSV(&_21, &join, " ", &table, " ", &condition); @@ -934,7 +934,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, subSelect) object_init_ex(return_value, phalcon_datamapper_query_select_ce); zephir_read_property(&_0, this_ptr, ZEND_STRL("connection"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("bind"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 223, &_0, &_1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 204, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -1057,9 +1057,9 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, getCurrentStatement) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, this_ptr, "buildlimitearly", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 224); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 205); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildfrom", NULL, 225); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "buildfrom", NULL, 206); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZVAL_STRING(&_6, "WHERE"); @@ -1184,7 +1184,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, buildFrom) ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _4); ZEPHIR_MAKE_REF(&table); - ZEPHIR_CALL_FUNCTION(&_6$$4, "array_shift", &_7, 23, &table); + ZEPHIR_CALL_FUNCTION(&_6$$4, "array_shift", &_7, 21, &table); ZEPHIR_UNREF(&table); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$4, this_ptr, "indent", &_9, 0, &table); @@ -1205,7 +1205,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Select, buildFrom) ZEPHIR_CALL_METHOD(&table, &_3, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&table); - ZEPHIR_CALL_FUNCTION(&_11$$5, "array_shift", &_7, 23, &table); + ZEPHIR_CALL_FUNCTION(&_11$$5, "array_shift", &_7, 21, &table); ZEPHIR_UNREF(&table); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "indent", &_9, 0, &table); diff --git a/ext/phalcon/datamapper/query/update.zep.c b/ext/phalcon/datamapper/query/update.zep.c index 3319c578f5f..d67e164c09e 100644 --- a/ext/phalcon/datamapper/query/update.zep.c +++ b/ext/phalcon/datamapper/query/update.zep.c @@ -293,7 +293,7 @@ PHP_METHOD(Phalcon_DataMapper_Query_Update, getStatement) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("store"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_string(&_2, &_1, SL("FROM"), PH_NOISY | PH_READONLY, "phalcon/DataMapper/Query/Update.zep", 101); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 226); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "buildcolumns", NULL, 207); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, "WHERE"); diff --git a/ext/phalcon/db/adapter/abstractadapter.zep.c b/ext/phalcon/db/adapter/abstractadapter.zep.c index fb379b49241..f663601a88e 100644 --- a/ext/phalcon/db/adapter/abstractadapter.zep.c +++ b/ext/phalcon/db/adapter/abstractadapter.zep.c @@ -24,9 +24,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. @@ -837,7 +837,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeIndexes) ZVAL_COPY(&indexColumns, _8); ZEPHIR_INIT_NVAR(&_12$$9); object_init_ex(&_12$$9, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_13, 32, &name, &indexColumns); + ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_13, 30, &name, &indexColumns); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_12$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -856,7 +856,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeIndexes) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$10); object_init_ex(&_14$$10, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_13, 32, &name, &indexColumns); + ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_13, 30, &name, &indexColumns); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_14$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -1095,7 +1095,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeReferences) ZEPHIR_OBS_NVAR(&_26$$9); zephir_array_fetch_string(&_26$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413); zephir_array_update_string(&_25$$9, SL("referencedColumns"), &_26$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_24$$9, "__construct", &_27, 33, &name, &_25$$9); + ZEPHIR_CALL_METHOD(NULL, &_24$$9, "__construct", &_27, 31, &name, &_25$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_24$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1128,7 +1128,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, describeReferences) ZEPHIR_OBS_NVAR(&_30$$10); zephir_array_fetch_string(&_30$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/AbstractAdapter.zep", 413); zephir_array_update_string(&_29$$10, SL("referencedColumns"), &_30$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$10, "__construct", &_27, 33, &name, &_29$$10); + ZEPHIR_CALL_METHOD(NULL, &_28$$10, "__construct", &_27, 31, &name, &_29$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -1974,7 +1974,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultIdValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "null"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -2015,7 +2015,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, getDefaultValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "DEFAULT"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -2213,7 +2213,7 @@ PHP_METHOD(Phalcon_Db_Adapter_AbstractAdapter, insert) object_init_ex(&_0$$3, phalcon_db_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_SVS(&_1$$3, "Unable to insert into ", &table, " without data"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Db/Adapter/AbstractAdapter.zep", 810); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/db/adapter/adapterinterface.zep.c b/ext/phalcon/db/adapter/adapterinterface.zep.c index 44f9da0ab5c..d19ed3aec15 100644 --- a/ext/phalcon/db/adapter/adapterinterface.zep.c +++ b/ext/phalcon/db/adapter/adapterinterface.zep.c @@ -13,9 +13,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c index 5822ae985e3..7d17855504a 100644 --- a/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c +++ b/ext/phalcon/db/adapter/pdo/abstractpdo.zep.c @@ -26,9 +26,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -637,7 +637,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, convertBoundParams) ZEPHIR_INIT_NVAR(&placeMatch); ZEPHIR_INIT_VAR(&_9$$3); ZVAL_STRING(&_9$$3, "?"); - ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 50, &bindPattern, &_9$$3, &sql); + ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 37, &bindPattern, &_9$$3, &sql); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&boundSql, &sql); @@ -929,7 +929,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared) do { if (ZEPHIR_IS_LONG(&type, 1)) { ZVAL_LONG(&_6$$12, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_6$$12); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 38, &value, &_6$$12); zephir_check_call_status(); break; } @@ -1110,7 +1110,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, executePrepared) do { if (ZEPHIR_IS_LONG(&type, 1)) { ZVAL_LONG(&_26$$43, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 51, &value, &_26$$43); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_7, 38, &value, &_26$$43); zephir_check_call_status(); break; } @@ -1582,7 +1582,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, query) zephir_check_call_status(); } object_init_ex(return_value, phalcon_db_result_pdoresult_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 52, this_ptr, &statement, &sqlStatement, &bindParams, &bindTypes); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 39, this_ptr, &statement, &sqlStatement, &bindParams, &bindTypes); zephir_check_call_status(); RETURN_MM(); } @@ -1825,7 +1825,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_AbstractPdo, prepareRealSql) ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); ZVAL_LONG(&_16$$3, 1); - ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &keys, &values, &statement, &_16$$3); + ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 37, &keys, &values, &statement, &_16$$3); zephir_check_call_status(); } zephir_update_property_zval(this_ptr, ZEND_STRL("realSqlStatement"), &result); diff --git a/ext/phalcon/db/adapter/pdo/mysql.zep.c b/ext/phalcon/db/adapter/pdo/mysql.zep.c index dd0a865aa6c..5b561425ad4 100644 --- a/ext/phalcon/db/adapter/pdo/mysql.zep.c +++ b/ext/phalcon/db/adapter/pdo/mysql.zep.c @@ -24,9 +24,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -666,7 +666,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 495); ZEPHIR_INIT_NVAR(&_63$$3); object_init_ex(&_63$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_63$$3, "__construct", &_64, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_63$$3, "__construct", &_64, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_63$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 496); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -968,7 +968,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 495); ZEPHIR_INIT_NVAR(&_124$$49); object_init_ex(&_124$$49, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_124$$49, "__construct", &_64, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_124$$49, "__construct", &_64, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_124$$49, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Mysql.zep", 496); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -1195,7 +1195,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) object_init_ex(&_26$$19, phalcon_db_index_ce); zephir_array_fetch_string(&_27$$19, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551); zephir_array_fetch_string(&_28$$19, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 553); - ZEPHIR_CALL_METHOD(NULL, &_26$$19, "__construct", &_29, 32, &name, &_27$$19, &_28$$19); + ZEPHIR_CALL_METHOD(NULL, &_26$$19, "__construct", &_29, 30, &name, &_27$$19, &_28$$19); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_26$$19, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1216,7 +1216,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) object_init_ex(&_30$$20, phalcon_db_index_ce); zephir_array_fetch_string(&_31$$20, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 551); zephir_array_fetch_string(&_32$$20, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 553); - ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", &_29, 32, &name, &_31$$20, &_32$$20); + ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", &_29, 30, &name, &_31$$20, &_32$$20); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_30$$20, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -1491,7 +1491,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) ZEPHIR_OBS_NVAR(&_30$$9); zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 620); zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9); + ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 31, &name, &_29$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1530,7 +1530,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) ZEPHIR_OBS_NVAR(&_34$$10); zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Mysql.zep", 620); zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10); + ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 31, &name, &_33$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); diff --git a/ext/phalcon/db/adapter/pdo/postgresql.zep.c b/ext/phalcon/db/adapter/pdo/postgresql.zep.c index 07f90f28f57..9e0c60feaa4 100644 --- a/ext/phalcon/db/adapter/pdo/postgresql.zep.c +++ b/ext/phalcon/db/adapter/pdo/postgresql.zep.c @@ -24,9 +24,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -768,13 +768,13 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) ZVAL_STRING(&_52$$38, "/^'|'?::[[:alnum:][:space:]]+$/"); ZEPHIR_INIT_NVAR(&_53$$38); ZVAL_STRING(&_53$$38, ""); - ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 50, &_52$$38, &_53$$38, &_51$$38); + ZEPHIR_CALL_FUNCTION(&_54$$38, "preg_replace", &_55, 37, &_52$$38, &_53$$38, &_51$$38); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_54$$38, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_56$$38, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509); ZEPHIR_INIT_NVAR(&_52$$38); ZVAL_STRING(&_52$$38, "null"); - ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 47, &_56$$38, &_52$$38); + ZEPHIR_CALL_FUNCTION(&_57$$38, "strcasecmp", &_58, 35, &_56$$38, &_52$$38); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_57$$38, 0)) { zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE); @@ -788,7 +788,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524); ZEPHIR_INIT_NVAR(&_61$$3); object_init_ex(&_61$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_61$$3, "__construct", &_62, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_61$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -1066,13 +1066,13 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) ZVAL_STRING(&_111$$76, "/^'|'?::[[:alnum:][:space:]]+$/"); ZEPHIR_INIT_NVAR(&_112$$76); ZVAL_STRING(&_112$$76, ""); - ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 50, &_111$$76, &_112$$76, &_110$$76); + ZEPHIR_CALL_FUNCTION(&_113$$76, "preg_replace", &_55, 37, &_111$$76, &_112$$76, &_110$$76); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_113$$76, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_114$$76, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 509); ZEPHIR_INIT_NVAR(&_111$$76); ZVAL_STRING(&_111$$76, "null"); - ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 47, &_114$$76, &_111$$76); + ZEPHIR_CALL_FUNCTION(&_115$$76, "strcasecmp", &_58, 35, &_114$$76, &_111$$76); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_115$$76, 0)) { zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE); @@ -1087,7 +1087,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 524); ZEPHIR_INIT_NVAR(&_118$$41); object_init_ex(&_118$$41, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 227, &columnName, &definition); + ZEPHIR_CALL_METHOD(NULL, &_118$$41, "__construct", &_62, 208, &columnName, &definition); zephir_check_call_status(); zephir_array_append(&columns, &_118$$41, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 525); ZEPHIR_CPY_WRT(&oldColumn, &columnName); @@ -1362,7 +1362,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences) ZEPHIR_OBS_NVAR(&_30$$9); zephir_array_fetch_string(&_30$$9, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593); zephir_array_update_string(&_29$$9, SL("onDelete"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 33, &name, &_29$$9); + ZEPHIR_CALL_METHOD(NULL, &_28$$9, "__construct", &_31, 31, &name, &_29$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_28$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1401,7 +1401,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeReferences) ZEPHIR_OBS_NVAR(&_34$$10); zephir_array_fetch_string(&_34$$10, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Postgresql.zep", 593); zephir_array_update_string(&_33$$10, SL("onDelete"), &_34$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 33, &name, &_33$$10); + ZEPHIR_CALL_METHOD(NULL, &_32$$10, "__construct", &_31, 31, &name, &_33$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -1448,7 +1448,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "DEFAULT"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/db/adapter/pdo/sqlite.zep.c b/ext/phalcon/db/adapter/pdo/sqlite.zep.c index e4e2deb456f..e258997a8ab 100644 --- a/ext/phalcon/db/adapter/pdo/sqlite.zep.c +++ b/ext/phalcon/db/adapter/pdo/sqlite.zep.c @@ -24,9 +24,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -160,11 +160,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect) */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) { - zend_bool _5$$3, _34$$3, _43$$28, _71$$28; + zend_bool _5$$3, _31$$3, _43$$28, _69$$28; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_33 = NULL, *_40 = NULL, *_41 = NULL; + zephir_fcall_cache_entry *_35 = NULL, *_40 = NULL, *_41 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _28$$3, _29$$3, _30$$3, _31$$3, _32$$3, _35$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$5, _11$$7, _12$$7, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$12, _20$$13, _21$$14, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27, _42$$28, _66$$28, _67$$28, _68$$28, _69$$28, _70$$28, _72$$28, _44$$29, _45$$29, _46$$30, _47$$30, _48$$30, _49$$32, _50$$32, _51$$33, _52$$34, _53$$35, _54$$36, _55$$36, _56$$37, _57$$37, _58$$38, _59$$39, _60$$40, _61$$41, _62$$42, _63$$43, _64$$45, _65$$46, _73$$52, _74$$52, _75$$52, _76$$52; + zval *table_param = NULL, *schema_param = NULL, __$true, __$false, columns, columnType, fields, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, *_3, _4, _28$$3, _29$$3, _30$$3, _32$$3, _33$$3, _34$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$5, _11$$7, _12$$7, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$12, _20$$13, _21$$14, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27, _42$$28, _66$$28, _67$$28, _68$$28, _70$$28, _71$$28, _72$$28, _44$$29, _45$$29, _46$$30, _47$$30, _48$$30, _49$$32, _50$$32, _51$$33, _52$$34, _53$$35, _54$$36, _55$$36, _56$$37, _57$$37, _58$$38, _59$$39, _60$$40, _61$$41, _62$$42, _63$$43, _64$$45, _65$$46, _73$$52, _74$$52, _75$$52, _76$$52; zval table, schema; zval *this_ptr = getThis(); @@ -190,9 +190,9 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_UNDEF(&_28$$3); ZVAL_UNDEF(&_29$$3); ZVAL_UNDEF(&_30$$3); - ZVAL_UNDEF(&_31$$3); ZVAL_UNDEF(&_32$$3); - ZVAL_UNDEF(&_35$$3); + ZVAL_UNDEF(&_33$$3); + ZVAL_UNDEF(&_34$$3); ZVAL_UNDEF(&_6$$4); ZVAL_UNDEF(&_7$$4); ZVAL_UNDEF(&_8$$5); @@ -223,8 +223,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_UNDEF(&_66$$28); ZVAL_UNDEF(&_67$$28); ZVAL_UNDEF(&_68$$28); - ZVAL_UNDEF(&_69$$28); ZVAL_UNDEF(&_70$$28); + ZVAL_UNDEF(&_71$$28); ZVAL_UNDEF(&_72$$28); ZVAL_UNDEF(&_44$$29); ZVAL_UNDEF(&_45$$29); @@ -300,7 +300,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_2, 3); ZEPHIR_CALL_METHOD(&fields, this_ptr, "fetchall", NULL, 0, &_1, &_2); zephir_check_call_status(); - zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 312); + zephir_is_iterable(&fields, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 311); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _3) { @@ -310,12 +310,12 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_create_array(&definition, 1, 0); add_assoc_long_ex(&definition, SL("bindType"), 2); ZEPHIR_OBS_NVAR(&columnType); - zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128); - _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 127); + _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); if (!(_5$$3)) { - _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); } - if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) { + if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 142)) { ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_LONG(&_6$$4, 14); zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE); @@ -331,11 +331,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_9$$5); ZVAL_LONG(&_9$$5, 1); zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_10$$5, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158); + zephir_array_fetch_long(&_10$$5, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 157); if (zephir_is_true(&_10$$5)) { zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) { + } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 160)) { ZEPHIR_INIT_NVAR(&_11$$7); ZVAL_LONG(&_11$$7, 8); zephir_array_update_string(&definition, SL("type"), &_11$$7, PH_COPY | PH_SEPARATE); @@ -344,19 +344,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_array_update_string(&definition, SL("bindType"), &_12$$7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&columnType); ZVAL_STRING(&columnType, "boolean"); - } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) { + } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 171)) { ZEPHIR_INIT_NVAR(&_13$$8); ZVAL_LONG(&_13$$8, 5); zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) { + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 180)) { ZEPHIR_INIT_NVAR(&_14$$9); ZVAL_LONG(&_14$$9, 4); zephir_array_update_string(&definition, SL("type"), &_14$$9, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) { + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 185)) { ZEPHIR_INIT_NVAR(&_15$$10); ZVAL_LONG(&_15$$10, 1); zephir_array_update_string(&definition, SL("type"), &_15$$10, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) { + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 194)) { ZEPHIR_INIT_NVAR(&_16$$11); ZVAL_LONG(&_16$$11, 3); zephir_array_update_string(&definition, SL("type"), &_16$$11, PH_COPY | PH_SEPARATE); @@ -364,7 +364,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_17$$11); ZVAL_LONG(&_17$$11, 32); zephir_array_update_string(&definition, SL("bindType"), &_17$$11, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) { + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 201)) { ZEPHIR_INIT_NVAR(&_18$$12); ZVAL_LONG(&_18$$12, 7); zephir_array_update_string(&definition, SL("type"), &_18$$12, PH_COPY | PH_SEPARATE); @@ -372,19 +372,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_19$$12); ZVAL_LONG(&_19$$12, 3); zephir_array_update_string(&definition, SL("bindType"), &_19$$12, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) { + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 212)) { ZEPHIR_INIT_NVAR(&_20$$13); ZVAL_LONG(&_20$$13, 17); zephir_array_update_string(&definition, SL("type"), &_20$$13, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) { + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 221)) { ZEPHIR_INIT_NVAR(&_21$$14); ZVAL_LONG(&_21$$14, 2); zephir_array_update_string(&definition, SL("type"), &_21$$14, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) { + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 226)) { ZEPHIR_INIT_NVAR(&_22$$15); ZVAL_LONG(&_22$$15, 5); zephir_array_update_string(&definition, SL("type"), &_22$$15, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) { + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 231)) { ZEPHIR_INIT_NVAR(&_23$$16); ZVAL_LONG(&_23$$16, 6); zephir_array_update_string(&definition, SL("type"), &_23$$16, PH_COPY | PH_SEPARATE); @@ -393,7 +393,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_24$$17, 2); zephir_array_update_string(&definition, SL("type"), &_24$$17, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) { + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 248)) { ZEPHIR_INIT_NVAR(&matches); ZVAL_NULL(&matches); ZEPHIR_INIT_NVAR(&_25$$18); @@ -413,7 +413,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } } } - if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) { + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 264)) { zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&oldColumn) == IS_NULL) { @@ -421,40 +421,41 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281); + zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 280); if (zephir_is_true(&_28$$3)) { zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288); + zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 287); if (ZEPHIR_IS_LONG(&_29$$3, 0)) { zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - ZEPHIR_INIT_NVAR(&_31$$3); - ZVAL_STRING(&_31$$3, "null"); - ZEPHIR_CALL_FUNCTION(&_32$$3, "strcasecmp", &_33, 47, &_30$$3, &_31$$3); - zephir_check_call_status(); - _34$$3 = !ZEPHIR_IS_LONG(&_32$$3, 0); - if (_34$$3) { - zephir_array_fetch_long(&_35$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - _34$$3 = !ZEPHIR_IS_STRING(&_35$$3, ""); + ZEPHIR_OBS_NVAR(&_30$$3); + zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + _31$$3 = !(ZEPHIR_IS_EMPTY(&_30$$3)); + if (_31$$3) { + zephir_array_fetch_long(&_32$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + ZEPHIR_INIT_NVAR(&_33$$3); + ZVAL_STRING(&_33$$3, "null"); + ZEPHIR_CALL_FUNCTION(&_34$$3, "strcasecmp", &_35, 35, &_32$$3, &_33$$3); + zephir_check_call_status(); + _31$$3 = !ZEPHIR_IS_LONG_IDENTICAL(&_34$$3, 0); } - if (_34$$3) { - zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301); + if (_31$$3) { + zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 300); ZEPHIR_INIT_NVAR(&_37$$27); ZVAL_STRING(&_37$$27, "/^'|'$/"); ZEPHIR_INIT_NVAR(&_38$$27); ZVAL_STRING(&_38$$27, ""); - ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 50, &_37$$27, &_38$$27, &_36$$27); + ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 37, &_37$$27, &_38$$27, &_36$$27); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_39$$27, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); - ZEPHIR_INIT_NVAR(&_31$$3); - object_init_ex(&_31$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_31$$3, "__construct", &_41, 227, &columnName, &definition); + zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 306); + ZEPHIR_INIT_NVAR(&_33$$3); + object_init_ex(&_33$$3, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_33$$3, "__construct", &_41, 208, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, &_31$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308); + zephir_array_append(&columns, &_33$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); ZEPHIR_CPY_WRT(&oldColumn, &columnName); } ZEND_HASH_FOREACH_END(); } else { @@ -473,12 +474,12 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) add_assoc_long_ex(&_42$$28, SL("bindType"), 2); ZEPHIR_CPY_WRT(&definition, &_42$$28); ZEPHIR_OBS_NVAR(&columnType); - zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 128); - _43$$28 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 127); + _43$$28 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); if (!(_43$$28)) { - _43$$28 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 150); + _43$$28 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 149); } - if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 143)) { + if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 142)) { ZEPHIR_INIT_NVAR(&_44$$29); ZVAL_LONG(&_44$$29, 14); zephir_array_update_string(&definition, SL("type"), &_44$$29, PH_COPY | PH_SEPARATE); @@ -494,11 +495,11 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_47$$30); ZVAL_LONG(&_47$$30, 1); zephir_array_update_string(&definition, SL("bindType"), &_47$$30, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_48$$30, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 158); + zephir_array_fetch_long(&_48$$30, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 157); if (zephir_is_true(&_48$$30)) { zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 161)) { + } else if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 160)) { ZEPHIR_INIT_NVAR(&_49$$32); ZVAL_LONG(&_49$$32, 8); zephir_array_update_string(&definition, SL("type"), &_49$$32, PH_COPY | PH_SEPARATE); @@ -507,19 +508,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) zephir_array_update_string(&definition, SL("bindType"), &_50$$32, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&columnType); ZVAL_STRING(&columnType, "boolean"); - } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 172)) { + } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 171)) { ZEPHIR_INIT_NVAR(&_51$$33); ZVAL_LONG(&_51$$33, 5); zephir_array_update_string(&definition, SL("type"), &_51$$33, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 181)) { + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 180)) { ZEPHIR_INIT_NVAR(&_52$$34); ZVAL_LONG(&_52$$34, 4); zephir_array_update_string(&definition, SL("type"), &_52$$34, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 186)) { + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 185)) { ZEPHIR_INIT_NVAR(&_53$$35); ZVAL_LONG(&_53$$35, 1); zephir_array_update_string(&definition, SL("type"), &_53$$35, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 195)) { + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 194)) { ZEPHIR_INIT_NVAR(&_54$$36); ZVAL_LONG(&_54$$36, 3); zephir_array_update_string(&definition, SL("type"), &_54$$36, PH_COPY | PH_SEPARATE); @@ -527,7 +528,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_55$$36); ZVAL_LONG(&_55$$36, 32); zephir_array_update_string(&definition, SL("bindType"), &_55$$36, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 202)) { + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 201)) { ZEPHIR_INIT_NVAR(&_56$$37); ZVAL_LONG(&_56$$37, 7); zephir_array_update_string(&definition, SL("type"), &_56$$37, PH_COPY | PH_SEPARATE); @@ -535,19 +536,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZEPHIR_INIT_NVAR(&_57$$37); ZVAL_LONG(&_57$$37, 3); zephir_array_update_string(&definition, SL("bindType"), &_57$$37, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 213)) { + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 212)) { ZEPHIR_INIT_NVAR(&_58$$38); ZVAL_LONG(&_58$$38, 17); zephir_array_update_string(&definition, SL("type"), &_58$$38, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 222)) { + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 221)) { ZEPHIR_INIT_NVAR(&_59$$39); ZVAL_LONG(&_59$$39, 2); zephir_array_update_string(&definition, SL("type"), &_59$$39, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 227)) { + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 226)) { ZEPHIR_INIT_NVAR(&_60$$40); ZVAL_LONG(&_60$$40, 5); zephir_array_update_string(&definition, SL("type"), &_60$$40, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 232)) { + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 231)) { ZEPHIR_INIT_NVAR(&_61$$41); ZVAL_LONG(&_61$$41, 6); zephir_array_update_string(&definition, SL("type"), &_61$$41, PH_COPY | PH_SEPARATE); @@ -556,7 +557,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) ZVAL_LONG(&_62$$42, 2); zephir_array_update_string(&definition, SL("type"), &_62$$42, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 249)) { + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 248)) { ZEPHIR_INIT_NVAR(&matches); ZVAL_NULL(&matches); ZEPHIR_INIT_NVAR(&_63$$43); @@ -576,7 +577,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } } } - if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 265)) { + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/Db/Adapter/Pdo/Sqlite.zep", 264)) { zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } if (Z_TYPE_P(&oldColumn) == IS_NULL) { @@ -584,41 +585,42 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_66$$28, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 281); + zephir_array_fetch_long(&_66$$28, &field, 5, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 280); if (zephir_is_true(&_66$$28)) { zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_67$$28, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 288); + zephir_array_fetch_long(&_67$$28, &field, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 287); if (ZEPHIR_IS_LONG(&_67$$28, 0)) { zephir_array_update_string(&definition, SL("notNull"), &__$false, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_68$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - ZEPHIR_INIT_NVAR(&_69$$28); - ZVAL_STRING(&_69$$28, "null"); - ZEPHIR_CALL_FUNCTION(&_70$$28, "strcasecmp", &_33, 47, &_68$$28, &_69$$28); - zephir_check_call_status(); - _71$$28 = !ZEPHIR_IS_LONG(&_70$$28, 0); - if (_71$$28) { - zephir_array_fetch_long(&_72$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 296); - _71$$28 = !ZEPHIR_IS_STRING(&_72$$28, ""); + ZEPHIR_OBS_NVAR(&_68$$28); + zephir_array_fetch_long(&_68$$28, &field, 4, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + _69$$28 = !(ZEPHIR_IS_EMPTY(&_68$$28)); + if (_69$$28) { + zephir_array_fetch_long(&_70$$28, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 295); + ZEPHIR_INIT_NVAR(&_71$$28); + ZVAL_STRING(&_71$$28, "null"); + ZEPHIR_CALL_FUNCTION(&_72$$28, "strcasecmp", &_35, 35, &_70$$28, &_71$$28); + zephir_check_call_status(); + _69$$28 = !ZEPHIR_IS_LONG_IDENTICAL(&_72$$28, 0); } - if (_71$$28) { - zephir_array_fetch_long(&_73$$52, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 301); + if (_69$$28) { + zephir_array_fetch_long(&_73$$52, &field, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 300); ZEPHIR_INIT_NVAR(&_74$$52); ZVAL_STRING(&_74$$52, "/^'|'$/"); ZEPHIR_INIT_NVAR(&_75$$52); ZVAL_STRING(&_75$$52, ""); - ZEPHIR_CALL_FUNCTION(&_76$$52, "preg_replace", &_40, 50, &_74$$52, &_75$$52, &_73$$52); + ZEPHIR_CALL_FUNCTION(&_76$$52, "preg_replace", &_40, 37, &_74$$52, &_75$$52, &_73$$52); zephir_check_call_status(); zephir_array_update_string(&definition, SL("default"), &_76$$52, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_NVAR(&columnName); - zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); - ZEPHIR_INIT_NVAR(&_69$$28); - object_init_ex(&_69$$28, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, &_69$$28, "__construct", &_41, 227, &columnName, &definition); + zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 306); + ZEPHIR_INIT_NVAR(&_71$$28); + object_init_ex(&_71$$28, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_71$$28, "__construct", &_41, 208, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, &_69$$28, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 308); + zephir_array_append(&columns, &_71$$28, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 307); ZEPHIR_CPY_WRT(&oldColumn, &columnName); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); @@ -750,27 +752,27 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_3, 2); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 370); + zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 369); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) { ZEPHIR_INIT_NVAR(&index); ZVAL_COPY(&index, _4); ZEPHIR_OBS_NVAR(&keyName); - zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332); + zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 331); if (!(zephir_array_isset(&indexes, &keyName))) { ZEPHIR_INIT_NVAR(&_6$$4); array_init(&_6$$4); zephir_array_update_zval(&indexes, &keyName, &_6$$4, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338); + zephir_array_fetch(&_7$$3, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 337); if (!(zephir_array_isset_string(&_7$$3, SL("columns")))) { ZEPHIR_INIT_NVAR(&columns); array_init(&columns); } else { - zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch(&_8$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch_string(&columns, &_8$$6, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); } zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_10$$3, &_9$$3, "describeindex", NULL, 0, &keyName); @@ -778,14 +780,14 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_11$$3, 2); ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_10$$3, &_11$$3); zephir_check_call_status(); - zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353); + zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 352); if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _12$$3) { ZEPHIR_INIT_NVAR(&describeIndex); ZVAL_COPY(&describeIndex, _12$$3); - zephir_array_fetch_string(&_14$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_14$$7, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_14$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_14$$7, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0); @@ -798,8 +800,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) } ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_15$$8, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_15$$8, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_15$$8, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_15$$8, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0); zephir_check_call_status(); } @@ -811,7 +813,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_16$$3); zephir_check_call_status(); - zephir_array_fetch_string(&_18$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359); + zephir_array_fetch_string(&_18$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 358); if (zephir_is_true(&_18$$3)) { ZEPHIR_INIT_NVAR(&_19$$9); ZEPHIR_INIT_NVAR(&_20$$9); @@ -845,20 +847,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZEPHIR_CALL_METHOD(&index, &_0, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&keyName); - zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 332); + zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 331); if (!(zephir_array_isset(&indexes, &keyName))) { ZEPHIR_INIT_NVAR(&_25$$14); array_init(&_25$$14); zephir_array_update_zval(&indexes, &keyName, &_25$$14, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_26$$13, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 338); + zephir_array_fetch(&_26$$13, &indexes, &keyName, PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 337); if (!(zephir_array_isset_string(&_26$$13, SL("columns")))) { ZEPHIR_INIT_NVAR(&columns); array_init(&columns); } else { - zephir_array_fetch(&_27$$16, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch(&_27$$16, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_27$$16, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 341); + zephir_array_fetch_string(&columns, &_27$$16, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 340); } zephir_read_property(&_28$$13, this_ptr, ZEND_STRL("dialect"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_29$$13, &_28$$13, "describeindex", NULL, 0, &keyName); @@ -866,14 +868,14 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_LONG(&_30$$13, 2); ZEPHIR_CALL_METHOD(&describeIndexes, this_ptr, "fetchall", NULL, 0, &_29$$13, &_30$$13); zephir_check_call_status(); - zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 353); + zephir_is_iterable(&describeIndexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 352); if (Z_TYPE_P(&describeIndexes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&describeIndexes), _31$$13) { ZEPHIR_INIT_NVAR(&describeIndex); ZVAL_COPY(&describeIndex, _31$$13); - zephir_array_fetch_string(&_33$$17, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_33$$17, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_33$$17, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_33$$17, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "rewind", NULL, 0); @@ -886,8 +888,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) } ZEPHIR_CALL_METHOD(&describeIndex, &describeIndexes, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_34$$18, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); - zephir_array_append(&columns, &_34$$18, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 350); + zephir_array_fetch_string(&_34$$18, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); + zephir_array_append(&columns, &_34$$18, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 349); ZEPHIR_CALL_METHOD(NULL, &describeIndexes, "next", NULL, 0); zephir_check_call_status(); } @@ -899,7 +901,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_17, 0, &_35$$13); zephir_check_call_status(); - zephir_array_fetch_string(&_36$$13, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 359); + zephir_array_fetch_string(&_36$$13, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 358); if (zephir_is_true(&_36$$13)) { ZEPHIR_INIT_NVAR(&_37$$19); ZEPHIR_INIT_NVAR(&_38$$19); @@ -927,7 +929,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZEPHIR_INIT_NVAR(&index); ZEPHIR_INIT_VAR(&indexObjects); array_init(&indexObjects); - zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 380); + zephir_is_iterable(&indexes, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 379); if (Z_TYPE_P(&indexes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _45, _46, _43) { @@ -941,9 +943,9 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) ZVAL_COPY(&index, _43); ZEPHIR_INIT_NVAR(&_47$$23); object_init_ex(&_47$$23, phalcon_db_index_ce); - zephir_array_fetch_string(&_48$$23, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375); - zephir_array_fetch_string(&_49$$23, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377); - ZEPHIR_CALL_METHOD(NULL, &_47$$23, "__construct", &_50, 32, &name, &_48$$23, &_49$$23); + zephir_array_fetch_string(&_48$$23, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 374); + zephir_array_fetch_string(&_49$$23, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 376); + ZEPHIR_CALL_METHOD(NULL, &_47$$23, "__construct", &_50, 30, &name, &_48$$23, &_49$$23); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_47$$23, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -962,9 +964,9 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_51$$24); object_init_ex(&_51$$24, phalcon_db_index_ce); - zephir_array_fetch_string(&_52$$24, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 375); - zephir_array_fetch_string(&_53$$24, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 377); - ZEPHIR_CALL_METHOD(NULL, &_51$$24, "__construct", &_50, 32, &name, &_52$$24, &_53$$24); + zephir_array_fetch_string(&_52$$24, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 374); + zephir_array_fetch_string(&_53$$24, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 376); + ZEPHIR_CALL_METHOD(NULL, &_51$$24, "__construct", &_50, 30, &name, &_52$$24, &_53$$24); zephir_check_call_status(); zephir_array_update_zval(&indexObjects, &name, &_51$$24, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &indexes, "next", NULL, 0); @@ -1074,7 +1076,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZVAL_LONG(&_3, 3); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 420); + zephir_is_iterable(&_0, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 419); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _6, _7, _4) { @@ -1092,29 +1094,29 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&referencedSchema); ZVAL_NULL(&referencedSchema); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399); + zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 398); ZEPHIR_INIT_NVAR(&columns); array_init(&columns); ZEPHIR_INIT_NVAR(&referencedColumns); array_init(&referencedColumns); } else { - zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); ZEPHIR_OBS_NVAR(&referencedSchema); - zephir_array_fetch_string(&referencedSchema, &_8$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); - zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch_string(&referencedSchema, &_8$$5, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); + zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_string(&referencedTable, &_9$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); - zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); + zephir_array_fetch_string(&referencedTable, &_9$$5, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_10$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); - zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&columns, &_10$$5, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch(&_11$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); ZEPHIR_OBS_NVAR(&referencedColumns); - zephir_array_fetch_string(&referencedColumns, &_11$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&referencedColumns, &_11$$5, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); } - zephir_array_fetch_long(&_12$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_fetch_long(&_13$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); - zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); + zephir_array_fetch_long(&_12$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_append(&columns, &_12$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_fetch_long(&_13$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); + zephir_array_append(&referencedColumns, &_13$$3, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); ZEPHIR_INIT_NVAR(&_14$$3); zephir_create_array(&_14$$3, 4, 0); zephir_array_update_string(&_14$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); @@ -1142,29 +1144,29 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&referencedSchema); ZVAL_NULL(&referencedSchema); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 399); + zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 398); ZEPHIR_INIT_NVAR(&columns); array_init(&columns); ZEPHIR_INIT_NVAR(&referencedColumns); array_init(&referencedColumns); } else { - zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_15$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); ZEPHIR_OBS_NVAR(&referencedSchema); - zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); - zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch_string(&referencedSchema, &_15$$8, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 402); + zephir_array_fetch(&_16$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); ZEPHIR_OBS_NVAR(&referencedTable); - zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); - zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); + zephir_array_fetch_string(&referencedTable, &_16$$8, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 403); + zephir_array_fetch(&_17$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); ZEPHIR_OBS_NVAR(&columns); - zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); - zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&columns, &_17$$8, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 404); + zephir_array_fetch(&_18$$8, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); ZEPHIR_OBS_NVAR(&referencedColumns); - zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 406); + zephir_array_fetch_string(&referencedColumns, &_18$$8, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 405); } - zephir_array_fetch_long(&_19$$6, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_append(&columns, &_19$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); - zephir_array_fetch_long(&_20$$6, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); - zephir_array_append(&referencedColumns, &_20$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 410); + zephir_array_fetch_long(&_19$$6, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_append(&columns, &_19$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 408); + zephir_array_fetch_long(&_20$$6, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); + zephir_array_append(&referencedColumns, &_20$$6, PH_SEPARATE, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 409); ZEPHIR_INIT_NVAR(&_21$$6); zephir_create_array(&_21$$6, 4, 0); zephir_array_update_string(&_21$$6, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); @@ -1180,7 +1182,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&number); ZEPHIR_INIT_VAR(&referenceObjects); array_init(&referenceObjects); - zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 434); + zephir_is_iterable(&references, 0, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 433); if (Z_TYPE_P(&references) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _24, _25, _22) { @@ -1197,18 +1199,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&_27$$9); zephir_create_array(&_27$$9, 4, 0); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 425); zephir_array_update_string(&_27$$9, SL("referencedSchema"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); zephir_array_update_string(&_27$$9, SL("referencedTable"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); zephir_array_update_string(&_27$$9, SL("columns"), &_28$$9, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_28$$9); - zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430); + zephir_array_fetch_string(&_28$$9, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 429); zephir_array_update_string(&_27$$9, SL("referencedColumns"), &_28$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_26$$9, "__construct", &_29, 33, &name, &_27$$9); + ZEPHIR_CALL_METHOD(NULL, &_26$$9, "__construct", &_29, 31, &name, &_27$$9); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_26$$9, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -1230,18 +1232,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) ZEPHIR_INIT_NVAR(&_31$$10); zephir_create_array(&_31$$10, 4, 0); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 425); zephir_array_update_string(&_31$$10, SL("referencedSchema"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 426); zephir_array_update_string(&_31$$10, SL("referencedTable"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 428); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("columns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 427); zephir_array_update_string(&_31$$10, SL("columns"), &_32$$10, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_32$$10); - zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 430); + zephir_array_fetch_string(&_32$$10, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/Db/Adapter/Pdo/Sqlite.zep", 429); zephir_array_update_string(&_31$$10, SL("referencedColumns"), &_32$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &_30$$10, "__construct", &_29, 33, &name, &_31$$10); + ZEPHIR_CALL_METHOD(NULL, &_30$$10, "__construct", &_29, 31, &name, &_31$$10); zephir_check_call_status(); zephir_array_update_zval(&referenceObjects, &name, &_30$$10, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &references, "next", NULL, 0); @@ -1287,7 +1289,7 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue) object_init_ex(return_value, phalcon_db_rawvalue_ce); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "NULL"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 32, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/db/adapter/pdofactory.zep.c b/ext/phalcon/db/adapter/pdofactory.zep.c index 452bbc3b979..7b4483747f1 100644 --- a/ext/phalcon/db/adapter/pdofactory.zep.c +++ b/ext/phalcon/db/adapter/pdofactory.zep.c @@ -139,7 +139,7 @@ PHP_METHOD(Phalcon_Db_Adapter_PdoFactory, load) array_init(&_2); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "options"); - ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 171, config, &_3, &_2); + ZEPHIR_CALL_METHOD(&options, &_1, "__invoke", NULL, 150, config, &_3, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &options); zephir_check_call_status(); diff --git a/ext/phalcon/db/dialect.zep.c b/ext/phalcon/db/dialect.zep.c index b2f182a3f54..16b60c5a04d 100644 --- a/ext/phalcon/db/dialect.zep.c +++ b/ext/phalcon/db/dialect.zep.c @@ -420,7 +420,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getColumnList) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _0); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getsqlcolumn", &_3, 40, &column, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&columns, &_2$$3, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125); } ZEND_HASH_FOREACH_END(); @@ -435,7 +435,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getColumnList) } ZEPHIR_CALL_METHOD(&column, &columnList, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getsqlcolumn", &_3, 53, &column, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getsqlcolumn", &_3, 40, &column, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&columns, &_4$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 125); ZEPHIR_CALL_METHOD(NULL, &columnList, "next", NULL, 0); @@ -647,17 +647,17 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) } do { if (ZEPHIR_IS_STRING(&type, "scalar")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 54, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 41, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "object")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 55, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 42, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "qualified")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 56, &expression, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 43, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -706,34 +706,34 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) RETURN_CTOR(&_6$$8); } if (ZEPHIR_IS_STRING(&type, "binary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 57, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 44, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "unary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 58, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 45, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "parentheses")) { zephir_array_fetch_string(&_8$$14, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 304); - ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 59, &_8$$14, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 46, &_8$$14, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, "(", &_7$$14, ")"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "functionCall")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 60, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 47, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "list")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 61, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 48, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "all")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 62, &expression, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 49, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -745,17 +745,17 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "cast")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 63, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 50, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "convert")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 64, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 51, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_STRING(&type, "case")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 65, &expression, &escapeChar, &bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 52, &expression, &escapeChar, &bindCounts); zephir_check_call_status(); RETURN_MM(); } @@ -765,7 +765,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) object_init_ex(&_11, phalcon_db_exception_ce); ZEPHIR_INIT_VAR(&_12); ZEPHIR_CONCAT_SVS(&_12, "Invalid SQL expression type '", &type, "'"); - ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 31, &_12); + ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 29, &_12); zephir_check_call_status(); zephir_throw_exception_debug(&_11, "phalcon/Db/Dialect.zep", 369); ZEPHIR_MM_RESTORE(); @@ -819,7 +819,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlTable) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, table, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, table, &escapeChar); zephir_check_call_status(); RETURN_MM(); } @@ -1088,12 +1088,12 @@ PHP_METHOD(Phalcon_Db_Dialect, select) } zephir_read_property(&_0, this_ptr, ZEND_STRL("escapeChar"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&escapeChar, &_0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &columns, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &columns, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SV(&_2, " ", &_1); zephir_concat_self(&sql, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getsqlexpressionfrom", NULL, 68, &tables, &escapeChar); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "getsqlexpressionfrom", NULL, 55, &tables, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SV(&_4, " ", &_3); @@ -1105,7 +1105,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) } if (_5) { zephir_array_fetch_string(&_7$$10, &definition, SL("joins"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 517); - ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "getsqlexpressionjoins", NULL, 69, &_7$$10, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "getsqlexpressionjoins", NULL, 56, &_7$$10, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$10); ZEPHIR_CONCAT_SV(&_8$$10, " ", &_6$$10); @@ -1117,7 +1117,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) _9 = zephir_is_true(&where); } if (_9) { - ZEPHIR_CALL_METHOD(&_10$$11, this_ptr, "getsqlexpressionwhere", NULL, 70, &where, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_10$$11, this_ptr, "getsqlexpressionwhere", NULL, 57, &where, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11$$11); ZEPHIR_CONCAT_SV(&_11$$11, " ", &_10$$11); @@ -1129,7 +1129,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) _12 = zephir_is_true(&groupBy); } if (_12) { - ZEPHIR_CALL_METHOD(&_13$$12, this_ptr, "getsqlexpressiongroupby", NULL, 71, &groupBy, &escapeChar); + ZEPHIR_CALL_METHOD(&_13$$12, this_ptr, "getsqlexpressiongroupby", NULL, 58, &groupBy, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_14$$12); ZEPHIR_CONCAT_SV(&_14$$12, " ", &_13$$12); @@ -1141,7 +1141,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) _15 = zephir_is_true(&having); } if (_15) { - ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "getsqlexpressionhaving", NULL, 72, &having, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "getsqlexpressionhaving", NULL, 59, &having, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_17$$13); ZEPHIR_CONCAT_SV(&_17$$13, " ", &_16$$13); @@ -1153,7 +1153,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) _18 = zephir_is_true(&orderBy); } if (_18) { - ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "getsqlexpressionorderby", NULL, 73, &orderBy, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "getsqlexpressionorderby", NULL, 60, &orderBy, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_20$$14); ZEPHIR_CONCAT_SV(&_20$$14, " ", &_19$$14); @@ -1169,7 +1169,7 @@ PHP_METHOD(Phalcon_Db_Dialect, select) zephir_create_array(&_22$$15, 2, 0); zephir_array_update_string(&_22$$15, SL("sql"), &sql, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$15, SL("value"), &limit, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 74, &_22$$15, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 61, &_22$$15, &escapeChar, &bindCounts); zephir_check_call_status(); } _23 = zephir_array_isset_string_fetch(&forUpdate, &definition, SL("forUpdate"), 1); @@ -1447,7 +1447,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionBinaryOperations) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 660); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_2, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 665); ZEPHIR_CONCAT_VSVSV(return_value, &left, " ", &_2, " ", &right); @@ -1543,17 +1543,17 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) zephir_array_fetch_string(&_6$$3, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685); if (ZEPHIR_IS_STRING(&_6$$3, "when")) { zephir_array_fetch_string(&_8$$4, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 59, &_8$$4, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 46, &_8$$4, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_10$$4, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 59, &_10$$4, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 46, &_10$$4, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_CONCAT_SVSV(&_11$$4, " WHEN ", &_7$$4, " THEN ", &_9$$4); zephir_concat_self(&sql, &_11$$4); } else { zephir_array_fetch_string(&_13$$5, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 59, &_13$$5, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 46, &_13$$5, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$5); ZEPHIR_CONCAT_SV(&_14$$5, " ELSE ", &_12$$5); @@ -1574,17 +1574,17 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) zephir_array_fetch_string(&_15$$6, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 685); if (ZEPHIR_IS_STRING(&_15$$6, "when")) { zephir_array_fetch_string(&_17$$7, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 687); - ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "getsqlexpression", NULL, 59, &_17$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$7, this_ptr, "getsqlexpression", NULL, 46, &_17$$7, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_19$$7, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 689); - ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "getsqlexpression", NULL, 59, &_19$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "getsqlexpression", NULL, 46, &_19$$7, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_20$$7); ZEPHIR_CONCAT_SVSV(&_20$$7, " WHEN ", &_16$$7, " THEN ", &_18$$7); zephir_concat_self(&sql, &_20$$7); } else { zephir_array_fetch_string(&_22$$8, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 691); - ZEPHIR_CALL_METHOD(&_21$$8, this_ptr, "getsqlexpression", NULL, 59, &_22$$8, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_21$$8, this_ptr, "getsqlexpression", NULL, 46, &_22$$8, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_23$$8); ZEPHIR_CONCAT_SV(&_23$$8, " ELSE ", &_21$$8); @@ -1655,7 +1655,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCastValue) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 718); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "CAST(", &left, " AS ", &right, ")"); RETURN_MM(); @@ -1717,7 +1717,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionConvertValue) ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 746); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 59, &_1, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 46, &_1, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "CONVERT(", &left, " USING ", &right, ")"); RETURN_MM(); @@ -1771,7 +1771,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getsqltable", &_3, 62, &table, &escapeChar); zephir_check_call_status(); zephir_array_append(&tables, &_2$$4, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765); } ZEND_HASH_FOREACH_END(); @@ -1786,7 +1786,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) } ZEPHIR_CALL_METHOD(&table, expression, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqltable", &_3, 75, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getsqltable", &_3, 62, &table, &escapeChar); zephir_check_call_status(); zephir_array_append(&tables, &_4$$5, PH_SEPARATE, "phalcon/Db/Dialect.zep", 765); ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0); @@ -1984,7 +1984,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionGroupBy) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-GROUP-BY expression", "phalcon/Db/Dialect.zep", 834); return; } - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getsqlexpression", &_3, 59, &field, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getsqlexpression", &_3, 46, &field, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&fields, &_4$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 841); ZEPHIR_CALL_METHOD(NULL, expression, "next", NULL, 0); @@ -2153,7 +2153,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { ZEPHIR_INIT_NVAR(&condition); ZVAL_COPY(&condition, _4$$6); - ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$7, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_6$$7, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); } ZEND_HASH_FOREACH_END(); @@ -2168,7 +2168,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_7$$8, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0); @@ -2193,7 +2193,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) zephir_concat_self_str(&joinType, SL(" ")); } zephir_array_fetch_string(&_10$$3, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913); - ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_10$$3, &escapeChar); + ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 62, &_10$$3, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$3); ZEPHIR_CONCAT_SVSVSV(&_12$$3, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition); @@ -2217,7 +2217,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } if (_13$$11) { if (!(zephir_array_isset_long(&joinConditionsArray, 0))) { - ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 59, &joinConditionsArray, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_3, 46, &joinConditionsArray, &escapeChar, &bindCounts); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&joinCondition); @@ -2228,7 +2228,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { ZEPHIR_INIT_NVAR(&condition); ZVAL_COPY(&condition, _14$$14); - ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_16$$15, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); } ZEND_HASH_FOREACH_END(); @@ -2243,7 +2243,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) } ZEPHIR_CALL_METHOD(&condition, &joinConditionsArray, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "getsqlexpression", &_3, 59, &condition, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "getsqlexpression", &_3, 46, &condition, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&joinCondition, &_17$$16, PH_SEPARATE, "phalcon/Db/Dialect.zep", 900); ZEPHIR_CALL_METHOD(NULL, &joinConditionsArray, "next", NULL, 0); @@ -2268,7 +2268,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) zephir_concat_self_str(&joinType, SL(" ")); } zephir_array_fetch_string(&_20$$11, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 913); - ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 75, &_20$$11, &escapeChar); + ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_11, 62, &_20$$11, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_21$$11); ZEPHIR_CONCAT_SVSVSV(&_21$$11, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition); @@ -2364,7 +2364,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionLimit) _2$$4 = Z_TYPE_P(&offset) == IS_ARRAY; } if (_2$$4) { - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 59, &offset, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 46, &offset, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CPY_WRT(&offset, &_3$$7); } @@ -2479,7 +2479,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionList) } ZEPHIR_CALL_METHOD(&item, &values, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getsqlexpression", &_5, 59, &item, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getsqlexpression", &_5, 46, &item, &escapeChar, &bindCounts); zephir_check_call_status(); zephir_array_append(&items, &_6$$6, PH_SEPARATE, "phalcon/Db/Dialect.zep", 993); ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0); @@ -2684,7 +2684,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionOrderBy) return; } zephir_array_fetch_long(&_6$$7, &field, 0, PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1053); - ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 59, &_6$$7, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_3, 46, &_6$$7, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&type); _7$$7 = zephir_array_isset_long_fetch(&type, &field, 1, 0); @@ -2810,7 +2810,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionScalar) if (zephir_array_isset_string(&expression, SL("column"))) { zephir_array_fetch_string(&_0$$3, &expression, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1107); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 53, &_0$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 40, &_0$$3); zephir_check_call_status(); RETURN_MM(); } @@ -2892,7 +2892,7 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionUnaryOperations) ZEPHIR_OBS_VAR(&right); if (zephir_array_isset_string_fetch(&right, &expression, SL("right"), 0)) { zephir_array_fetch_string(&_2$$4, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Db/Dialect.zep", 1145); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 59, &right, &escapeChar, &bindCounts); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 46, &right, &escapeChar, &bindCounts); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &_2$$4, " ", &_3$$4); RETURN_MM(); @@ -3009,7 +3009,7 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias) if (!ZEPHIR_IS_STRING(&alias, "")) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 66, &alias, &escapeChar); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 53, &alias, &escapeChar); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &qualified, " AS ", &_0$$3); RETURN_MM(); @@ -3077,18 +3077,18 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareTable) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table, &escapeChar); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 53, &table, &escapeChar); zephir_check_call_status(); zephir_get_strval(&table, &_0); if (!ZEPHIR_IS_STRING(&schema, "")) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 76, &schema, &escapeChar); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 63, &schema, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VSV(&_2$$3, &_1$$3, ".", &table); zephir_get_strval(&table, &_2$$3); } if (!ZEPHIR_IS_STRING(&alias, "")) { - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 66, &alias, &escapeChar); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 53, &alias, &escapeChar); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$4); ZEPHIR_CONCAT_VSV(&_4$$4, &table, " AS ", &_3$$4); @@ -3149,11 +3149,11 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareQualified) if (!ZEPHIR_IS_STRING(&domain, "")) { ZEPHIR_INIT_VAR(&_0$$3); ZEPHIR_CONCAT_VSV(&_0$$3, &domain, ".", &column); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &_0$$3, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, &_0$$3, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 66, &column, &escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 53, &column, &escapeChar); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/db/dialect/mysql.zep.c b/ext/phalcon/db/dialect/mysql.zep.c index 72212de7d4e..398a85ce313 100644 --- a/ext/phalcon/db/dialect/mysql.zep.c +++ b/ext/phalcon/db/dialect/mysql.zep.c @@ -143,7 +143,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) } _8$$5 = _7$$5; if (!(_8$$5)) { - ZEPHIR_CALL_FUNCTION(&_9$$5, "is_float", NULL, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_9$$5, "is_float", NULL, 209, &defaultValue); zephir_check_call_status(); _8$$5 = zephir_is_true(&_9$$5); } @@ -154,7 +154,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) } else { ZEPHIR_INIT_VAR(&_11$$7); ZVAL_STRING(&_11$$7, "\""); - ZEPHIR_CALL_FUNCTION(&_12$$7, "addcslashes", NULL, 229, &defaultValue, &_11$$7); + ZEPHIR_CALL_FUNCTION(&_12$$7, "addcslashes", NULL, 210, &defaultValue, &_11$$7); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_13$$7); ZEPHIR_CONCAT_SVS(&_13$$7, " DEFAULT \"", &_12$$7, "\""); @@ -262,7 +262,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) } ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -272,7 +272,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_11, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getcolumnlist", NULL, 67, &_11); + ZEPHIR_CALL_METHOD(&_10, this_ptr, "getcolumnlist", NULL, 54, &_11); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_12); ZEPHIR_CONCAT_SVSVSVS(&_12, " FOREIGN KEY (", &_5, ") REFERENCES ", &_7, "(", &_10, ")"); @@ -367,7 +367,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_5, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 67, &_5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 54, &_5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVSVS(&_6, "`", &_3, "` (", &_4, ")"); @@ -428,7 +428,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addPrimaryKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &_2); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " ADD PRIMARY KEY (", &_1, ")"); RETURN_MM(); @@ -642,7 +642,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } _11$$10 = _10$$10; if (!(_11$$10)) { - ZEPHIR_CALL_FUNCTION(&_12$$10, "is_float", &_13, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_12$$10, "is_float", &_13, 209, &defaultValue); zephir_check_call_status(); _11$$10 = zephir_is_true(&_12$$10); } @@ -653,7 +653,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_INIT_NVAR(&_15$$12); ZVAL_STRING(&_15$$12, "\""); - ZEPHIR_CALL_FUNCTION(&_16$$12, "addcslashes", &_17, 229, &defaultValue, &_15$$12); + ZEPHIR_CALL_FUNCTION(&_16$$12, "addcslashes", &_17, 210, &defaultValue, &_15$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_18$$12); ZEPHIR_CONCAT_SVS(&_18$$12, " DEFAULT \"", &_16$$12, "\""); @@ -722,7 +722,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } _30$$19 = _29$$19; if (!(_30$$19)) { - ZEPHIR_CALL_FUNCTION(&_31$$19, "is_float", &_13, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_31$$19, "is_float", &_13, 209, &defaultValue); zephir_check_call_status(); _30$$19 = zephir_is_true(&_31$$19); } @@ -733,7 +733,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_INIT_NVAR(&_33$$21); ZVAL_STRING(&_33$$21, "\""); - ZEPHIR_CALL_FUNCTION(&_34$$21, "addcslashes", &_17, 229, &defaultValue, &_33$$21); + ZEPHIR_CALL_FUNCTION(&_34$$21, "addcslashes", &_17, 210, &defaultValue, &_33$$21); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_35$$21); ZEPHIR_CONCAT_SVS(&_35$$21, " DEFAULT \"", &_34$$21, "\""); @@ -780,7 +780,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_44$$27, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_43$$27, this_ptr, "getcolumnlist", &_45, 67, &_44$$27); + ZEPHIR_CALL_METHOD(&_43$$27, this_ptr, "getcolumnlist", &_45, 54, &_44$$27); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_46$$27); ZEPHIR_CONCAT_SVS(&_46$$27, "PRIMARY KEY (", &_43$$27, ")"); @@ -789,7 +789,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_48$$29, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_47$$29, this_ptr, "getcolumnlist", &_45, 67, &_48$$29); + ZEPHIR_CALL_METHOD(&_47$$29, this_ptr, "getcolumnlist", &_45, 54, &_48$$29); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$29); ZEPHIR_CONCAT_VSVSVS(&_49$$29, &indexType, " KEY `", &indexName, "` (", &_47$$29, ")"); @@ -797,7 +797,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_CALL_METHOD(&_51$$30, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_50$$30, this_ptr, "getcolumnlist", &_45, 67, &_51$$30); + ZEPHIR_CALL_METHOD(&_50$$30, this_ptr, "getcolumnlist", &_45, 54, &_51$$30); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_52$$30); ZEPHIR_CONCAT_SVSVS(&_52$$30, "KEY `", &indexName, "` (", &_50$$30, ")"); @@ -824,7 +824,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_54$$32, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_53$$32, this_ptr, "getcolumnlist", &_45, 67, &_54$$32); + ZEPHIR_CALL_METHOD(&_53$$32, this_ptr, "getcolumnlist", &_45, 54, &_54$$32); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_55$$32); ZEPHIR_CONCAT_SVS(&_55$$32, "PRIMARY KEY (", &_53$$32, ")"); @@ -833,7 +833,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_57$$34, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_56$$34, this_ptr, "getcolumnlist", &_45, 67, &_57$$34); + ZEPHIR_CALL_METHOD(&_56$$34, this_ptr, "getcolumnlist", &_45, 54, &_57$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_58$$34); ZEPHIR_CONCAT_VSVSVS(&_58$$34, &indexType, " KEY `", &indexName, "` (", &_56$$34, ")"); @@ -841,7 +841,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) } else { ZEPHIR_CALL_METHOD(&_60$$35, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_59$$35, this_ptr, "getcolumnlist", &_45, 67, &_60$$35); + ZEPHIR_CALL_METHOD(&_59$$35, this_ptr, "getcolumnlist", &_45, 54, &_60$$35); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_61$$35); ZEPHIR_CONCAT_SVSVS(&_61$$35, "KEY `", &indexName, "` (", &_59$$35, ")"); @@ -867,7 +867,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_66$$37, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_65$$37, this_ptr, "getcolumnlist", &_45, 67, &_66$$37); + ZEPHIR_CALL_METHOD(&_65$$37, this_ptr, "getcolumnlist", &_45, 54, &_66$$37); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_68$$37, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -877,7 +877,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_71$$37, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_70$$37, this_ptr, "getcolumnlist", &_45, 67, &_71$$37); + ZEPHIR_CALL_METHOD(&_70$$37, this_ptr, "getcolumnlist", &_45, 54, &_71$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_72$$37); ZEPHIR_CONCAT_SVSVSSVSVS(&_72$$37, "CONSTRAINT `", &_64$$37, "` FOREIGN KEY (", &_65$$37, ")", " REFERENCES ", &_67$$37, " (", &_70$$37, ")"); @@ -913,7 +913,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_77$$40, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_76$$40, this_ptr, "getcolumnlist", &_45, 67, &_77$$40); + ZEPHIR_CALL_METHOD(&_76$$40, this_ptr, "getcolumnlist", &_45, 54, &_77$$40); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_79$$40, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); @@ -923,7 +923,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_82$$40, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_81$$40, this_ptr, "getcolumnlist", &_45, 67, &_82$$40); + ZEPHIR_CALL_METHOD(&_81$$40, this_ptr, "getcolumnlist", &_45, 54, &_82$$40); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_83$$40); ZEPHIR_CONCAT_SVSVSSVSVS(&_83$$40, "CONSTRAINT `", &_75$$40, "` FOREIGN KEY (", &_76$$40, ")", " REFERENCES ", &_78$$40, " (", &_81$$40, ")"); @@ -1635,7 +1635,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_VV(&_2$$3, &_0$$3, &_1$$3); @@ -1697,7 +1697,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_7$$18, this_ptr, "getcolumnsizeandscale", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$18, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_8$$18, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$18); ZEPHIR_CONCAT_VV(&_9$$18, &_7$$18, &_8$$18); @@ -1708,9 +1708,9 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DOUBLE")); } - ZEPHIR_CALL_METHOD(&_10$$20, this_ptr, "checkcolumnsizeandscale", NULL, 231, column); + ZEPHIR_CALL_METHOD(&_10$$20, this_ptr, "checkcolumnsizeandscale", NULL, 212, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_12$$20); ZEPHIR_CONCAT_VV(&_12$$20, &_10$$20, &_11$$20); @@ -1730,9 +1730,9 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT")); } - ZEPHIR_CALL_METHOD(&_14$$24, this_ptr, "checkcolumnsizeandscale", NULL, 231, column); + ZEPHIR_CALL_METHOD(&_14$$24, this_ptr, "checkcolumnsizeandscale", NULL, 212, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15$$24, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_15$$24, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_16$$24); ZEPHIR_CONCAT_VV(&_16$$24, &_14$$24, &_15$$24); @@ -1745,7 +1745,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_17$$26, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_18$$26, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_18$$26, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_19$$26); ZEPHIR_CONCAT_VV(&_19$$26, &_17$$26, &_18$$26); @@ -1782,7 +1782,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_20$$36, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_21$$36, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_21$$36, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_22$$36); ZEPHIR_CONCAT_VV(&_22$$36, &_20$$36, &_21$$36); @@ -1801,7 +1801,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_23$$40, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_24$$40, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_24$$40, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_25$$40); ZEPHIR_CONCAT_VV(&_25$$40, &_23$$40, &_24$$40); @@ -1852,7 +1852,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } ZEPHIR_CALL_METHOD(&_30$$52, this_ptr, "getcolumnsize", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_31$$52, this_ptr, "checkcolumnunsigned", NULL, 230, column); + ZEPHIR_CALL_METHOD(&_31$$52, this_ptr, "checkcolumnunsigned", NULL, 211, column); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_32$$52); ZEPHIR_CONCAT_VV(&_32$$52, &_30$$52, &_31$$52); @@ -1881,7 +1881,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_36$$59); ZEPHIR_CONCAT_SV(&_36$$59, "Unrecognized MySQL data type at column ", &_35$$59); - ZEPHIR_CALL_METHOD(NULL, &_34$$59, "__construct", NULL, 31, &_36$$59); + ZEPHIR_CALL_METHOD(NULL, &_34$$59, "__construct", NULL, 29, &_36$$59); zephir_check_call_status(); zephir_throw_exception_debug(&_34$$59, "phalcon/Db/Dialect/Mysql.zep", 635); ZEPHIR_MM_RESTORE(); @@ -1901,7 +1901,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) ZVAL_COPY(&value$$61, _37$$61); ZEPHIR_INIT_NVAR(&_39$$62); ZVAL_STRING(&_39$$62, "\""); - ZEPHIR_CALL_FUNCTION(&_40$$62, "addcslashes", &_41, 229, &value$$61, &_39$$62); + ZEPHIR_CALL_FUNCTION(&_40$$62, "addcslashes", &_41, 210, &value$$61, &_39$$62); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_42$$62); ZEPHIR_CONCAT_SVS(&_42$$62, "\"", &_40$$62, "\", "); @@ -1920,7 +1920,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_43$$63); ZVAL_STRING(&_43$$63, "\""); - ZEPHIR_CALL_FUNCTION(&_44$$63, "addcslashes", &_41, 229, &value$$61, &_43$$63); + ZEPHIR_CALL_FUNCTION(&_44$$63, "addcslashes", &_41, 210, &value$$61, &_43$$63); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$63); ZEPHIR_CONCAT_SVS(&_45$$63, "\"", &_44$$63, "\", "); @@ -1940,7 +1940,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_50$$64); ZVAL_STRING(&_50$$64, "\""); - ZEPHIR_CALL_FUNCTION(&_51$$64, "addcslashes", &_41, 229, &typeValues, &_50$$64); + ZEPHIR_CALL_FUNCTION(&_51$$64, "addcslashes", &_41, 210, &typeValues, &_50$$64); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_52$$64); ZEPHIR_CONCAT_SVS(&_52$$64, "(\"", &_51$$64, "\")"); @@ -2187,7 +2187,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) } _13$$8 = _12$$8; if (!(_13$$8)) { - ZEPHIR_CALL_FUNCTION(&_14$$8, "is_float", NULL, 228, &defaultValue); + ZEPHIR_CALL_FUNCTION(&_14$$8, "is_float", NULL, 209, &defaultValue); zephir_check_call_status(); _13$$8 = zephir_is_true(&_14$$8); } @@ -2198,7 +2198,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) } else { ZEPHIR_INIT_VAR(&_16$$10); ZVAL_STRING(&_16$$10, "\""); - ZEPHIR_CALL_FUNCTION(&_17$$10, "addcslashes", NULL, 229, &defaultValue, &_16$$10); + ZEPHIR_CALL_FUNCTION(&_17$$10, "addcslashes", NULL, 210, &defaultValue, &_16$$10); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_18$$10); ZEPHIR_CONCAT_SVS(&_18$$10, " DEFAULT \"", &_17$$10, "\""); diff --git a/ext/phalcon/db/dialect/postgresql.zep.c b/ext/phalcon/db/dialect/postgresql.zep.c index ddc608acd5b..a8bf13b7476 100644 --- a/ext/phalcon/db/dialect/postgresql.zep.c +++ b/ext/phalcon/db/dialect/postgresql.zep.c @@ -210,13 +210,13 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addForeignKey) } ZEPHIR_CALL_METHOD(&_6, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_7, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_9, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8, this_ptr, "getcolumnlist", NULL, 67, &_9); + ZEPHIR_CALL_METHOD(&_8, this_ptr, "getcolumnlist", NULL, 54, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_10); ZEPHIR_CONCAT_SVSSVSVS(&_10, " FOREIGN KEY (", &_5, ")", " REFERENCES \"", &_7, "\" (", &_8, ")"); @@ -319,7 +319,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addIndex) zephir_concat_self(&sql, &_4); ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVS(&_7, " (", &_5, ")"); @@ -380,7 +380,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addPrimaryKey) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 67, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 54, &_2); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVSVS(return_value, "ALTER TABLE ", &_0, " ADD CONSTRAINT \"", &tableName, "_PRIMARY\" PRIMARY KEY (", &_1, ")"); RETURN_MM(); @@ -674,7 +674,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) } ZEPHIR_INIT_NVAR(&column); if (!(ZEPHIR_IS_EMPTY(&primaryColumns))) { - ZEPHIR_CALL_METHOD(&_30$$19, this_ptr, "getcolumnlist", NULL, 67, &primaryColumns); + ZEPHIR_CALL_METHOD(&_30$$19, this_ptr, "getcolumnlist", NULL, 54, &primaryColumns); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_31$$19); ZEPHIR_CONCAT_SVS(&_31$$19, "PRIMARY KEY (", &_30$$19, ")"); @@ -696,7 +696,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_35$$22, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_34$$22, this_ptr, "getcolumnlist", NULL, 67, &_35$$22); + ZEPHIR_CALL_METHOD(&_34$$22, this_ptr, "getcolumnlist", NULL, 54, &_35$$22); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$22); ZEPHIR_CONCAT_SVS(&_36$$22, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_34$$22, ")"); @@ -705,7 +705,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_38$$24, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_37$$24, this_ptr, "getcolumnlist", NULL, 67, &_38$$24); + ZEPHIR_CALL_METHOD(&_37$$24, this_ptr, "getcolumnlist", NULL, 54, &_38$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_39$$24); ZEPHIR_CONCAT_SVSVSVS(&_39$$24, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_37$$24, ")"); @@ -720,7 +720,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&indexSqlAfterCreate, &_42$$25); ZEPHIR_CALL_METHOD(&_44$$25, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_43$$25, this_ptr, "getcolumnlist", NULL, 67, &_44$$25); + ZEPHIR_CALL_METHOD(&_43$$25, this_ptr, "getcolumnlist", NULL, 54, &_44$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$25); ZEPHIR_CONCAT_SVS(&_45$$25, " (", &_43$$25, ");"); @@ -750,7 +750,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { ZEPHIR_CALL_METHOD(&_47$$28, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_46$$28, this_ptr, "getcolumnlist", NULL, 67, &_47$$28); + ZEPHIR_CALL_METHOD(&_46$$28, this_ptr, "getcolumnlist", NULL, 54, &_47$$28); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_48$$28); ZEPHIR_CONCAT_SVS(&_48$$28, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_46$$28, ")"); @@ -759,7 +759,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) if (!(ZEPHIR_IS_EMPTY(&indexType))) { ZEPHIR_CALL_METHOD(&_50$$30, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_49$$30, this_ptr, "getcolumnlist", NULL, 67, &_50$$30); + ZEPHIR_CALL_METHOD(&_49$$30, this_ptr, "getcolumnlist", NULL, 54, &_50$$30); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_51$$30); ZEPHIR_CONCAT_SVSVSVS(&_51$$30, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_49$$30, ")"); @@ -774,7 +774,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&indexSqlAfterCreate, &_54$$31); ZEPHIR_CALL_METHOD(&_56$$31, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_55$$31, this_ptr, "getcolumnlist", NULL, 67, &_56$$31); + ZEPHIR_CALL_METHOD(&_55$$31, this_ptr, "getcolumnlist", NULL, 54, &_56$$31); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_57$$31); ZEPHIR_CONCAT_SVS(&_57$$31, " (", &_55$$31, ");"); @@ -802,7 +802,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_62$$34, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_61$$34, this_ptr, "getcolumnlist", NULL, 67, &_62$$34); + ZEPHIR_CALL_METHOD(&_61$$34, this_ptr, "getcolumnlist", NULL, 54, &_62$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_63$$34); ZEPHIR_CONCAT_SVSVS(&_63$$34, "CONSTRAINT \"", &_60$$34, "\" FOREIGN KEY (", &_61$$34, ") REFERENCES "); @@ -814,7 +814,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&referenceSql, &_64$$34); ZEPHIR_CALL_METHOD(&_67$$34, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_66$$34, this_ptr, "getcolumnlist", NULL, 67, &_67$$34); + ZEPHIR_CALL_METHOD(&_66$$34, this_ptr, "getcolumnlist", NULL, 54, &_67$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_68$$34); ZEPHIR_CONCAT_SVS(&_68$$34, " (", &_66$$34, ")"); @@ -850,7 +850,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_73$$37, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_72$$37, this_ptr, "getcolumnlist", NULL, 67, &_73$$37); + ZEPHIR_CALL_METHOD(&_72$$37, this_ptr, "getcolumnlist", NULL, 54, &_73$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_74$$37); ZEPHIR_CONCAT_SVSVS(&_74$$37, "CONSTRAINT \"", &_71$$37, "\" FOREIGN KEY (", &_72$$37, ") REFERENCES "); @@ -862,7 +862,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) zephir_concat_self(&referenceSql, &_75$$37); ZEPHIR_CALL_METHOD(&_78$$37, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_77$$37, this_ptr, "getcolumnlist", NULL, 67, &_78$$37); + ZEPHIR_CALL_METHOD(&_77$$37, this_ptr, "getcolumnlist", NULL, 54, &_78$$37); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_79$$37); ZEPHIR_CONCAT_SVS(&_79$$37, " (", &_77$$37, ")"); @@ -1638,7 +1638,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7$$36); ZEPHIR_CONCAT_SV(&_7$$36, "Unrecognized PostgreSQL data type at column ", &_6$$36); - ZEPHIR_CALL_METHOD(NULL, &_5$$36, "__construct", NULL, 31, &_7$$36); + ZEPHIR_CALL_METHOD(NULL, &_5$$36, "__construct", NULL, 29, &_7$$36); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$36, "phalcon/Db/Dialect/Postgresql.zep", 511); ZEPHIR_MM_RESTORE(); @@ -1657,7 +1657,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) ZVAL_COPY(&value$$38, _8$$38); ZEPHIR_INIT_NVAR(&_10$$39); ZVAL_STRING(&_10$$39, "\'"); - ZEPHIR_CALL_FUNCTION(&_11$$39, "addcslashes", &_12, 229, &value$$38, &_10$$39); + ZEPHIR_CALL_FUNCTION(&_11$$39, "addcslashes", &_12, 210, &value$$38, &_10$$39); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$39); ZEPHIR_CONCAT_SVS(&_13$$39, "'", &_11$$39, "', "); @@ -1676,7 +1676,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$40); ZVAL_STRING(&_14$$40, "\'"); - ZEPHIR_CALL_FUNCTION(&_15$$40, "addcslashes", &_12, 229, &value$$38, &_14$$40); + ZEPHIR_CALL_FUNCTION(&_15$$40, "addcslashes", &_12, 210, &value$$38, &_14$$40); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$40); ZEPHIR_CONCAT_SVS(&_16$$40, "'", &_15$$40, "', "); @@ -1696,7 +1696,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_21$$41); ZVAL_STRING(&_21$$41, "\'"); - ZEPHIR_CALL_FUNCTION(&_22$$41, "addcslashes", &_12, 229, &typeValues, &_21$$41); + ZEPHIR_CALL_FUNCTION(&_22$$41, "addcslashes", &_12, 210, &typeValues, &_21$$41); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_23$$41); ZEPHIR_CONCAT_SVS(&_23$$41, "('", &_22$$41, "')"); @@ -2305,7 +2305,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, castDefault) } else { ZEPHIR_INIT_VAR(&_7$$6); ZVAL_STRING(&_7$$6, "\'"); - ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 229, &defaultValue, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 210, &defaultValue, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$6); ZEPHIR_CONCAT_SVS(&_9$$6, "'", &_8$$6, "'"); diff --git a/ext/phalcon/db/dialect/sqlite.zep.c b/ext/phalcon/db/dialect/sqlite.zep.c index 51c70198827..bfc6e136cee 100644 --- a/ext/phalcon/db/dialect/sqlite.zep.c +++ b/ext/phalcon/db/dialect/sqlite.zep.c @@ -129,7 +129,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addColumn) } else { ZEPHIR_INIT_VAR(&_7$$5); ZVAL_STRING(&_7$$5, "\""); - ZEPHIR_CALL_FUNCTION(&_8$$5, "addcslashes", NULL, 229, &defaultValue, &_7$$5); + ZEPHIR_CALL_FUNCTION(&_8$$5, "addcslashes", NULL, 210, &defaultValue, &_7$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$5); ZEPHIR_CONCAT_SVS(&_9$$5, " DEFAULT \"", &_8$$5, "\""); @@ -281,7 +281,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex) } ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 67, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 54, &_6); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVSVS(&_7, " ON \"", &tableName, "\" (", &_5, ")"); @@ -533,7 +533,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else { ZEPHIR_INIT_NVAR(&_13$$12); ZVAL_STRING(&_13$$12, "\""); - ZEPHIR_CALL_FUNCTION(&_14$$12, "addcslashes", &_15, 229, &defaultValue, &_13$$12); + ZEPHIR_CALL_FUNCTION(&_14$$12, "addcslashes", &_15, 210, &defaultValue, &_13$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$12); ZEPHIR_CONCAT_SVS(&_16$$12, " DEFAULT \"", &_14$$12, "\""); @@ -597,7 +597,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else { ZEPHIR_INIT_NVAR(&_26$$20); ZVAL_STRING(&_26$$20, "\""); - ZEPHIR_CALL_FUNCTION(&_27$$20, "addcslashes", &_15, 229, &defaultValue, &_26$$20); + ZEPHIR_CALL_FUNCTION(&_27$$20, "addcslashes", &_15, 210, &defaultValue, &_26$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$20); ZEPHIR_CONCAT_SVS(&_28$$20, " DEFAULT \"", &_27$$20, "\""); @@ -642,7 +642,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) if (_32$$24) { ZEPHIR_CALL_METHOD(&_36$$25, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$25, this_ptr, "getcolumnlist", &_37, 67, &_36$$25); + ZEPHIR_CALL_METHOD(&_35$$25, this_ptr, "getcolumnlist", &_37, 54, &_36$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_38$$25); ZEPHIR_CONCAT_SVS(&_38$$25, "PRIMARY KEY (", &_35$$25, ")"); @@ -650,7 +650,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else if (_33$$24) { ZEPHIR_CALL_METHOD(&_40$$26, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_39$$26, this_ptr, "getcolumnlist", &_37, 67, &_40$$26); + ZEPHIR_CALL_METHOD(&_39$$26, this_ptr, "getcolumnlist", &_37, 54, &_40$$26); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_41$$26); ZEPHIR_CONCAT_SVS(&_41$$26, "UNIQUE (", &_39$$26, ")"); @@ -685,7 +685,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) if (_42$$27) { ZEPHIR_CALL_METHOD(&_46$$28, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_45$$28, this_ptr, "getcolumnlist", &_37, 67, &_46$$28); + ZEPHIR_CALL_METHOD(&_45$$28, this_ptr, "getcolumnlist", &_37, 54, &_46$$28); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_47$$28); ZEPHIR_CONCAT_SVS(&_47$$28, "PRIMARY KEY (", &_45$$28, ")"); @@ -693,7 +693,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) } else if (_43$$27) { ZEPHIR_CALL_METHOD(&_49$$29, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_48$$29, this_ptr, "getcolumnlist", &_37, 67, &_49$$29); + ZEPHIR_CALL_METHOD(&_48$$29, this_ptr, "getcolumnlist", &_37, 54, &_49$$29); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_50$$29); ZEPHIR_CONCAT_SVS(&_50$$29, "UNIQUE (", &_48$$29, ")"); @@ -717,13 +717,13 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_55$$31, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_54$$31, this_ptr, "getcolumnlist", &_37, 67, &_55$$31); + ZEPHIR_CALL_METHOD(&_54$$31, this_ptr, "getcolumnlist", &_37, 54, &_55$$31); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_56$$31, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_58$$31, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_57$$31, this_ptr, "getcolumnlist", &_37, 67, &_58$$31); + ZEPHIR_CALL_METHOD(&_57$$31, this_ptr, "getcolumnlist", &_37, 54, &_58$$31); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&referenceSql); ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_53$$31, "` FOREIGN KEY (", &_54$$31, ")", " REFERENCES `", &_56$$31, "`(", &_57$$31, ")"); @@ -758,13 +758,13 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_63$$34, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_62$$34, this_ptr, "getcolumnlist", &_37, 67, &_63$$34); + ZEPHIR_CALL_METHOD(&_62$$34, this_ptr, "getcolumnlist", &_37, 54, &_63$$34); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_64$$34, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_66$$34, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_65$$34, this_ptr, "getcolumnlist", &_37, 67, &_66$$34); + ZEPHIR_CALL_METHOD(&_65$$34, this_ptr, "getcolumnlist", &_37, 54, &_66$$34); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&referenceSql); ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_61$$34, "` FOREIGN KEY (", &_62$$34, ")", " REFERENCES `", &_64$$34, "`(", &_65$$34, ")"); @@ -1594,7 +1594,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_7$$38); ZEPHIR_CONCAT_SV(&_7$$38, "Unrecognized SQLite data type at column ", &_6$$38); - ZEPHIR_CALL_METHOD(NULL, &_5$$38, "__construct", NULL, 31, &_7$$38); + ZEPHIR_CALL_METHOD(NULL, &_5$$38, "__construct", NULL, 29, &_7$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$38, "phalcon/Db/Dialect/Sqlite.zep", 520); ZEPHIR_MM_RESTORE(); @@ -1614,7 +1614,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) ZVAL_COPY(&value$$40, _8$$40); ZEPHIR_INIT_NVAR(&_10$$41); ZVAL_STRING(&_10$$41, "\""); - ZEPHIR_CALL_FUNCTION(&_11$$41, "addcslashes", &_12, 229, &value$$40, &_10$$41); + ZEPHIR_CALL_FUNCTION(&_11$$41, "addcslashes", &_12, 210, &value$$40, &_10$$41); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$41); ZEPHIR_CONCAT_SVS(&_13$$41, "\"", &_11$$41, "\", "); @@ -1633,7 +1633,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$42); ZVAL_STRING(&_14$$42, "\""); - ZEPHIR_CALL_FUNCTION(&_15$$42, "addcslashes", &_12, 229, &value$$40, &_14$$42); + ZEPHIR_CALL_FUNCTION(&_15$$42, "addcslashes", &_12, 210, &value$$40, &_14$$42); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$42); ZEPHIR_CONCAT_SVS(&_16$$42, "\"", &_15$$42, "\", "); @@ -1653,7 +1653,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) } else { ZEPHIR_INIT_VAR(&_21$$43); ZVAL_STRING(&_21$$43, "\""); - ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_12, 229, &typeValues, &_21$$43); + ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_12, 210, &typeValues, &_21$$43); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_23$$43); ZEPHIR_CONCAT_SVS(&_23$$43, "(\"", &_22$$43, "\")"); @@ -1724,13 +1724,13 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listIndexesSql) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 66, &table); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 53, &table); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZEPHIR_CONCAT_SVS(&_1, "SELECT sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ", &_0, " COLLATE NOCASE"); zephir_get_strval(&sql, &_1); if (!(ZEPHIR_IS_EMPTY(&keyName))) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 66, &keyName); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 53, &keyName); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVS(&_3$$3, " AND name = ", &_2$$3, " COLLATE NOCASE"); diff --git a/ext/phalcon/db/enum.zep.c b/ext/phalcon/db/enum.zep.c index e12c380b07c..724d45481d8 100644 --- a/ext/phalcon/db/enum.zep.c +++ b/ext/phalcon/db/enum.zep.c @@ -63,6 +63,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Enum) zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_UNIQUE"), 196608); + zephir_declare_class_constant_long(phalcon_db_enum_ce, SL("FETCH_DEFAULT"), 0); + return SUCCESS; } diff --git a/ext/phalcon/db/profiler.zep.c b/ext/phalcon/db/profiler.zep.c index dc33299c0c5..c27e1b66976 100644 --- a/ext/phalcon/db/profiler.zep.c +++ b/ext/phalcon/db/profiler.zep.c @@ -223,19 +223,19 @@ PHP_METHOD(Phalcon_Db_Profiler, startProfile) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 232, &sqlStatement); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 213, &sqlStatement); zephir_check_call_status(); if (Z_TYPE_P(sqlVariables) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 233, sqlVariables); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 214, sqlVariables); zephir_check_call_status(); } if (Z_TYPE_P(sqlBindTypes) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 234, sqlBindTypes); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 215, sqlBindTypes); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_0, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&_0, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 235, &_0); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 216, &_0); zephir_check_call_status(); if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("beforestartprofile")) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "beforestartprofile", NULL, 0, &activeProfile); @@ -266,7 +266,7 @@ PHP_METHOD(Phalcon_Db_Profiler, stopProfile) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&finalTime, "hrtime", NULL, 216, &__$true); + ZEPHIR_CALL_FUNCTION(&finalTime, "hrtime", NULL, 197, &__$true); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("activeProfile"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&activeProfile, &_0); diff --git a/ext/phalcon/db/result/pdoresult.zep.c b/ext/phalcon/db/result/pdoresult.zep.c index 77108e3d03a..a2b3cf2f079 100644 --- a/ext/phalcon/db/result/pdoresult.zep.c +++ b/ext/phalcon/db/result/pdoresult.zep.c @@ -69,7 +69,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Result_PdoResult) * * @var int */ - zend_declare_property_long(phalcon_db_result_pdoresult_ce, SL("fetchMode"), 5, ZEND_ACC_PROTECTED); + zend_declare_property_long(phalcon_db_result_pdoresult_ce, SL("fetchMode"), 0, ZEND_ACC_PROTECTED); /** * Internal resultset * @@ -168,8 +168,8 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) { long n = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; - zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0, _1$$4, _2$$4; + zephir_fcall_cache_entry *_4 = NULL; + zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0, _1$$4, _2$$4, _3$$6; zend_long number, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -181,6 +181,7 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$4); ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$6); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -222,7 +223,8 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, dataSeek) if (!(n != number)) { break; } - ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_3, 0); + zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_4, 0, &_3$$6); zephir_check_call_status(); n++; } @@ -272,44 +274,55 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, execute) PHP_METHOD(Phalcon_Db_Result_PdoResult, fetch) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, fetchStyle_sub, *cursorOrientation = NULL, cursorOrientation_sub, *cursorOffset = NULL, cursorOffset_sub, __$null, _0; + zval *fetchStyle_param = NULL, *cursorOrientation_param = NULL, *cursorOffset_param = NULL, mode, _0, _1, _2; + zend_long fetchStyle, cursorOrientation, cursorOffset, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&fetchStyle_sub); - ZVAL_UNDEF(&cursorOrientation_sub); - ZVAL_UNDEF(&cursorOffset_sub); - ZVAL_NULL(&__$null); + ZVAL_UNDEF(&mode); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(fetchStyle) - Z_PARAM_ZVAL_OR_NULL(cursorOrientation) - Z_PARAM_ZVAL_OR_NULL(cursorOffset) + Z_PARAM_LONG_OR_NULL(fetchStyle, is_null_true) + Z_PARAM_LONG(cursorOrientation) + Z_PARAM_LONG(cursorOffset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &fetchStyle, &cursorOrientation, &cursorOffset); - if (!fetchStyle) { - fetchStyle = &fetchStyle_sub; - fetchStyle = &__$null; + zephir_fetch_params(1, 0, 3, &fetchStyle_param, &cursorOrientation_param, &cursorOffset_param); + if (!fetchStyle_param) { + fetchStyle = 0; + } else { + fetchStyle = zephir_get_intval(fetchStyle_param); } - if (!cursorOrientation) { - cursorOrientation = &cursorOrientation_sub; - cursorOrientation = &__$null; + if (!cursorOrientation_param) { + cursorOrientation = 0; + } else { + cursorOrientation = zephir_get_intval(cursorOrientation_param); } - if (!cursorOffset) { - cursorOffset = &cursorOffset_sub; - cursorOffset = &__$null; + if (!cursorOffset_param) { + cursorOffset = 0; + } else { + cursorOffset = zephir_get_intval(cursorOffset_param); } + if (1 == 1) { + ZEPHIR_INIT_VAR(&mode); + ZVAL_LONG(&mode, fetchStyle); + } else { + ZEPHIR_OBS_NVAR(&mode); + zephir_read_property(&mode, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC); + } zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, fetchStyle, cursorOrientation, cursorOffset); + ZVAL_LONG(&_1, cursorOrientation); + ZVAL_LONG(&_2, cursorOffset); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, &mode, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -329,67 +342,78 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, fetch) */ PHP_METHOD(Phalcon_Db_Result_PdoResult, fetchAll) { - zend_bool _1; + zend_bool _3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, fetchStyle_sub, *fetchArgument = NULL, fetchArgument_sub, *ctorArgs = NULL, ctorArgs_sub, __$null, pdoStatement, _0; + zval *fetchStyle_param = NULL, *fetchArgument_param = NULL, *ctorArgs_param = NULL, pdoStatement, mode, _0, _1$$3, _2$$3, _4$$4, _5$$4; + zend_long fetchStyle, fetchArgument, ctorArgs, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&fetchStyle_sub); - ZVAL_UNDEF(&fetchArgument_sub); - ZVAL_UNDEF(&ctorArgs_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&pdoStatement); + ZVAL_UNDEF(&mode); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 3) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(fetchStyle) - Z_PARAM_ZVAL_OR_NULL(fetchArgument) - Z_PARAM_ZVAL_OR_NULL(ctorArgs) + Z_PARAM_LONG_OR_NULL(fetchStyle, is_null_true) + Z_PARAM_LONG(fetchArgument) + Z_PARAM_LONG(ctorArgs) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &fetchStyle, &fetchArgument, &ctorArgs); - if (!fetchStyle) { - fetchStyle = &fetchStyle_sub; - fetchStyle = &__$null; + zephir_fetch_params(1, 0, 3, &fetchStyle_param, &fetchArgument_param, &ctorArgs_param); + if (!fetchStyle_param) { + fetchStyle = 0; + } else { + fetchStyle = zephir_get_intval(fetchStyle_param); } - if (!fetchArgument) { - fetchArgument = &fetchArgument_sub; - fetchArgument = &__$null; + if (!fetchArgument_param) { + fetchArgument = 0; + } else { + fetchArgument = zephir_get_intval(fetchArgument_param); } - if (!ctorArgs) { - ctorArgs = &ctorArgs_sub; - ctorArgs = &__$null; + if (!ctorArgs_param) { + ctorArgs = 0; + } else { + ctorArgs = zephir_get_intval(ctorArgs_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&pdoStatement, &_0); - if (Z_TYPE_P(fetchStyle) != IS_LONG) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); + if (1 == 1) { + ZEPHIR_INIT_VAR(&mode); + ZVAL_LONG(&mode, fetchStyle); + } else { + ZEPHIR_OBS_NVAR(&mode); + zephir_read_property(&mode, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC); } - if (ZEPHIR_IS_LONG(fetchStyle, 8)) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs); + if (fetchStyle == 8) { + ZVAL_LONG(&_1$$3, fetchArgument); + ZVAL_LONG(&_2$$3, ctorArgs); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &mode, &_1$$3, &_2$$3); zephir_check_call_status(); RETURN_MM(); } - _1 = ZEPHIR_IS_LONG(fetchStyle, 7); - if (!(_1)) { - _1 = ZEPHIR_IS_LONG(fetchStyle, 10); + _3 = fetchStyle == 7; + if (!(_3)) { + _3 = fetchStyle == 10; } - if (_1) { - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); + if (_3) { + ZVAL_LONG(&_4$$4, fetchStyle); + ZVAL_LONG(&_5$$4, fetchArgument); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &_4$$4, &_5$$4); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle); + ZVAL_LONG(&_0, fetchStyle); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -413,18 +437,20 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, fetchAll) */ PHP_METHOD(Phalcon_Db_Result_PdoResult, fetchArray) { - zval _0; + zval _0, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("pdoStatement"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0); + zephir_read_property(&_1, this_ptr, ZEND_STRL("fetchMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -513,7 +539,7 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, numRows) ZVAL_STRING(&_7$$6, "/^SELECT\\s+(.*)/i"); zephir_preg_match(&_6$$6, &_7$$6, &sqlStatement, &matches, 0, 0 , 0 ); if (zephir_is_true(&_6$$6)) { - zephir_array_fetch_long(&_8$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Result/PdoResult.zep", 309); + zephir_array_fetch_long(&_8$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Db/Result/PdoResult.zep", 311); ZEPHIR_INIT_VAR(&_9$$7); ZEPHIR_CONCAT_SVS(&_9$$7, "SELECT COUNT(*) \"numrows\" FROM (SELECT ", &_8$$7, ")"); zephir_read_property(&_10$$7, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY); @@ -523,7 +549,7 @@ PHP_METHOD(Phalcon_Db_Result_PdoResult, numRows) ZEPHIR_CALL_METHOD(&row, &result, "fetch", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&rowCount); - zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/Db/Result/PdoResult.zep", 315); + zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/Db/Result/PdoResult.zep", 317); } } else { ZEPHIR_INIT_NVAR(&rowCount); diff --git a/ext/phalcon/db/result/pdoresult.zep.h b/ext/phalcon/db/result/pdoresult.zep.h index af7754674f4..56eb8da1bbe 100644 --- a/ext/phalcon/db/result/pdoresult.zep.h +++ b/ext/phalcon/db/result/pdoresult.zep.h @@ -31,15 +31,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdoresult_exec ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetch, 0, 0, 0) - ZEND_ARG_INFO(0, fetchStyle) - ZEND_ARG_INFO(0, cursorOrientation) - ZEND_ARG_INFO(0, cursorOffset) + ZEND_ARG_TYPE_INFO(0, fetchStyle, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, cursorOrientation, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, cursorOffset, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetchall, 0, 0, IS_ARRAY, 0) - ZEND_ARG_INFO(0, fetchStyle) - ZEND_ARG_INFO(0, fetchArgument) - ZEND_ARG_INFO(0, ctorArgs) + ZEND_ARG_TYPE_INFO(0, fetchStyle, IS_LONG, 1) + ZEND_ARG_TYPE_INFO(0, fetchArgument, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, ctorArgs, IS_LONG, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdoresult_fetcharray, 0, 0, 0) diff --git a/ext/phalcon/di/di.zep.c b/ext/phalcon/di/di.zep.c index 593077e0cbc..e239ff61d86 100644 --- a/ext/phalcon/di/di.zep.c +++ b/ext/phalcon/di/di.zep.c @@ -179,7 +179,7 @@ PHP_METHOD(Phalcon_Di_Di, __call) ZVAL_LONG(&_0$$3, 3); ZEPHIR_INIT_VAR(&_1$$3); zephir_substr(&_1$$3, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 104, &_1$$3); + ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 73, &_1$$3); zephir_check_call_status(); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_2$$3, &possibleService)) { @@ -194,7 +194,7 @@ PHP_METHOD(Phalcon_Di_Di, __call) ZVAL_LONG(&_3$$6, 3); ZEPHIR_INIT_VAR(&_4$$6); zephir_substr(&_4$$6, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_5$$6, "lcfirst", NULL, 104, &_4$$6); + ZEPHIR_CALL_FUNCTION(&_5$$6, "lcfirst", NULL, 73, &_4$$6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &_5$$6, &definition); zephir_check_call_status(); @@ -205,9 +205,9 @@ PHP_METHOD(Phalcon_Di_Di, __call) object_init_ex(&_6, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_7); ZEPHIR_CONCAT_SVS(&_7, "Call to undefined method or service '", &method, "'"); - ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 31, &_7); + ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 29, &_7); zephir_check_call_status(); - zephir_throw_exception_debug(&_6, "phalcon/Di/Di.zep", 146); + zephir_throw_exception_debug(&_6, "phalcon/Di/Di.zep", 147); ZEPHIR_MM_RESTORE(); return; } @@ -273,11 +273,11 @@ PHP_METHOD(Phalcon_Di_Di, attempt) } else { ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 105, definition, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 74, definition, &_2); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_1); zephir_read_property(&_3, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 162); + zephir_array_fetch(&_4, &_3, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 163); RETURN_CTOR(&_4); } @@ -286,11 +286,11 @@ PHP_METHOD(Phalcon_Di_Di, attempt) */ PHP_METHOD(Phalcon_Di_Di, get) { - zval _6$$5, _15$$17; + zval _6$$5, _15$$18; zend_bool _1$$3, _14$$11; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, eventsManager, isShared, instance, _0, _5, _2$$3, _3$$4, _4$$4, _7$$5, _8$$7, _9$$7, _10$$9, _12$$12, _16$$17; + zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, eventsManager, isShared, instance, _0, _5, _2$$3, _3$$4, _4$$4, _7$$5, _8$$7, _9$$7, _10$$9, _12$$12, _16$$18; zval name, _11$$9, _13$$12; zval *this_ptr = getThis(); @@ -313,9 +313,9 @@ PHP_METHOD(Phalcon_Di_Di, get) ZVAL_UNDEF(&_9$$7); ZVAL_UNDEF(&_10$$9); ZVAL_UNDEF(&_12$$12); - ZVAL_UNDEF(&_16$$17); + ZVAL_UNDEF(&_16$$18); ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_15$$18); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -357,7 +357,7 @@ PHP_METHOD(Phalcon_Di_Di, get) } if (_1$$3) { zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("sharedInstances"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_4$$4, &_3$$4, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 180); + zephir_array_fetch(&_4$$4, &_3$$4, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 181); RETURN_CTOR(&_4$$4); } } @@ -395,9 +395,9 @@ PHP_METHOD(Phalcon_Di_Di, get) object_init_ex(&_10$$9, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_11$$9); ZEPHIR_CONCAT_SVS(&_11$$9, "Service '", &name, "' cannot be resolved"); - ZEPHIR_CALL_METHOD(NULL, &_10$$9, "__construct", NULL, 31, &_11$$9); + ZEPHIR_CALL_METHOD(NULL, &_10$$9, "__construct", NULL, 29, &_11$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_10$$9, "phalcon/Di/Di.zep", 209); + zephir_throw_exception_debug(&_10$$9, "phalcon/Di/Di.zep", 210); ZEPHIR_MM_RESTORE(); return; } @@ -411,9 +411,9 @@ PHP_METHOD(Phalcon_Di_Di, get) object_init_ex(&_12$$12, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_13$$12); ZEPHIR_CONCAT_SVS(&_13$$12, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", NULL, 31, &_13$$12); + ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", NULL, 29, &_13$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$12, "phalcon/Di/Di.zep", 224); + zephir_throw_exception_debug(&_12$$12, "phalcon/Di/Di.zep", 225); ZEPHIR_MM_RESTORE(); return; } @@ -437,16 +437,20 @@ PHP_METHOD(Phalcon_Di_Di, get) ZEPHIR_CALL_METHOD(NULL, &instance, "setdi", NULL, 0, this_ptr); zephir_check_call_status(); } + if (zephir_instance_of_ev(&instance, phalcon_di_initializationawareinterface_ce)) { + ZEPHIR_CALL_METHOD(NULL, &instance, "initialize", NULL, 0); + zephir_check_call_status(); + } } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_15$$17); - zephir_create_array(&_15$$17, 3, 0); - zephir_array_update_string(&_15$$17, SL("name"), &name, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$17, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$17, SL("instance"), &instance, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(&_16$$17); - ZVAL_STRING(&_16$$17, "di:afterServiceResolve"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_16$$17, this_ptr, &_15$$17); + ZEPHIR_INIT_VAR(&_15$$18); + zephir_create_array(&_15$$18, 3, 0); + zephir_array_update_string(&_15$$18, SL("name"), &name, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_15$$18, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_15$$18, SL("instance"), &instance, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_16$$18); + ZVAL_STRING(&_16$$18, "di:afterServiceResolve"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_16$$18, this_ptr, &_15$$18); zephir_check_call_status(); } RETURN_CCTOR(&instance); @@ -524,9 +528,9 @@ PHP_METHOD(Phalcon_Di_Di, getRaw) object_init_ex(&_1$$3, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 290); + zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 295); ZEPHIR_MM_RESTORE(); return; } @@ -579,9 +583,9 @@ PHP_METHOD(Phalcon_Di_Di, getService) object_init_ex(&_1$$3, phalcon_di_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Service '", &name, "' was not found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 306); + zephir_throw_exception_debug(&_1$$3, "phalcon/Di/Di.zep", 311); ZEPHIR_MM_RESTORE(); return; } @@ -691,7 +695,7 @@ PHP_METHOD(Phalcon_Di_Di, loadFromConfig) ZEPHIR_CALL_METHOD(&services, config, "toarray", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&services, 0, "phalcon/Di/Di.zep", 356); + zephir_is_iterable(&services, 0, "phalcon/Di/Di.zep", 361); if (Z_TYPE_P(&services) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&services), _2, _3, _0) { @@ -706,7 +710,7 @@ PHP_METHOD(Phalcon_Di_Di, loadFromConfig) _4$$3 = zephir_array_isset_string(&service, SL("shared")); if (_4$$3) { ZEPHIR_OBS_NVAR(&_5$$3); - zephir_array_fetch_string(&_5$$3, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 354); + zephir_array_fetch_string(&_5$$3, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 359); _4$$3 = zephir_is_true(&_5$$3); } ZVAL_BOOL(&_6$$3, _4$$3); @@ -729,7 +733,7 @@ PHP_METHOD(Phalcon_Di_Di, loadFromConfig) _8$$4 = zephir_array_isset_string(&service, SL("shared")); if (_8$$4) { ZEPHIR_OBS_NVAR(&_9$$4); - zephir_array_fetch_string(&_9$$4, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 354); + zephir_array_fetch_string(&_9$$4, &service, SL("shared"), PH_NOISY, "phalcon/Di/Di.zep", 359); _8$$4 = zephir_is_true(&_9$$4); } ZVAL_BOOL(&_10$$4, _8$$4); @@ -809,7 +813,7 @@ PHP_METHOD(Phalcon_Di_Di, loadFromPhp) ZEPHIR_INIT_VAR(&services); object_init_ex(&services, phalcon_config_adapter_php_ce); - ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 106, &filePath); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 75, &filePath); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); @@ -891,7 +895,7 @@ PHP_METHOD(Phalcon_Di_Di, loadFromYaml) ZEPHIR_INIT_VAR(&services); object_init_ex(&services, phalcon_config_adapter_yaml_ce); - ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 107, &filePath, &callbacks); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 76, &filePath, &callbacks); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); @@ -946,7 +950,8 @@ PHP_METHOD(Phalcon_Di_Di, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -974,7 +979,8 @@ PHP_METHOD(Phalcon_Di_Di, offsetExists) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -1006,7 +1012,8 @@ PHP_METHOD(Phalcon_Di_Di, offsetSet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *definition, definition_sub; + zval name_sub, definition_sub; + zval *name, *definition; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -1036,7 +1043,8 @@ PHP_METHOD(Phalcon_Di_Di, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub; + zval name_sub; + zval *name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); @@ -1219,11 +1227,11 @@ PHP_METHOD(Phalcon_Di_Di, set) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 105, definition, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 74, definition, &_1); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_0); zephir_read_property(&_2, this_ptr, ZEND_STRL("services"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 547); + zephir_array_fetch(&_3, &_2, &name, PH_NOISY | PH_READONLY, "phalcon/Di/Di.zep", 552); RETURN_CTOR(&_3); } diff --git a/ext/phalcon/di/di.zep.h b/ext/phalcon/di/di.zep.h index 33f3042c063..40be02f13f3 100644 --- a/ext/phalcon/di/di.zep.h +++ b/ext/phalcon/di/di.zep.h @@ -100,7 +100,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_has, 0, 1, _IS_BOO ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_di_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/di/factorydefault.zep.c b/ext/phalcon/di/factorydefault.zep.c index 86942877a86..e500047d4c4 100644 --- a/ext/phalcon/di/factorydefault.zep.c +++ b/ext/phalcon/di/factorydefault.zep.c @@ -81,7 +81,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Annotations\\Adapter\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -98,7 +98,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) zephir_array_fast_append(&_6, &_7); zephir_array_update_string(&_5, SL("arguments"), &_6, PH_COPY | PH_SEPARATE); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_5, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_5, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("assets"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -106,7 +106,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Crypt"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("crypt"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -114,7 +114,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Response\\Cookies"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("cookies"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -122,7 +122,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Dispatcher"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -130,7 +130,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Html\\Escaper"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -138,7 +138,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Events\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -146,7 +146,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Flash\\Direct"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flash"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -154,15 +154,15 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Flash\\Session"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flashSession"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); object_init_ex(&_2, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(&_8, &filter, "newinstance", NULL, 120); + ZEPHIR_CALL_METHOD(&_8, &filter, "newinstance", NULL, 89); zephir_check_call_status(); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_8, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_8, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -170,7 +170,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Support\\HelperFactory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("helper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -178,7 +178,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -186,7 +186,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -194,7 +194,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Request"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("request"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -202,7 +202,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Http\\Response"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("response"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -210,7 +210,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Router"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -218,7 +218,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Security"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -235,7 +235,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) zephir_array_fast_append(&_7, &_9); zephir_array_update_string(&_6, SL("arguments"), &_7, PH_COPY | PH_SEPARATE); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_6, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_6, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("tag"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -243,7 +243,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -251,7 +251,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Url"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("url"), &_2, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_1); diff --git a/ext/phalcon/di/factorydefault/cli.zep.c b/ext/phalcon/di/factorydefault/cli.zep.c index e144f26a2bf..bb65f4c1f65 100644 --- a/ext/phalcon/di/factorydefault/cli.zep.c +++ b/ext/phalcon/di/factorydefault/cli.zep.c @@ -79,7 +79,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Annotations\\Adapter\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -87,7 +87,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Cli\\Dispatcher"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -95,7 +95,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Html\\Escaper"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -103,15 +103,15 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Events\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); object_init_ex(&_2, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(&_5, &filter, "newinstance", NULL, 120); + ZEPHIR_CALL_METHOD(&_5, &filter, "newinstance", NULL, 89); zephir_check_call_status(); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_5, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_5, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -119,7 +119,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Support\\HelperFactory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("helper"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -127,7 +127,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -135,7 +135,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -143,7 +143,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Cli\\Router"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -151,7 +151,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Encryption\\Security"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_2); @@ -159,7 +159,7 @@ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); ZVAL_BOOL(&_4, 1); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 105, &_3, &_4); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 74, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); zephir_update_property_zval(this_ptr, ZEND_STRL("services"), &_1); diff --git a/ext/phalcon/di/initializationawareinterface.zep.c b/ext/phalcon/di/initializationawareinterface.zep.c new file mode 100644 index 00000000000..fbc3b32f2e0 --- /dev/null +++ b/ext/phalcon/di/initializationawareinterface.zep.c @@ -0,0 +1,22 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include + +#include "kernel/main.h" + + +ZEPHIR_INIT_CLASS(Phalcon_Di_InitializationAwareInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Di, InitializationAwareInterface, phalcon, di_initializationawareinterface, phalcon_di_initializationawareinterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Di_InitializationAwareInterface, initialize); diff --git a/ext/phalcon/di/initializationawareinterface.zep.h b/ext/phalcon/di/initializationawareinterface.zep.h new file mode 100644 index 00000000000..6fe4403b2c3 --- /dev/null +++ b/ext/phalcon/di/initializationawareinterface.zep.h @@ -0,0 +1,12 @@ + +extern zend_class_entry *phalcon_di_initializationawareinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Di_InitializationAwareInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_initializationawareinterface_initialize, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_di_initializationawareinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Di_InitializationAwareInterface, initialize, arginfo_phalcon_di_initializationawareinterface_initialize) + PHP_FE_END +}; diff --git a/ext/phalcon/di/injectable.zep.c b/ext/phalcon/di/injectable.zep.c index 23a96961fa8..375131de487 100644 --- a/ext/phalcon/di/injectable.zep.c +++ b/ext/phalcon/di/injectable.zep.c @@ -40,14 +40,14 @@ * @property \Phalcon\Http\Request|\Phalcon\Http\RequestInterface $request * @property \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface $response * @property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies - * @property \Phalcon\Filter $filter + * @property \Phalcon\Filter\Filter $filter * @property \Phalcon\Flash\Direct $flash * @property \Phalcon\Flash\Session $flashSession * @property \Phalcon\Session\ManagerInterface $session * @property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager * @property \Phalcon\Db\Adapter\AdapterInterface $db - * @property \Phalcon\Security $security - * @property \Phalcon\Crypt\Crypt|\Phalcon\Crypt\CryptInterface $crypt + * @property \Phalcon\Encryption\Security $security + * @property \Phalcon\Encryption\Crypt|\Phalcon\Encryption\Crypt\CryptInterface $crypt * @property \Phalcon\Tag $tag * @property \Phalcon\Html\Escaper|\Phalcon\Html\Escaper\EscaperInterface $escaper * @property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations diff --git a/ext/phalcon/di/service.zep.c b/ext/phalcon/di/service.zep.c index 0fe1300185c..497fd329257 100644 --- a/ext/phalcon/di/service.zep.c +++ b/ext/phalcon/di/service.zep.c @@ -298,7 +298,7 @@ PHP_METHOD(Phalcon_Di_Service, resolve) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 236, container, &definition, parameters); + ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 217, container, &definition, parameters); zephir_check_call_status(); } else { found = 0; @@ -308,7 +308,7 @@ PHP_METHOD(Phalcon_Di_Service, resolve) if (UNEXPECTED(found == 0)) { ZEPHIR_INIT_VAR(&_5$$21); object_init_ex(&_5$$21, phalcon_di_exception_serviceresolutionexception_ce); - ZEPHIR_CALL_METHOD(NULL, &_5$$21, "__construct", NULL, 31); + ZEPHIR_CALL_METHOD(NULL, &_5$$21, "__construct", NULL, 29); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$21, "phalcon/Di/Service.zep", 205); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/di/service/builder.zep.c b/ext/phalcon/di/service/builder.zep.c index db87be759a9..feed512bca5 100644 --- a/ext/phalcon/di/service/builder.zep.c +++ b/ext/phalcon/di/service/builder.zep.c @@ -152,7 +152,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) } else { ZEPHIR_OBS_VAR(&arguments); if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 0)) { - ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&instance); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, &_0$$8); @@ -190,7 +190,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_5$$14, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_6$$14); ZEPHIR_CONCAT_SV(&_6$$14, "Method call must be an array on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_7, 31, &_6$$14); + ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_7, 29, &_6$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$14, "phalcon/Di/Service/Builder.zep", 103); ZEPHIR_MM_RESTORE(); @@ -202,7 +202,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_8$$15, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_9$$15); ZEPHIR_CONCAT_SV(&_9$$15, "The method name is required on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_8$$15, "__construct", &_7, 31, &_9$$15); + ZEPHIR_CALL_METHOD(NULL, &_8$$15, "__construct", &_7, 29, &_9$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$15, "phalcon/Di/Service/Builder.zep", 112); ZEPHIR_MM_RESTORE(); @@ -220,7 +220,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) zephir_cast_to_string(&_11$$17, &methodPosition); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SV(&_12$$17, "Call arguments must be an array on position ", &_11$$17); - ZEPHIR_CALL_METHOD(NULL, &_10$$17, "__construct", &_7, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_10$$17, "__construct", &_7, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$17, "phalcon/Di/Service/Builder.zep", 125); ZEPHIR_MM_RESTORE(); @@ -228,7 +228,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) } if (zephir_fast_count_int(&arguments)) { ZEPHIR_INIT_NVAR(&_13$$18); - ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_CALL_USER_FUNC_ARRAY(&_13$$18, &methodCall, &_14$$18); zephir_check_call_status(); @@ -257,7 +257,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_16$$20, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_17$$20); ZEPHIR_CONCAT_SV(&_17$$20, "Method call must be an array on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_16$$20, "__construct", &_7, 31, &_17$$20); + ZEPHIR_CALL_METHOD(NULL, &_16$$20, "__construct", &_7, 29, &_17$$20); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$20, "phalcon/Di/Service/Builder.zep", 103); ZEPHIR_MM_RESTORE(); @@ -269,7 +269,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_18$$21, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_19$$21); ZEPHIR_CONCAT_SV(&_19$$21, "The method name is required on position ", &methodPosition); - ZEPHIR_CALL_METHOD(NULL, &_18$$21, "__construct", &_7, 31, &_19$$21); + ZEPHIR_CALL_METHOD(NULL, &_18$$21, "__construct", &_7, 29, &_19$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$21, "phalcon/Di/Service/Builder.zep", 112); ZEPHIR_MM_RESTORE(); @@ -288,7 +288,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) zephir_cast_to_string(&_22$$23, &methodPosition); ZEPHIR_INIT_NVAR(&_23$$23); ZEPHIR_CONCAT_SV(&_23$$23, "Call arguments must be an array on position ", &_22$$23); - ZEPHIR_CALL_METHOD(NULL, &_21$$23, "__construct", &_7, 31, &_23$$23); + ZEPHIR_CALL_METHOD(NULL, &_21$$23, "__construct", &_7, 29, &_23$$23); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$23, "phalcon/Di/Service/Builder.zep", 125); ZEPHIR_MM_RESTORE(); @@ -296,7 +296,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) } if (zephir_fast_count_int(&arguments)) { ZEPHIR_INIT_NVAR(&_24$$24); - ZEPHIR_CALL_METHOD(&_25$$24, this_ptr, "buildparameters", NULL, 237, container, &arguments); + ZEPHIR_CALL_METHOD(&_25$$24, this_ptr, "buildparameters", NULL, 218, container, &arguments); zephir_check_call_status(); ZEPHIR_CALL_USER_FUNC_ARRAY(&_24$$24, &methodCall, &_25$$24); zephir_check_call_status(); @@ -340,7 +340,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_31$$29, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_32$$29); ZEPHIR_CONCAT_SV(&_32$$29, "Property must be an array on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_31$$29, "__construct", &_7, 31, &_32$$29); + ZEPHIR_CALL_METHOD(NULL, &_31$$29, "__construct", &_7, 29, &_32$$29); zephir_check_call_status(); zephir_throw_exception_debug(&_31$$29, "phalcon/Di/Service/Builder.zep", 179); ZEPHIR_MM_RESTORE(); @@ -352,7 +352,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_33$$30, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_34$$30); ZEPHIR_CONCAT_SV(&_34$$30, "The property name is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_33$$30, "__construct", &_7, 31, &_34$$30); + ZEPHIR_CALL_METHOD(NULL, &_33$$30, "__construct", &_7, 29, &_34$$30); zephir_check_call_status(); zephir_throw_exception_debug(&_33$$30, "phalcon/Di/Service/Builder.zep", 188); ZEPHIR_MM_RESTORE(); @@ -364,13 +364,13 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_35$$31, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_36$$31); ZEPHIR_CONCAT_SV(&_36$$31, "The property value is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_35$$31, "__construct", &_7, 31, &_36$$31); + ZEPHIR_CALL_METHOD(NULL, &_35$$31, "__construct", &_7, 29, &_36$$31); zephir_check_call_status(); zephir_throw_exception_debug(&_35$$31, "phalcon/Di/Service/Builder.zep", 197); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_37$$28, this_ptr, "buildparameter", &_38, 238, container, &propertyPosition, &propertyValue); + ZEPHIR_CALL_METHOD(&_37$$28, this_ptr, "buildparameter", &_38, 219, container, &propertyPosition, &propertyValue); zephir_check_call_status(); zephir_update_property_zval_zval(&instance, &propertyName, &_37$$28); } ZEND_HASH_FOREACH_END(); @@ -392,7 +392,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_39$$33, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_40$$33); ZEPHIR_CONCAT_SV(&_40$$33, "Property must be an array on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_39$$33, "__construct", &_7, 31, &_40$$33); + ZEPHIR_CALL_METHOD(NULL, &_39$$33, "__construct", &_7, 29, &_40$$33); zephir_check_call_status(); zephir_throw_exception_debug(&_39$$33, "phalcon/Di/Service/Builder.zep", 179); ZEPHIR_MM_RESTORE(); @@ -404,7 +404,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_41$$34, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_42$$34); ZEPHIR_CONCAT_SV(&_42$$34, "The property name is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_7, 31, &_42$$34); + ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_7, 29, &_42$$34); zephir_check_call_status(); zephir_throw_exception_debug(&_41$$34, "phalcon/Di/Service/Builder.zep", 188); ZEPHIR_MM_RESTORE(); @@ -416,13 +416,13 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build) object_init_ex(&_43$$35, phalcon_di_exception_ce); ZEPHIR_INIT_NVAR(&_44$$35); ZEPHIR_CONCAT_SV(&_44$$35, "The property value is required on position ", &propertyPosition); - ZEPHIR_CALL_METHOD(NULL, &_43$$35, "__construct", &_7, 31, &_44$$35); + ZEPHIR_CALL_METHOD(NULL, &_43$$35, "__construct", &_7, 29, &_44$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_43$$35, "phalcon/Di/Service/Builder.zep", 197); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_45$$32, this_ptr, "buildparameter", &_38, 238, container, &propertyPosition, &propertyValue); + ZEPHIR_CALL_METHOD(&_45$$32, this_ptr, "buildparameter", &_38, 219, container, &propertyPosition, &propertyValue); zephir_check_call_status(); zephir_update_property_zval_zval(&instance, &propertyName, &_45$$32); ZEPHIR_CALL_METHOD(NULL, ¶mCalls, "next", NULL, 0); @@ -494,7 +494,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_1$$3, position); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Argument at position ", &_1$$3, " must have a type"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Di/Service/Builder.zep", 229); ZEPHIR_MM_RESTORE(); @@ -510,7 +510,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_4$$5, position); ZEPHIR_INIT_VAR(&_5$$5); ZEPHIR_CONCAT_SV(&_5$$5, "Service 'name' is required in parameter on position ", &_4$$5); - ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 31, &_5$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 29, &_5$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$5, "phalcon/Di/Service/Builder.zep", 242); ZEPHIR_MM_RESTORE(); @@ -533,7 +533,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_7$$8, position); ZEPHIR_INIT_VAR(&_8$$8); ZEPHIR_CONCAT_SV(&_8$$8, "Service 'value' is required in parameter on position ", &_7$$8); - ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 31, &_8$$8); + ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 29, &_8$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$8, "phalcon/Di/Service/Builder.zep", 260); ZEPHIR_MM_RESTORE(); @@ -550,7 +550,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_10$$10, position); ZEPHIR_INIT_VAR(&_11$$10); ZEPHIR_CONCAT_SV(&_11$$10, "Service 'className' is required in parameter on position ", &_10$$10); - ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 31, &_11$$10); + ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 29, &_11$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$10, "phalcon/Di/Service/Builder.zep", 273); ZEPHIR_MM_RESTORE(); @@ -576,7 +576,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameter) ZVAL_LONG(&_13$$13, position); ZEPHIR_INIT_VAR(&_14$$13); ZEPHIR_CONCAT_SV(&_14$$13, "Unknown service type in parameter on position ", &_13$$13); - ZEPHIR_CALL_METHOD(NULL, &_12$$13, "__construct", NULL, 31, &_14$$13); + ZEPHIR_CALL_METHOD(NULL, &_12$$13, "__construct", NULL, 29, &_14$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$13, "phalcon/Di/Service/Builder.zep", 301); ZEPHIR_MM_RESTORE(); @@ -636,7 +636,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameters) } ZEPHIR_INIT_NVAR(&argument); ZVAL_COPY(&argument, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "buildparameter", &_5, 238, container, &position, &argument); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "buildparameter", &_5, 219, container, &position, &argument); zephir_check_call_status(); zephir_array_append(&buildArguments, &_4$$3, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 320); } ZEND_HASH_FOREACH_END(); @@ -653,7 +653,7 @@ PHP_METHOD(Phalcon_Di_Service_Builder, buildParameters) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "buildparameter", &_5, 238, container, &position, &argument); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "buildparameter", &_5, 219, container, &position, &argument); zephir_check_call_status(); zephir_array_append(&buildArguments, &_6$$4, PH_SEPARATE, "phalcon/Di/Service/Builder.zep", 320); ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0); diff --git a/ext/phalcon/dispatcher/abstractdispatcher.zep.c b/ext/phalcon/dispatcher/abstractdispatcher.zep.c index dbf47ec34d2..20d68affb47 100644 --- a/ext/phalcon/dispatcher/abstractdispatcher.zep.c +++ b/ext/phalcon/dispatcher/abstractdispatcher.zep.c @@ -487,7 +487,7 @@ PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, dispatch) } break; } - ZEPHIR_CALL_FUNCTION(&handlerHash, "spl_object_hash", &_35, 108, &handler); + ZEPHIR_CALL_FUNCTION(&handlerHash, "spl_object_hash", &_35, 77, &handler); zephir_check_call_status(); zephir_read_property(&_36$$10, this_ptr, ZEND_STRL("handlerHashes"), PH_NOISY_CC | PH_READONLY); isNewHandler = !((zephir_array_isset(&_36$$10, &handlerHash))); @@ -1093,7 +1093,7 @@ PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, getActiveMethod) zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "tocamelcase", NULL, 0, &_3$$3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&activeMethodName, "lcfirst", NULL, 104, &_2$$3); + ZEPHIR_CALL_FUNCTION(&activeMethodName, "lcfirst", NULL, 73, &_2$$3); zephir_check_call_status(); ZEPHIR_OBS_VAR(&_4$$3); zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("actionName"), PH_NOISY_CC); @@ -1849,11 +1849,11 @@ PHP_METHOD(Phalcon_Dispatcher_AbstractDispatcher, toCamelCase) if (!(zephir_array_isset_fetch(&camelCaseInput, &_0, &input, 0))) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "/[_-]+/"); - ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_split", NULL, 98, &_1$$3, &input); + ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_split", NULL, 67, &_1$$3, &input); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, "ucfirst"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "array_map", NULL, 97, &_1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "array_map", NULL, 66, &_1$$3, &_2$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&camelCaseInput); zephir_fast_join_str(&camelCaseInput, SL(""), &_3$$3); diff --git a/ext/phalcon/encryption/crypt.zep.c b/ext/phalcon/encryption/crypt.zep.c index 564146922ad..e055a2ca67f 100644 --- a/ext/phalcon/encryption/crypt.zep.c +++ b/ext/phalcon/encryption/crypt.zep.c @@ -194,7 +194,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, __construct) if (Z_TYPE_P(padFactory) == IS_NULL) { ZEPHIR_INIT_NVAR(padFactory); object_init_ex(padFactory, phalcon_encryption_crypt_padfactory_ce); - ZEPHIR_CALL_METHOD(NULL, padFactory, "__construct", NULL, 239); + ZEPHIR_CALL_METHOD(NULL, padFactory, "__construct", NULL, 220); zephir_check_call_status(); } zephir_update_property_zval(this_ptr, ZEND_STRL("padFactory"), padFactory); @@ -303,14 +303,14 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) ZVAL_STRING(&_1, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 240); + ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 221); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 241, &mode); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 222, &mode); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "8bit"); - ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 242, &input, &_0, &ivLength, &_1); + ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 223, &input, &_0, &ivLength, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&digest); ZVAL_STRING(&digest, ""); @@ -320,24 +320,24 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, ""); - ZEPHIR_CALL_FUNCTION(&_3$$5, "hash", NULL, 99, &hashAlgorithm, &_2$$5, &__$true); + ZEPHIR_CALL_FUNCTION(&_3$$5, "hash", NULL, 68, &hashAlgorithm, &_2$$5, &__$true); zephir_check_call_status(); ZEPHIR_INIT_VAR(&hashLength); ZVAL_LONG(&hashLength, zephir_fast_strlen_ev(&_3$$5)); ZEPHIR_INIT_NVAR(&_2$$5); ZVAL_STRING(&_2$$5, "8bit"); - ZEPHIR_CALL_FUNCTION(&digest, "mb_substr", NULL, 242, &input, &ivLength, &hashLength, &_2$$5); + ZEPHIR_CALL_FUNCTION(&digest, "mb_substr", NULL, 223, &input, &ivLength, &hashLength, &_2$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4$$5); zephir_add_function(&_4$$5, &ivLength, &hashLength); ZEPHIR_INIT_NVAR(&_2$$5); ZVAL_STRING(&_2$$5, "8bit"); - ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 242, &input, &_4$$5, &__$null, &_2$$5); + ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 223, &input, &_4$$5, &__$null, &_2$$5); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_5$$6); ZVAL_STRING(&_5$$6, "8bit"); - ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 242, &input, &ivLength, &__$null, &_5$$6); + ZEPHIR_CALL_FUNCTION(&cipherText, "mb_substr", NULL, 223, &input, &ivLength, &__$null, &_5$$6); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&decrypted, this_ptr, "decryptgcmccmauth", NULL, 0, &mode, &cipherText, &decryptKey, &iv); @@ -348,7 +348,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decrypt) ZEPHIR_CPY_WRT(&decrypted, &_6); zephir_read_property(&_7, this_ptr, ZEND_STRL("useSigning"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7)) { - ZEPHIR_CALL_FUNCTION(&_8$$7, "hash_hmac", NULL, 243, &hashAlgorithm, &padded, &decryptKey, &__$true); + ZEPHIR_CALL_FUNCTION(&_8$$7, "hash_hmac", NULL, 224, &hashAlgorithm, &padded, &decryptKey, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_IDENTICAL(&digest, &_8$$7)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_mismatch_ce, "Hash does not match.", "phalcon/Encryption/Crypt.zep", 224); @@ -428,7 +428,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decryptBase64) ZEPHIR_CONCAT_VV(&_4$$3, &_2$$3, &_1$$3); zephir_get_strval(&input, &_4$$3); } - ZEPHIR_CALL_FUNCTION(&_5, "base64_decode", NULL, 244, &input); + ZEPHIR_CALL_FUNCTION(&_5, "base64_decode", NULL, 225, &input); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, &_5, &key); zephir_check_call_status(); @@ -511,9 +511,9 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encrypt) ZVAL_STRING(&_1, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 240); + ZEPHIR_CALL_METHOD(&mode, this_ptr, "getmode", NULL, 221); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 241, &mode); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getblocksize", NULL, 222, &mode); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&iv, this_ptr, "phpopensslrandompseudobytes", NULL, 0, &ivLength); zephir_check_call_status(); @@ -529,7 +529,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encrypt) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(&_2$$6, this_ptr, "gethashalgorithm", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&digest, "hash_hmac", NULL, 243, &_2$$6, &padded, &encryptKey, &__$true); + ZEPHIR_CALL_FUNCTION(&digest, "hash_hmac", NULL, 224, &_2$$6, &padded, &encryptKey, &__$true); zephir_check_call_status(); ZEPHIR_CONCAT_VVV(return_value, &iv, &digest, &encrypted); RETURN_MM(); @@ -594,7 +594,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encryptBase64) if (safe) { ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "encrypt", NULL, 0, &input, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 245, &_0$$3); + ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 226, &_0$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "+/"); @@ -609,7 +609,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encryptBase64) } ZEPHIR_CALL_METHOD(&_5, this_ptr, "encrypt", NULL, 0, &input, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_5); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_5); zephir_check_call_status(); RETURN_MM(); } @@ -693,11 +693,11 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getAvailableHashAlgorithms) ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfunctionexists", NULL, 0, &_1); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac_algos", NULL, 246); + ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac_algos", NULL, 227); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_FUNCTION("hash_algos", NULL, 247); + ZEPHIR_RETURN_CALL_FUNCTION("hash_algos", NULL, 228); zephir_check_call_status(); RETURN_MM(); } @@ -744,6 +744,50 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getKey) RETURN_MEMBER(getThis(), "key"); } +/** + * Returns if the input length for decryption is valid or not + * (number of bytes required by the cipher). + * + * @param string $input + * + * @return bool + */ +PHP_METHOD(Phalcon_Encryption_Crypt, isValidDecryptLength) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *input_param = NULL, length, _0, _1; + zval input; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&input); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(input) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &input_param); + zephir_get_strval(&input, input_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&length, this_ptr, "phpopensslcipherivlength", NULL, 0, &_0); + zephir_check_call_status(); + if (ZEPHIR_IS_FALSE_IDENTICAL(&length)) { + RETURN_MM_BOOL(0); + } + ZEPHIR_CALL_FUNCTION(&_1, "mb_strlen", NULL, 229, &input); + zephir_check_call_status(); + RETURN_MM_BOOL(ZEPHIR_LE(&length, &_1)); +} + /** * @param string $data * @@ -870,7 +914,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, setCipher) ZVAL_STRING(&_0, "cipher"); ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcipherhashisavailable", NULL, 0, &cipher, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getivlength", NULL, 248, &cipher); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getivlength", NULL, 230, &cipher); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("ivLength"), &_1); zephir_update_property_zval(this_ptr, ZEND_STRL("cipher"), &cipher); @@ -1084,11 +1128,11 @@ PHP_METHOD(Phalcon_Encryption_Crypt, checkCipherHashIsAvailable) object_init_ex(&_1$$5, phalcon_encryption_crypt_exception_exception_ce); ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, "The %s algorithm '%s' is not supported on this system."); - ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 140, &_2$$5, &type, &cipher); + ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 112, &_2$$5, &type, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 31, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 29, &_3$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$5, "phalcon/Encryption/Crypt.zep", 587); + zephir_throw_exception_debug(&_1$$5, "phalcon/Encryption/Crypt.zep", 608); ZEPHIR_MM_RESTORE(); return; } @@ -1161,10 +1205,10 @@ PHP_METHOD(Phalcon_Encryption_Crypt, cryptPadText) ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "ecb"); zephir_array_fast_append(&_1, &_2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 249, &_1, &mode); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 231, &_1, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_CALL_FUNCTION(&_3$$3, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&_3$$3, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); paddingSize = (blockSize - zephir_safe_mod_zval_long(&_3$$3, blockSize)); _4$$3 = paddingSize >= 256; @@ -1172,7 +1216,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, cryptPadText) _4$$3 = paddingSize < 0; } if (_4$$3) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Padding size cannot be less than 0 or greater than 256", "phalcon/Encryption/Crypt.zep", 620); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Padding size cannot be less than 0 or greater than 256", "phalcon/Encryption/Crypt.zep", 641); return; } zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("padFactory"), PH_NOISY_CC | PH_READONLY); @@ -1272,7 +1316,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, cryptUnpadText) ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "ecb"); zephir_array_fast_append(&_3, &_4); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 249, &_3, &mode); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 231, &_3, &mode); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2); } @@ -1357,7 +1401,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decryptGetUnpadded) ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "ecb"); zephir_array_fast_append(&_1, &_2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 249, &_1, &mode); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "checkismode", NULL, 231, &_1, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("padding"), PH_NOISY_CC | PH_READONLY); @@ -1434,7 +1478,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decryptGcmCcmAuth) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "gcm"); zephir_array_fast_append(&_2, &_3); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 249, &_2, &mode); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 231, &_2, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authData"), PH_NOISY_CC | PH_READONLY); @@ -1449,15 +1493,15 @@ PHP_METHOD(Phalcon_Encryption_Crypt, decryptGcmCcmAuth) ZEPHIR_INIT_VAR(&encrypted); zephir_fast_str_replace(&encrypted, &authTag, &_5$$3, &cipherText); ZVAL_LONG(&_4$$3, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 251, &encrypted, &cipher, &decryptKey, &_4$$3, &iv, &authTag, &authData); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 232, &encrypted, &cipher, &decryptKey, &_4$$3, &iv, &authTag, &authData); zephir_check_call_status(); } else { ZVAL_LONG(&_6$$4, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 251, &cipherText, &cipher, &decryptKey, &_6$$4, &iv); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 232, &cipherText, &cipher, &decryptKey, &_6$$4, &iv); zephir_check_call_status(); } if (ZEPHIR_IS_FALSE_IDENTICAL(&decrypted)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not decrypt data", "phalcon/Encryption/Crypt.zep", 761); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not decrypt data", "phalcon/Encryption/Crypt.zep", 782); return; } RETURN_CCTOR(&decrypted); @@ -1517,7 +1561,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encryptGetPadded) ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "ecb"); zephir_array_fast_append(&_3, &_4); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 249, &_3, &mode); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "checkismode", NULL, 231, &_3, &mode); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_2); } @@ -1595,13 +1639,13 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encryptGcmCcm) ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "gcm"); zephir_array_fast_append(&_2, &_3); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 249, &_2, &mode); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "checkismode", NULL, 231, &_2, &mode); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&authData, &_4$$3); if (1 == ZEPHIR_IS_EMPTY(&authData)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Auth data must be provided when using AEAD mode", "phalcon/Encryption/Crypt.zep", 820); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Auth data must be provided when using AEAD mode", "phalcon/Encryption/Crypt.zep", 841); return; } zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("authTag"), PH_NOISY_CC | PH_READONLY); @@ -1610,17 +1654,17 @@ PHP_METHOD(Phalcon_Encryption_Crypt, encryptGcmCcm) ZEPHIR_CPY_WRT(&authTagLength, &_4$$3); ZVAL_LONG(&_4$$3, 1); ZEPHIR_MAKE_REF(&authTag); - ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 252, &padded, &cipher, &encryptKey, &_4$$3, &iv, &authTag, &authData, &authTagLength); + ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 233, &padded, &cipher, &encryptKey, &_4$$3, &iv, &authTag, &authData, &authTagLength); ZEPHIR_UNREF(&authTag); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("authTag"), &authTag); } else { ZVAL_LONG(&_5$$5, 1); - ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 252, &padded, &cipher, &encryptKey, &_5$$5, &iv); + ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 233, &padded, &cipher, &encryptKey, &_5$$5, &iv); zephir_check_call_status(); } if (ZEPHIR_IS_FALSE_IDENTICAL(&encrypted)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not encrypt data", "phalcon/Encryption/Crypt.zep", 849); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Could not encrypt data", "phalcon/Encryption/Crypt.zep", 870); return; } ZEPHIR_CONCAT_VV(return_value, &encrypted, &authTag); @@ -1658,14 +1702,14 @@ PHP_METHOD(Phalcon_Encryption_Crypt, initializeAvailableCiphers) ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfunctionexists", NULL, 0, &_1); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "This class requires the openssl extension for PHP", "phalcon/Encryption/Crypt.zep", 871); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "This class requires the openssl extension for PHP", "phalcon/Encryption/Crypt.zep", 892); return; } - ZEPHIR_CALL_FUNCTION(&available, "openssl_get_cipher_methods", NULL, 253, &__$true); + ZEPHIR_CALL_FUNCTION(&available, "openssl_get_cipher_methods", NULL, 234, &__$true); zephir_check_call_status(); ZEPHIR_INIT_VAR(&allowed); array_init(&allowed); - zephir_is_iterable(&available, 0, "phalcon/Encryption/Crypt.zep", 888); + zephir_is_iterable(&available, 0, "phalcon/Encryption/Crypt.zep", 909); if (Z_TYPE_P(&available) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&available), _2) { @@ -1802,9 +1846,9 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getBlockSize) zephir_read_property(&_2, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, ""); - ZEPHIR_CALL_FUNCTION(&_4, "str_ireplace", NULL, 254, &_1, &_3, &_2); + ZEPHIR_CALL_FUNCTION(&_4, "str_ireplace", NULL, 235, &_1, &_3, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getivlength", NULL, 248, &_4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getivlength", NULL, 230, &_4); zephir_check_call_status(); RETURN_MM(); } @@ -1840,10 +1884,10 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getIvLength) zephir_get_strval(&cipher, cipher_param); - ZEPHIR_CALL_FUNCTION(&length, "openssl_cipher_iv_length", NULL, 255, &cipher); + ZEPHIR_CALL_FUNCTION(&length, "openssl_cipher_iv_length", NULL, 236, &cipher); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&length)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Cannot calculate the initialization vector (IV) length of the cipher", "phalcon/Encryption/Crypt.zep", 941); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_encryption_crypt_exception_exception_ce, "Cannot calculate the initialization vector (IV) length of the cipher", "phalcon/Encryption/Crypt.zep", 962); return; } RETURN_CCTOR(&length); @@ -1875,7 +1919,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getMode) zephir_read_property(&_0, this_ptr, ZEND_STRL("cipher"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "-"); - ZEPHIR_CALL_FUNCTION(&_2, "strrpos", NULL, 123, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "strrpos", NULL, 237, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&position); ZVAL_LONG(&position, zephir_get_intval(&_2)); @@ -1916,6 +1960,33 @@ PHP_METHOD(Phalcon_Encryption_Crypt, phpFunctionExists) RETURN_MM_BOOL((zephir_function_exists(&name) == SUCCESS)); } +PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *cipher_param = NULL; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(cipher) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &cipher_param); + zephir_get_strval(&cipher, cipher_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("openssl_cipher_iv_length", NULL, 236, &cipher); + zephir_check_call_status(); + RETURN_MM(); +} + PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -1938,7 +2009,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes) ZVAL_LONG(&_0, length); - ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 256, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 238, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/encryption/crypt.zep.h b/ext/phalcon/encryption/crypt.zep.h index 1b248d34456..82b1b10b7ac 100644 --- a/ext/phalcon/encryption/crypt.zep.h +++ b/ext/phalcon/encryption/crypt.zep.h @@ -16,6 +16,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getAvailableHashAlgorithms); PHP_METHOD(Phalcon_Encryption_Crypt, getHashAlgorithm); PHP_METHOD(Phalcon_Encryption_Crypt, getCipher); PHP_METHOD(Phalcon_Encryption_Crypt, getKey); +PHP_METHOD(Phalcon_Encryption_Crypt, isValidDecryptLength); PHP_METHOD(Phalcon_Encryption_Crypt, setAuthData); PHP_METHOD(Phalcon_Encryption_Crypt, setAuthTag); PHP_METHOD(Phalcon_Encryption_Crypt, setAuthTagLength); @@ -37,6 +38,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt, getBlockSize); PHP_METHOD(Phalcon_Encryption_Crypt, getIvLength); PHP_METHOD(Phalcon_Encryption_Crypt, getMode); PHP_METHOD(Phalcon_Encryption_Crypt, phpFunctionExists); +PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength); PHP_METHOD(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes); zend_object *zephir_init_properties_Phalcon_Encryption_Crypt(zend_class_entry *class_type); @@ -92,6 +94,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_getkey, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_isvaliddecryptlength, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_encryption_crypt_setauthdata, 0, 1, Phalcon\\Encryption\\Crypt\\CryptInterface, 0) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -193,6 +199,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_encryption_crypt_phpfunc ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_encryption_crypt_phpopensslcipherivlength, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_encryption_crypt_phpopensslrandompseudobytes, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -214,6 +224,7 @@ ZEPHIR_INIT_FUNCS(phalcon_encryption_crypt_method_entry) { PHP_ME(Phalcon_Encryption_Crypt, getHashAlgorithm, arginfo_phalcon_encryption_crypt_gethashalgorithm, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, getCipher, arginfo_phalcon_encryption_crypt_getcipher, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, getKey, arginfo_phalcon_encryption_crypt_getkey, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Encryption_Crypt, isValidDecryptLength, arginfo_phalcon_encryption_crypt_isvaliddecryptlength, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthData, arginfo_phalcon_encryption_crypt_setauthdata, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthTag, arginfo_phalcon_encryption_crypt_setauthtag, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Encryption_Crypt, setAuthTagLength, arginfo_phalcon_encryption_crypt_setauthtaglength, ZEND_ACC_PUBLIC) @@ -235,6 +246,7 @@ ZEPHIR_INIT_FUNCS(phalcon_encryption_crypt_method_entry) { PHP_ME(Phalcon_Encryption_Crypt, getIvLength, arginfo_phalcon_encryption_crypt_getivlength, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Encryption_Crypt, getMode, arginfo_phalcon_encryption_crypt_getmode, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Encryption_Crypt, phpFunctionExists, arginfo_phalcon_encryption_crypt_phpfunctionexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Encryption_Crypt, phpOpensslCipherIvLength, arginfo_phalcon_encryption_crypt_phpopensslcipherivlength, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Encryption_Crypt, phpOpensslRandomPseudoBytes, arginfo_phalcon_encryption_crypt_phpopensslrandompseudobytes, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/encryption/crypt/padding/ansi.zep.c b/ext/phalcon/encryption/crypt/padding/ansi.zep.c index 94aa191cde2..ea0cca6da0e 100644 --- a/ext/phalcon/encryption/crypt/padding/ansi.zep.c +++ b/ext/phalcon/encryption/crypt/padding/ansi.zep.c @@ -71,13 +71,13 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, pad) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, (paddingSize - 1)); ZEPHIR_CALL_FUNCTION(&_2, "str_repeat", NULL, 1, &_1, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); - ZEPHIR_CALL_FUNCTION(&_3, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "chr", NULL, 239, &_0); zephir_check_call_status(); ZEPHIR_CONCAT_VV(return_value, &_2, &_3); RETURN_MM(); @@ -133,7 +133,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, unpad) ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 258, &last); + ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 240, &last); zephir_check_call_status(); if (ZEPHIR_LE_LONG(&ord, blockSize)) { ZEPHIR_CPY_WRT(&paddingSize, &ord); @@ -141,7 +141,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Ansi, unpad) ZVAL_STRING(&repeat, ""); if (ZEPHIR_GT_LONG(&paddingSize, 1)) { ZVAL_LONG(&_2$$4, 0); - ZEPHIR_CALL_FUNCTION(&_3$$4, "chr", NULL, 257, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "chr", NULL, 239, &_2$$4); zephir_check_call_status(); ZVAL_LONG(&_2$$4, (zephir_get_numberval(&paddingSize) - 1)); ZEPHIR_CALL_FUNCTION(&repeat, "str_repeat", NULL, 1, &_3$$4, &_2$$4); diff --git a/ext/phalcon/encryption/crypt/padding/iso10126.zep.c b/ext/phalcon/encryption/crypt/padding/iso10126.zep.c index 03e130d2f9d..7407345d620 100644 --- a/ext/phalcon/encryption/crypt/padding/iso10126.zep.c +++ b/ext/phalcon/encryption/crypt/padding/iso10126.zep.c @@ -91,15 +91,15 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Iso10126, pad) } ZEPHIR_INIT_NVAR(&counter); ZVAL_LONG(&counter, _1); - ZEPHIR_CALL_FUNCTION(&_3$$3, "rand", &_4, 259); + ZEPHIR_CALL_FUNCTION(&_3$$3, "rand", &_4, 241); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_5$$3, "chr", &_6, 257, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "chr", &_6, 239, &_3$$3); zephir_check_call_status(); zephir_concat_self(&padding, &_5$$3); } } ZVAL_LONG(&_7, paddingSize); - ZEPHIR_CALL_FUNCTION(&_8, "chr", &_6, 257, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "chr", &_6, 239, &_7); zephir_check_call_status(); zephir_concat_self(&padding, &_8); RETURN_CCTOR(&padding); @@ -145,7 +145,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Iso10126, unpad) ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 258, &last); + ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 240, &last); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/encryption/crypt/padding/isoiek.zep.c b/ext/phalcon/encryption/crypt/padding/isoiek.zep.c index 4a117f1ef25..2fa3de71915 100644 --- a/ext/phalcon/encryption/crypt/padding/isoiek.zep.c +++ b/ext/phalcon/encryption/crypt/padding/isoiek.zep.c @@ -71,10 +71,10 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, pad) ZVAL_LONG(&_0, 0x80); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_2, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, (paddingSize - 1)); ZEPHIR_CALL_FUNCTION(&_3, "str_repeat", NULL, 1, &_2, &_0); @@ -123,9 +123,9 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) paddingSize = 0; - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); while (1) { @@ -133,7 +133,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/IsoIek.zep", 48); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_IDENTICAL(&_1, &_3); } @@ -149,7 +149,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_IsoIek, unpad) } zephir_array_fetch_long(&_6, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/IsoIek.zep", 55); ZVAL_LONG(&_2, 0x80); - ZEPHIR_CALL_FUNCTION(&_7, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_7, "chr", &_4, 239, &_2); zephir_check_call_status(); if (ZEPHIR_IS_EQUAL(&_6, &_7)) { paddingSize++; diff --git a/ext/phalcon/encryption/crypt/padding/pkcs7.zep.c b/ext/phalcon/encryption/crypt/padding/pkcs7.zep.c index c787ccaebb4..a1116219cdb 100644 --- a/ext/phalcon/encryption/crypt/padding/pkcs7.zep.c +++ b/ext/phalcon/encryption/crypt/padding/pkcs7.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Pkcs7, pad) ZVAL_LONG(&_0, paddingSize); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); ZEPHIR_RETURN_CALL_FUNCTION("str_repeat", NULL, 1, &_1, &_0); @@ -116,17 +116,17 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Pkcs7, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); ZVAL_LONG(&_0, (zephir_get_numberval(&length) - 1)); ZVAL_LONG(&_1, 1); ZEPHIR_INIT_VAR(&last); zephir_substr(&last, &input, zephir_get_intval(&_0), 1 , 0); - ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 258, &last); + ZEPHIR_CALL_FUNCTION(&ord, "ord", NULL, 240, &last); zephir_check_call_status(); if (ZEPHIR_LE_LONG(&ord, blockSize)) { ZEPHIR_CPY_WRT(&paddingSize, &ord); - ZEPHIR_CALL_FUNCTION(&_2$$3, "chr", NULL, 257, &paddingSize); + ZEPHIR_CALL_FUNCTION(&_2$$3, "chr", NULL, 239, &paddingSize); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 1, &_2$$3, &paddingSize); zephir_check_call_status(); diff --git a/ext/phalcon/encryption/crypt/padding/space.zep.c b/ext/phalcon/encryption/crypt/padding/space.zep.c index db316499c5b..6da31520e72 100644 --- a/ext/phalcon/encryption/crypt/padding/space.zep.c +++ b/ext/phalcon/encryption/crypt/padding/space.zep.c @@ -112,9 +112,9 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Space, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); paddingSize = 0; @@ -123,7 +123,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Space, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/Space.zep", 48); ZVAL_LONG(&_2, 32); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_EQUAL(&_1, &_3); } diff --git a/ext/phalcon/encryption/crypt/padding/zero.zep.c b/ext/phalcon/encryption/crypt/padding/zero.zep.c index c4116fd1410..b496241b9a3 100644 --- a/ext/phalcon/encryption/crypt/padding/zero.zep.c +++ b/ext/phalcon/encryption/crypt/padding/zero.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, pad) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 257, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, paddingSize); ZEPHIR_RETURN_CALL_FUNCTION("str_repeat", NULL, 1, &_1, &_0); @@ -113,9 +113,9 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, unpad) blockSize = zephir_get_intval(blockSize_param); - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &input); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &input); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 115, &input); + ZEPHIR_CALL_FUNCTION(&inputArray, "str_split", NULL, 84, &input); zephir_check_call_status(); counter = (zephir_get_numberval(&length) - 1); paddingSize = 0; @@ -124,7 +124,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_Padding_Zero, unpad) if (_0) { zephir_array_fetch_long(&_1, &inputArray, counter, PH_NOISY | PH_READONLY, "phalcon/Encryption/Crypt/Padding/Zero.zep", 48); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 257, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "chr", &_4, 239, &_2); zephir_check_call_status(); _0 = ZEPHIR_IS_EQUAL(&_1, &_3); } diff --git a/ext/phalcon/encryption/crypt/padfactory.zep.c b/ext/phalcon/encryption/crypt/padfactory.zep.c index 9471b509272..4942a8130ee 100644 --- a/ext/phalcon/encryption/crypt/padfactory.zep.c +++ b/ext/phalcon/encryption/crypt/padfactory.zep.c @@ -173,7 +173,7 @@ PHP_METHOD(Phalcon_Encryption_Crypt_PadFactory, padNumberToService) ZVAL_LONG(&_1, number); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "noop"); - ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 171, &map, &_1, &_2); + ZEPHIR_RETURN_CALL_METHOD(&_0, "__invoke", NULL, 150, &map, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/encryption/security.zep.c b/ext/phalcon/encryption/security.zep.c index 7d15c3e70b0..fc41e5da75e 100644 --- a/ext/phalcon/encryption/security.zep.c +++ b/ext/phalcon/encryption/security.zep.c @@ -238,7 +238,7 @@ PHP_METHOD(Phalcon_Encryption_Security, checkHash) if (_0) { RETURN_MM_BOOL(0); } - ZEPHIR_RETURN_CALL_FUNCTION("password_verify", NULL, 260, &password, &passwordHash); + ZEPHIR_RETURN_CALL_FUNCTION("password_verify", NULL, 242, &password, &passwordHash); zephir_check_call_status(); RETURN_MM(); } @@ -298,13 +298,13 @@ PHP_METHOD(Phalcon_Encryption_Security, checkToken) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "processtokenkey", NULL, 261, &tokenKey); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "processtokenkey", NULL, 243, &tokenKey); zephir_check_call_status(); zephir_get_strval(&tokenKey, &_0); if (!(!(ZEPHIR_IS_EMPTY(&tokenKey)))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&userToken, this_ptr, "processusertoken", NULL, 262, &tokenKey, tokenValue); + ZEPHIR_CALL_METHOD(&userToken, this_ptr, "processusertoken", NULL, 244, &tokenKey, tokenValue); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&knownToken, this_ptr, "getrequesttoken", NULL, 0); zephir_check_call_status(); @@ -382,16 +382,16 @@ PHP_METHOD(Phalcon_Encryption_Security, computeHmac) ZVAL_BOOL(&_0, (raw ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 243, &algo, &data, &key, &_0); + ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 224, &algo, &data, &key, &_0); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&hmac))) { ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, phalcon_encryption_security_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Unknown hashing algorithm: %s"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &algo); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &algo); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Encryption/Security.zep", 219); ZEPHIR_MM_RESTORE(); @@ -483,7 +483,7 @@ PHP_METHOD(Phalcon_Encryption_Security, getHashInformation) zephir_get_strval(&hash, hash_param); - ZEPHIR_RETURN_CALL_FUNCTION("password_get_info", NULL, 263, &hash); + ZEPHIR_RETURN_CALL_FUNCTION("password_get_info", NULL, 245, &hash); zephir_check_call_status(); RETURN_MM(); } @@ -789,11 +789,11 @@ PHP_METHOD(Phalcon_Encryption_Security, hash) } - ZEPHIR_CALL_METHOD(&cost, this_ptr, "processcost", NULL, 264, &options); + ZEPHIR_CALL_METHOD(&cost, this_ptr, "processcost", NULL, 246, &options); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&formatted, "sprintf", NULL, 140, &_0, &cost); + ZEPHIR_CALL_FUNCTION(&formatted, "sprintf", NULL, 112, &_0, &cost); zephir_check_call_status(); ZEPHIR_INIT_VAR(&prefix); ZVAL_STRING(&prefix, ""); @@ -823,14 +823,14 @@ PHP_METHOD(Phalcon_Encryption_Security, hash) if (ZEPHIR_IS_LONG(&_1, 5)) { ZEPHIR_INIT_VAR(&_2$$6); ZVAL_STRING(&_2$$6, "$2a$%s$"); - ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 140, &_2$$6, &formatted); + ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 112, &_2$$6, &formatted); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&_1, 6)) { ZEPHIR_INIT_VAR(&_3$$7); ZVAL_STRING(&_3$$7, "$2x$%s$"); - ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 140, &_3$$7, &formatted); + ZEPHIR_CALL_FUNCTION(&prefix, "sprintf", NULL, 112, &_3$$7, &formatted); zephir_check_call_status(); break; } @@ -844,7 +844,7 @@ PHP_METHOD(Phalcon_Encryption_Security, hash) zephir_check_call_status(); ZEPHIR_INIT_VAR(&salt); ZEPHIR_CONCAT_VVS(&salt, &prefix, &_4$$9, "$"); - ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 265, &password, &salt); + ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 247, &password, &salt); zephir_check_call_status(); RETURN_MM(); } @@ -852,11 +852,11 @@ PHP_METHOD(Phalcon_Encryption_Security, hash) zephir_create_array(&_6, 1, 0); zephir_array_update_string(&_6, SL("cost"), &cost, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&options, &_6); - ZEPHIR_CALL_METHOD(&algorithm, this_ptr, "processalgorithm", NULL, 266); + ZEPHIR_CALL_METHOD(&algorithm, this_ptr, "processalgorithm", NULL, 248); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "processargonoptions", NULL, 267, &options); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "processargonoptions", NULL, 249, &options); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("password_hash", NULL, 268, &password, &algorithm, &arguments); + ZEPHIR_RETURN_CALL_FUNCTION("password_hash", NULL, 250, &password, &algorithm, &arguments); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/encryption/security/jwt/builder.zep.c b/ext/phalcon/encryption/security/jwt/builder.zep.c index 0c3ec84ee1d..57700a72f5a 100644 --- a/ext/phalcon/encryption/security/jwt/builder.zep.c +++ b/ext/phalcon/encryption/security/jwt/builder.zep.c @@ -132,7 +132,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, init) zephir_update_property_zval(this_ptr, ZEND_STRL("passphrase"), &_0); ZEPHIR_INIT_NVAR(&_0); object_init_ex(&_0, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("claims"), &_0); ZEPHIR_INIT_VAR(&_1); @@ -141,7 +141,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, init) zephir_create_array(&_2, 2, 0); add_assoc_stringl_ex(&_2, SL("typ"), SL("JWT")); add_assoc_stringl_ex(&_2, SL("alg"), SL("none")); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("jose"), &_1); RETURN_THIS(); @@ -502,27 +502,27 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, getToken) } ZEPHIR_CALL_METHOD(&_2, this_ptr, "getclaims", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 269, &_2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 251, &_2); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedClaims, this_ptr, "encodeurl", NULL, 270, &_1); + ZEPHIR_CALL_METHOD(&encodedClaims, this_ptr, "encodeurl", NULL, 252, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&claims); object_init_ex(&claims, phalcon_encryption_security_jwt_token_item_ce); ZEPHIR_CALL_METHOD(&_3, this_ptr, "getclaims", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &claims, "__construct", NULL, 271, &_3, &encodedClaims); + ZEPHIR_CALL_METHOD(NULL, &claims, "__construct", NULL, 253, &_3, &encodedClaims); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_5, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "encode", NULL, 269, &_5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "encode", NULL, 251, &_5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedHeaders, this_ptr, "encodeurl", NULL, 270, &_4); + ZEPHIR_CALL_METHOD(&encodedHeaders, this_ptr, "encodeurl", NULL, 252, &_4); zephir_check_call_status(); ZEPHIR_INIT_VAR(&headers); object_init_ex(&headers, phalcon_encryption_security_jwt_token_item_ce); ZEPHIR_CALL_METHOD(&_6, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 271, &_6, &encodedHeaders); + ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 253, &_6, &encodedHeaders); zephir_check_call_status(); zephir_read_property(&_7, this_ptr, ZEND_STRL("signer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_8); @@ -530,14 +530,14 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, getToken) zephir_read_property(&_9, this_ptr, ZEND_STRL("passphrase"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&signatureHash, &_7, "sign", NULL, 0, &_8, &_9); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&encodedSignature, this_ptr, "encodeurl", NULL, 270, &signatureHash); + ZEPHIR_CALL_METHOD(&encodedSignature, this_ptr, "encodeurl", NULL, 252, &signatureHash); zephir_check_call_status(); ZEPHIR_INIT_VAR(&signature); object_init_ex(&signature, phalcon_encryption_security_jwt_token_signature_ce); - ZEPHIR_CALL_METHOD(NULL, &signature, "__construct", NULL, 272, &signatureHash, &encodedSignature); + ZEPHIR_CALL_METHOD(NULL, &signature, "__construct", NULL, 254, &signatureHash, &encodedSignature); zephir_check_call_status(); object_init_ex(return_value, phalcon_encryption_security_jwt_token_token_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 273, &headers, &claims, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 255, &headers, &claims, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -1096,7 +1096,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, encodeUrl) } - ZEPHIR_CALL_FUNCTION(&_0, "base64_encode", NULL, 245, &input); + ZEPHIR_CALL_FUNCTION(&_0, "base64_encode", NULL, 226, &input); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "+/"); @@ -1160,16 +1160,16 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Builder, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Encryption/Security/JWT/Builder.zep", 451); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/encryption/security/jwt/signer/hmac.zep.c b/ext/phalcon/encryption/security/jwt/signer/hmac.zep.c index b915c433ad7..7527c0e9ed0 100644 --- a/ext/phalcon/encryption/security/jwt/signer/hmac.zep.c +++ b/ext/phalcon/encryption/security/jwt/signer/hmac.zep.c @@ -177,7 +177,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, sign) } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethash", NULL, 274, &payload, &passphrase); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethash", NULL, 256, &payload, &passphrase); zephir_check_call_status(); RETURN_MM(); } @@ -244,7 +244,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, verify) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gethash", NULL, 274, &payload, &passphrase); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gethash", NULL, 256, &payload, &passphrase); zephir_check_call_status(); RETURN_MM_BOOL(zephir_hash_equals(&source, &_0)); } @@ -302,7 +302,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Signer_Hmac, getHash) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getalgorithm", NULL, 0); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac", NULL, 243, &_0, &payload, &passphrase, &__$true); + ZEPHIR_RETURN_CALL_FUNCTION("hash_hmac", NULL, 224, &_0, &payload, &passphrase, &__$true); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/encryption/security/jwt/token/parser.zep.c b/ext/phalcon/encryption/security/jwt/token/parser.zep.c index fa661031977..0508e9b0ff9 100644 --- a/ext/phalcon/encryption/security/jwt/token/parser.zep.c +++ b/ext/phalcon/encryption/security/jwt/token/parser.zep.c @@ -85,7 +85,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, parse) } - ZEPHIR_CALL_METHOD(&results, this_ptr, "parsetoken", NULL, 275, &token); + ZEPHIR_CALL_METHOD(&results, this_ptr, "parsetoken", NULL, 257, &token); zephir_check_call_status(); ZEPHIR_OBS_VAR(&encodedHeaders); zephir_array_fetch_long(&encodedHeaders, &results, 0, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 33); @@ -93,14 +93,14 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, parse) zephir_array_fetch_long(&encodedClaims, &results, 1, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 34); ZEPHIR_OBS_VAR(&encodedSignature); zephir_array_fetch_long(&encodedSignature, &results, 2, PH_NOISY, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 35); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "decodeheaders", NULL, 276, &encodedHeaders); + ZEPHIR_CALL_METHOD(&headers, this_ptr, "decodeheaders", NULL, 258, &encodedHeaders); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&claims, this_ptr, "decodeclaims", NULL, 277, &encodedClaims); + ZEPHIR_CALL_METHOD(&claims, this_ptr, "decodeclaims", NULL, 259, &encodedClaims); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&signature, this_ptr, "decodesignature", NULL, 278, &headers, &encodedSignature); + ZEPHIR_CALL_METHOD(&signature, this_ptr, "decodesignature", NULL, 260, &headers, &encodedSignature); zephir_check_call_status(); object_init_ex(return_value, phalcon_encryption_security_jwt_token_token_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 273, &headers, &claims, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 255, &headers, &claims, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -142,10 +142,10 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeClaims) zephir_get_strval(&claims, claims_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 279, &claims); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 261, &claims); zephir_check_call_status(); ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 280, &_0, &_1); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 262, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&decoded) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Claims (not an array)", "phalcon/Encryption/Security/JWT/Token/Parser.zep", 59); @@ -166,7 +166,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeClaims) zephir_array_update_string(&decoded, SL("aud"), &_4$$4, PH_COPY | PH_SEPARATE); } object_init_ex(return_value, phalcon_encryption_security_jwt_token_item_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 271, &decoded, &claims); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 253, &decoded, &claims); zephir_check_call_status(); RETURN_MM(); } @@ -203,10 +203,10 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeHeaders) zephir_get_strval(&headers, headers_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 279, &headers); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "decodeurl", NULL, 261, &headers); zephir_check_call_status(); ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 280, &_0, &_1); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decode", NULL, 262, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&decoded) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Invalid Header (not an array)", "phalcon/Encryption/Security/JWT/Token/Parser.zep", 88); @@ -217,7 +217,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeHeaders) return; } object_init_ex(return_value, phalcon_encryption_security_jwt_token_item_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 271, &decoded, &headers); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 253, &decoded, &headers); zephir_check_call_status(); RETURN_MM(); } @@ -272,11 +272,11 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeSignature) ZVAL_STRING(&decoded, ""); ZEPHIR_INIT_NVAR(&signature); } else { - ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decodeurl", NULL, 279, &signature); + ZEPHIR_CALL_METHOD(&decoded, this_ptr, "decodeurl", NULL, 261, &signature); zephir_check_call_status(); } object_init_ex(return_value, phalcon_encryption_security_jwt_token_signature_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 272, &decoded, &signature); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 254, &decoded, &signature); zephir_check_call_status(); RETURN_MM(); } @@ -393,16 +393,16 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Encryption/Security/JWT/Token/Parser.zep", 163); ZEPHIR_MM_RESTORE(); @@ -466,7 +466,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Token_Parser, decodeUrl) ZVAL_STRING(&_4, "+/"); ZEPHIR_CALL_FUNCTION(&_5, "strtr", NULL, 5, &input, &_3, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&data, "base64_decode", NULL, 244, &_5); + ZEPHIR_CALL_FUNCTION(&data, "base64_decode", NULL, 225, &_5); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) { ZEPHIR_INIT_NVAR(&data); diff --git a/ext/phalcon/encryption/security/jwt/validator.zep.c b/ext/phalcon/encryption/security/jwt/validator.zep.c index f9c3a9f4c5f..50a8ee2db80 100644 --- a/ext/phalcon/encryption/security/jwt/validator.zep.c +++ b/ext/phalcon/encryption/security/jwt/validator.zep.c @@ -216,7 +216,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateExpiration) _4 = zephir_is_true(&_2); if (_4) { ZVAL_LONG(&_6, timestamp); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "gettimestamp", NULL, 281, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "gettimestamp", NULL, 263, &_6); zephir_check_call_status(); zephir_read_property(&_6, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_7, &_6, "getclaims", NULL, 0); @@ -322,7 +322,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateIssuedAt) ZVAL_LONG(&_1, timestamp); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 281, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 263, &_1); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0); @@ -426,7 +426,7 @@ PHP_METHOD(Phalcon_Encryption_Security_JWT_Validator, validateNotBefore) ZVAL_LONG(&_1, timestamp); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 281, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "gettimestamp", NULL, 263, &_1); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("token"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2, &_1, "getclaims", NULL, 0); diff --git a/ext/phalcon/encryption/security/random.zep.c b/ext/phalcon/encryption/security/random.zep.c index 0baf0b9df05..acf8a9d6bc2 100644 --- a/ext/phalcon/encryption/security/random.zep.c +++ b/ext/phalcon/encryption/security/random.zep.c @@ -259,7 +259,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, base64) ZVAL_LONG(&_1, len); ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -327,7 +327,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, base64Safe) ZVAL_LONG(&_1, len); ZEPHIR_CALL_METHOD(&_0, this_ptr, "base64", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 245, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 226, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "+/"); @@ -339,7 +339,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, base64Safe) ZVAL_STRING(&_3, "#[^a-z0-9_=-]+#i"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, ""); - ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 50, &_3, &_4, &s); + ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 37, &_3, &_4, &s); zephir_check_call_status(); ZEPHIR_CPY_WRT(&s, &_5); if (!(padding)) { @@ -400,7 +400,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, bytes) len = 16; } ZVAL_LONG(&_0, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 282, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 264, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -453,10 +453,10 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, hex) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "H*"); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 283, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 265, &_2, &_0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&_3); - ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 23, &_3); + ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 21, &_3); ZEPHIR_UNREF(&_3); zephir_check_call_status(); RETURN_MM(); @@ -503,7 +503,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, number) } ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 284, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 266, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -555,7 +555,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, uuid) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "N1a/n1b/n1c/n1d/n1e/N1f"); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 283, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 265, &_2, &_0); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&ary, "array_values", NULL, 14, &_3); zephir_check_call_status(); @@ -570,7 +570,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, uuid) ZEPHIR_INIT_VAR(&_7); ZVAL_STRING(&_7, "%08x-%04x-%04x-%04x-%04x%08x"); ZEPHIR_MAKE_REF(&ary); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &ary, &_7); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &ary, &_7); ZEPHIR_UNREF(&ary); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7); @@ -636,7 +636,7 @@ PHP_METHOD(Phalcon_Encryption_Security_Random, base) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "C*"); - ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 283, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 265, &_1, &_0); zephir_check_call_status(); zephir_is_iterable(&bytes, 0, "phalcon/Encryption/Security/Random.zep", 351); if (Z_TYPE_P(&bytes) == IS_ARRAY) { diff --git a/ext/phalcon/events/abstracteventsaware.zep.c b/ext/phalcon/events/abstracteventsaware.zep.c index 1459883378e..49b62ad9298 100644 --- a/ext/phalcon/events/abstracteventsaware.zep.c +++ b/ext/phalcon/events/abstracteventsaware.zep.c @@ -27,10 +27,7 @@ * file that was distributed with this source code. */ /** - * Trait EventsAwareTrait - * - * @package Phalcon\Events\Traits - * + * This abstract class offers access to the events manager * @property ?ManagerInterface $eventsManager */ ZEPHIR_INIT_CLASS(Phalcon_Events_AbstractEventsAware) diff --git a/ext/phalcon/events/event.zep.c b/ext/phalcon/events/event.zep.c index 3179f103817..7fdec350012 100644 --- a/ext/phalcon/events/event.zep.c +++ b/ext/phalcon/events/event.zep.c @@ -30,8 +30,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\Event - * * This class offers contextual information of a fired event in the * EventsManager * @@ -190,9 +188,9 @@ PHP_METHOD(Phalcon_Events_Event, __construct) zephir_gettype(&_2$$3, source); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVSV(&_3$$3, "The source of ", &type, " event must be an object, got ", &_2$$3); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Events/Event.zep", 75); + zephir_throw_exception_debug(&_1$$3, "phalcon/Events/Event.zep", 73); ZEPHIR_MM_RESTORE(); return; } @@ -325,7 +323,7 @@ PHP_METHOD(Phalcon_Events_Event, stop) zephir_read_property(&_0, this_ptr, ZEND_STRL("cancelable"), PH_NOISY_CC | PH_READONLY); if (UNEXPECTED(!zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/Events/Event.zep", 137); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/Events/Event.zep", 135); return; } if (1) { diff --git a/ext/phalcon/events/eventinterface.zep.c b/ext/phalcon/events/eventinterface.zep.c index f58878c77ec..24d030852b4 100644 --- a/ext/phalcon/events/eventinterface.zep.c +++ b/ext/phalcon/events/eventinterface.zep.c @@ -21,8 +21,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\EventInterface - * * Interface for Phalcon\Events\Event class */ ZEPHIR_INIT_CLASS(Phalcon_Events_EventInterface) diff --git a/ext/phalcon/events/eventsawareinterface.zep.c b/ext/phalcon/events/eventsawareinterface.zep.c index b6e7d39f75e..a6da297a9d8 100644 --- a/ext/phalcon/events/eventsawareinterface.zep.c +++ b/ext/phalcon/events/eventsawareinterface.zep.c @@ -21,8 +21,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\EventsAwareInterface - * * This interface must for those classes that accept an EventsManager and * dispatch events */ diff --git a/ext/phalcon/events/exception.zep.c b/ext/phalcon/events/exception.zep.c index fb87ca043cc..7b9df85646f 100644 --- a/ext/phalcon/events/exception.zep.c +++ b/ext/phalcon/events/exception.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\Exception - * * Exceptions thrown in Phalcon\Events will use this class */ ZEPHIR_INIT_CLASS(Phalcon_Events_Exception) diff --git a/ext/phalcon/events/manager.zep.c b/ext/phalcon/events/manager.zep.c index 4e91508ba44..74219736fd5 100644 --- a/ext/phalcon/events/manager.zep.c +++ b/ext/phalcon/events/manager.zep.c @@ -34,8 +34,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\Manager - * * Phalcon Events Manager, offers an easy way to intercept and manipulate, if * needed, the normal flow of operation. With the EventsManager the developer * can create hooks or plugins that will offer monitoring of data, manipulation, @@ -125,7 +123,7 @@ PHP_METHOD(Phalcon_Events_Manager, attach) ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 58); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 56); return; } ZEPHIR_OBS_VAR(&priorityQueue); @@ -139,7 +137,7 @@ PHP_METHOD(Phalcon_Events_Manager, attach) } ZVAL_LONG(&_2$$4, 1); - ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 286, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 268, &_2$$4); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("events"), &eventType, &priorityQueue); } @@ -148,7 +146,7 @@ PHP_METHOD(Phalcon_Events_Manager, attach) priority = 100; } ZVAL_LONG(&_4, priority); - ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 287, handler, &_4); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 269, handler, &_4); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -247,7 +245,7 @@ PHP_METHOD(Phalcon_Events_Manager, detach) ZEPHIR_CALL_METHOD(&_0, this_ptr, "isvalidhandler", NULL, 0, handler); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 109); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object or Callable", "phalcon/Events/Manager.zep", 107); return; } ZEPHIR_OBS_VAR(&priorityQueue); @@ -261,7 +259,7 @@ PHP_METHOD(Phalcon_Events_Manager, detach) } ZVAL_LONG(&_2$$4, 1); - ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 286, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 268, &_2$$4); zephir_check_call_status(); ZVAL_LONG(&_2$$4, 3); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 0, &_2$$4); @@ -278,11 +276,11 @@ PHP_METHOD(Phalcon_Events_Manager, detach) zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_5, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_6$$5, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 134); + zephir_array_fetch_string(&_6$$5, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 132); if (!ZEPHIR_IS_IDENTICAL(&_6$$5, handler)) { - zephir_array_fetch_string(&_7$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 136); - zephir_array_fetch_string(&_8$$6, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 138); - ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_9, 287, &_7$$6, &_8$$6); + zephir_array_fetch_string(&_7$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 134); + zephir_array_fetch_string(&_8$$6, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/Events/Manager.zep", 136); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_9, 269, &_7$$6, &_8$$6); zephir_check_call_status(); } } @@ -458,23 +456,23 @@ PHP_METHOD(Phalcon_Events_Manager, fire) if (ZEPHIR_IS_EMPTY(&events)) { RETURN_MM_NULL(); } - if (UNEXPECTED(!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/Events/Manager.zep", 199)))) { + if (UNEXPECTED(!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/Events/Manager.zep", 197)))) { ZEPHIR_INIT_VAR(&_1$$4); object_init_ex(&_1$$4, phalcon_events_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SV(&_2$$4, "Invalid event type ", &eventType); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Events/Manager.zep", 200); + zephir_throw_exception_debug(&_1$$4, "phalcon/Events/Manager.zep", 198); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_INIT_VAR(&eventParts); zephir_fast_explode_str(&eventParts, SL(":"), &eventType, LONG_MAX); ZEPHIR_OBS_VAR(&type); - zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/Events/Manager.zep", 204); + zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/Events/Manager.zep", 202); ZEPHIR_OBS_VAR(&eventName); - zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/Events/Manager.zep", 205); + zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/Events/Manager.zep", 203); ZEPHIR_INIT_VAR(&status); ZVAL_NULL(&status); zephir_read_property(&_0, this_ptr, ZEND_STRL("collect"), PH_NOISY_CC | PH_READONLY); @@ -490,19 +488,19 @@ PHP_METHOD(Phalcon_Events_Manager, fire) } else { ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 288, &eventName, source, data, &_4); + ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 270, &eventName, source, data, &_4); zephir_check_call_status(); ZEPHIR_OBS_VAR(&fireEvents); if (zephir_array_isset_fetch(&fireEvents, &events, &type, 0)) { if (Z_TYPE_P(&fireEvents) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 289, &fireEvents, &event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 271, &fireEvents, &event); zephir_check_call_status(); } } ZEPHIR_OBS_NVAR(&fireEvents); if (zephir_array_isset_fetch(&fireEvents, &events, &eventType, 0)) { if (Z_TYPE_P(&fireEvents) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 289, &fireEvents, &event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 271, &fireEvents, &event); zephir_check_call_status(); } } @@ -555,7 +553,7 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue) ZEPHIR_CALL_METHOD(&eventName, event, "gettype", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&eventName) != IS_STRING)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/Events/Manager.zep", 252); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/Events/Manager.zep", 250); return; } ZEPHIR_CALL_METHOD(&source, event, "getsource", NULL, 0); @@ -686,7 +684,7 @@ PHP_METHOD(Phalcon_Events_Manager, getListeners) } ZEPHIR_CALL_METHOD(&_2$$4, &priorityQueue, "current", &_3, 0); zephir_check_call_status(); - zephir_array_append(&listeners, &_2$$4, PH_SEPARATE, "phalcon/Events/Manager.zep", 335); + zephir_array_append(&listeners, &_2$$4, PH_SEPARATE, "phalcon/Events/Manager.zep", 333); ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_4, 0); zephir_check_call_status(); } diff --git a/ext/phalcon/events/managerinterface.zep.c b/ext/phalcon/events/managerinterface.zep.c index 7bf5b54bee1..49758830bb6 100644 --- a/ext/phalcon/events/managerinterface.zep.c +++ b/ext/phalcon/events/managerinterface.zep.c @@ -21,8 +21,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Events\ManagerInterface - * * Interface for Phalcon\Events managers. */ ZEPHIR_INIT_CLASS(Phalcon_Events_ManagerInterface) diff --git a/ext/phalcon/filter/filter.zep.c b/ext/phalcon/filter/filter.zep.c index 961939b4036..3750853111a 100644 --- a/ext/phalcon/filter/filter.zep.c +++ b/ext/phalcon/filter/filter.zep.c @@ -251,7 +251,7 @@ PHP_METHOD(Phalcon_Filter_Filter, get) object_init_ex(&_1$$3, phalcon_filter_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Filter ", &name, " is not registered"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Filter/Filter.zep", 119); ZEPHIR_MM_RESTORE(); @@ -262,7 +262,7 @@ PHP_METHOD(Phalcon_Filter_Filter, get) zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("mapper"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&definition); zephir_array_fetch(&definition, &_4$$4, &name, PH_NOISY, "phalcon/Filter/Filter.zep", 123); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "createinstance", NULL, 290, &definition); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "createinstance", NULL, 272, &definition); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("services"), &name, &_5$$4); } @@ -351,7 +351,7 @@ PHP_METHOD(Phalcon_Filter_Filter, sanitize) } else { ZVAL_BOOL(&_0$$3, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarraysanitizers", NULL, 291, sanitizers, value, &_0$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarraysanitizers", NULL, 273, sanitizers, value, &_0$$3); zephir_check_call_status(); RETURN_MM(); } @@ -360,11 +360,11 @@ PHP_METHOD(Phalcon_Filter_Filter, sanitize) _1 = !noRecursive; } if (_1) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarrayvalues", NULL, 292, value, sanitizers); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processarrayvalues", NULL, 274, value, sanitizers); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "sanitizer", NULL, 293, value, sanitizers); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "sanitizer", NULL, 275, value, sanitizers); zephir_check_call_status(); RETURN_MM(); } @@ -578,7 +578,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } ZEPHIR_INIT_NVAR(&sanitizer); ZVAL_COPY(&sanitizer, _0); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 294, &sanitizerKey, &sanitizer); + ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 276, &sanitizerKey, &sanitizer); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sanitizerName); zephir_array_fetch_long(&sanitizerName, &split, 0, PH_NOISY, "phalcon/Filter/Filter.zep", 279); @@ -589,10 +589,10 @@ PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } else { ZVAL_BOOL(&_6$$4, 0); } - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisarray", &_7, 295, value, &sanitizerName, &sanitizerParams, &_6$$4); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisarray", &_7, 277, value, &sanitizerName, &sanitizerParams, &_6$$4); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_5$$4); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisnotarray", &_8, 296, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "processvalueisnotarray", &_8, 278, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_5$$4); } ZEND_HASH_FOREACH_END(); @@ -609,7 +609,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&sanitizer, &sanitizers, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 294, &sanitizerKey, &sanitizer); + ZEPHIR_CALL_METHOD(&split, this_ptr, "splitsanitizerparameters", &_4, 276, &sanitizerKey, &sanitizer); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sanitizerName); zephir_array_fetch_long(&sanitizerName, &split, 0, PH_NOISY, "phalcon/Filter/Filter.zep", 279); @@ -620,10 +620,10 @@ PHP_METHOD(Phalcon_Filter_Filter, processArraySanitizers) } else { ZVAL_BOOL(&_10$$5, 0); } - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisarray", &_7, 295, value, &sanitizerName, &sanitizerParams, &_10$$5); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisarray", &_7, 277, value, &sanitizerName, &sanitizerParams, &_10$$5); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_9$$5); - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisnotarray", &_8, 296, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "processvalueisnotarray", &_8, 278, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_9$$5); ZEPHIR_CALL_METHOD(NULL, &sanitizers, "next", NULL, 0); @@ -704,7 +704,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processArrayValues) } ZEPHIR_INIT_NVAR(&itemValue); ZVAL_COPY(&itemValue, _0); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "sanitizer", &_5, 293, &itemValue, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "sanitizer", &_5, 275, &itemValue, &sanitizerName, &sanitizerParams); zephir_check_call_status(); zephir_array_update_zval(&arrayValues, &itemKey, &_4$$3, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -721,7 +721,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processArrayValues) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&itemValue, &values, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "sanitizer", &_5, 293, &itemValue, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "sanitizer", &_5, 275, &itemValue, &sanitizerName, &sanitizerParams); zephir_check_call_status(); zephir_array_update_zval(&arrayValues, &itemKey, &_6$$4, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &values, "next", NULL, 0); @@ -855,7 +855,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processValueIsArray) _0 = !noRecursive; } if (_0) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "processarrayvalues", NULL, 292, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "processarrayvalues", NULL, 274, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_1$$3); } @@ -902,7 +902,7 @@ PHP_METHOD(Phalcon_Filter_Filter, processValueIsNotArray) if (Z_TYPE_P(value) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "sanitizer", NULL, 293, value, &sanitizerName, &sanitizerParams); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "sanitizer", NULL, 275, value, &sanitizerName, &sanitizerParams); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_0$$3); } diff --git a/ext/phalcon/filter/filterfactory.zep.c b/ext/phalcon/filter/filterfactory.zep.c index b072056c2e6..2125b3a6a19 100644 --- a/ext/phalcon/filter/filterfactory.zep.c +++ b/ext/phalcon/filter/filterfactory.zep.c @@ -59,7 +59,7 @@ PHP_METHOD(Phalcon_Filter_FilterFactory, newInstance) object_init_ex(return_value, phalcon_filter_filter_ce); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getservices", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 297, &_0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 279, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/absint.zep.c b/ext/phalcon/filter/sanitize/absint.zep.c index 1e6a6292f90..a8c533994ed 100644 --- a/ext/phalcon/filter/sanitize/absint.zep.c +++ b/ext/phalcon/filter/sanitize/absint.zep.c @@ -66,10 +66,10 @@ PHP_METHOD(Phalcon_Filter_Sanitize_AbsInt, __invoke) ZVAL_LONG(&_0, 519); - ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 298, input, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 280, input, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, zephir_get_intval(&_1)); - ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 299, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 281, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/alnum.zep.c b/ext/phalcon/filter/sanitize/alnum.zep.c index 5eac75fabcd..77e56e8f18f 100644 --- a/ext/phalcon/filter/sanitize/alnum.zep.c +++ b/ext/phalcon/filter/sanitize/alnum.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Alnum, __invoke) ZVAL_STRING(&_0, "/[^A-Za-z0-9]/"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, &_0, &_1, input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/alpha.zep.c b/ext/phalcon/filter/sanitize/alpha.zep.c index 76fd34ef4c8..d5d3b5251d1 100644 --- a/ext/phalcon/filter/sanitize/alpha.zep.c +++ b/ext/phalcon/filter/sanitize/alpha.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Alpha, __invoke) ZVAL_STRING(&_0, "/[^A-Za-z]/"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_0, &_1, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, &_0, &_1, input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/email.zep.c b/ext/phalcon/filter/sanitize/email.zep.c index 4134877401f..379385cecaa 100644 --- a/ext/phalcon/filter/sanitize/email.zep.c +++ b/ext/phalcon/filter/sanitize/email.zep.c @@ -66,7 +66,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Email, __invoke) ZVAL_LONG(&_0, 517); ZVAL_LONG(&_1, 1048576); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/floatval.zep.c b/ext/phalcon/filter/sanitize/floatval.zep.c index 99f58a9ceaa..62c16388779 100644 --- a/ext/phalcon/filter/sanitize/floatval.zep.c +++ b/ext/phalcon/filter/sanitize/floatval.zep.c @@ -72,7 +72,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_FloatVal, __invoke) zephir_create_array(&_0, 1, 0); add_assoc_long_ex(&_0, SL("flags"), 4096); ZVAL_LONG(&_1, 520); - ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 298, input, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 280, input, &_1, &_0); zephir_check_call_status(); RETURN_MM_DOUBLE(zephir_get_doubleval(&_2)); } diff --git a/ext/phalcon/filter/sanitize/intval.zep.c b/ext/phalcon/filter/sanitize/intval.zep.c index 14d48915aff..64b47ed1fc6 100644 --- a/ext/phalcon/filter/sanitize/intval.zep.c +++ b/ext/phalcon/filter/sanitize/intval.zep.c @@ -66,7 +66,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_IntVal, __invoke) ZVAL_LONG(&_0, 519); - ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 298, input, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM_LONG(zephir_get_intval(&_1)); } diff --git a/ext/phalcon/filter/sanitize/lower.zep.c b/ext/phalcon/filter/sanitize/lower.zep.c index 133a3549ccf..4cced1f84bd 100644 --- a/ext/phalcon/filter/sanitize/lower.zep.c +++ b/ext/phalcon/filter/sanitize/lower.zep.c @@ -87,7 +87,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Lower, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); zephir_fast_strtolower(return_value, &_2); RETURN_MM(); diff --git a/ext/phalcon/filter/sanitize/lowerfirst.zep.c b/ext/phalcon/filter/sanitize/lowerfirst.zep.c index 96ee38c63ec..47b8c23cac9 100644 --- a/ext/phalcon/filter/sanitize/lowerfirst.zep.c +++ b/ext/phalcon/filter/sanitize/lowerfirst.zep.c @@ -75,7 +75,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_LowerFirst, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("lcfirst", NULL, 104, &input); + ZEPHIR_RETURN_CALL_FUNCTION("lcfirst", NULL, 73, &input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/regex.zep.c b/ext/phalcon/filter/sanitize/regex.zep.c index bd53c10357d..b0fa62060e7 100644 --- a/ext/phalcon/filter/sanitize/regex.zep.c +++ b/ext/phalcon/filter/sanitize/regex.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Regex, __invoke) zephir_fetch_params(1, 3, 0, &input, &pattern, &replace); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, pattern, replace, input); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 37, pattern, replace, input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/special.zep.c b/ext/phalcon/filter/sanitize/special.zep.c index d8304aa51ed..1d7049310df 100644 --- a/ext/phalcon/filter/sanitize/special.zep.c +++ b/ext/phalcon/filter/sanitize/special.zep.c @@ -64,7 +64,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Special, __invoke) ZVAL_LONG(&_0, 515); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/specialfull.zep.c b/ext/phalcon/filter/sanitize/specialfull.zep.c index 5baee7e7c6c..4449e417ad7 100644 --- a/ext/phalcon/filter/sanitize/specialfull.zep.c +++ b/ext/phalcon/filter/sanitize/specialfull.zep.c @@ -64,7 +64,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_SpecialFull, __invoke) ZVAL_LONG(&_0, 522); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/stringval.zep.c b/ext/phalcon/filter/sanitize/stringval.zep.c index ceda3770528..02a20f60225 100644 --- a/ext/phalcon/filter/sanitize/stringval.zep.c +++ b/ext/phalcon/filter/sanitize/stringval.zep.c @@ -12,8 +12,11 @@ #include #include "kernel/main.h" -#include "kernel/fcall.h" +#include "kernel/string.h" #include "kernel/memory.h" +#include "kernel/fcall.h" +#include "kernel/operators.h" +#include "kernel/array.h" #include "kernel/object.h" @@ -26,8 +29,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Filter\Sanitize\String - * * Sanitizes a value to string */ ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_StringVal) @@ -40,17 +41,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Filter_Sanitize_StringVal) /** * @param mixed $input The text to sanitize * - * @return string + * @return string|false */ PHP_METHOD(Phalcon_Filter_Sanitize_StringVal, __invoke) { + zval _7, _8; + zval _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *input, input_sub, _0; + zval *input = NULL, input_sub, _0, _1, _3, _4, _5, _6; zval *this_ptr = getThis(); ZVAL_UNDEF(&input_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -61,11 +72,45 @@ PHP_METHOD(Phalcon_Filter_Sanitize_StringVal, __invoke) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &input); + ZEPHIR_SEPARATE_PARAM(input); - ZVAL_LONG(&_0, 513); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + if (Z_TYPE_P(input) == IS_ARRAY) { + RETURN_MM_BOOL(0); + } + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 239, &_0); + zephir_check_call_status(); + zephir_cast_to_string(&_2, input); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, ""); + ZEPHIR_INIT_NVAR(input); + zephir_fast_str_replace(input, &_1, &_3, &_2); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "/<[^>]*>?/"); + ZEPHIR_INIT_VAR(&_5); + ZVAL_STRING(&_5, ""); + ZEPHIR_CALL_FUNCTION(&_6, "preg_replace", NULL, 37, &_4, &_5, input); zephir_check_call_status(); - RETURN_MM(); + ZEPHIR_CPY_WRT(input, &_6); + ZEPHIR_INIT_VAR(&_7); + zephir_create_array(&_7, 2, 0); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "'"); + zephir_array_fast_append(&_7, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "\""); + zephir_array_fast_append(&_7, &_4); + ZEPHIR_INIT_VAR(&_8); + zephir_create_array(&_8, 2, 0); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "'"); + zephir_array_fast_append(&_8, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, """); + zephir_array_fast_append(&_8, &_4); + ZEPHIR_INIT_NVAR(&_4); + zephir_fast_str_replace(&_4, &_7, &_8, input); + RETURN_CCTOR(&_4); } diff --git a/ext/phalcon/filter/sanitize/striptags.zep.c b/ext/phalcon/filter/sanitize/striptags.zep.c index 021a04f0b15..4e4425e464c 100644 --- a/ext/phalcon/filter/sanitize/striptags.zep.c +++ b/ext/phalcon/filter/sanitize/striptags.zep.c @@ -75,7 +75,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Striptags, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 301, &input); + ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 283, &input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/upper.zep.c b/ext/phalcon/filter/sanitize/upper.zep.c index 5c83b905e82..f29646226be 100644 --- a/ext/phalcon/filter/sanitize/upper.zep.c +++ b/ext/phalcon/filter/sanitize/upper.zep.c @@ -87,7 +87,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Upper, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); zephir_fast_strtoupper(return_value, &_2); RETURN_MM(); diff --git a/ext/phalcon/filter/sanitize/upperwords.zep.c b/ext/phalcon/filter/sanitize/upperwords.zep.c index 0723682d9d3..c37d69be145 100644 --- a/ext/phalcon/filter/sanitize/upperwords.zep.c +++ b/ext/phalcon/filter/sanitize/upperwords.zep.c @@ -86,9 +86,9 @@ PHP_METHOD(Phalcon_Filter_Sanitize_UpperWords, __invoke) zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 300, &input); + ZEPHIR_CALL_FUNCTION(&_2, "utf8_decode", NULL, 282, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ucwords", NULL, 302, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("ucwords", NULL, 284, &_2); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/sanitize/url.zep.c b/ext/phalcon/filter/sanitize/url.zep.c index 11a1f11b7b8..aed6a862797 100644 --- a/ext/phalcon/filter/sanitize/url.zep.c +++ b/ext/phalcon/filter/sanitize/url.zep.c @@ -64,7 +64,7 @@ PHP_METHOD(Phalcon_Filter_Sanitize_Url, __invoke) ZVAL_LONG(&_0, 518); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 298, input, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 280, input, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/filter/validation.zep.c b/ext/phalcon/filter/validation.zep.c index 6384d7c1644..23fc2b495d0 100644 --- a/ext/phalcon/filter/validation.zep.c +++ b/ext/phalcon/filter/validation.zep.c @@ -285,7 +285,7 @@ PHP_METHOD(Phalcon_Filter_Validation, appendMessage) ZEPHIR_CALL_METHOD(NULL, &messages, "__construct", NULL, 8); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &messages, "appendmessage", NULL, 303, message); + ZEPHIR_CALL_METHOD(NULL, &messages, "appendmessage", NULL, 285, message); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("messages"), &messages); RETURN_THIS(); @@ -674,7 +674,7 @@ PHP_METHOD(Phalcon_Filter_Validation, getValue) zephir_camelize(&_6$$13, &field, NULL ); ZEPHIR_INIT_VAR(&method); ZEPHIR_CONCAT_SV(&method, "set", &_6$$13); - ZEPHIR_CALL_FUNCTION(&_7$$13, "property_exists", NULL, 304, &entity, &field); + ZEPHIR_CALL_FUNCTION(&_7$$13, "property_exists", NULL, 286, &entity, &field); zephir_check_call_status(); if ((zephir_method_exists(&entity, &method) == SUCCESS)) { ZEPHIR_CALL_METHOD_ZVAL(NULL, &entity, &method, NULL, 0, &value); @@ -1331,7 +1331,7 @@ PHP_METHOD(Phalcon_Filter_Validation, preChecking) { ZEPHIR_INIT_NVAR(&singleField); ZVAL_COPY(&singleField, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "prechecking", &_3, 305, &singleField, validator); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "prechecking", &_3, 287, &singleField, validator); zephir_check_call_status(); zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Filter/Validation.zep", 592); if (zephir_fast_in_array(&__$false, &results)) { @@ -1350,7 +1350,7 @@ PHP_METHOD(Phalcon_Filter_Validation, preChecking) } ZEPHIR_CALL_METHOD(&singleField, field, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "prechecking", &_3, 305, &singleField, validator); + ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "prechecking", &_3, 287, &singleField, validator); zephir_check_call_status(); zephir_array_append(&results, &_4$$6, PH_SEPARATE, "phalcon/Filter/Validation.zep", 592); if (zephir_fast_in_array(&__$false, &results)) { diff --git a/ext/phalcon/filter/validation/abstractvalidator.zep.c b/ext/phalcon/filter/validation/abstractvalidator.zep.c index fafb97becf2..67330d23551 100644 --- a/ext/phalcon/filter/validation/abstractvalidator.zep.c +++ b/ext/phalcon/filter/validation/abstractvalidator.zep.c @@ -489,14 +489,15 @@ PHP_METHOD(Phalcon_Filter_Validation_AbstractValidator, prepareCode) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field_param = NULL, code, _0, _1$$3; + zval *field_param = NULL, code, _0, _1, _2$$3; zval field; zval *this_ptr = getThis(); ZVAL_UNDEF(&field); ZVAL_UNDEF(&code); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -520,11 +521,12 @@ PHP_METHOD(Phalcon_Filter_Validation_AbstractValidator, prepareCode) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "code"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(&code, this_ptr, "getoption", NULL, 0, &_0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_ARRAY) { - zephir_array_fetch(&_1$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/AbstractValidator.zep", 188); - ZEPHIR_CPY_WRT(&code, &_1$$3); + zephir_array_fetch(&_2$$3, &code, &field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/AbstractValidator.zep", 188); + ZEPHIR_CPY_WRT(&code, &_2$$3); } RETURN_CCTOR(&code); } diff --git a/ext/phalcon/filter/validation/abstractvalidator.zep.h b/ext/phalcon/filter/validation/abstractvalidator.zep.h index 3b02c6a831e..2f82a22868d 100644 --- a/ext/phalcon/filter/validation/abstractvalidator.zep.h +++ b/ext/phalcon/filter/validation/abstractvalidator.zep.h @@ -61,7 +61,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstra ZEND_ARG_INFO(0, field) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstractvalidator_preparecode, 0, 1, IS_LONG, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_validation_abstractvalidator_preparecode, 0, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/filter/validation/abstractvalidatorcomposite.zep.c b/ext/phalcon/filter/validation/abstractvalidatorcomposite.zep.c index 3f0468dc41c..36db5f86a19 100644 --- a/ext/phalcon/filter/validation/abstractvalidatorcomposite.zep.c +++ b/ext/phalcon/filter/validation/abstractvalidatorcomposite.zep.c @@ -99,7 +99,7 @@ PHP_METHOD(Phalcon_Filter_Validation_AbstractValidatorComposite, validate) zephir_get_class(&_2$$3, this_ptr, 0); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_VS(&_3$$3, &_2$$3, " does not have any validator added"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Filter/Validation/AbstractValidatorComposite.zep", 33); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/filter/validation/validator/alnum.zep.c b/ext/phalcon/filter/validation/validator/alnum.zep.c index 7064e6fcbb5..9428278d450 100644 --- a/ext/phalcon/filter/validation/validator/alnum.zep.c +++ b/ext/phalcon/filter/validation/validator/alnum.zep.c @@ -149,7 +149,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Alnum, validate) if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_FUNCTION(&_1, "ctype_alnum", NULL, 306, &value); + ZEPHIR_CALL_FUNCTION(&_1, "ctype_alnum", NULL, 288, &value); zephir_check_call_status(); if (!(zephir_is_true(&_1))) { ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "messagefactory", NULL, 0, validation, field); diff --git a/ext/phalcon/filter/validation/validator/callback.zep.c b/ext/phalcon/filter/validation/validator/callback.zep.c index d4033ddba2c..3de639e7602 100644 --- a/ext/phalcon/filter/validation/validator/callback.zep.c +++ b/ext/phalcon/filter/validation/validator/callback.zep.c @@ -165,7 +165,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Callback, validate) ZEPHIR_CALL_METHOD(&data, validation, "getdata", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&returnedValue, "call_user_func", NULL, 199, &callback, &data); + ZEPHIR_CALL_FUNCTION(&returnedValue, "call_user_func", NULL, 180, &callback, &data); zephir_check_call_status(); _1$$3 = Z_TYPE_P(&returnedValue) == IS_OBJECT; if (_1$$3) { diff --git a/ext/phalcon/filter/validation/validator/confirmation.zep.c b/ext/phalcon/filter/validation/validator/confirmation.zep.c index 85a0f4eafc8..120239f75a7 100644 --- a/ext/phalcon/filter/validation/validator/confirmation.zep.c +++ b/ext/phalcon/filter/validation/validator/confirmation.zep.c @@ -169,7 +169,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Confirmation, validate) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&valueWith, validation, "getvalue", NULL, 0, &fieldWith); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 307, &value, &valueWith); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "compare", NULL, 289, &value, &valueWith); zephir_check_call_status(); if (!(zephir_is_true(&_2))) { ZEPHIR_INIT_VAR(&_3$$4); @@ -252,7 +252,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Confirmation, compare) zephir_check_call_status(); zephir_get_strval(&b, &_5$$3); } - ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 308, &a, &b); + ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 290, &a, &b); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_6, 0)); } diff --git a/ext/phalcon/filter/validation/validator/creditcard.zep.c b/ext/phalcon/filter/validation/validator/creditcard.zep.c index 3b39f744ac1..6853070b66a 100644 --- a/ext/phalcon/filter/validation/validator/creditcard.zep.c +++ b/ext/phalcon/filter/validation/validator/creditcard.zep.c @@ -149,7 +149,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, validate) if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 309, &value); + ZEPHIR_CALL_METHOD(&valid, this_ptr, "verifybyluhnalgorithm", NULL, 291, &value); zephir_check_call_status(); if (!(zephir_is_true(&valid))) { ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "messagefactory", NULL, 0, validation, field); @@ -205,11 +205,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, verifyByLuhnAlgorithm ZEPHIR_INIT_VAR(&hash); ZVAL_STRING(&hash, ""); - ZEPHIR_CALL_FUNCTION(&_0, "str_split", NULL, 115, &number); + ZEPHIR_CALL_FUNCTION(&_0, "str_split", NULL, 84, &number); zephir_check_call_status(); zephir_get_arrval(&_1, &_0); ZEPHIR_CPY_WRT(&digits, &_1); - ZEPHIR_CALL_FUNCTION(&_3, "array_reverse", NULL, 310, &digits); + ZEPHIR_CALL_FUNCTION(&_3, "array_reverse", NULL, 292, &digits); zephir_check_call_status(); zephir_is_iterable(&_3, 0, "phalcon/Filter/Validation/Validator/CreditCard.zep", 109); if (Z_TYPE_P(&_3) == IS_ARRAY) { @@ -259,9 +259,9 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_CreditCard, verifyByLuhnAlgorithm } ZEPHIR_INIT_NVAR(&digit); ZEPHIR_INIT_NVAR(&position); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &hash); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &hash); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "array_sum", NULL, 311, &_10); + ZEPHIR_CALL_FUNCTION(&result, "array_sum", NULL, 293, &_10); zephir_check_call_status(); RETURN_MM_BOOL((zephir_safe_mod_zval_long(&result, 10) == 0)); } diff --git a/ext/phalcon/filter/validation/validator/date.zep.c b/ext/phalcon/filter/validation/validator/date.zep.c index 3d1179372f6..5e6166840f1 100644 --- a/ext/phalcon/filter/validation/validator/date.zep.c +++ b/ext/phalcon/filter/validation/validator/date.zep.c @@ -171,7 +171,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Date, validate) ZEPHIR_INIT_NVAR(&format); ZVAL_STRING(&format, "Y-m-d"); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "checkdate", NULL, 312, &value, &format); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "checkdate", NULL, 294, &value, &format); zephir_check_call_status(); if (!(zephir_is_true(&_3))) { ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "messagefactory", NULL, 0, validation, field); diff --git a/ext/phalcon/filter/validation/validator/digit.zep.c b/ext/phalcon/filter/validation/validator/digit.zep.c index 99096b09c18..9777f073f07 100644 --- a/ext/phalcon/filter/validation/validator/digit.zep.c +++ b/ext/phalcon/filter/validation/validator/digit.zep.c @@ -152,7 +152,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Digit, validate) } _1 = Z_TYPE_P(&value) == IS_LONG; if (!(_1)) { - ZEPHIR_CALL_FUNCTION(&_2, "ctype_digit", NULL, 313, &value); + ZEPHIR_CALL_FUNCTION(&_2, "ctype_digit", NULL, 295, &value); zephir_check_call_status(); _1 = zephir_is_true(&_2); } diff --git a/ext/phalcon/filter/validation/validator/email.zep.c b/ext/phalcon/filter/validation/validator/email.zep.c index aaf6d337a20..be345c21d12 100644 --- a/ext/phalcon/filter/validation/validator/email.zep.c +++ b/ext/phalcon/filter/validation/validator/email.zep.c @@ -151,7 +151,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Email, validate) RETURN_MM_BOOL(1); } ZVAL_LONG(&_1, 274); - ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 298, &value, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "filter_var", NULL, 280, &value, &_1); zephir_check_call_status(); if (!(zephir_is_true(&_2))) { ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "messagefactory", NULL, 0, validation, field); diff --git a/ext/phalcon/filter/validation/validator/exclusionin.zep.c b/ext/phalcon/filter/validation/validator/exclusionin.zep.c index 9dc7d16a1fd..e6fc892ae76 100644 --- a/ext/phalcon/filter/validation/validator/exclusionin.zep.c +++ b/ext/phalcon/filter/validation/validator/exclusionin.zep.c @@ -207,7 +207,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_ExclusionIn, validate) return; } } - ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 314, &value, &domain, &strict); + ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 296, &value, &domain, &strict); zephir_check_call_status(); if (zephir_is_true(&_5)) { ZEPHIR_INIT_VAR(&replacePairs); diff --git a/ext/phalcon/filter/validation/validator/file.zep.c b/ext/phalcon/filter/validation/validator/file.zep.c index b0fc029bcf5..ab4b6d07526 100644 --- a/ext/phalcon/filter/validation/validator/file.zep.c +++ b/ext/phalcon/filter/validation/validator/file.zep.c @@ -242,21 +242,21 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) if (zephir_array_isset_string(&options, SL("messageFileEmpty"))) { ZEPHIR_INIT_VAR(&_0$$3); ZVAL_STRING(&_0$$3, "messageFileEmpty"); - ZEPHIR_CALL_METHOD(&messageFileEmpty, &helper, "__invoke", NULL, 171, &options, &_0$$3); + ZEPHIR_CALL_METHOD(&messageFileEmpty, &helper, "__invoke", NULL, 150, &options, &_0$$3); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageFileEmpty"), PH_SEPARATE); } if (zephir_array_isset_string(&options, SL("messageIniSize"))) { ZEPHIR_INIT_VAR(&_1$$4); ZVAL_STRING(&_1$$4, "messageIniSize"); - ZEPHIR_CALL_METHOD(&messageIniSize, &helper, "__invoke", NULL, 171, &options, &_1$$4); + ZEPHIR_CALL_METHOD(&messageIniSize, &helper, "__invoke", NULL, 150, &options, &_1$$4); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageIniSize"), PH_SEPARATE); } if (zephir_array_isset_string(&options, SL("messageValid"))) { ZEPHIR_INIT_VAR(&_2$$5); ZVAL_STRING(&_2$$5, "messageValid"); - ZEPHIR_CALL_METHOD(&messageValid, &helper, "__invoke", NULL, 171, &options, &_2$$5); + ZEPHIR_CALL_METHOD(&messageValid, &helper, "__invoke", NULL, 150, &options, &_2$$5); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageValid"), PH_SEPARATE); } @@ -274,40 +274,40 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) ZVAL_COPY(&value, _3); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "minSize"); - ZEPHIR_CALL_FUNCTION(&_8$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_8$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "maxSize"); - ZEPHIR_CALL_FUNCTION(&_10$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_10$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "equalSize"); - ZEPHIR_CALL_FUNCTION(&_11$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "allowedTypes"); - ZEPHIR_CALL_FUNCTION(&_12$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_12$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "maxResolution"); - ZEPHIR_CALL_FUNCTION(&_13$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_13$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "minResolution"); - ZEPHIR_CALL_FUNCTION(&_14$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_14$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "equalResolution"); - ZEPHIR_CALL_FUNCTION(&_15$$6, "strcasecmp", &_9, 47, &key, &_7$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "strcasecmp", &_9, 35, &key, &_7$$6); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_8$$6, 0)) { ZEPHIR_INIT_NVAR(&_16$$7); ZVAL_STRING(&_16$$7, "messageMinSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_16$$7); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_16$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$7); ZVAL_STRING(&_16$$7, "includedMinSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_16$$7); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_16$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_min_ce); @@ -316,18 +316,18 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_17$$7, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_17$$7, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_17$$7, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_18, 315, &_17$$7); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_18, 297, &_17$$7); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_10$$6, 0)) { ZEPHIR_INIT_NVAR(&_19$$8); ZVAL_STRING(&_19$$8, "messageSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_19$$8); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_19$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$8); ZVAL_STRING(&_19$$8, "includedSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_19$$8); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_19$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_max_ce); @@ -336,7 +336,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_20$$8, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_20$$8, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_20$$8, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_21, 316, &_20$$8); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_21, 298, &_20$$8); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE); @@ -344,7 +344,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_11$$6, 0)) { ZEPHIR_INIT_NVAR(&_22$$9); ZVAL_STRING(&_22$$9, "messageEqualSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_22$$9); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_22$$9); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_equal_ce); @@ -352,14 +352,14 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_23$$9, 2, 0); zephir_array_update_string(&_23$$9, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_23$$9, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_24, 317, &_23$$9); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_24, 299, &_23$$9); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_12$$6, 0)) { ZEPHIR_INIT_NVAR(&_25$$10); ZVAL_STRING(&_25$$10, "messageType"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_25$$10); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_25$$10); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_mimetype_ce); @@ -367,18 +367,18 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_26$$10, 2, 0); zephir_array_update_string(&_26$$10, SL("types"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_26$$10, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_27, 318, &_26$$10); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_27, 300, &_26$$10); zephir_check_call_status(); zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$6, 0)) { ZEPHIR_INIT_NVAR(&_28$$11); ZVAL_STRING(&_28$$11, "messageMaxResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_28$$11); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_28$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$11); ZVAL_STRING(&_28$$11, "includedMaxResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_28$$11); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_28$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_max_ce); @@ -387,7 +387,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_29$$11, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_29$$11, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_29$$11, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_30, 319, &_29$$11); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_30, 301, &_29$$11); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE); @@ -395,11 +395,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_14$$6, 0)) { ZEPHIR_INIT_NVAR(&_31$$12); ZVAL_STRING(&_31$$12, "messageMinResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_31$$12); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_31$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_31$$12); ZVAL_STRING(&_31$$12, "includedMinResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_31$$12); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_31$$12); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_min_ce); @@ -408,7 +408,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_32$$12, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_32$$12, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_32$$12, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_33, 320, &_32$$12); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_33, 302, &_32$$12); zephir_check_call_status(); zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE); @@ -416,7 +416,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_15$$6, 0)) { ZEPHIR_INIT_NVAR(&_34$$13); ZVAL_STRING(&_34$$13, "messageEqualResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_34$$13); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_34$$13); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_equal_ce); @@ -424,7 +424,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_35$$13, 2, 0); zephir_array_update_string(&_35$$13, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_35$$13, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_35$$13); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_35$$13); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE); @@ -432,15 +432,15 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) continue; } if (Z_TYPE_P(&messageFileEmpty) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 322, &messageFileEmpty); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 304, &messageFileEmpty); zephir_check_call_status(); } if (Z_TYPE_P(&messageIniSize) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 323, &messageIniSize); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 305, &messageIniSize); zephir_check_call_status(); } if (Z_TYPE_P(&messageValid) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 324, &messageValid); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 306, &messageValid); zephir_check_call_status(); } zephir_update_property_array_append(this_ptr, SL("validators"), &validator); @@ -460,40 +460,40 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "minSize"); - ZEPHIR_CALL_FUNCTION(&_41$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_41$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "maxSize"); - ZEPHIR_CALL_FUNCTION(&_42$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_42$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "equalSize"); - ZEPHIR_CALL_FUNCTION(&_43$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_43$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "allowedTypes"); - ZEPHIR_CALL_FUNCTION(&_44$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_44$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "maxResolution"); - ZEPHIR_CALL_FUNCTION(&_45$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_45$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "minResolution"); - ZEPHIR_CALL_FUNCTION(&_46$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_46$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_40$$18); ZVAL_STRING(&_40$$18, "equalResolution"); - ZEPHIR_CALL_FUNCTION(&_47$$18, "strcasecmp", &_9, 47, &key, &_40$$18); + ZEPHIR_CALL_FUNCTION(&_47$$18, "strcasecmp", &_9, 35, &key, &_40$$18); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_41$$18, 0)) { ZEPHIR_INIT_NVAR(&_48$$19); ZVAL_STRING(&_48$$19, "messageMinSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_48$$19); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_48$$19); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_48$$19); ZVAL_STRING(&_48$$19, "includedMinSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_48$$19); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_48$$19); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_min_ce); @@ -502,18 +502,18 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_49$$19, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_49$$19, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_49$$19, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_49$$19); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_49$$19); zephir_check_call_status(); zephir_array_unset_string(&options, SL("messageMinSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_42$$18, 0)) { ZEPHIR_INIT_NVAR(&_50$$20); ZVAL_STRING(&_50$$20, "messageSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_50$$20); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_50$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_50$$20); ZVAL_STRING(&_50$$20, "includedSize"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_50$$20); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_50$$20); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_max_ce); @@ -522,7 +522,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_51$$20, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_51$$20, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_51$$20, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_51$$20); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_51$$20); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageSize"), PH_SEPARATE); @@ -530,7 +530,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_43$$18, 0)) { ZEPHIR_INIT_NVAR(&_52$$21); ZVAL_STRING(&_52$$21, "messageEqualSize"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_52$$21); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_52$$21); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_size_equal_ce); @@ -538,14 +538,14 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_53$$21, 2, 0); zephir_array_update_string(&_53$$21, SL("size"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_53$$21, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_53$$21); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_53$$21); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalSize"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualSize"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_44$$18, 0)) { ZEPHIR_INIT_NVAR(&_54$$22); ZVAL_STRING(&_54$$22, "messageType"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_54$$22); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_54$$22); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_mimetype_ce); @@ -553,18 +553,18 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_55$$22, 2, 0); zephir_array_update_string(&_55$$22, SL("types"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_55$$22, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_55$$22); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_55$$22); zephir_check_call_status(); zephir_array_unset_string(&options, SL("allowedTypes"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageType"), PH_SEPARATE); } else if (ZEPHIR_IS_LONG_IDENTICAL(&_45$$18, 0)) { ZEPHIR_INIT_NVAR(&_56$$23); ZVAL_STRING(&_56$$23, "messageMaxResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_56$$23); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_56$$23); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_56$$23); ZVAL_STRING(&_56$$23, "includedMaxResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_56$$23); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_56$$23); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_max_ce); @@ -573,7 +573,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_57$$23, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_57$$23, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_57$$23, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_57$$23); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_57$$23); zephir_check_call_status(); zephir_array_unset_string(&options, SL("maxResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMaxResolution"), PH_SEPARATE); @@ -581,11 +581,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_46$$18, 0)) { ZEPHIR_INIT_NVAR(&_58$$24); ZVAL_STRING(&_58$$24, "messageMinResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_58$$24); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_58$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_58$$24); ZVAL_STRING(&_58$$24, "includedMinResolution"); - ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 171, &options, &_58$$24); + ZEPHIR_CALL_METHOD(&included, &helper, "__invoke", NULL, 150, &options, &_58$$24); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_min_ce); @@ -594,7 +594,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_array_update_string(&_59$$24, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_59$$24, SL("included"), &included, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_59$$24, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_59$$24); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_59$$24); zephir_check_call_status(); zephir_array_unset_string(&options, SL("minResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("includedMinResolution"), PH_SEPARATE); @@ -602,7 +602,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) } else if (ZEPHIR_IS_LONG_IDENTICAL(&_47$$18, 0)) { ZEPHIR_INIT_NVAR(&_60$$25); ZVAL_STRING(&_60$$25, "messageEqualResolution"); - ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 171, &options, &_60$$25); + ZEPHIR_CALL_METHOD(&message, &helper, "__invoke", NULL, 150, &options, &_60$$25); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&validator); object_init_ex(&validator, phalcon_filter_validation_validator_file_resolution_equal_ce); @@ -610,7 +610,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) zephir_create_array(&_61$$25, 2, 0); zephir_array_update_string(&_61$$25, SL("resolution"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_61$$25, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 321, &_61$$25); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_36, 303, &_61$$25); zephir_check_call_status(); zephir_array_unset_string(&options, SL("equalResolution"), PH_SEPARATE); zephir_array_unset_string(&options, SL("messageEqualResolution"), PH_SEPARATE); @@ -618,15 +618,15 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File, __construct) continue; } if (Z_TYPE_P(&messageFileEmpty) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 322, &messageFileEmpty); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagefileempty", &_37, 304, &messageFileEmpty); zephir_check_call_status(); } if (Z_TYPE_P(&messageIniSize) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 323, &messageIniSize); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessageinisize", &_38, 305, &messageIniSize); zephir_check_call_status(); } if (Z_TYPE_P(&messageValid) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 324, &messageValid); + ZEPHIR_CALL_METHOD(NULL, &validator, "setmessagevalid", &_39, 306, &messageValid); zephir_check_call_status(); } zephir_update_property_array_append(this_ptr, SL("validators"), &validator); diff --git a/ext/phalcon/filter/validation/validator/file/mimetype.zep.c b/ext/phalcon/filter/validation/validator/file/mimetype.zep.c index fbe4cdaede7..5945ec2c6d6 100644 --- a/ext/phalcon/filter/validation/validator/file/mimetype.zep.c +++ b/ext/phalcon/filter/validation/validator/file/mimetype.zep.c @@ -147,12 +147,12 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File_MimeType, validate) } if ((zephir_function_exists_ex(ZEND_STRL("finfo_open")) == SUCCESS)) { ZVAL_LONG(&_2$$6, 16); - ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 325, &_2$$6); + ZEPHIR_CALL_FUNCTION(&tmp, "finfo_open", NULL, 307, &_2$$6); zephir_check_call_status(); zephir_array_fetch_string(&_3$$6, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/MimeType.zep", 101); - ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 326, &tmp, &_3$$6); + ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 308, &tmp, &_3$$6); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 327, &tmp); + ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 309, &tmp); zephir_check_call_status(); } else { ZEPHIR_OBS_NVAR(&mime); diff --git a/ext/phalcon/filter/validation/validator/file/resolution/equal.zep.c b/ext/phalcon/filter/validation/validator/file/resolution/equal.zep.c index 434afdb5da7..7f0e59ab96a 100644 --- a/ext/phalcon/filter/validation/validator/file/resolution/equal.zep.c +++ b/ext/phalcon/filter/validation/validator/file/resolution/equal.zep.c @@ -169,7 +169,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Equal, validate) ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep", 88); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Equal.zep", 89); diff --git a/ext/phalcon/filter/validation/validator/file/resolution/max.zep.c b/ext/phalcon/filter/validation/validator/file/resolution/max.zep.c index 69efbfa0075..d344a114a16 100644 --- a/ext/phalcon/filter/validation/validator/file/resolution/max.zep.c +++ b/ext/phalcon/filter/validation/validator/file/resolution/max.zep.c @@ -180,7 +180,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Max, validate) ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Max.zep", 94); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Max.zep", 95); diff --git a/ext/phalcon/filter/validation/validator/file/resolution/min.zep.c b/ext/phalcon/filter/validation/validator/file/resolution/min.zep.c index 34509a9868f..2fa7a808777 100644 --- a/ext/phalcon/filter/validation/validator/file/resolution/min.zep.c +++ b/ext/phalcon/filter/validation/validator/file/resolution/min.zep.c @@ -180,7 +180,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_File_Resolution_Min, validate) ZEPHIR_CALL_METHOD(&value, validation, "getvalue", NULL, 0, field); zephir_check_call_status(); zephir_array_fetch_string(&_1, &value, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/File/Resolution/Min.zep", 94); - ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 328, &_1); + ZEPHIR_CALL_FUNCTION(&tmp, "getimagesize", NULL, 310, &_1); zephir_check_call_status(); ZEPHIR_OBS_VAR(&width); zephir_array_fetch_long(&width, &tmp, 0, PH_NOISY, "phalcon/Filter/Validation/Validator/File/Resolution/Min.zep", 95); diff --git a/ext/phalcon/filter/validation/validator/inclusionin.zep.c b/ext/phalcon/filter/validation/validator/inclusionin.zep.c index 07efc52353b..d9affc22cf3 100644 --- a/ext/phalcon/filter/validation/validator/inclusionin.zep.c +++ b/ext/phalcon/filter/validation/validator/inclusionin.zep.c @@ -201,7 +201,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_InclusionIn, validate) return; } } - ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 314, &value, &domain, &strict); + ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 296, &value, &domain, &strict); zephir_check_call_status(); if (!(zephir_is_true(&_5))) { ZEPHIR_INIT_VAR(&replacePairs); diff --git a/ext/phalcon/filter/validation/validator/ip.zep.c b/ext/phalcon/filter/validation/validator/ip.zep.c index 67d35951a49..e3143edb4e6 100644 --- a/ext/phalcon/filter/validation/validator/ip.zep.c +++ b/ext/phalcon/filter/validation/validator/ip.zep.c @@ -240,7 +240,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Ip, validate) zephir_bitwise_or_function(&_10, &_9, &allowReserved); zephir_array_update_string(&options, SL("flags"), &_10, PH_COPY | PH_SEPARATE); ZVAL_LONG(&_2, 275); - ZEPHIR_CALL_FUNCTION(&_11, "filter_var", NULL, 298, &value, &_2, &options); + ZEPHIR_CALL_FUNCTION(&_11, "filter_var", NULL, 280, &value, &_2, &options); zephir_check_call_status(); if (!(zephir_is_true(&_11))) { ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "messagefactory", NULL, 0, validation, field); diff --git a/ext/phalcon/filter/validation/validator/regex.zep.c b/ext/phalcon/filter/validation/validator/regex.zep.c index a07ec820af6..a4f26e39996 100644 --- a/ext/phalcon/filter/validation/validator/regex.zep.c +++ b/ext/phalcon/filter/validation/validator/regex.zep.c @@ -126,10 +126,10 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, __construct) */ PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) { - zend_bool failed = 0; + zend_bool failed = 0, _3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validation, validation_sub, *field, field_sub, matches, value, pattern, _0, _1, _2$$4, _3$$5, _4$$7; + zval *validation, validation_sub, *field, field_sub, matches, value, pattern, _0, _1, _2$$4, _4$$5, _5$$7; zval *this_ptr = getThis(); ZVAL_UNDEF(&validation_sub); @@ -140,8 +140,8 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$7); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) @@ -172,18 +172,22 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Regex, validate) zephir_array_fetch(&_2$$4, &pattern, field, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 94); ZEPHIR_CPY_WRT(&pattern, &_2$$4); } - ZEPHIR_INIT_NVAR(&_1); - zephir_preg_match(&_1, &pattern, &value, &matches, 0, 0 , 0 ); - if (zephir_is_true(&_1)) { - zephir_array_fetch_long(&_3$$5, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 98); - failed = !ZEPHIR_IS_EQUAL(&_3$$5, &value); + _3 = Z_TYPE_P(&value) != IS_NULL; + if (_3) { + ZEPHIR_INIT_NVAR(&_1); + zephir_preg_match(&_1, &pattern, &value, &matches, 0, 0 , 0 ); + _3 = zephir_is_true(&_1); + } + if (_3) { + zephir_array_fetch_long(&_4$$5, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/Filter/Validation/Validator/Regex.zep", 101); + failed = !ZEPHIR_IS_EQUAL(&_4$$5, &value); } else { failed = 1; } if (failed) { - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "messagefactory", NULL, 0, validation, field); + ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "messagefactory", NULL, 0, validation, field); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, validation, "appendmessage", NULL, 0, &_5$$7); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/filter/validation/validator/stringlength.zep.c b/ext/phalcon/filter/validation/validator/stringlength.zep.c index 82021449d56..423ec383a71 100644 --- a/ext/phalcon/filter/validation/validator/stringlength.zep.c +++ b/ext/phalcon/filter/validation/validator/stringlength.zep.c @@ -177,11 +177,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) ZVAL_COPY(&value, _0); ZEPHIR_INIT_NVAR(&_4$$3); ZVAL_STRING(&_4$$3, "min"); - ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 47, &key, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "strcasecmp", &_6, 35, &key, &_4$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_4$$3); ZVAL_STRING(&_4$$3, "max"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 47, &key, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "strcasecmp", &_6, 35, &key, &_4$$3); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_5$$3, 0)) { if (zephir_array_isset_string(&options, SL("message"))) { @@ -205,7 +205,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_8$$4, SL("min"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$4, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$4, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_9, 329, &_8$$4); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_9, 311, &_8$$4); zephir_check_call_status(); zephir_array_unset_string(&options, SL("min"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -234,7 +234,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_10$$9, SL("max"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$9, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$9, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_10$$9); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_10$$9); zephir_check_call_status(); zephir_array_unset_string(&options, SL("max"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -261,11 +261,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$15); ZVAL_STRING(&_12$$15, "min"); - ZEPHIR_CALL_FUNCTION(&_13$$15, "strcasecmp", &_6, 47, &key, &_12$$15); + ZEPHIR_CALL_FUNCTION(&_13$$15, "strcasecmp", &_6, 35, &key, &_12$$15); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$15); ZVAL_STRING(&_12$$15, "max"); - ZEPHIR_CALL_FUNCTION(&_14$$15, "strcasecmp", &_6, 47, &key, &_12$$15); + ZEPHIR_CALL_FUNCTION(&_14$$15, "strcasecmp", &_6, 35, &key, &_12$$15); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$15, 0)) { if (zephir_array_isset_string(&options, SL("message"))) { @@ -289,7 +289,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_15$$16, SL("min"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$16, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$16, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_15$$16); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_15$$16); zephir_check_call_status(); zephir_array_unset_string(&options, SL("min"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); @@ -318,7 +318,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength, __construct) zephir_array_update_string(&_16$$21, SL("max"), &value, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$21, SL("message"), &message, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$21, SL("included"), &included, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 330, &_16$$21); + ZEPHIR_CALL_METHOD(NULL, &validator, "__construct", &_11, 312, &_16$$21); zephir_check_call_status(); zephir_array_unset_string(&options, SL("max"), PH_SEPARATE); zephir_array_unset_string(&options, SL("message"), PH_SEPARATE); diff --git a/ext/phalcon/filter/validation/validator/stringlength/max.zep.c b/ext/phalcon/filter/validation/validator/stringlength/max.zep.c index db1038c76ad..c169963bfbd 100644 --- a/ext/phalcon/filter/validation/validator/stringlength/max.zep.c +++ b/ext/phalcon/filter/validation/validator/stringlength/max.zep.c @@ -174,7 +174,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength_Max, validate) RETURN_MM_BOOL(1); } if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &value); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &value); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&length); diff --git a/ext/phalcon/filter/validation/validator/stringlength/min.zep.c b/ext/phalcon/filter/validation/validator/stringlength/min.zep.c index c504524a53a..4189c4c2d39 100644 --- a/ext/phalcon/filter/validation/validator/stringlength/min.zep.c +++ b/ext/phalcon/filter/validation/validator/stringlength/min.zep.c @@ -174,7 +174,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_StringLength_Min, validate) RETURN_MM_BOOL(1); } if ((zephir_function_exists_ex(ZEND_STRL("mb_strlen")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &value); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &value); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&length); diff --git a/ext/phalcon/filter/validation/validator/uniqueness.zep.c b/ext/phalcon/filter/validation/validator/uniqueness.zep.c index 2371bcf310b..bf6299a1859 100644 --- a/ext/phalcon/filter/validation/validator/uniqueness.zep.c +++ b/ext/phalcon/filter/validation/validator/uniqueness.zep.c @@ -648,7 +648,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Uniqueness, isUniquenessModel) zephir_array_keys(&_10$$6, &except); ZVAL_LONG(&_11$$6, 0); ZVAL_LONG(&_12$$6, (zephir_fast_count_int(&except) - 1)); - ZEPHIR_CALL_FUNCTION(&_13$$6, "range", &_14, 331, &_11$$6, &_12$$6); + ZEPHIR_CALL_FUNCTION(&_13$$6, "range", &_14, 313, &_11$$6, &_12$$6); zephir_check_call_status(); _9$$6 = !ZEPHIR_IS_IDENTICAL(&_10$$6, &_13$$6); } @@ -1052,7 +1052,7 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Uniqueness, isUniquenessModel) zephir_array_keys(&_88$$37, &except); ZVAL_LONG(&_89$$37, 0); ZVAL_LONG(&_90$$37, (zephir_fast_count_int(&except) - 1)); - ZEPHIR_CALL_FUNCTION(&_91$$37, "range", &_14, 331, &_89$$37, &_90$$37); + ZEPHIR_CALL_FUNCTION(&_91$$37, "range", &_14, 313, &_89$$37, &_90$$37); zephir_check_call_status(); _87$$37 = !ZEPHIR_IS_IDENTICAL(&_88$$37, &_91$$37); } diff --git a/ext/phalcon/filter/validation/validator/url.zep.c b/ext/phalcon/filter/validation/validator/url.zep.c index 6c7abac64af..a1df2590da1 100644 --- a/ext/phalcon/filter/validation/validator/url.zep.c +++ b/ext/phalcon/filter/validation/validator/url.zep.c @@ -159,11 +159,11 @@ PHP_METHOD(Phalcon_Filter_Validation_Validator_Url, validate) zephir_read_property(&_1, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset_string_fetch(&options, &_1, SL("options"), 0)) { ZVAL_LONG(&_2$$4, 273); - ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 298, &value, &_2$$4, &options); + ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 280, &value, &_2$$4, &options); zephir_check_call_status(); } else { ZVAL_LONG(&_3$$5, 273); - ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 298, &value, &_3$$5); + ZEPHIR_CALL_FUNCTION(&result, "filter_var", NULL, 280, &value, &_3$$5); zephir_check_call_status(); } if (!(zephir_is_true(&result))) { diff --git a/ext/phalcon/flash/abstractflash.zep.c b/ext/phalcon/flash/abstractflash.zep.c index 22e84fc3c73..9bdafc49e6f 100644 --- a/ext/phalcon/flash/abstractflash.zep.c +++ b/ext/phalcon/flash/abstractflash.zep.c @@ -690,9 +690,9 @@ PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage) { ZEPHIR_INIT_NVAR(&item); ZVAL_COPY(&item, _2); - ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 109, &item); + ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 78, &item); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 110, &type, &prepared); + ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 79, &type, &prepared); zephir_check_call_status(); zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_6$$5)) { @@ -713,9 +713,9 @@ PHP_METHOD(Phalcon_Flash_AbstractFlash, outputMessage) } ZEPHIR_CALL_METHOD(&item, message, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 109, &item); + ZEPHIR_CALL_METHOD(&prepared, this_ptr, "prepareescapedmessage", &_4, 78, &item); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 110, &type, &prepared); + ZEPHIR_CALL_METHOD(&html, this_ptr, "preparehtmlmessage", &_5, 79, &type, &prepared); zephir_check_call_status(); zephir_read_property(&_7$$8, this_ptr, ZEND_STRL("implicitFlush"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$8)) { @@ -941,13 +941,13 @@ PHP_METHOD(Phalcon_Flash_AbstractFlash, prepareHtmlMessage) RETURN_CTOR(&message); } zephir_read_property(&_1, this_ptr, ZEND_STRL("cssClasses"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&cssClasses, this_ptr, "checkclasses", NULL, 111, &_1, &type); + ZEPHIR_CALL_METHOD(&cssClasses, this_ptr, "checkclasses", NULL, 80, &_1, &type); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("cssIconClasses"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&cssIconClasses, this_ptr, "checkclasses", NULL, 111, &_2, &type); + ZEPHIR_CALL_METHOD(&cssIconClasses, this_ptr, "checkclasses", NULL, 80, &_2, &type); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("interpolator"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 112, &cssClasses, &cssIconClasses); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "gettemplate", NULL, 81, &cssClasses, &cssIconClasses); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); zephir_create_array(&_5, 3, 0); diff --git a/ext/phalcon/forms/element/abstractelement.zep.c b/ext/phalcon/forms/element/abstractelement.zep.c index f09761c9a16..69996a2b050 100644 --- a/ext/phalcon/forms/element/abstractelement.zep.c +++ b/ext/phalcon/forms/element/abstractelement.zep.c @@ -88,7 +88,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_AbstractElement) } /** - * Phalcon\Forms\Element constructor + * Constructor * * @param string name Attribute name (value of 'name' attribute of HTML element) * @param array attributes Additional HTML element attributes diff --git a/ext/phalcon/forms/element/email.zep.c b/ext/phalcon/forms/element/email.zep.c index 0cdde1a4e73..60faae25942 100644 --- a/ext/phalcon/forms/element/email.zep.c +++ b/ext/phalcon/forms/element/email.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Email - * * Component INPUT[type=email] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Email) diff --git a/ext/phalcon/forms/element/hidden.zep.c b/ext/phalcon/forms/element/hidden.zep.c index 6b7d13e3c34..8e14d29ed19 100644 --- a/ext/phalcon/forms/element/hidden.zep.c +++ b/ext/phalcon/forms/element/hidden.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Hidden - * * Component INPUT[type=hidden] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Hidden) diff --git a/ext/phalcon/forms/element/numeric.zep.c b/ext/phalcon/forms/element/numeric.zep.c index c8022b2c9a5..6f51c9ad40c 100644 --- a/ext/phalcon/forms/element/numeric.zep.c +++ b/ext/phalcon/forms/element/numeric.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Numeric - * * Component INPUT[type=number] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Numeric) diff --git a/ext/phalcon/forms/element/password.zep.c b/ext/phalcon/forms/element/password.zep.c index 411211e5e4b..53e3111734e 100644 --- a/ext/phalcon/forms/element/password.zep.c +++ b/ext/phalcon/forms/element/password.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Password - * * Component INPUT[type=password] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Password) diff --git a/ext/phalcon/forms/element/radio.zep.c b/ext/phalcon/forms/element/radio.zep.c index 30b19d00d89..d857b61ae34 100644 --- a/ext/phalcon/forms/element/radio.zep.c +++ b/ext/phalcon/forms/element/radio.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Radio - * * Component INPUT[type=radio] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Radio) diff --git a/ext/phalcon/forms/element/select.zep.c b/ext/phalcon/forms/element/select.zep.c index 583ca012f44..af9df3b69af 100644 --- a/ext/phalcon/forms/element/select.zep.c +++ b/ext/phalcon/forms/element/select.zep.c @@ -28,8 +28,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Select - * * Component SELECT (choice) for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Select) @@ -44,7 +42,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Select) } /** - * Phalcon\Forms\Element constructor + * Constructor * * @param object|array options * @param array attributes @@ -126,7 +124,7 @@ PHP_METHOD(Phalcon_Forms_Element_Select, addOption) if (Z_TYPE_P(option) == IS_ARRAY) { - zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 53); + zephir_is_iterable(option, 0, "phalcon/Forms/Element/Select.zep", 51); if (Z_TYPE_P(option) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(option), _2$$3, _3$$3, _0$$3) { diff --git a/ext/phalcon/forms/element/text.zep.c b/ext/phalcon/forms/element/text.zep.c index dd2899c4722..d6e16876641 100644 --- a/ext/phalcon/forms/element/text.zep.c +++ b/ext/phalcon/forms/element/text.zep.c @@ -23,8 +23,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Forms\Element\Text - * * Component INPUT[type=text] for forms */ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Text) diff --git a/ext/phalcon/forms/form.zep.c b/ext/phalcon/forms/form.zep.c index 7bd9e52f03a..14ecfd3dcb2 100644 --- a/ext/phalcon/forms/form.zep.c +++ b/ext/phalcon/forms/form.zep.c @@ -169,7 +169,7 @@ PHP_METHOD(Phalcon_Forms_Form, __construct) zephir_update_property_zval(this_ptr, ZEND_STRL("options"), &userOptions); ZEPHIR_INIT_VAR(&_1); object_init_ex(&_1, phalcon_html_attributes_ce); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1); if ((zephir_method_exists_ex(this_ptr, ZEND_STRL("initialize")) == SUCCESS)) { @@ -736,7 +736,7 @@ PHP_METHOD(Phalcon_Forms_Form, get) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 343); ZEPHIR_MM_RESTORE(); @@ -794,7 +794,7 @@ PHP_METHOD(Phalcon_Forms_Form, getAttributes) if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { ZEPHIR_INIT_VAR(&_1$$3); object_init_ex(&_1$$3, phalcon_html_attributes_ce); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 24); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 22); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1$$3); } @@ -921,7 +921,7 @@ PHP_METHOD(Phalcon_Forms_Form, getLabel) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 418); ZEPHIR_MM_RESTORE(); @@ -1408,7 +1408,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) if (_7) { ZEPHIR_INIT_NVAR(&validation); object_init_ex(&validation, phalcon_filter_validation_ce); - ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 332); + ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 314); zephir_check_call_status(); } zephir_read_property(&_8, this_ptr, ZEND_STRL("elements"), PH_NOISY_CC | PH_READONLY); @@ -1431,7 +1431,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) { ZEPHIR_INIT_NVAR(&validator); ZVAL_COPY(&validator, _11$$10); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -1445,7 +1445,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) } ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); zephir_check_call_status(); @@ -1455,7 +1455,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 334, &name, &filters); + ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 316, &name, &filters); zephir_check_call_status(); } } ZEND_HASH_FOREACH_END(); @@ -1483,7 +1483,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) { ZEPHIR_INIT_NVAR(&validator); ZVAL_COPY(&validator, _15$$15); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); } ZEND_HASH_FOREACH_END(); } else { @@ -1497,7 +1497,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) } ZEPHIR_CALL_METHOD(&validator, &validators, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 333, &name, &validator); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_13, 315, &name, &validator); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &validators, "next", NULL, 0); zephir_check_call_status(); @@ -1507,7 +1507,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&filters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 334, &name, &filters); + ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_14, 316, &name, &filters); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, &_8, "next", NULL, 0); @@ -1515,7 +1515,7 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) } } ZEPHIR_INIT_NVAR(&element); - ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 335, data, entity); + ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 317, data, entity); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_17, &messages, "count", NULL, 0); zephir_check_call_status(); @@ -1613,7 +1613,7 @@ PHP_METHOD(Phalcon_Forms_Form, label) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 748); ZEPHIR_MM_RESTORE(); @@ -1690,7 +1690,7 @@ PHP_METHOD(Phalcon_Forms_Form, render) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Form.zep", 772); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/forms/form.zep.h b/ext/phalcon/forms/form.zep.h index 432dd0a2e32..ad501f307ea 100644 --- a/ext/phalcon/forms/form.zep.h +++ b/ext/phalcon/forms/form.zep.h @@ -82,7 +82,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_count, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_get, 0, 1, Phalcon\\Forms\\Element\\ElementInterface, 0) @@ -227,11 +231,7 @@ ZEPHIR_INIT_FUNCS(phalcon_forms_form_method_entry) { PHP_ME(Phalcon_Forms_Form, bind, arginfo_phalcon_forms_form_bind, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, clear, arginfo_phalcon_forms_form_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, count, arginfo_phalcon_forms_form_count, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Forms_Form, current, arginfo_phalcon_forms_form_current, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Forms_Form, current, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Forms_Form, get, arginfo_phalcon_forms_form_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getAction, arginfo_phalcon_forms_form_getaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getAttributes, arginfo_phalcon_forms_form_getattributes, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/forms/manager.zep.c b/ext/phalcon/forms/manager.zep.c index 16d15bf0d25..7eb311748c5 100644 --- a/ext/phalcon/forms/manager.zep.c +++ b/ext/phalcon/forms/manager.zep.c @@ -83,7 +83,7 @@ PHP_METHOD(Phalcon_Forms_Manager, create) ZEPHIR_INIT_VAR(&form); object_init_ex(&form, phalcon_forms_form_ce); - ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 336, entity); + ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 318, entity); zephir_check_call_status(); zephir_update_property_array(this_ptr, SL("forms"), &name, &form); RETURN_CCTOR(&form); @@ -125,7 +125,7 @@ PHP_METHOD(Phalcon_Forms_Manager, get) object_init_ex(&_1$$3, phalcon_forms_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "There is no form with name='", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Forms/Manager.zep", 46); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/html/attributes.zep.c b/ext/phalcon/html/attributes.zep.c index f5d360a3731..b3a4e739a64 100644 --- a/ext/phalcon/html/attributes.zep.c +++ b/ext/phalcon/html/attributes.zep.c @@ -164,7 +164,7 @@ PHP_METHOD(Phalcon_Html_Attributes, renderAttributes) ZVAL_LONG(&_5$$4, 3); ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_STRING(&_6$$4, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_7$$4, "htmlspecialchars", &_8, 337, &value, &_5$$4, &_6$$4, &__$true); + ZEPHIR_CALL_FUNCTION(&_7$$4, "htmlspecialchars", &_8, 319, &value, &_5$$4, &_6$$4, &__$true); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_9$$4); ZEPHIR_CONCAT_VSVS(&_9$$4, &key, "=\"", &_7$$4, "\" "); @@ -192,7 +192,7 @@ PHP_METHOD(Phalcon_Html_Attributes, renderAttributes) ZVAL_LONG(&_11$$6, 3); ZEPHIR_INIT_NVAR(&_12$$6); ZVAL_STRING(&_12$$6, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_13$$6, "htmlspecialchars", &_8, 337, &value, &_11$$6, &_12$$6, &__$true); + ZEPHIR_CALL_FUNCTION(&_13$$6, "htmlspecialchars", &_8, 319, &value, &_11$$6, &_12$$6, &__$true); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$6); ZEPHIR_CONCAT_VSVS(&_14$$6, &key, "=\"", &_13$$6, "\" "); diff --git a/ext/phalcon/html/breadcrumbs.zep.c b/ext/phalcon/html/breadcrumbs.zep.c index 9fb8cff8c1a..164dbc9d889 100644 --- a/ext/phalcon/html/breadcrumbs.zep.c +++ b/ext/phalcon/html/breadcrumbs.zep.c @@ -267,7 +267,7 @@ PHP_METHOD(Phalcon_Html_Breadcrumbs, render) ZEPHIR_INIT_VAR(&urls); zephir_array_keys(&urls, &elements); ZEPHIR_MAKE_REF(&urls); - ZEPHIR_CALL_FUNCTION(&lastUrl, "end", NULL, 338, &urls); + ZEPHIR_CALL_FUNCTION(&lastUrl, "end", NULL, 320, &urls); ZEPHIR_UNREF(&urls); zephir_check_call_status(); ZEPHIR_OBS_VAR(&lastLabel); diff --git a/ext/phalcon/html/escaper.zep.c b/ext/phalcon/html/escaper.zep.c index 9700fd94866..3c64b70d14a 100644 --- a/ext/phalcon/html/escaper.zep.c +++ b/ext/phalcon/html/escaper.zep.c @@ -125,7 +125,7 @@ PHP_METHOD(Phalcon_Html_Escaper, attributes) zephir_read_property(&_0, this_ptr, ZEND_STRL("encoding"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("doubleEncode"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2, 3); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 337, &input, &_2, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 319, &input, &_2, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -161,9 +161,9 @@ PHP_METHOD(Phalcon_Html_Escaper, css) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 339, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 321, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapecss", NULL, 340, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapecss", NULL, 322, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -236,7 +236,7 @@ PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) { ZEPHIR_INIT_NVAR(&charset); ZVAL_COPY(&charset, _2); - ZEPHIR_CALL_FUNCTION(&_4$$5, "mb_detect_encoding", &_5, 341, &input, &charset, &__$true); + ZEPHIR_CALL_FUNCTION(&_4$$5, "mb_detect_encoding", &_5, 323, &input, &charset, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_4$$5)) { RETURN_CCTOR(&charset); @@ -253,7 +253,7 @@ PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) } ZEPHIR_CALL_METHOD(&charset, &_0, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$7, "mb_detect_encoding", &_5, 341, &input, &charset, &__$true); + ZEPHIR_CALL_FUNCTION(&_6$$7, "mb_detect_encoding", &_5, 323, &input, &charset, &__$true); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_6$$7)) { RETURN_CCTOR(&charset); @@ -263,7 +263,7 @@ PHP_METHOD(Phalcon_Html_Escaper, detectEncoding) } } ZEPHIR_INIT_NVAR(&charset); - ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_5, 341, &input); + ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_5, 323, &input); zephir_check_call_status(); RETURN_MM(); } @@ -502,7 +502,7 @@ PHP_METHOD(Phalcon_Html_Escaper, html) zephir_read_property(&_0, this_ptr, ZEND_STRL("flags"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_1, this_ptr, ZEND_STRL("encoding"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2, this_ptr, ZEND_STRL("doubleEncode"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 337, &input, &_0, &_1, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 319, &input, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); } @@ -538,9 +538,9 @@ PHP_METHOD(Phalcon_Html_Escaper, js) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 339, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 321, &input); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapejs", NULL, 342, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doescapejs", NULL, 324, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -576,11 +576,11 @@ PHP_METHOD(Phalcon_Html_Escaper, normalizeEncoding) zephir_get_strval(&input, input_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 343, &input); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 325, &input); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "UTF-32"); - ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 344, &input, &_1, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 326, &input, &_1, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -756,7 +756,7 @@ PHP_METHOD(Phalcon_Html_Escaper, url) zephir_get_strval(&input, input_param); - ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 345, &input); + ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 327, &input); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/html/helper/abstracthelper.zep.c b/ext/phalcon/html/helper/abstracthelper.zep.c index 09081aba871..183ed41a957 100644 --- a/ext/phalcon/html/helper/abstracthelper.zep.c +++ b/ext/phalcon/html/helper/abstracthelper.zep.c @@ -22,9 +22,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/abstractlist.zep.c b/ext/phalcon/html/helper/abstractlist.zep.c index ec0a895eaa0..62042249184 100644 --- a/ext/phalcon/html/helper/abstractlist.zep.c +++ b/ext/phalcon/html/helper/abstractlist.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/abstractseries.zep.c b/ext/phalcon/html/helper/abstractseries.zep.c index b6970e5909a..2f2a03dfd3a 100644 --- a/ext/phalcon/html/helper/abstractseries.zep.c +++ b/ext/phalcon/html/helper/abstractseries.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/anchor.zep.c b/ext/phalcon/html/helper/anchor.zep.c index edeea9a7db6..fbaade54bbd 100644 --- a/ext/phalcon/html/helper/anchor.zep.c +++ b/ext/phalcon/html/helper/anchor.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/base.zep.c b/ext/phalcon/html/helper/base.zep.c index 48d7106bcd8..b5e854120c8 100644 --- a/ext/phalcon/html/helper/base.zep.c +++ b/ext/phalcon/html/helper/base.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/body.zep.c b/ext/phalcon/html/helper/body.zep.c index b4b722c2efc..9437e8e9444 100644 --- a/ext/phalcon/html/helper/body.zep.c +++ b/ext/phalcon/html/helper/body.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/button.zep.c b/ext/phalcon/html/helper/button.zep.c index f70e5447749..7da0dce07ae 100644 --- a/ext/phalcon/html/helper/button.zep.c +++ b/ext/phalcon/html/helper/button.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/close.zep.c b/ext/phalcon/html/helper/close.zep.c index f946b41edb6..d9c24360b94 100644 --- a/ext/phalcon/html/helper/close.zep.c +++ b/ext/phalcon/html/helper/close.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/element.zep.c b/ext/phalcon/html/helper/element.zep.c index 5a6e5f3aaa3..e5e4c06373b 100644 --- a/ext/phalcon/html/helper/element.zep.c +++ b/ext/phalcon/html/helper/element.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/form.zep.c b/ext/phalcon/html/helper/form.zep.c index aa3d9273ee1..eef6bd65101 100644 --- a/ext/phalcon/html/helper/form.zep.c +++ b/ext/phalcon/html/helper/form.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/img.zep.c b/ext/phalcon/html/helper/img.zep.c index a91051d2388..719b4487a87 100644 --- a/ext/phalcon/html/helper/img.zep.c +++ b/ext/phalcon/html/helper/img.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/abstractinput.zep.c b/ext/phalcon/html/helper/input/abstractinput.zep.c index 8ab881457cf..745705e4df0 100644 --- a/ext/phalcon/html/helper/input/abstractinput.zep.c +++ b/ext/phalcon/html/helper/input/abstractinput.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/checkbox.zep.c b/ext/phalcon/html/helper/input/checkbox.zep.c index 483a5941d27..6f19870a0a3 100644 --- a/ext/phalcon/html/helper/input/checkbox.zep.c +++ b/ext/phalcon/html/helper/input/checkbox.zep.c @@ -21,9 +21,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -115,9 +115,9 @@ PHP_METHOD(Phalcon_Html_Helper_Input_Checkbox, __toString) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processchecked", NULL, 121); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "processchecked", NULL, 90); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&unchecked, this_ptr, "processunchecked", NULL, 122); + ZEPHIR_CALL_METHOD(&unchecked, this_ptr, "processunchecked", NULL, 91); zephir_check_call_status(); ZEPHIR_CALL_PARENT(&element, phalcon_html_helper_input_checkbox_ce, getThis(), "__tostring", &_0, 0); zephir_check_call_status(); diff --git a/ext/phalcon/html/helper/input/color.zep.c b/ext/phalcon/html/helper/input/color.zep.c index ffcbaa9a52b..b6f7a69f159 100644 --- a/ext/phalcon/html/helper/input/color.zep.c +++ b/ext/phalcon/html/helper/input/color.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/date.zep.c b/ext/phalcon/html/helper/input/date.zep.c index 24765f7ae2e..2f8f7f8324d 100644 --- a/ext/phalcon/html/helper/input/date.zep.c +++ b/ext/phalcon/html/helper/input/date.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/datetime.zep.c b/ext/phalcon/html/helper/input/datetime.zep.c index 48ea3dc875c..ef649091719 100644 --- a/ext/phalcon/html/helper/input/datetime.zep.c +++ b/ext/phalcon/html/helper/input/datetime.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/datetimelocal.zep.c b/ext/phalcon/html/helper/input/datetimelocal.zep.c index 1e0287cdad2..820ae2afb6c 100644 --- a/ext/phalcon/html/helper/input/datetimelocal.zep.c +++ b/ext/phalcon/html/helper/input/datetimelocal.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/email.zep.c b/ext/phalcon/html/helper/input/email.zep.c index 6375ba4564b..a6647bfb6f8 100644 --- a/ext/phalcon/html/helper/input/email.zep.c +++ b/ext/phalcon/html/helper/input/email.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/file.zep.c b/ext/phalcon/html/helper/input/file.zep.c index 40d50ba8f9a..7b95a9703bf 100644 --- a/ext/phalcon/html/helper/input/file.zep.c +++ b/ext/phalcon/html/helper/input/file.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/hidden.zep.c b/ext/phalcon/html/helper/input/hidden.zep.c index a1c6459ecdc..1bae63c7879 100644 --- a/ext/phalcon/html/helper/input/hidden.zep.c +++ b/ext/phalcon/html/helper/input/hidden.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/image.zep.c b/ext/phalcon/html/helper/input/image.zep.c index fbce2696fc3..a80288144d7 100644 --- a/ext/phalcon/html/helper/input/image.zep.c +++ b/ext/phalcon/html/helper/input/image.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/input.zep.c b/ext/phalcon/html/helper/input/input.zep.c index 2d5ecedbf7e..de6ce473de6 100644 --- a/ext/phalcon/html/helper/input/input.zep.c +++ b/ext/phalcon/html/helper/input/input.zep.c @@ -18,9 +18,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/month.zep.c b/ext/phalcon/html/helper/input/month.zep.c index 266f6433f17..0beb52417d4 100644 --- a/ext/phalcon/html/helper/input/month.zep.c +++ b/ext/phalcon/html/helper/input/month.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/numeric.zep.c b/ext/phalcon/html/helper/input/numeric.zep.c index 6d25b01079c..41e32205280 100644 --- a/ext/phalcon/html/helper/input/numeric.zep.c +++ b/ext/phalcon/html/helper/input/numeric.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -29,7 +29,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Helper_Input_Numeric) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Helper\\Input, Numeric, phalcon, html_helper_input_numeric, phalcon_html_helper_input_abstractinput_ce, NULL, 0); - zend_declare_property_string(phalcon_html_helper_input_numeric_ce, SL("type"), "numeric", ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_html_helper_input_numeric_ce, SL("type"), "number", ZEND_ACC_PROTECTED); return SUCCESS; } diff --git a/ext/phalcon/html/helper/input/password.zep.c b/ext/phalcon/html/helper/input/password.zep.c index bef328e3bf9..33d37e6cc40 100644 --- a/ext/phalcon/html/helper/input/password.zep.c +++ b/ext/phalcon/html/helper/input/password.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/radio.zep.c b/ext/phalcon/html/helper/input/radio.zep.c index 8c8022765d6..4aa46f38629 100644 --- a/ext/phalcon/html/helper/input/radio.zep.c +++ b/ext/phalcon/html/helper/input/radio.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/range.zep.c b/ext/phalcon/html/helper/input/range.zep.c index 6af3bada99a..d789646d9d0 100644 --- a/ext/phalcon/html/helper/input/range.zep.c +++ b/ext/phalcon/html/helper/input/range.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/search.zep.c b/ext/phalcon/html/helper/input/search.zep.c index 7cb923e8f38..439bc0d3fb3 100644 --- a/ext/phalcon/html/helper/input/search.zep.c +++ b/ext/phalcon/html/helper/input/search.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/select.zep.c b/ext/phalcon/html/helper/input/select.zep.c index 22b3da12dad..6cc7a9440c9 100644 --- a/ext/phalcon/html/helper/input/select.zep.c +++ b/ext/phalcon/html/helper/input/select.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -115,7 +115,7 @@ PHP_METHOD(Phalcon_Html_Helper_Input_Select, add) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "processvalue", NULL, 346, &attributes, &value); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "processvalue", NULL, 328, &attributes, &value); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attributes, &_0); ZEPHIR_INIT_VAR(&_1); diff --git a/ext/phalcon/html/helper/input/submit.zep.c b/ext/phalcon/html/helper/input/submit.zep.c index 6b042813db2..790ff32eaba 100644 --- a/ext/phalcon/html/helper/input/submit.zep.c +++ b/ext/phalcon/html/helper/input/submit.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/tel.zep.c b/ext/phalcon/html/helper/input/tel.zep.c index 5cfb8ab05fe..e422048e4e5 100644 --- a/ext/phalcon/html/helper/input/tel.zep.c +++ b/ext/phalcon/html/helper/input/tel.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/text.zep.c b/ext/phalcon/html/helper/input/text.zep.c index 55cd3332bbb..7b02ad93f4a 100644 --- a/ext/phalcon/html/helper/input/text.zep.c +++ b/ext/phalcon/html/helper/input/text.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/textarea.zep.c b/ext/phalcon/html/helper/input/textarea.zep.c index 12f59d26a99..6d106fa7d56 100644 --- a/ext/phalcon/html/helper/input/textarea.zep.c +++ b/ext/phalcon/html/helper/input/textarea.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/time.zep.c b/ext/phalcon/html/helper/input/time.zep.c index c9527a10fc5..64c8be74d15 100644 --- a/ext/phalcon/html/helper/input/time.zep.c +++ b/ext/phalcon/html/helper/input/time.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/url.zep.c b/ext/phalcon/html/helper/input/url.zep.c index 3022fed7f61..45a3f50735b 100644 --- a/ext/phalcon/html/helper/input/url.zep.c +++ b/ext/phalcon/html/helper/input/url.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/input/week.zep.c b/ext/phalcon/html/helper/input/week.zep.c index 282eefee8fa..52ace921fff 100644 --- a/ext/phalcon/html/helper/input/week.zep.c +++ b/ext/phalcon/html/helper/input/week.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/label.zep.c b/ext/phalcon/html/helper/label.zep.c index 6a3dd8ece0d..b5d9c3a25ac 100644 --- a/ext/phalcon/html/helper/label.zep.c +++ b/ext/phalcon/html/helper/label.zep.c @@ -19,9 +19,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/meta.zep.c b/ext/phalcon/html/helper/meta.zep.c index 48fd619c0f7..3fb6d01a2ea 100644 --- a/ext/phalcon/html/helper/meta.zep.c +++ b/ext/phalcon/html/helper/meta.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -130,7 +130,7 @@ PHP_METHOD(Phalcon_Html_Helper_Meta, addHttp) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "http-equiv"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addelement", NULL, 347, &_0, &httpEquiv, &content); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addelement", NULL, 329, &_0, &httpEquiv, &content); zephir_check_call_status(); RETURN_MM(); } @@ -170,7 +170,7 @@ PHP_METHOD(Phalcon_Html_Helper_Meta, addName) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "name"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 347, &_0, &name, &content); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 329, &_0, &name, &content); zephir_check_call_status(); RETURN_THIS(); } @@ -210,7 +210,7 @@ PHP_METHOD(Phalcon_Html_Helper_Meta, addProperty) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "property"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 347, &_0, &name, &content); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addelement", NULL, 329, &_0, &name, &content); zephir_check_call_status(); RETURN_THIS(); } diff --git a/ext/phalcon/html/helper/ol.zep.c b/ext/phalcon/html/helper/ol.zep.c index 7f6f836e600..a2189c9445d 100644 --- a/ext/phalcon/html/helper/ol.zep.c +++ b/ext/phalcon/html/helper/ol.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/script.zep.c b/ext/phalcon/html/helper/script.zep.c index 4d94ef5a775..9deb1aa1e83 100644 --- a/ext/phalcon/html/helper/script.zep.c +++ b/ext/phalcon/html/helper/script.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/style.zep.c b/ext/phalcon/html/helper/style.zep.c index 73a37b78b38..43d6670b4c2 100644 --- a/ext/phalcon/html/helper/style.zep.c +++ b/ext/phalcon/html/helper/style.zep.c @@ -20,9 +20,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/helper/title.zep.c b/ext/phalcon/html/helper/title.zep.c index 11ae5a2f205..f7a04995a43 100644 --- a/ext/phalcon/html/helper/title.zep.c +++ b/ext/phalcon/html/helper/title.zep.c @@ -22,9 +22,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -153,7 +153,7 @@ PHP_METHOD(Phalcon_Html_Helper_Title, __toString) zephir_read_property(&_2, this_ptr, ZEND_STRL("title"), PH_NOISY_CC); zephir_array_fast_append(&_1, &_2); zephir_read_property(&_3, this_ptr, ZEND_STRL("append"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&items, "array_merge", NULL, 348, &_0, &_1, &_3); + ZEPHIR_CALL_FUNCTION(&items, "array_merge", NULL, 330, &_0, &_1, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); zephir_read_property(&_5, this_ptr, ZEND_STRL("indent"), PH_NOISY_CC | PH_READONLY); diff --git a/ext/phalcon/html/helper/ul.zep.c b/ext/phalcon/html/helper/ul.zep.c index de086cb7a54..fd7fa4ada60 100644 --- a/ext/phalcon/html/helper/ul.zep.c +++ b/ext/phalcon/html/helper/ul.zep.c @@ -16,9 +16,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/html/link/abstractlink.zep.c b/ext/phalcon/html/link/abstractlink.zep.c new file mode 100644 index 00000000000..97d3cd71c25 --- /dev/null +++ b/ext/phalcon/html/link/abstractlink.zep.c @@ -0,0 +1,479 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/memory.h" +#include "kernel/fcall.h" +#include "kernel/object.h" +#include "kernel/operators.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * @property array $attributes + * @property string $href + * @property array $rels + * @property bool $templated + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLink) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, AbstractLink, phalcon, html_link_abstractlink, phalcon_html_link_abstractlink_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + /** + * @var Collection + */ + zend_declare_property_null(phalcon_html_link_abstractlink_ce, SL("attributes"), ZEND_ACC_PROTECTED); + /** + * @var string + */ + zend_declare_property_string(phalcon_html_link_abstractlink_ce, SL("href"), "", ZEND_ACC_PROTECTED); + /** + * @var Collection + */ + zend_declare_property_null(phalcon_html_link_abstractlink_ce, SL("rels"), ZEND_ACC_PROTECTED); + /** + * @var bool + */ + zend_declare_property_bool(phalcon_html_link_abstractlink_ce, SL("templated"), 0, ZEND_ACC_PROTECTED); + return SUCCESS; +} + +/** + * Link constructor. + * + * @param string $rel + * @param string $href + * @param array $attributes + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, __construct) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval attributes; + zval *rel_param = NULL, *href_param = NULL, *attributes_param = NULL, _0, _1, _2, _3$$3, _4$$3; + zval rel, href; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rel); + ZVAL_UNDEF(&href); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&attributes); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 3) + Z_PARAM_OPTIONAL + Z_PARAM_STR(rel) + Z_PARAM_STR(href) + Z_PARAM_ARRAY(attributes) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 3, &rel_param, &href_param, &attributes_param); + if (!rel_param) { + ZEPHIR_INIT_VAR(&rel); + ZVAL_STRING(&rel, ""); + } else { + zephir_get_strval(&rel, rel_param); + } + if (!href_param) { + ZEPHIR_INIT_VAR(&href); + ZVAL_STRING(&href, ""); + } else { + zephir_get_strval(&href, href_param); + } + if (!attributes_param) { + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); + } else { + zephir_get_arrval(&attributes, attributes_param); + } + + + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_support_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 22, &attributes); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_0); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_support_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 22); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("rels"), &_1); + zephir_update_property_zval(this_ptr, ZEND_STRL("href"), &href); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "hrefistemplated", NULL, 0, &href); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("templated"), &_2); + if (1 != ZEPHIR_IS_EMPTY(&rel)) { + zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_4$$3, 1); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "set", NULL, 0, &rel, &_4$$3); + zephir_check_call_status(); + } + ZEPHIR_MM_RESTORE(); +} + +/** + * Returns a list of attributes that describe the target URI. + * + * @return array + * A key-value list of attributes, where the key is a string and the value + * is either a PHP primitive or an array of PHP strings. If no values are + * found an empty array MUST be returned. + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetAttributes) +{ + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Returns the target of the link. + * + * The target link must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative link + * is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * + * If a URI template is returned, isTemplated() MUST return True. + * + * @return string + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetHref) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "href"); +} + +/** + * Returns the relationship type(s) of the link. + * + * This method returns 0 or more relationship types for a link, expressed + * as an array of strings. + * + * @return string[] + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetRels) +{ + zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + + + ZEPHIR_MM_GROW(); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_1, 0); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getkeys", NULL, 0, &_1); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Returns whether this is a templated link. + * + * @return bool + * True if this link object is templated, False otherwise. + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doIsTemplated) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "templated"); +} + +/** + * Determines if a href is a templated link or not. + * + * @see https://tools.ietf.org/html/rfc6570 + * + * @param string $href + * + * @return bool + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, hrefIsTemplated) +{ + zend_bool _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *href_param = NULL, _0, _1, _3; + zval href; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&href); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(href) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); + + + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "{"); + ZEPHIR_CALL_FUNCTION(&_1, "mb_strpos", NULL, 82, &href, &_0); + zephir_check_call_status(); + _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); + if (_2) { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "}"); + ZEPHIR_CALL_FUNCTION(&_3, "mb_strpos", NULL, 82, &href, &_0); + zephir_check_call_status(); + _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_3); + } + RETURN_MM_BOOL(_2); +} + +/** + * @param string $key + * @param mixed $value + * + * @return mixed + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithAttribute) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *value, value_sub, newInstance, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(key) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &key_param, &value); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &key, value); + zephir_check_call_status(); + RETURN_CCTOR(&newInstance); +} + +/** + * @param string $href + * + * @return mixed + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithHref) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *href_param = NULL, newInstance, _0; + zval href; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&href); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(href) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); + + + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_update_property_zval(&newInstance, ZEND_STRL("href"), &href); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hrefistemplated", NULL, 0, &href); + zephir_check_call_status(); + zephir_update_property_zval(&newInstance, ZEND_STRL("templated"), &_0); + RETURN_CCTOR(&newInstance); +} + +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithRel) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, newInstance, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_1, 1); + ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, &key, &_1); + zephir_check_call_status(); + RETURN_CCTOR(&newInstance); +} + +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutAttribute) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, newInstance, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &key); + zephir_check_call_status(); + RETURN_CCTOR(&newInstance); +} + +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutRel) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, newInstance, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &key); + zephir_check_call_status(); + RETURN_CCTOR(&newInstance); +} + diff --git a/ext/phalcon/html/link/abstractlink.zep.h b/ext/phalcon/html/link/abstractlink.zep.h new file mode 100644 index 00000000000..9a2094a9098 --- /dev/null +++ b/ext/phalcon/html/link/abstractlink.zep.h @@ -0,0 +1,78 @@ + +extern zend_class_entry *phalcon_html_link_abstractlink_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLink); + +PHP_METHOD(Phalcon_Html_Link_AbstractLink, __construct); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetAttributes); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetHref); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doGetRels); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doIsTemplated); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, hrefIsTemplated); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithAttribute); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithHref); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithRel); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutAttribute); +PHP_METHOD(Phalcon_Html_Link_AbstractLink, doWithoutRel); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink___construct, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, attributes, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogetattributes, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogethref, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_dogetrels, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_doistemplated, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlink_hrefistemplated, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithattribute, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithhref, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithrel, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithoutattribute, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlink_dowithoutrel, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_abstractlink_method_entry) { + PHP_ME(Phalcon_Html_Link_AbstractLink, __construct, arginfo_phalcon_html_link_abstractlink___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetAttributes, arginfo_phalcon_html_link_abstractlink_dogetattributes, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetHref, arginfo_phalcon_html_link_abstractlink_dogethref, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doGetRels, arginfo_phalcon_html_link_abstractlink_dogetrels, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doIsTemplated, arginfo_phalcon_html_link_abstractlink_doistemplated, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, hrefIsTemplated, arginfo_phalcon_html_link_abstractlink_hrefistemplated, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithAttribute, arginfo_phalcon_html_link_abstractlink_dowithattribute, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithHref, arginfo_phalcon_html_link_abstractlink_dowithhref, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithRel, arginfo_phalcon_html_link_abstractlink_dowithrel, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithoutAttribute, arginfo_phalcon_html_link_abstractlink_dowithoutattribute, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLink, doWithoutRel, arginfo_phalcon_html_link_abstractlink_dowithoutrel, ZEND_ACC_PROTECTED) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/abstractlinkprovider.zep.c b/ext/phalcon/html/link/abstractlinkprovider.zep.c new file mode 100644 index 00000000000..2cd33e63e03 --- /dev/null +++ b/ext/phalcon/html/link/abstractlinkprovider.zep.c @@ -0,0 +1,390 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/fcall.h" +#include "kernel/memory.h" +#include "kernel/operators.h" +#include "kernel/object.h" +#include "kernel/array.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * @property array $links + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLinkProvider) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, AbstractLinkProvider, phalcon, html_link_abstractlinkprovider, phalcon_html_link_abstractlinkprovider_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + /** + * @var array + */ + zend_declare_property_null(phalcon_html_link_abstractlinkprovider_ce, SL("links"), ZEND_ACC_PROTECTED); + phalcon_html_link_abstractlinkprovider_ce->create_object = zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider; + + return SUCCESS; +} + +/** + * LinkProvider constructor. + * + * @param array $links + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, __construct) +{ + zend_bool _5$$3, _11$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_4 = NULL, *_8 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *links_param = NULL, link, *_0, _1, _2$$3, _3$$3, _6$$3, _7$$4, _9$$5, _10$$5, _12$$5, _13$$6; + zval links; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&links); + ZVAL_UNDEF(&link); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_13$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(links) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &links_param); + if (!links_param) { + ZEPHIR_INIT_VAR(&links); + array_init(&links); + } else { + zephir_get_arrval(&links, links_param); + } + + + zephir_is_iterable(&links, 0, "phalcon/Html/Link/AbstractLinkProvider.zep", 42); + if (Z_TYPE_P(&links) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) + { + ZEPHIR_INIT_NVAR(&link); + ZVAL_COPY(&link, _0); + ZEPHIR_INIT_NVAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Phalcon\\Html\\Link\\Interfaces\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$3, "is_a", &_4, 83, &link, &_2$$3); + zephir_check_call_status(); + _5$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3); + if (!(_5$$3)) { + ZEPHIR_INIT_NVAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Psr\\Link\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_6$$3, "is_a", &_4, 83, &link, &_2$$3); + zephir_check_call_status(); + _5$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_6$$3); + } + if (_5$$3) { + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getkey", &_8, 0, &link); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("links"), &_7$$4, &link); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, &links, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&link, &links, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_9$$5); + ZVAL_STRING(&_9$$5, "Phalcon\\Html\\Link\\Interfaces\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_10$$5, "is_a", &_4, 83, &link, &_9$$5); + zephir_check_call_status(); + _11$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_10$$5); + if (!(_11$$5)) { + ZEPHIR_INIT_NVAR(&_9$$5); + ZVAL_STRING(&_9$$5, "Psr\\Link\\LinkInterface"); + ZEPHIR_CALL_FUNCTION(&_12$$5, "is_a", &_4, 83, &link, &_9$$5); + zephir_check_call_status(); + _11$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_12$$5); + } + if (_11$$5) { + ZEPHIR_CALL_METHOD(&_13$$6, this_ptr, "getkey", &_8, 0, &link); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("links"), &_13$$6, &link); + } + ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&link); + ZEPHIR_MM_RESTORE(); +} + +/** + * Returns an iterable of LinkInterface objects. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * are available, an empty array or \Traversable MUST be returned. + * + * @return array + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "links"); +} + +/** + * Returns an iterable of LinkInterface objects that have a specific + * relationship. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * with that relationship are available, an empty array or \Traversable + * MUST be returned. + * + * @return array + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel) +{ + zval filtered; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *rel_param = NULL, link, rels, _0, *_1, _2; + zval rel; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rel); + ZVAL_UNDEF(&link); + ZVAL_UNDEF(&rels); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&filtered); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(rel) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); + + + ZEPHIR_INIT_VAR(&filtered); + array_init(&filtered); + zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/Html/Link/AbstractLinkProvider.zep", 80); + if (Z_TYPE_P(&_0) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&link); + ZVAL_COPY(&link, _1); + ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_fast_in_array(&rel, &rels)) { + zephir_array_append(&filtered, &link, PH_SEPARATE, "phalcon/Html/Link/AbstractLinkProvider.zep", 76); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_2)) { + break; + } + ZEPHIR_CALL_METHOD(&link, &_0, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_fast_in_array(&rel, &rels)) { + zephir_array_append(&filtered, &link, PH_SEPARATE, "phalcon/Html/Link/AbstractLinkProvider.zep", 76); + } + ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&link); + RETURN_CTOR(&filtered); +} + +/** + * Returns an instance with the specified link included. + * + * If the specified link is already present, this method MUST return + * normally without errors. The link is present if $link is === identical + * to a link object already in the collection. + * + * @param mixed $link A link object that should be included in this + * collection. + * + * @return $this + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithLink) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *link, link_sub, key, newInstance; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&link_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newInstance); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(link) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &link); + + + ZEPHIR_CALL_METHOD(&key, this_ptr, "getkey", NULL, 0, link); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_update_property_array(&newInstance, SL("links"), &key, link); + RETURN_CCTOR(&newInstance); +} + +/** + * Returns an instance with the specified link removed. + * + * If the specified link is not present, this method MUST return normally + * without errors. The link is present if $link is === identical to a link + * object already in the collection. + * + * @param mixed $link The link to remove. + * + * @return $this + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *link, link_sub, key, newInstance, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&link_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newInstance); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(link) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &link); + + + ZEPHIR_CALL_METHOD(&key, this_ptr, "getkey", NULL, 0, link); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&newInstance); + if (zephir_clone(&newInstance, this_ptr) == FAILURE) { + RETURN_MM(); + } + zephir_unset_property_array(&newInstance, ZEND_STRL("links"), &key); + zephir_read_property(&_0, &newInstance, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_0, &key, PH_SEPARATE); + RETURN_CCTOR(&newInstance); +} + +/** + * Returns the object hash key + * + * @param mixed link + * + * @return string + */ +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, getKey) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *link, link_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&link_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(link) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &link); + + + ZEPHIR_RETURN_CALL_FUNCTION("spl_object_hash", NULL, 77, link); + zephir_check_call_status(); + RETURN_MM(); +} + +zend_object *zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider(zend_class_entry *class_type) +{ + zval _0, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + + + ZEPHIR_MM_GROW(); + + { + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("links"), &_1$$3); + } + ZEPHIR_MM_RESTORE(); + return Z_OBJ_P(this_ptr); + } +} + diff --git a/ext/phalcon/html/link/abstractlinkprovider.zep.h b/ext/phalcon/html/link/abstractlinkprovider.zep.h new file mode 100644 index 00000000000..070c526435a --- /dev/null +++ b/ext/phalcon/html/link/abstractlinkprovider.zep.h @@ -0,0 +1,52 @@ + +extern zend_class_entry *phalcon_html_link_abstractlinkprovider_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_AbstractLinkProvider); + +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, __construct); +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks); +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel); +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithLink); +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink); +PHP_METHOD(Phalcon_Html_Link_AbstractLinkProvider, getKey); +zend_object *zephir_init_properties_Phalcon_Html_Link_AbstractLinkProvider(zend_class_entry *class_type); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, links, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, links, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dogetlinks, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dogetlinksbyrel, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dowithlink, 0, 0, 1) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_dowithoutlink, 0, 0, 1) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_getkey, 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, link) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_abstractlinkprovider_zephir_init_properties_phalcon_html_link_abstractlinkprovider, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_abstractlinkprovider_method_entry) { + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, __construct, arginfo_phalcon_html_link_abstractlinkprovider___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doGetLinks, arginfo_phalcon_html_link_abstractlinkprovider_dogetlinks, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doGetLinksByRel, arginfo_phalcon_html_link_abstractlinkprovider_dogetlinksbyrel, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doWithLink, arginfo_phalcon_html_link_abstractlinkprovider_dowithlink, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, doWithoutLink, arginfo_phalcon_html_link_abstractlinkprovider_dowithoutlink, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Html_Link_AbstractLinkProvider, getKey, arginfo_phalcon_html_link_abstractlinkprovider_getkey, ZEND_ACC_PROTECTED) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/evolvablelink.zep.c b/ext/phalcon/html/link/evolvablelink.zep.c index 5575cb70d90..178a16812f1 100644 --- a/ext/phalcon/html/link/evolvablelink.zep.c +++ b/ext/phalcon/html/link/evolvablelink.zep.c @@ -12,9 +12,10 @@ #include #include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" #include "kernel/fcall.h" +#include "kernel/memory.h" +#include "kernel/object.h" +#include "kernel/operators.h" /** @@ -37,7 +38,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLink) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLink, phalcon, html_link_evolvablelink, phalcon_html_link_link_ce, phalcon_html_link_evolvablelink_method_entry, 0); - zend_class_implements(phalcon_html_link_evolvablelink_ce, 1, zephir_get_internal_ce(SL("psr\\link\\evolvablelinkinterface"))); + zend_class_implements(phalcon_html_link_evolvablelink_ce, 1, phalcon_html_link_interfaces_evolvablelinkinterface_ce); return SUCCESS; } @@ -47,22 +48,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLink) * If the specified attribute is already present, it will be overwritten * with the new value. * - * @param string attribute The attribute to include. - * @param string value The value of the attribute to set. - * - * @return static + * @param string $attribute The attribute to include. + * @param string $value The value of the attribute to set. */ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute, attribute_sub, *value, value_sub, newInstance, _0; + zval *attribute, attribute_sub, *value, value_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&attribute_sub); ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) @@ -76,14 +73,9 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) zephir_fetch_params(1, 2, 0, &attribute, &value); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, attribute, value); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithattribute", NULL, 0, attribute, value); zephir_check_call_status(); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } /** @@ -101,39 +93,33 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withAttribute) * An implementing library SHOULD evaluate a passed object to a string * immediately rather than waiting for it to be returned later. * - * @return static + * @param string $rel The relationship value to add. */ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withHref) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *href, href_sub, newInstance, _0; + zval *href_param = NULL; + zval href; zval *this_ptr = getThis(); - ZVAL_UNDEF(&href_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&href); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(href) + Z_PARAM_STR(href) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &href); + zephir_fetch_params(1, 1, 0, &href_param); + zephir_get_strval(&href, href_param); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_update_property_zval(&newInstance, ZEND_STRL("href"), href); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hrefistemplated", NULL, 0, href); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithhref", NULL, 0, &href); zephir_check_call_status(); - zephir_update_property_zval(&newInstance, ZEND_STRL("templated"), &_0); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } /** @@ -142,43 +128,33 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withHref) * If the specified rel is already present, this method MUST return * normally without errors, but without adding the rel a second time. * - * @param string rel - * The relationship value to add. - * - * @return static + * @param string $rel The relationship value to add. */ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, newInstance, _0, _1; + zval *rel_param = NULL; + zval rel; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&rel); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(rel) + Z_PARAM_STR(rel) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &rel); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZVAL_BOOL(&_1, 1); - ZEPHIR_CALL_METHOD(NULL, &_0, "set", NULL, 0, rel, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithrel", NULL, 0, &rel); zephir_check_call_status(); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } /** @@ -187,41 +163,33 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel) * If the specified attribute is not present, this method MUST return * normally without errors. * - * @param string attribute - * The attribute to remove. - * - * @return static + * @param string $attribute The attribute to remove. */ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute, attribute_sub, newInstance, _0; + zval *attribute_param = NULL; + zval attribute; zval *this_ptr = getThis(); - ZVAL_UNDEF(&attribute_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&attribute); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(attribute) + Z_PARAM_STR(attribute) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &attribute); + zephir_fetch_params(1, 1, 0, &attribute_param); + zephir_get_strval(&attribute, attribute_param); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_read_property(&_0, &newInstance, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, attribute); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutattribute", NULL, 0, &attribute); zephir_check_call_status(); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } /** @@ -230,40 +198,32 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute) * If the specified rel is not present, this method MUST return * normally without errors. * - * @param string rel - * The relationship value to exclude. - * - * @return static + * @param string $rel The relationship value to exclude. */ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, newInstance, _0; + zval *rel_param = NULL; + zval rel; zval *this_ptr = getThis(); - ZVAL_UNDEF(&rel_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&rel); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(rel) + Z_PARAM_STR(rel) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &rel); + zephir_fetch_params(1, 1, 0, &rel_param); + zephir_get_strval(&rel, rel_param); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_read_property(&_0, &newInstance, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, rel); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutrel", NULL, 0, &rel); zephir_check_call_status(); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } diff --git a/ext/phalcon/html/link/evolvablelink.zep.h b/ext/phalcon/html/link/evolvablelink.zep.h index e1170bcffac..988cb13dd60 100644 --- a/ext/phalcon/html/link/evolvablelink.zep.h +++ b/ext/phalcon/html/link/evolvablelink.zep.h @@ -9,25 +9,25 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withRel); PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutAttribute); PHP_METHOD(Phalcon_Html_Link_EvolvableLink, withoutRel); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withattribute, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withattribute, 0, 2, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) ZEND_ARG_INFO(0, attribute) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withhref, 0, 0, 1) - ZEND_ARG_INFO(0, href) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withhref, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withrel, 0, 0, 1) - ZEND_ARG_INFO(0, rel) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutattribute, 0, 0, 1) - ZEND_ARG_INFO(0, attribute) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutattribute, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutrel, 0, 0, 1) - ZEND_ARG_INFO(0, rel) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelink_withoutrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_evolvablelink_method_entry) { diff --git a/ext/phalcon/html/link/evolvablelinkprovider.zep.c b/ext/phalcon/html/link/evolvablelinkprovider.zep.c index 0ea82dcd006..50d7cedffbd 100644 --- a/ext/phalcon/html/link/evolvablelinkprovider.zep.c +++ b/ext/phalcon/html/link/evolvablelinkprovider.zep.c @@ -13,9 +13,8 @@ #include "kernel/main.h" #include "kernel/fcall.h" -#include "kernel/object.h" #include "kernel/memory.h" -#include "kernel/array.h" +#include "kernel/object.h" /** @@ -35,7 +34,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLinkProvider) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, EvolvableLinkProvider, phalcon, html_link_evolvablelinkprovider, phalcon_html_link_linkprovider_ce, phalcon_html_link_evolvablelinkprovider_method_entry, 0); - zend_class_implements(phalcon_html_link_evolvablelinkprovider_ce, 1, zephir_get_internal_ce(SL("psr\\link\\evolvablelinkproviderinterface"))); + zend_class_implements(phalcon_html_link_evolvablelinkprovider_ce, 1, phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce); return SUCCESS; } @@ -55,16 +54,14 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *link, link_sub, key, newInstance; + zval *link, link_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&link_sub); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&newInstance); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) + Z_PARAM_OBJECT_OF_CLASS(link, phalcon_html_link_interfaces_linkinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif @@ -73,14 +70,9 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink) zephir_fetch_params(1, 1, 0, &link); - ZEPHIR_CALL_METHOD(&key, this_ptr, "getkey", NULL, 0, link); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithlink", NULL, 0, link); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_update_property_array(&newInstance, SL("links"), &key, link); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } /** @@ -99,18 +91,14 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *link, link_sub, key, links, newInstance, _0; + zval *link, link_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&link_sub); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&links); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) + Z_PARAM_OBJECT_OF_CLASS(link, phalcon_html_link_interfaces_linkinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif @@ -119,16 +107,8 @@ PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink) zephir_fetch_params(1, 1, 0, &link); - ZEPHIR_CALL_METHOD(&key, this_ptr, "getkey", NULL, 0, link); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dowithoutlink", NULL, 0, link); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&links, &_0); - zephir_array_unset(&links, &key, PH_SEPARATE); - zephir_update_property_zval(&newInstance, ZEND_STRL("links"), &links); - RETURN_CCTOR(&newInstance); + RETURN_MM(); } diff --git a/ext/phalcon/html/link/evolvablelinkprovider.zep.h b/ext/phalcon/html/link/evolvablelinkprovider.zep.h index 89c2836fc50..873cfbf7e70 100644 --- a/ext/phalcon/html/link/evolvablelinkprovider.zep.h +++ b/ext/phalcon/html/link/evolvablelinkprovider.zep.h @@ -6,12 +6,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_EvolvableLinkProvider); PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withLink); PHP_METHOD(Phalcon_Html_Link_EvolvableLinkProvider, withoutLink); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withlink, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withoutlink, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_evolvablelinkprovider_withoutlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_evolvablelinkprovider_method_entry) { diff --git a/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.c b/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.c new file mode 100644 index 00000000000..7f0bfebed1e --- /dev/null +++ b/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.c @@ -0,0 +1,86 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../../ext_config.h" +#endif + +#include +#include "../../../../php_ext.h" +#include "../../../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * An evolvable link value object. + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, EvolvableLinkInterface, phalcon, html_link_interfaces_evolvablelinkinterface, phalcon_html_link_interfaces_evolvablelinkinterface_method_entry); + + zend_class_implements(phalcon_html_link_interfaces_evolvablelinkinterface_ce, 1, phalcon_html_link_interfaces_linkinterface_ce); + return SUCCESS; +} + +/** + * Returns an instance with the specified href. + * + * @param string $href + * The href value to include. It must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative + * link is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * - An object implementing __toString() that produces one of the + * above values. + * + * An implementing library SHOULD evaluate a passed object to a string + * immediately rather than waiting for it to be returned later. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withHref); +/** + * Returns an instance with the specified relationship included. + * + * If the specified rel is already present, this method MUST return + * normally without errors, but without adding the rel a second time. + * + * @param string $rel The relationship value to add. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withRel); +/** + * Returns an instance with the specified relationship excluded. + * + * If the specified rel is already not present, this method MUST return + * normally without errors. + * + * @param string $rel The relationship value to exclude. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutRel); +/** + * Returns an instance with the specified attribute added. + * + * If the specified attribute is already present, it will be overwritten + * with the new value. + * + * @param string $attribute The attribute to include. + * @param string $value The value of the attribute to set. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withAttribute); +/** + * Returns an instance with the specified attribute excluded. + * + * If the specified attribute is not present, this method MUST return + * normally without errors. + * + * @param string $attribute The attribute to remove. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutAttribute); diff --git a/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.h b/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.h new file mode 100644 index 00000000000..1bb97542bd8 --- /dev/null +++ b/ext/phalcon/html/link/interfaces/evolvablelinkinterface.zep.h @@ -0,0 +1,34 @@ + +extern zend_class_entry *phalcon_html_link_interfaces_evolvablelinkinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withhref, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutrel, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withattribute, 0, 2, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutattribute, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkInterface, 0) + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_evolvablelinkinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withHref, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withhref) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withRel, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withrel) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutRel, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutrel) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withAttribute, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withattribute) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkInterface, withoutAttribute, arginfo_phalcon_html_link_interfaces_evolvablelinkinterface_withoutattribute) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.c b/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.c new file mode 100644 index 00000000000..66dae102178 --- /dev/null +++ b/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.c @@ -0,0 +1,53 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../../ext_config.h" +#endif + +#include +#include "../../../../php_ext.h" +#include "../../../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * An evolvable link provider value object. + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, EvolvableLinkProviderInterface, phalcon, html_link_interfaces_evolvablelinkproviderinterface, phalcon_html_link_interfaces_evolvablelinkproviderinterface_method_entry); + + zend_class_implements(phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce, 1, phalcon_html_link_interfaces_linkproviderinterface_ce); + return SUCCESS; +} + +/** + * Returns an instance with the specified link included. + * + * If the specified link is already present, this method MUST return + * normally without errors. The link is present if $link is === identical + * to a link object already in the collection. + * + * @param LinkInterface $link A link object that should be included in this collection. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withLink); +/** + * Returns an instance with the specifed link removed. + * + * If the specified link is not present, this method MUST return normally + * without errors. The link is present if $link is === identical to a link + * object already in the collection. + * + * @param LinkInterface $link The link to remove. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withoutLink); diff --git a/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.h b/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.h new file mode 100644 index 00000000000..5c5dcee00a3 --- /dev/null +++ b/ext/phalcon/html/link/interfaces/evolvablelinkproviderinterface.zep.h @@ -0,0 +1,18 @@ + +extern zend_class_entry *phalcon_html_link_interfaces_evolvablelinkproviderinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withoutlink, 0, 1, Phalcon\\Html\\Link\\Interfaces\\EvolvableLinkProviderInterface, 0) + ZEND_ARG_OBJ_INFO(0, link, Phalcon\\Html\\Link\\Interfaces\\LinkInterface, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_evolvablelinkproviderinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withLink, arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withlink) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_EvolvableLinkProviderInterface, withoutLink, arginfo_phalcon_html_link_interfaces_evolvablelinkproviderinterface_withoutlink) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/interfaces/linkinterface.zep.c b/ext/phalcon/html/link/interfaces/linkinterface.zep.c new file mode 100644 index 00000000000..16b8cf68091 --- /dev/null +++ b/ext/phalcon/html/link/interfaces/linkinterface.zep.c @@ -0,0 +1,71 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../../ext_config.h" +#endif + +#include +#include "../../../../php_ext.h" +#include "../../../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * A readable link object. + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, LinkInterface, phalcon, html_link_interfaces_linkinterface, phalcon_html_link_interfaces_linkinterface_method_entry); + + return SUCCESS; +} + +/** + * Returns a list of attributes that describe the target URI. + * + * @return array + * A key-value list of attributes, where the key is a string and the value + * is either a PHP primitive or an array of PHP strings. If no values are + * found an empty array MUST be returned. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getAttributes); +/** + * Returns the target of the link. + * + * The target link must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative link + * is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * + * If a URI template is returned, isTemplated() MUST return True. + * + * @return string + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getHref); +/** + * Returns the relationship type(s) of the link. + * + * This method returns 0 or more relationship types for a link, expressed + * as an array of strings. + * + * @return string[] + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, getRels); +/** + * Returns whether this is a templated link. + * + * @return bool + * True if this link object is templated, False otherwise. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkInterface, isTemplated); diff --git a/ext/phalcon/html/link/interfaces/linkinterface.zep.h b/ext/phalcon/html/link/interfaces/linkinterface.zep.h new file mode 100644 index 00000000000..d4af118adeb --- /dev/null +++ b/ext/phalcon/html/link/interfaces/linkinterface.zep.h @@ -0,0 +1,24 @@ + +extern zend_class_entry *phalcon_html_link_interfaces_linkinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_getattributes, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_gethref, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_getrels, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkinterface_istemplated, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_linkinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getAttributes, arginfo_phalcon_html_link_interfaces_linkinterface_getattributes) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getHref, arginfo_phalcon_html_link_interfaces_linkinterface_gethref) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, getRels, arginfo_phalcon_html_link_interfaces_linkinterface_getrels) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkInterface, isTemplated, arginfo_phalcon_html_link_interfaces_linkinterface_istemplated) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.c b/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.c new file mode 100644 index 00000000000..9447314ef0e --- /dev/null +++ b/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.c @@ -0,0 +1,41 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../../ext_config.h" +#endif + +#include +#include "../../../../php_ext.h" +#include "../../../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * A link provider object. + */ +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkProviderInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Html\\Link\\Interfaces, LinkProviderInterface, phalcon, html_link_interfaces_linkproviderinterface, phalcon_html_link_interfaces_linkproviderinterface_method_entry); + + return SUCCESS; +} + +/** + * Returns an array of LinkInterface objects. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinks); +/** + * Returns an array of LinkInterface objects that have a specific + * relationship. + */ +ZEPHIR_DOC_METHOD(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinksByRel); diff --git a/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.h b/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.h new file mode 100644 index 00000000000..1fdc360455f --- /dev/null +++ b/ext/phalcon/html/link/interfaces/linkproviderinterface.zep.h @@ -0,0 +1,17 @@ + +extern zend_class_entry *phalcon_html_link_interfaces_linkproviderinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Interfaces_LinkProviderInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinks, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinksbyrel, 0, 1, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_html_link_interfaces_linkproviderinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinks, arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinks) + PHP_ABSTRACT_ME(Phalcon_Html_Link_Interfaces_LinkProviderInterface, getLinksByRel, arginfo_phalcon_html_link_interfaces_linkproviderinterface_getlinksbyrel) + PHP_FE_END +}; diff --git a/ext/phalcon/html/link/link.zep.c b/ext/phalcon/html/link/link.zep.c index 8ce4be4e6e0..b8cdf262683 100644 --- a/ext/phalcon/html/link/link.zep.c +++ b/ext/phalcon/html/link/link.zep.c @@ -12,11 +12,9 @@ #include #include "kernel/main.h" -#include "kernel/memory.h" #include "kernel/fcall.h" #include "kernel/object.h" -#include "kernel/operators.h" -#include "kernel/string.h" +#include "kernel/memory.h" /** @@ -37,107 +35,12 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Link) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, Link, phalcon, html_link_link, phalcon_html_link_link_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, Link, phalcon, html_link_link, phalcon_html_link_abstractlink_ce, phalcon_html_link_link_method_entry, 0); - /** - * @var Collection|CollectionInterface - */ - zend_declare_property_null(phalcon_html_link_link_ce, SL("attributes"), ZEND_ACC_PROTECTED); - /** - * @var string - */ - zend_declare_property_string(phalcon_html_link_link_ce, SL("href"), "", ZEND_ACC_PROTECTED); - /** - * @var Collection|CollectionInterface - */ - zend_declare_property_null(phalcon_html_link_link_ce, SL("rels"), ZEND_ACC_PROTECTED); - /** - * @var bool - */ - zend_declare_property_bool(phalcon_html_link_link_ce, SL("templated"), 0, ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_html_link_link_ce, 1, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))); + zend_class_implements(phalcon_html_link_link_ce, 1, phalcon_html_link_interfaces_linkinterface_ce); return SUCCESS; } -/** - * Link constructor. - * - * @param string rel - * @param string href - */ -PHP_METHOD(Phalcon_Html_Link_Link, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval attributes; - zval *rel_param = NULL, *href_param = NULL, *attributes_param = NULL, _0, _1, _2, _3$$3, _4$$3; - zval rel, href; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&rel); - ZVAL_UNDEF(&href); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&attributes); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 3) - Z_PARAM_OPTIONAL - Z_PARAM_STR(rel) - Z_PARAM_STR(href) - Z_PARAM_ARRAY(attributes) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &rel_param, &href_param, &attributes_param); - if (!rel_param) { - ZEPHIR_INIT_VAR(&rel); - ZVAL_STRING(&rel, ""); - } else { - zephir_get_strval(&rel, rel_param); - } - if (!href_param) { - ZEPHIR_INIT_VAR(&href); - ZVAL_STRING(&href, ""); - } else { - zephir_get_strval(&href, href_param); - } - if (!attributes_param) { - ZEPHIR_INIT_VAR(&attributes); - array_init(&attributes); - } else { - zephir_get_arrval(&attributes, attributes_param); - } - - - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("rels"), &_0); - ZEPHIR_INIT_VAR(&_1); - object_init_ex(&_1, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 24, &attributes); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_1); - zephir_update_property_zval(this_ptr, ZEND_STRL("href"), &href); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "hrefistemplated", NULL, 0, &href); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("templated"), &_2); - if (!(ZEPHIR_IS_EMPTY(&rel))) { - zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZVAL_BOOL(&_4$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "set", NULL, 0, &rel, &_4$$3); - zephir_check_call_status(); - } - ZEPHIR_MM_RESTORE(); -} - /** * Returns a list of attributes that describe the target URI. * @@ -148,18 +51,15 @@ PHP_METHOD(Phalcon_Html_Link_Link, __construct) */ PHP_METHOD(Phalcon_Html_Link_Link, getAttributes) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetattributes", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -179,11 +79,17 @@ PHP_METHOD(Phalcon_Html_Link_Link, getAttributes) */ PHP_METHOD(Phalcon_Html_Link_Link, getHref) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - RETURN_MEMBER(getThis(), "href"); + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogethref", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); } /** @@ -196,20 +102,15 @@ PHP_METHOD(Phalcon_Html_Link_Link, getHref) */ PHP_METHOD(Phalcon_Html_Link_Link, getRels) { - zval _0, _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("rels"), PH_NOISY_CC | PH_READONLY); - ZVAL_BOOL(&_1, 0); - ZEPHIR_RETURN_CALL_METHOD(&_0, "getkeys", NULL, 0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetrels", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -221,61 +122,16 @@ PHP_METHOD(Phalcon_Html_Link_Link, getRels) */ PHP_METHOD(Phalcon_Html_Link_Link, isTemplated) { - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "templated"); -} - -/** - * Determines if a href is a templated link or not. - * - * @see https://tools.ietf.org/html/rfc6570 - * - * @param string href - * - * @return bool - */ -PHP_METHOD(Phalcon_Html_Link_Link, hrefIsTemplated) -{ - zend_bool _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *href_param = NULL, _0, _1, _3, _4; - zval href; zval *this_ptr = getThis(); - ZVAL_UNDEF(&href); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(href) - ZEND_PARSE_PARAMETERS_END(); -#endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &href_param); - zephir_get_strval(&href, href_param); - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "{"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, &href, &_0, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); - if (_2) { - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "}"); - ZEPHIR_CALL_FUNCTION(&_4, "strrpos", NULL, 123, &href, &_3); - zephir_check_call_status(); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4); - } - RETURN_MM_BOOL(_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "doistemplated", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); } diff --git a/ext/phalcon/html/link/link.zep.h b/ext/phalcon/html/link/link.zep.h index 876552603de..06859f7b3e7 100644 --- a/ext/phalcon/html/link/link.zep.h +++ b/ext/phalcon/html/link/link.zep.h @@ -3,61 +3,27 @@ extern zend_class_entry *phalcon_html_link_link_ce; ZEPHIR_INIT_CLASS(Phalcon_Html_Link_Link); -PHP_METHOD(Phalcon_Html_Link_Link, __construct); PHP_METHOD(Phalcon_Html_Link_Link, getAttributes); PHP_METHOD(Phalcon_Html_Link_Link, getHref); PHP_METHOD(Phalcon_Html_Link_Link, getRels); PHP_METHOD(Phalcon_Html_Link_Link, isTemplated); -PHP_METHOD(Phalcon_Html_Link_Link, hrefIsTemplated); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, rel, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, attributes, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_getattributes, 0, 0, 0) -ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_gethref, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_getattributes, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_getrels, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_gethref, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_link_istemplated, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_getrels, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_hrefistemplated, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, href, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_link_istemplated, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_html_link_link_method_entry) { - PHP_ME(Phalcon_Html_Link_Link, __construct, arginfo_phalcon_html_link_link___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getAttributes, arginfo_phalcon_html_link_link_getattributes, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getAttributes, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getHref, arginfo_phalcon_html_link_link_gethref, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getHref, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, getRels, arginfo_phalcon_html_link_link_getrels, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, getRels, NULL, ZEND_ACC_PUBLIC) -#endif -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_Link, isTemplated, arginfo_phalcon_html_link_link_istemplated, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_Link, isTemplated, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Html_Link_Link, hrefIsTemplated, arginfo_phalcon_html_link_link_hrefistemplated, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/html/link/linkprovider.zep.c b/ext/phalcon/html/link/linkprovider.zep.c index a594168aeaf..4b3ea9dfc55 100644 --- a/ext/phalcon/html/link/linkprovider.zep.c +++ b/ext/phalcon/html/link/linkprovider.zep.c @@ -13,10 +13,8 @@ #include "kernel/main.h" #include "kernel/fcall.h" -#include "kernel/memory.h" #include "kernel/object.h" -#include "kernel/operators.h" -#include "kernel/array.h" +#include "kernel/memory.h" /** @@ -32,107 +30,31 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Html_Link_LinkProvider) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Html\\Link, LinkProvider, phalcon, html_link_linkprovider, phalcon_html_link_linkprovider_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html\\Link, LinkProvider, phalcon, html_link_linkprovider, phalcon_html_link_abstractlinkprovider_ce, phalcon_html_link_linkprovider_method_entry, 0); - /** - * @var LinkInterface[] - */ - zend_declare_property_null(phalcon_html_link_linkprovider_ce, SL("links"), ZEND_ACC_PROTECTED); - phalcon_html_link_linkprovider_ce->create_object = zephir_init_properties_Phalcon_Html_Link_LinkProvider; - - zend_class_implements(phalcon_html_link_linkprovider_ce, 1, zephir_get_internal_ce(SL("psr\\link\\linkproviderinterface"))); + zend_class_implements(phalcon_html_link_linkprovider_ce, 1, phalcon_html_link_interfaces_linkproviderinterface_ce); return SUCCESS; } -/** - * LinkProvider constructor. - * - * @param array links - */ -PHP_METHOD(Phalcon_Html_Link_LinkProvider, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *links_param = NULL, link, *_0, _1, _2$$4, _4$$6; - zval links; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&links); - ZVAL_UNDEF(&link); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_4$$6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(links) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &links_param); - if (!links_param) { - ZEPHIR_INIT_VAR(&links); - array_init(&links); - } else { - zephir_get_arrval(&links, links_param); - } - - - zephir_is_iterable(&links, 0, "phalcon/Html/Link/LinkProvider.zep", 40); - if (Z_TYPE_P(&links) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) - { - ZEPHIR_INIT_NVAR(&link); - ZVAL_COPY(&link, _0); - if (zephir_is_instance_of(&link, SL("Psr\\Link\\LinkInterface"))) { - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getkey", &_3, 0, &link); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("links"), &_2$$4, &link); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &links, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&link, &links, "current", NULL, 0); - zephir_check_call_status(); - if (zephir_is_instance_of(&link, SL("Psr\\Link\\LinkInterface"))) { - ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getkey", &_3, 0, &link); - zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("links"), &_4$$6, &link); - } - ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&link); - ZEPHIR_MM_RESTORE(); -} - /** * Returns an iterable of LinkInterface objects. * * The iterable may be an array or any PHP \Traversable object. If no links * are available, an empty array or \Traversable MUST be returned. - * - * @return LinkInterface[]|\Traversable */ PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - RETURN_MEMBER(getThis(), "links"); + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetlinks", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); } /** @@ -142,22 +64,15 @@ PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks) * The iterable may be an array or any PHP \Traversable object. If no links * with that relationship are available, an empty array or \Traversable * MUST be returned. - * - * @return LinkInterface[]|\Traversable */ PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rel, rel_sub, link, links, rels, _0, *_1, _2; + zval *rel, rel_sub; zval *this_ptr = getThis(); ZVAL_UNDEF(&rel_sub); - ZVAL_UNDEF(&link); - ZVAL_UNDEF(&links); - ZVAL_UNDEF(&rels); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -170,98 +85,8 @@ PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel) zephir_fetch_params(1, 1, 0, &rel); - ZEPHIR_INIT_VAR(&links); - array_init(&links); - zephir_read_property(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_0, 0, "phalcon/Html/Link/LinkProvider.zep", 77); - if (Z_TYPE_P(&_0) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) - { - ZEPHIR_INIT_NVAR(&link); - ZVAL_COPY(&link, _1); - ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); - zephir_check_call_status(); - if (1 == zephir_fast_in_array(rel, &rels)) { - zephir_array_append(&links, &link, PH_SEPARATE, "phalcon/Html/Link/LinkProvider.zep", 73); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &_0, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_2, &_0, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_2)) { - break; - } - ZEPHIR_CALL_METHOD(&link, &_0, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&rels, &link, "getrels", NULL, 0); - zephir_check_call_status(); - if (1 == zephir_fast_in_array(rel, &rels)) { - zephir_array_append(&links, &link, PH_SEPARATE, "phalcon/Html/Link/LinkProvider.zep", 73); - } - ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&link); - RETURN_CCTOR(&links); -} - -/** - * Returns the object hash key - * - * @param LinkInterface link - * - * @return string - */ -PHP_METHOD(Phalcon_Html_Link_LinkProvider, getKey) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *link, link_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&link_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(link, zephir_get_internal_ce(SL("psr\\link\\linkinterface"))) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &link); - - - ZEPHIR_RETURN_CALL_FUNCTION("spl_object_hash", NULL, 108, link); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "dogetlinksbyrel", NULL, 0, rel); zephir_check_call_status(); RETURN_MM(); } -zend_object *zephir_init_properties_Phalcon_Html_Link_LinkProvider(zend_class_entry *class_type) -{ - zval _0, _1$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("links"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("links"), &_1$$3); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } -} - diff --git a/ext/phalcon/html/link/linkprovider.zep.h b/ext/phalcon/html/link/linkprovider.zep.h index a5503012ac8..bb2f6220c42 100644 --- a/ext/phalcon/html/link/linkprovider.zep.h +++ b/ext/phalcon/html/link/linkprovider.zep.h @@ -3,42 +3,18 @@ extern zend_class_entry *phalcon_html_link_linkprovider_ce; ZEPHIR_INIT_CLASS(Phalcon_Html_Link_LinkProvider); -PHP_METHOD(Phalcon_Html_Link_LinkProvider, __construct); PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinks); PHP_METHOD(Phalcon_Html_Link_LinkProvider, getLinksByRel); -PHP_METHOD(Phalcon_Html_Link_LinkProvider, getKey); -zend_object *zephir_init_properties_Phalcon_Html_Link_LinkProvider(zend_class_entry *class_type); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider___construct, 0, 0, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, links, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, links, 0) -#endif +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinks, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinks, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinksbyrel, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getlinksbyrel, 0, 1, IS_ARRAY, 0) ZEND_ARG_INFO(0, rel) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_html_link_linkprovider_getkey, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_html_link_linkprovider_zephir_init_properties_phalcon_html_link_linkprovider, 0, 0, 0) -ZEND_END_ARG_INFO() - ZEPHIR_INIT_FUNCS(phalcon_html_link_linkprovider_method_entry) { - PHP_ME(Phalcon_Html_Link_LinkProvider, __construct, arginfo_phalcon_html_link_linkprovider___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Html_Link_LinkProvider, getLinks, arginfo_phalcon_html_link_linkprovider_getlinks, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Html_Link_LinkProvider, getLinks, NULL, ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Html_Link_LinkProvider, getLinksByRel, arginfo_phalcon_html_link_linkprovider_getlinksbyrel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Html_Link_LinkProvider, getKey, arginfo_phalcon_html_link_linkprovider_getkey, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/html/link/serializer/header.zep.c b/ext/phalcon/html/link/serializer/header.zep.c index 9b6c72101c1..f721a516efc 100644 --- a/ext/phalcon/html/link/serializer/header.zep.c +++ b/ext/phalcon/html/link/serializer/header.zep.c @@ -110,7 +110,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_NULL(&result); ZEPHIR_INIT_VAR(&elements); array_init(&elements); - zephir_is_iterable(&links, 0, "phalcon/Html/Link/Serializer/Header.zep", 72); + zephir_is_iterable(&links, 0, "phalcon/Html/Link/Serializer/Header.zep", 70); if (Z_TYPE_P(&links) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&links), _0) { @@ -135,7 +135,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&_4$$3); ZEPHIR_CONCAT_SVS(&_4$$3, "rel=\"", &_3$$3, "\""); zephir_array_fast_append(&parts, &_4$$3); - zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 66); + zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 64); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _7$$3, _8$$3, _5$$3) { @@ -148,7 +148,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _5$$3); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _9$$6) { @@ -156,7 +156,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _9$$6); ZEPHIR_INIT_NVAR(&_11$$7); ZEPHIR_CONCAT_VSVS(&_11$$7, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_11$$7, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_11$$7, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -171,7 +171,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_12$$8); ZEPHIR_CONCAT_VSVS(&_12$$8, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_12$$8, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_12$$8, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -182,11 +182,11 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_13$$9); ZEPHIR_CONCAT_VSVS(&_13$$9, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_13$$9, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_13$$9, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } } ZEND_HASH_FOREACH_END(); @@ -204,7 +204,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CALL_METHOD(&value, &attributes, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _14$$12) { @@ -212,7 +212,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _14$$12); ZEPHIR_INIT_NVAR(&_16$$13); ZEPHIR_CONCAT_VSVS(&_16$$13, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_16$$13, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_16$$13, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -227,7 +227,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_17$$14); ZEPHIR_CONCAT_VSVS(&_17$$14, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_17$$14, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_17$$14, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -238,11 +238,11 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_18$$15); ZEPHIR_CONCAT_VSVS(&_18$$15, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_18$$15, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_18$$15, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); @@ -257,7 +257,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_fast_join_str(&_20$$3, SL("; "), &parts); ZEPHIR_INIT_NVAR(&_4$$3); ZEPHIR_CONCAT_SVSV(&_4$$3, "<", &_19$$3, ">", &_20$$3); - zephir_array_append(&elements, &_4$$3, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 69); + zephir_array_append(&elements, &_4$$3, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 67); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &links, "rewind", NULL, 0); @@ -290,7 +290,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CONCAT_SVS(&_24$$17, "rel=\"", &_23$$17, "\""); zephir_array_fast_append(&_22$$17, &_24$$17); ZEPHIR_CPY_WRT(&parts, &_22$$17); - zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 66); + zephir_is_iterable(&attributes, 0, "phalcon/Html/Link/Serializer/Header.zep", 64); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _27$$17, _28$$17, _25$$17) { @@ -303,7 +303,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _25$$17); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _29$$20) { @@ -311,7 +311,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _29$$20); ZEPHIR_INIT_NVAR(&_31$$21); ZEPHIR_CONCAT_VSVS(&_31$$21, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_31$$21, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_31$$21, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -326,7 +326,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_32$$22); ZEPHIR_CONCAT_VSVS(&_32$$22, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_32$$22, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_32$$22, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -337,11 +337,11 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_33$$23); ZEPHIR_CONCAT_VSVS(&_33$$23, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_33$$23, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_33$$23, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } } ZEND_HASH_FOREACH_END(); @@ -359,7 +359,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZEPHIR_CALL_METHOD(&value, &attributes, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&value) == IS_ARRAY) { - zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 52); + zephir_is_iterable(&value, 0, "phalcon/Html/Link/Serializer/Header.zep", 50); if (Z_TYPE_P(&value) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&value), _34$$26) { @@ -367,7 +367,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) ZVAL_COPY(&subValue, _34$$26); ZEPHIR_INIT_NVAR(&_36$$27); ZEPHIR_CONCAT_VSVS(&_36$$27, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_36$$27, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_36$$27, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &value, "rewind", NULL, 0); @@ -382,7 +382,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_37$$28); ZEPHIR_CONCAT_VSVS(&_37$$28, &key, "=\"", &subValue, "\""); - zephir_array_append(&parts, &_37$$28, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 50); + zephir_array_append(&parts, &_37$$28, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 48); ZEPHIR_CALL_METHOD(NULL, &value, "next", NULL, 0); zephir_check_call_status(); } @@ -393,11 +393,11 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) if (((Z_TYPE_P(&value) == IS_TRUE || Z_TYPE_P(&value) == IS_FALSE) != 1)) { ZEPHIR_INIT_NVAR(&_38$$29); ZEPHIR_CONCAT_VSVS(&_38$$29, &key, "=\"", &value, "\""); - zephir_array_append(&parts, &_38$$29, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 56); + zephir_array_append(&parts, &_38$$29, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 54); continue; } if (ZEPHIR_IS_TRUE_IDENTICAL(&value)) { - zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 61); + zephir_array_append(&parts, &key, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 59); continue; } ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); @@ -412,7 +412,7 @@ PHP_METHOD(Phalcon_Html_Link_Serializer_Header, serialize) zephir_fast_join_str(&_40$$17, SL("; "), &parts); ZEPHIR_INIT_NVAR(&_24$$17); ZEPHIR_CONCAT_SVSV(&_24$$17, "<", &_39$$17, ">", &_40$$17); - zephir_array_append(&elements, &_24$$17, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 69); + zephir_array_append(&elements, &_24$$17, PH_SEPARATE, "phalcon/Html/Link/Serializer/Header.zep", 67); ZEPHIR_CALL_METHOD(NULL, &links, "next", NULL, 0); zephir_check_call_status(); } diff --git a/ext/phalcon/http/cookie.zep.c b/ext/phalcon/http/cookie.zep.c index d719faf28d5..636895f5a83 100644 --- a/ext/phalcon/http/cookie.zep.c +++ b/ext/phalcon/http/cookie.zep.c @@ -311,30 +311,30 @@ PHP_METHOD(Phalcon_Http_Cookie, delete) ZEPHIR_INIT_VAR(&_8); ZVAL_STRING(&_8, "expires"); ZVAL_LONG(&_0, (zephir_get_numberval(&_3) - 691200)); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 349, &options, &_8, &_0); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 331, &options, &_8, &_0); zephir_check_call_status(); zephir_array_update_string(&options, SL("expires"), &_7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "domain"); - ZEPHIR_CALL_METHOD(&_9, this_ptr, "getarrval", NULL, 349, &options, &_8, &domain); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "getarrval", NULL, 331, &options, &_8, &domain); zephir_check_call_status(); zephir_array_update_string(&options, SL("domain"), &_9, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "path"); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 349, &options, &_8, &path); + ZEPHIR_CALL_METHOD(&_10, this_ptr, "getarrval", NULL, 331, &options, &_8, &path); zephir_check_call_status(); zephir_array_update_string(&options, SL("path"), &_10, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "secure"); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 349, &options, &_8, &secure); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "getarrval", NULL, 331, &options, &_8, &secure); zephir_check_call_status(); zephir_array_update_string(&options, SL("secure"), &_11, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_8); ZVAL_STRING(&_8, "httponly"); - ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 349, &options, &_8, &httpOnly); + ZEPHIR_CALL_METHOD(&_12, this_ptr, "getarrval", NULL, 331, &options, &_8, &httpOnly); zephir_check_call_status(); zephir_array_update_string(&options, SL("httponly"), &_12, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 350, &name, &__$null, &options); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &__$null, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -855,30 +855,30 @@ PHP_METHOD(Phalcon_Http_Cookie, send) } ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "expires"); - ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 349, &options, &_3, &expire); + ZEPHIR_CALL_METHOD(&_13, this_ptr, "getarrval", NULL, 331, &options, &_3, &expire); zephir_check_call_status(); zephir_array_update_string(&options, SL("expires"), &_13, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "domain"); - ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 349, &options, &_3, &domain); + ZEPHIR_CALL_METHOD(&_14, this_ptr, "getarrval", NULL, 331, &options, &_3, &domain); zephir_check_call_status(); zephir_array_update_string(&options, SL("domain"), &_14, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "path"); - ZEPHIR_CALL_METHOD(&_15, this_ptr, "getarrval", NULL, 349, &options, &_3, &path); + ZEPHIR_CALL_METHOD(&_15, this_ptr, "getarrval", NULL, 331, &options, &_3, &path); zephir_check_call_status(); zephir_array_update_string(&options, SL("path"), &_15, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "secure"); - ZEPHIR_CALL_METHOD(&_16, this_ptr, "getarrval", NULL, 349, &options, &_3, &secure); + ZEPHIR_CALL_METHOD(&_16, this_ptr, "getarrval", NULL, 331, &options, &_3, &secure); zephir_check_call_status(); zephir_array_update_string(&options, SL("secure"), &_16, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "httponly"); - ZEPHIR_CALL_METHOD(&_17, this_ptr, "getarrval", NULL, 349, &options, &_3, &httpOnly); + ZEPHIR_CALL_METHOD(&_17, this_ptr, "getarrval", NULL, 331, &options, &_3, &httpOnly); zephir_check_call_status(); zephir_array_update_string(&options, SL("httponly"), &_17, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 350, &name, &encryptValue, &options); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 332, &name, &encryptValue, &options); zephir_check_call_status(); RETURN_THIS(); } @@ -1262,16 +1262,16 @@ PHP_METHOD(Phalcon_Http_Cookie, assertSignKeyIsLongEnough) } - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 250, &signKey); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 229, &signKey); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_LT_LONG(&length, 32))) { ZEPHIR_INIT_VAR(&_0$$3); object_init_ex(&_0$$3, phalcon_http_cookie_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "The cookie's key should be at least 32 characters long. Current length is %d."); - ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 140, &_1$$3, &length); + ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 112, &_1$$3, &length); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Cookie.zep", 649); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/http/message/abstractcommon.zep.c b/ext/phalcon/http/message/abstractcommon.zep.c deleted file mode 100644 index 541959c1376..00000000000 --- a/ext/phalcon/http/message/abstractcommon.zep.c +++ /dev/null @@ -1,151 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/exception.h" -#include "kernel/fcall.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Common methods - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractCommon) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, AbstractCommon, phalcon, http_message_abstractcommon, phalcon_http_message_abstractcommon_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - return SUCCESS; -} - -/** - * Returns a new instance having set the parameter - * - * @param mixed $element - * @param string $property - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, cloneInstance) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval property; - zval *element, element_sub, *property_param = NULL, newInstance; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&property); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(element) - Z_PARAM_STR(property) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &element, &property_param); - zephir_get_strval(&property, property_param); - - - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - zephir_update_property_zval_zval(&newInstance, &property, element); - RETURN_CCTOR(&newInstance); -} - -/** - * Checks the element passed if it is a string - * - * @param mixed $element - */ -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, checkStringParameter) -{ - zval *element, element_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &element); - - - if (Z_TYPE_P(element) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_http_message_exception_invalidargumentexception_ce, "Method requires a string argument", "phalcon/Http/Message/AbstractCommon.zep", 52); - return; - } -} - -/** - * Checks the element passed; assigns it to the property and returns a - * clone of the object back - * - * @param mixed $element - * @param string $property - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, processWith) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval property; - zval *element, element_sub, *property_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element_sub); - ZVAL_UNDEF(&property); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(element) - Z_PARAM_STR(property) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &element, &property_param); - zephir_get_strval(&property, property_param); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, element); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, element, &property); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/abstractcommon.zep.h b/ext/phalcon/http/message/abstractcommon.zep.h deleted file mode 100644 index 73f28827e8f..00000000000 --- a/ext/phalcon/http/message/abstractcommon.zep.h +++ /dev/null @@ -1,30 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_abstractcommon_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractCommon); - -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, cloneInstance); -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, checkStringParameter); -PHP_METHOD(Phalcon_Http_Message_AbstractCommon, processWith); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractcommon_cloneinstance, 0, 0, 2) - ZEND_ARG_INFO(0, element) - ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractcommon_checkstringparameter, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, element) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractcommon_processwith, 0, 0, 2) - ZEND_ARG_INFO(0, element) - ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractcommon_method_entry) { - PHP_ME(Phalcon_Http_Message_AbstractCommon, cloneInstance, arginfo_phalcon_http_message_abstractcommon_cloneinstance, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractCommon, checkStringParameter, arginfo_phalcon_http_message_abstractcommon_checkstringparameter, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractCommon, processWith, arginfo_phalcon_http_message_abstractcommon_processwith, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/abstractmessage.zep.c b/ext/phalcon/http/message/abstractmessage.zep.c deleted file mode 100644 index fcc8798e1f8..00000000000 --- a/ext/phalcon/http/message/abstractmessage.zep.c +++ /dev/null @@ -1,1261 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/string.h" -#include "kernel/array.h" -#include "kernel/exception.h" -#include "kernel/concat.h" -#include "ext/spl/spl_exceptions.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Message methods - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractMessage) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, AbstractMessage, phalcon, http_message_abstractmessage, phalcon_http_message_abstractcommon_ce, phalcon_http_message_abstractmessage_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - /** - * Gets the body of the message. - * - * @var StreamInterface - */ - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("body"), ZEND_ACC_PROTECTED); - /** - * @var Collection|CollectionInterface - */ - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("headers"), ZEND_ACC_PROTECTED); - /** - * Retrieves the HTTP protocol version as a string. - * - * The string MUST contain only the HTTP version number (e.g., '1.1', - * '1.0'). - * - * @return string HTTP protocol version. - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_abstractmessage_ce, SL("protocolVersion"), "1.1", ZEND_ACC_PROTECTED); - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @var UriInterface - */ - zend_declare_property_null(phalcon_http_message_abstractmessage_ce, SL("uri"), ZEND_ACC_PROTECTED); - return SUCCESS; -} - -/** - * Gets the body of the message. - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getBody) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "body"); -} - -/** - * Retrieves the HTTP protocol version as a string. - * - * - * The string MUST contain only the HTTP version number (e.g., '1.1', - * '1.0'). - * - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getProtocolVersion) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "protocolVersion"); -} - -/** - * Retrieves the URI instance. - * - * - * This method MUST return a UriInterface instance. - * - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUri) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "uri"); -} - -/** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeader) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name = NULL, name_sub, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - ZEPHIR_SEPARATE_PARAM(name); - - - zephir_cast_to_string(&_0, name); - ZEPHIR_CPY_WRT(name, &_0); - zephir_read_property(&_1, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_RETURN_CALL_METHOD(&_1, "get", NULL, 0, name, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderLine) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, header, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - ZEPHIR_CALL_METHOD(&header, this_ptr, "getheader", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ","); - zephir_fast_join(return_value, &_0, &header); - RETURN_MM(); -} - -/** - * Retrieves all message header values. - * - * The keys represent the header name as it will be sent over the wire, and - * each value is an array of strings associated with the header. - * - * // Represent the headers as a string - * foreach ($message->getHeaders() as $name => $values) { - * echo $name . ': ' . implode(', ', $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaders) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name - * - * @return bool - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, hasHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "has", NULL, 0, name); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified header appended with the given - * value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name - * @param string|string[] $value - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withAddedHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value = NULL, value_sub, existing, headers, _0, _1, _2, _3, _4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&existing); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - ZEPHIR_SEPARATE_PARAM(value); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", NULL, 35, name); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_CALL_METHOD(&existing, &headers, "get", NULL, 0, name, &_2); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getheadervalue", NULL, 36, value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, &_3); - ZEPHIR_INIT_VAR(&_4); - zephir_fast_array_merge(&_4, &existing, value); - ZEPHIR_CPY_WRT(value, &_4); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_4); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body - * - * @return static - * @throws InvalidArgumentException When the body is not valid. - * - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withBody) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *body, body_sub, newBody, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&newBody); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(body, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &body); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "w+b"); - ZEPHIR_CALL_METHOD(&newBody, this_ptr, "processbody", NULL, 37, body, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "body"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &newBody, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the provided value replacing the specified - * header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name - * @param string|string[] $value - * - * @return static - * @throws InvalidArgumentException for invalid header names or values. - * - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value = NULL, value_sub, headers, _0, _1, _2, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - ZEPHIR_SEPARATE_PARAM(value); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", NULL, 35, name); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getheadervalue", NULL, 36, value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, &_2); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_3); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified HTTP protocol version. - * - * The version string MUST contain only the HTTP version number (e.g., - * '1.1', '1.0'). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new protocol version. - * - * @param string $version - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withProtocolVersion) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *version, version_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&version_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(version) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &version); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processprotocol", NULL, 38, version); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "protocolVersion"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, version, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withoutHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, headers, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_1); - ZEPHIR_CALL_METHOD(NULL, &headers, "remove", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "headers"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &headers, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Ensure Host is the first header. - * - * @see: http://tools.ietf.org/html/rfc7230#section-5.4 - * - * @param CollectionInterface $collection - * - * @return CollectionInterface - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderHost) -{ - zend_bool _2, _4; - zval header, _11$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, collection_sub, data, host, hostArray, _0, _1, _3, _5, _6, _7, _8$$3, _10$$3, _12$$3, _9$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection_sub); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&hostArray); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_10$$3); - ZVAL_UNDEF(&_12$$3); - ZVAL_UNDEF(&_9$$4); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&_11$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(collection, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &collection); - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "host"); - ZEPHIR_CALL_METHOD(&_0, collection, "has", NULL, 0, &_1); - zephir_check_call_status(); - _2 = zephir_is_true(&_0); - if (_2) { - ZEPHIR_OBS_VAR(&_3); - zephir_read_property(&_3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC); - _2 = !(ZEPHIR_IS_EMPTY(&_3)); - } - _4 = _2; - if (_4) { - zephir_read_property(&_5, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_6, &_5, "gethost", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_7); - ZVAL_STRING(&_7, ""); - _4 = !ZEPHIR_IS_IDENTICAL(&_7, &_6); - } - if (UNEXPECTED(_4)) { - zephir_read_property(&_8$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "geturihost", NULL, 39, &_8$$3); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&hostArray, &host); - if (UNEXPECTED(Z_TYPE_P(&host) != IS_ARRAY)) { - ZEPHIR_INIT_VAR(&_9$$4); - zephir_create_array(&_9$$4, 1, 0); - zephir_array_fast_append(&_9$$4, &host); - ZEPHIR_CPY_WRT(&hostArray, &_9$$4); - } - ZEPHIR_INIT_VAR(&_10$$3); - ZVAL_STRING(&_10$$3, "host"); - ZEPHIR_CALL_METHOD(NULL, collection, "remove", NULL, 0, &_10$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&data, collection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&header); - array_init(&header); - zephir_array_update_string(&header, SL("Host"), &hostArray, PH_COPY | PH_SEPARATE); - zephir_get_arrval(&_11$$3, &data); - ZEPHIR_INIT_VAR(&_12$$3); - zephir_add_function(&_12$$3, &header, &_11$$3); - ZEPHIR_CPY_WRT(&header, &_12$$3); - ZEPHIR_CALL_METHOD(NULL, collection, "clear", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, collection, "init", NULL, 0, &header); - zephir_check_call_status(); - } - RETVAL_ZVAL(collection, 1, 0); - RETURN_MM(); -} - -/** - * Check the name of the header. Throw exception if not valid - * - * @see http://tools.ietf.org/html/rfc7230#section-3.2 - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderName) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, _1, _2, _3, _4, _5$$3, _6$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - _0 = Z_TYPE_P(name) != IS_STRING; - if (!(_0)) { - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "/^[a-zA-Z0-9'`#$%&*+.^_|~!-]+$/"); - ZEPHIR_INIT_VAR(&_3); - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "/^[a-zA-Z0-9'`#$%&*+.^_|~!-]+$/"); - zephir_preg_match(&_3, &_4, name, &_1, 0, 0 , 0 ); - _0 = !zephir_is_true(&_3); - } - if (UNEXPECTED(_0)) { - ZEPHIR_INIT_VAR(&_5$$3); - object_init_ex(&_5$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_6$$3); - ZEPHIR_CONCAT_SV(&_6$$3, "Invalid header name ", name); - ZEPHIR_CALL_METHOD(NULL, &_5$$3, "__construct", NULL, 40, &_6$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$3, "phalcon/Http/Message/AbstractMessage.zep", 333); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Validates a header value - * - * Most HTTP header field values are defined using common syntax - * components (token, quoted-string, and comment) separated by - * whitespace or specific delimiting characters. Delimiters are chosen - * from the set of US-ASCII visual characters not allowed in a token - * (DQUOTE and '(),/:;<=>?@[\]{}'). - * - * token = 1*tchar - * - * tchar = '!' / '#' / '$' / '%' / '&' / ''' / '*' - * / '+' / '-' / '.' / '^' / '_' / '`' / '|' / '~' - * / DIGIT / ALPHA - * ; any VCHAR, except delimiters - * - * A string of text is parsed as a single value if it is quoted using - * double-quote marks. - * - * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE - * qdtext = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text - * obs-text = %x80-FF - * - * Comments can be included in some HTTP header fields by surrounding - * the comment text with parentheses. Comments are only allowed in - * fields containing 'comment' as part of their field value definition. - * - * comment = '(' *( ctext / quoted-pair / comment ) ')' - * ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text - * - * The backslash octet ('\') can be used as a single-octet quoting - * mechanism within quoted-string and comment constructs. Recipients - * that process the value of a quoted-string MUST handle a quoted-pair - * as if it were replaced by the octet following the backslash. - * - * quoted-pair = '\' ( HTAB / SP / VCHAR / obs-text ) - * - * A sender SHOULD NOT generate a quoted-pair in a quoted-string except - * where necessary to quote DQUOTE and backslash octets occurring within - * that string. A sender SHOULD NOT generate a quoted-pair in a comment - * except where necessary to quote parentheses ['(' and ')'] and - * backslash octets occurring within that comment. - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderValue) -{ - zval _1; - zend_bool _0, _6; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *value = NULL, value_sub, _2, _3, _4, _5, _7, _8, _9, _10; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &value); - ZEPHIR_SEPARATE_PARAM(value); - - - _0 = Z_TYPE_P(value) != IS_STRING; - if (_0) { - _0 = 1 != zephir_is_numeric(value); - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid header value", "phalcon/Http/Message/AbstractMessage.zep", 385); - return; - } - zephir_cast_to_string(&_1, value); - ZEPHIR_CPY_WRT(value, &_1); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "#(?:(?:(?= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(values) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &values); - - - ZEPHIR_CPY_WRT(&valueArray, values); - if (UNEXPECTED(Z_TYPE_P(values) != IS_ARRAY)) { - ZEPHIR_INIT_VAR(&_0$$3); - zephir_create_array(&_0$$3, 1, 0); - zephir_array_fast_append(&_0$$3, values); - ZEPHIR_CPY_WRT(&valueArray, &_0$$3); - } - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&valueArray))) { - ZEPHIR_INIT_VAR(&_1$$4); - object_init_ex(&_1$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_2$$4); - ZEPHIR_CONCAT_SS(&_2$$4, "Invalid header value: must be a string or ", "array of strings; cannot be an empty array"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 40, &_2$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Http/Message/AbstractMessage.zep", 412); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_INIT_VAR(&valueData); - array_init(&valueData); - zephir_is_iterable(&valueArray, 0, "phalcon/Http/Message/AbstractMessage.zep", 422); - if (Z_TYPE_P(&valueArray) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&valueArray), _3) - { - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadervalue", &_5, 41, &value); - zephir_check_call_status(); - zephir_cast_to_string(&_6$$5, &value); - zephir_array_append(&valueData, &_6$$5, PH_SEPARATE, "phalcon/Http/Message/AbstractMessage.zep", 419); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &valueArray, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4, &valueArray, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4)) { - break; - } - ZEPHIR_CALL_METHOD(&value, &valueArray, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadervalue", &_5, 41, &value); - zephir_check_call_status(); - zephir_cast_to_string(&_7$$6, &value); - zephir_array_append(&valueData, &_7$$6, PH_SEPARATE, "phalcon/Http/Message/AbstractMessage.zep", 419); - ZEPHIR_CALL_METHOD(NULL, &valueArray, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - RETURN_CCTOR(&valueData); -} - -/** - * Return the host and if applicable the port - * - * @param UriInterface $uri - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUriHost) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub, host, _0, _1$$3, _2$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(uri, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uri); - - - ZEPHIR_CALL_METHOD(&host, uri, "gethost", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, uri, "getport", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&_1$$3, uri, "getport", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2$$3); - ZEPHIR_CONCAT_SV(&_2$$3, ":", &_1$$3); - zephir_concat_self(&host, &_2$$3); - } - RETURN_CCTOR(&host); -} - -/** - * Populates the header collection - * - * @param array $headers - * - * @return CollectionInterface - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection) -{ - zval _5$$3, _9$$4; - zend_string *_3; - zend_ulong _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL, *_8 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *headers_param = NULL, collection, name, value, *_0, _1, _6$$3, _10$$4; - zval headers; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_10$$4); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_9$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &headers_param); - zephir_get_arrval(&headers, headers_param); - - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_is_iterable(&headers, 0, "phalcon/Http/Message/AbstractMessage.zep", 466); - if (Z_TYPE_P(&headers) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&headers), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&name); - if (_3 != NULL) { - ZVAL_STR_COPY(&name, _3); - } else { - ZVAL_LONG(&name, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", &_4, 35, &name); - zephir_check_call_status(); - zephir_cast_to_string(&_5$$3, &name); - ZEPHIR_CPY_WRT(&name, &_5$$3); - ZEPHIR_CALL_METHOD(&_6$$3, this_ptr, "getheadervalue", &_7, 36, &value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&value, &_6$$3); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_8, 42, &name, &value); - zephir_check_call_status(); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &headers, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &headers, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&name, &headers, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &headers, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkheadername", &_4, 35, &name); - zephir_check_call_status(); - zephir_cast_to_string(&_9$$4, &name); - ZEPHIR_CPY_WRT(&name, &_9$$4); - ZEPHIR_CALL_METHOD(&_10$$4, this_ptr, "getheadervalue", &_7, 36, &value); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&value, &_10$$4); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_8, 42, &name, &value); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &headers, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&name); - RETURN_CCTOR(&collection); -} - -/** - * Set a valid stream - * - * @param StreamInterface|resource|string $body - * @param string $mode - * - * @return StreamInterface - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processBody) -{ - zend_bool _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *body = NULL, body_sub, *mode_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(body) - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &body, &mode_param); - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "r+b"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - _0 = Z_TYPE_P(body) == IS_OBJECT; - if (_0) { - _0 = zephir_is_instance_of(body, SL("Psr\\Http\\Message\\StreamInterface")); - } - if (UNEXPECTED(_0)) { - RETVAL_ZVAL(body, 1, 0); - RETURN_MM(); - } - _1 = Z_TYPE_P(body) != IS_STRING; - if (_1) { - _1 = Z_TYPE_P(body) != IS_RESOURCE; - } - if (UNEXPECTED(_1)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream passed as a parameter", "phalcon/Http/Message/AbstractMessage.zep", 486); - return; - } - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, body, &mode); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Sets the headers - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processHeaders) -{ - zend_bool _1$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *headers, headers_sub, collection, _0$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&_0$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &headers); - - - if (EXPECTED(Z_TYPE_P(headers) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&collection, this_ptr, "populateheadercollection", NULL, 44, headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "checkheaderhost", NULL, 45, &collection); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&collection, &_0$$3); - } else { - _1$$4 = Z_TYPE_P(headers) == IS_OBJECT; - if (_1$$4) { - _1$$4 = zephir_instance_of_ev(headers, phalcon_support_collection_collectioninterface_ce); - } - if (UNEXPECTED(!(_1$$4))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Headers needs to be either an array or instance of Phalcon\\Support\\Collection", "phalcon/Http/Message/AbstractMessage.zep", 506); - return; - } - ZEPHIR_CPY_WRT(&collection, headers); - } - RETURN_CCTOR(&collection); -} - -/** - * Checks the protocol - * - * @param string $protocol - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processProtocol) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *protocol = NULL, protocol_sub, protocols, _1$$4, _2$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&protocol_sub); - ZVAL_UNDEF(&protocols); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(protocol) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &protocol); - if (!protocol) { - protocol = &protocol_sub; - ZEPHIR_INIT_VAR(protocol); - ZVAL_STRING(protocol, ""); - } - - - ZEPHIR_INIT_VAR(&protocols); - zephir_create_array(&protocols, 4, 0); - add_assoc_long_ex(&protocols, SL("1.0"), 1); - add_assoc_long_ex(&protocols, SL("1.1"), 1); - add_assoc_long_ex(&protocols, SL("2.0"), 1); - add_assoc_long_ex(&protocols, SL("3.0"), 1); - _0 = ZEPHIR_IS_EMPTY(protocol); - if (!(_0)) { - _0 = Z_TYPE_P(protocol) != IS_STRING; - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid protocol value", "phalcon/Http/Message/AbstractMessage.zep", 534); - return; - } - if (UNEXPECTED(!(zephir_array_isset(&protocols, protocol)))) { - ZEPHIR_INIT_VAR(&_1$$4); - object_init_ex(&_1$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_2$$4); - ZEPHIR_CONCAT_SV(&_2$$4, "Unsupported protocol ", protocol); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 40, &_2$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$4, "phalcon/Http/Message/AbstractMessage.zep", 540); - ZEPHIR_MM_RESTORE(); - return; - } - RETVAL_ZVAL(protocol, 1, 0); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/abstractmessage.zep.h b/ext/phalcon/http/message/abstractmessage.zep.h deleted file mode 100644 index 4feed21f6d7..00000000000 --- a/ext/phalcon/http/message/abstractmessage.zep.h +++ /dev/null @@ -1,144 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_abstractmessage_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractMessage); - -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getBody); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getProtocolVersion); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUri); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeader); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderLine); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaders); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, hasHeader); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withAddedHeader); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withBody); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withHeader); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withProtocolVersion); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, withoutHeader); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderHost); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderName); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, checkHeaderValue); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getHeaderValue); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, getUriHost); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processBody); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processHeaders); -PHP_METHOD(Phalcon_Http_Message_AbstractMessage, processProtocol); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getbody, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getprotocolversion, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_geturi, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheaderline, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheaders, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_hasheader, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withaddedheader, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withbody, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, body, Psr\\Http\\Message\\StreamInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withheader, 0, 0, 2) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withprotocolversion, 0, 0, 1) - ZEND_ARG_INFO(0, version) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractmessage_withoutheader, 0, 0, 1) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheaderhost, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheadername, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_checkheadervalue, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_getheadervalue, 0, 1, IS_ARRAY, 0) - ZEND_ARG_INFO(0, values) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_geturihost, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_populateheadercollection, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, headers, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processbody, 0, 0, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_INFO(0, body) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processheaders, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_INFO(0, headers) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractmessage_processprotocol, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, protocol) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractmessage_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractMessage, getBody, arginfo_phalcon_http_message_abstractmessage_getbody, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_AbstractMessage, getBody, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_AbstractMessage, getProtocolVersion, arginfo_phalcon_http_message_abstractmessage_getprotocolversion, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUri, arginfo_phalcon_http_message_abstractmessage_geturi, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUri, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeader, arginfo_phalcon_http_message_abstractmessage_getheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaderLine, arginfo_phalcon_http_message_abstractmessage_getheaderline, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaders, arginfo_phalcon_http_message_abstractmessage_getheaders, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, hasHeader, arginfo_phalcon_http_message_abstractmessage_hasheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withAddedHeader, arginfo_phalcon_http_message_abstractmessage_withaddedheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withBody, arginfo_phalcon_http_message_abstractmessage_withbody, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withHeader, arginfo_phalcon_http_message_abstractmessage_withheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withProtocolVersion, arginfo_phalcon_http_message_abstractmessage_withprotocolversion, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, withoutHeader, arginfo_phalcon_http_message_abstractmessage_withoutheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderHost, arginfo_phalcon_http_message_abstractmessage_checkheaderhost, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderName, arginfo_phalcon_http_message_abstractmessage_checkheadername, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, checkHeaderValue, arginfo_phalcon_http_message_abstractmessage_checkheadervalue, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getHeaderValue, arginfo_phalcon_http_message_abstractmessage_getheadervalue, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, getUriHost, arginfo_phalcon_http_message_abstractmessage_geturihost, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, populateHeaderCollection, arginfo_phalcon_http_message_abstractmessage_populateheadercollection, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processBody, arginfo_phalcon_http_message_abstractmessage_processbody, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processHeaders, arginfo_phalcon_http_message_abstractmessage_processheaders, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractMessage, processProtocol, arginfo_phalcon_http_message_abstractmessage_processprotocol, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/abstractrequest.zep.c b/ext/phalcon/http/message/abstractrequest.zep.c deleted file mode 100644 index 53001b60c13..00000000000 --- a/ext/phalcon/http/message/abstractrequest.zep.c +++ /dev/null @@ -1,478 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/concat.h" -#include "kernel/string.h" -#include "kernel/exception.h" -#include "kernel/array.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Request methods - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractRequest) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, AbstractRequest, phalcon, http_message_abstractrequest, phalcon_http_message_abstractmessage_ce, phalcon_http_message_abstractrequest_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - /** - * Retrieves the HTTP method of the request. - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_abstractrequest_ce, SL("method"), "GET", ZEND_ACC_PROTECTED); - /** - * The request-target, if it has been provided or calculated. - * - * @var null|string - */ - zend_declare_property_null(phalcon_http_message_abstractrequest_ce, SL("requestTarget"), ZEND_ACC_PROTECTED); - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @var UriInterface - */ - zend_declare_property_null(phalcon_http_message_abstractrequest_ce, SL("uri"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_abstractrequest_ce, 1, phalcon_http_message_requestmethodinterface_ce); - return SUCCESS; -} - -/** - * Retrieves the HTTP method of the request. - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getMethod) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "method"); -} - -/** - * Retrieves the URI instance. - * - * - * This method MUST return a UriInterface instance. - * - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getUri) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "uri"); -} - -/** - * Retrieves the message's request target. - * - * Retrieves the message's request-target either as it will appear (for - * clients), as it appeared at request (for servers), or as it was - * specified for the instance (see withRequestTarget()). - * - * In most cases, this will be the origin-form of the composed URI, unless a - * value was provided to the concrete implementation (see - * withRequestTarget() below). - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getRequestTarget) -{ - zval requestTarget, _0, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&requestTarget); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("requestTarget"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&requestTarget, &_0); - if (UNEXPECTED(Z_TYPE_P(&requestTarget) == IS_NULL)) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&requestTarget, &_1$$3, "getpath", NULL, 0); - zephir_check_call_status(); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "getquery", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!(ZEPHIR_IS_EMPTY(&_3$$3)))) { - zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("uri"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_5$$4, &_4$$4, "getquery", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_6$$4); - ZEPHIR_CONCAT_SV(&_6$$4, "?", &_5$$4); - zephir_concat_self(&requestTarget, &_6$$4); - } - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&requestTarget))) { - ZEPHIR_INIT_NVAR(&requestTarget); - ZVAL_STRING(&requestTarget, "/"); - } - } - RETURN_CCTOR(&requestTarget); -} - -/** - * Return an instance with the provided HTTP method. - * - * While HTTP method names are typically all uppercase characters, HTTP - * method names are case-sensitive and thus implementations SHOULD NOT - * modify the given string. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request method. - * - * @param string $method - * - * @return static - * @throws InvalidArgumentException for invalid HTTP methods. - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withMethod) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method, method_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(method) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &method); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processmethod", NULL, 113, method); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "method"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, method, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specific request-target. - * - * If the request needs a non-origin-form request-target — e.g., for - * specifying an absolute-form, authority-form, or asterisk-form — - * this method may be used to create an instance with the specified - * request-target, verbatim. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request target. - * - * @see http://tools.ietf.org/html/rfc7230#section-5.3 (for the various - * request-target forms allowed in request messages) - * - * @param mixed $requestTarget - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withRequestTarget) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *requestTarget, requestTarget_sub, _0, _1, _2, _3, _4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&requestTarget_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(requestTarget) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &requestTarget); - - - ZEPHIR_INIT_VAR(&_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "/\\s/"); - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "/\\s/"); - zephir_preg_match(&_2, &_3, requestTarget, &_0, 0, 0 , 0 ); - if (UNEXPECTED(zephir_is_true(&_2))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid request target: cannot contain whitespace", "phalcon/Http/Message/AbstractRequest.zep", 131); - return; - } - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "requestTarget"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, requestTarget, &_4); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Returns an instance with the provided URI. - * - * This method MUST update the Host header of the returned request by - * default if the URI contains a host component. If the URI does not - * contain a host component, any pre-existing Host header MUST be carried - * over to the returned request. - * - * You can opt-in to preserving the original state of the Host header by - * setting `$preserveHost` to `true`. When `$preserveHost` is set to - * `true`, this method interacts with the Host header in the following - * ways: - * - * - If the Host header is missing or empty, and the new URI contains - * a host component, this method MUST update the Host header in the - * returned request. - * - If the Host header is missing or empty, and the new URI does not - * contain a host component, this method MUST NOT update the Host header in - * the returned request. - * - If a Host header is present and non-empty, this method MUST NOT update - * the Host header in the returned request. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @param UriInterface $uri - * @param bool $preserveHost - * - * @return static - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withUri) -{ - double _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub, *preserveHost = NULL, preserveHost_sub, __$false, headers, newInstance, _1, _2, _3, _4$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&preserveHost_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_OBJECT_OF_CLASS(uri, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(preserveHost) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &uri, &preserveHost); - if (!preserveHost) { - preserveHost = &preserveHost_sub; - ZEPHIR_CPY_WRT(preserveHost, &__$false); - } else { - ZEPHIR_SEPARATE_PARAM(preserveHost); - } - - - _0 = zephir_get_boolval(preserveHost); - ZEPHIR_INIT_NVAR(preserveHost); - ZVAL_BOOL(preserveHost, _0); - zephir_read_property(&_1, this_ptr, ZEND_STRL("headers"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_2); - if (zephir_clone(&_2, &_1) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&headers, &_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "uri"); - ZEPHIR_CALL_METHOD(&newInstance, this_ptr, "cloneinstance", NULL, 21, uri, &_3); - zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(preserveHost))) { - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "checkheaderhost", NULL, 45, &headers); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&headers, &_4$$3); - zephir_update_property_zval(&newInstance, ZEND_STRL("headers"), &headers); - } - RETURN_CCTOR(&newInstance); -} - -/** - * Check the method - * - * @param string $method - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processMethod) -{ - zend_bool _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method = NULL, method_sub, methods, _2$$3, _3$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method_sub); - ZVAL_UNDEF(&methods); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(method) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &method); - if (!method) { - method = &method_sub; - ZEPHIR_INIT_VAR(method); - ZVAL_STRING(method, ""); - } - - - ZEPHIR_INIT_VAR(&methods); - zephir_create_array(&methods, 10, 0); - add_assoc_long_ex(&methods, SL("CONNECT"), 1); - add_assoc_long_ex(&methods, SL("DELETE"), 1); - add_assoc_long_ex(&methods, SL("GET"), 1); - add_assoc_long_ex(&methods, SL("HEAD"), 1); - add_assoc_long_ex(&methods, SL("OPTIONS"), 1); - add_assoc_long_ex(&methods, SL("PATCH"), 1); - add_assoc_long_ex(&methods, SL("POST"), 1); - add_assoc_long_ex(&methods, SL("PURGE"), 1); - add_assoc_long_ex(&methods, SL("PUT"), 1); - add_assoc_long_ex(&methods, SL("TRACE"), 1); - _0 = !(ZEPHIR_IS_EMPTY(method)); - if (_0) { - _0 = Z_TYPE_P(method) == IS_STRING; - } - _1 = _0; - if (_1) { - _1 = zephir_array_isset(&methods, method); - } - if (UNEXPECTED(!(_1))) { - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_CONCAT_SV(&_3$$3, "Invalid or unsupported method ", method); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 40, &_3$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$3, "phalcon/Http/Message/AbstractRequest.zep", 216); - ZEPHIR_MM_RESTORE(); - return; - } - RETVAL_ZVAL(method, 1, 0); - RETURN_MM(); -} - -/** - * Sets a valid Uri - * - * @param UriInterface|string|null $uri - * - * @return UriInterface - */ -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processUri) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri, uri_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uri); - - - _0 = Z_TYPE_P(uri) == IS_OBJECT; - if (_0) { - _0 = zephir_is_instance_of(uri, SL("Psr\\Http\\Message\\UriInterface")); - } - if (UNEXPECTED(_0)) { - RETVAL_ZVAL(uri, 1, 0); - RETURN_MM(); - } - if (EXPECTED(Z_TYPE_P(uri) == IS_STRING)) { - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114, uri); - zephir_check_call_status(); - RETURN_MM(); - } - if (Z_TYPE_P(uri) == IS_NULL) { - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uri passed as a parameter", "phalcon/Http/Message/AbstractRequest.zep", 245); - return; -} - diff --git a/ext/phalcon/http/message/abstractrequest.zep.h b/ext/phalcon/http/message/abstractrequest.zep.h deleted file mode 100644 index c03186e4f47..00000000000 --- a/ext/phalcon/http/message/abstractrequest.zep.h +++ /dev/null @@ -1,59 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_abstractrequest_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_AbstractRequest); - -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getMethod); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getUri); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, getRequestTarget); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withMethod); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withRequestTarget); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, withUri); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processMethod); -PHP_METHOD(Phalcon_Http_Message_AbstractRequest, processUri); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_getmethod, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_geturi, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_getrequesttarget, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withmethod, 0, 0, 1) - ZEND_ARG_INFO(0, method) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withrequesttarget, 0, 0, 1) - ZEND_ARG_INFO(0, requestTarget) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_abstractrequest_withuri, 0, 0, 1) - ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_INFO(0, preserveHost) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_abstractrequest_processmethod, 0, 0, IS_STRING, 0) - ZEND_ARG_INFO(0, method) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_abstractrequest_processuri, 0, 1, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_abstractrequest_method_entry) { - PHP_ME(Phalcon_Http_Message_AbstractRequest, getMethod, arginfo_phalcon_http_message_abstractrequest_getmethod, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_AbstractRequest, getUri, arginfo_phalcon_http_message_abstractrequest_geturi, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_AbstractRequest, getUri, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_AbstractRequest, getRequestTarget, arginfo_phalcon_http_message_abstractrequest_getrequesttarget, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withMethod, arginfo_phalcon_http_message_abstractrequest_withmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withRequestTarget, arginfo_phalcon_http_message_abstractrequest_withrequesttarget, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, withUri, arginfo_phalcon_http_message_abstractrequest_withuri, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_AbstractRequest, processMethod, arginfo_phalcon_http_message_abstractrequest_processmethod, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_AbstractRequest, processUri, arginfo_phalcon_http_message_abstractrequest_processuri, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/exception/invalidargumentexception.zep.c b/ext/phalcon/http/message/exception/invalidargumentexception.zep.c deleted file mode 100644 index 3408b54efd8..00000000000 --- a/ext/phalcon/http/message/exception/invalidargumentexception.zep.c +++ /dev/null @@ -1,33 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../../ext_config.h" -#endif - -#include -#include "../../../../php_ext.h" -#include "../../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "ext/spl/spl_exceptions.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Exception_InvalidArgumentException) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Exception, InvalidArgumentException, phalcon, http_message_exception_invalidargumentexception, spl_ce_InvalidArgumentException, NULL, 0); - - zend_class_implements(phalcon_http_message_exception_invalidargumentexception_ce, 1, zend_ce_throwable); - return SUCCESS; -} - diff --git a/ext/phalcon/http/message/exception/invalidargumentexception.zep.h b/ext/phalcon/http/message/exception/invalidargumentexception.zep.h deleted file mode 100644 index 5128e49260e..00000000000 --- a/ext/phalcon/http/message/exception/invalidargumentexception.zep.h +++ /dev/null @@ -1,5 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_exception_invalidargumentexception_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Exception_InvalidArgumentException); - diff --git a/ext/phalcon/http/message/request.zep.c b/ext/phalcon/http/message/request.zep.c deleted file mode 100644 index eecfec19887..00000000000 --- a/ext/phalcon/http/message/request.zep.c +++ /dev/null @@ -1,133 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-7 Request - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Request) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Request, phalcon, http_message_request, phalcon_http_message_abstractrequest_ce, phalcon_http_message_request_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_request_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\requestinterface"))); - return SUCCESS; -} - -/** - * Request constructor. - * - * @param string $method - * @param UriInterface|string|null $uri - * @param StreamInterface|resource|string $body - * @param array $headers - */ -PHP_METHOD(Phalcon_Http_Message_Request, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *uri = NULL, uri_sub, *body = NULL, body_sub, *headers = NULL, headers_sub, __$null, _0, _1, _2, _3, _4, _5; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 4) - Z_PARAM_OPTIONAL - Z_PARAM_STR(method) - Z_PARAM_ZVAL_OR_NULL(uri) - Z_PARAM_ZVAL(body) - Z_PARAM_ZVAL(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 4, &method_param, &uri, &body, &headers); - if (!method_param) { - ZEPHIR_INIT_VAR(&method); - ZVAL_STRING(&method, "GET"); - } else { - zephir_get_strval(&method, method_param); - } - if (!uri) { - uri = &uri_sub; - uri = &__$null; - } - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } else { - ZEPHIR_SEPARATE_PARAM(body); - } - if (!headers) { - headers = &headers_sub; - ZEPHIR_INIT_VAR(headers); - array_init(headers); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://input"); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, body))) { - ZEPHIR_INIT_NVAR(body); - object_init_ex(body, phalcon_http_message_stream_input_ce); - ZEPHIR_CALL_METHOD(NULL, body, "__construct", NULL, 351); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processuri", NULL, 352, uri); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processheaders", NULL, 353, headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "processmethod", NULL, 113, &method); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("method"), &_3); - ZEPHIR_INIT_VAR(&_5); - ZVAL_STRING(&_5, "w+b"); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "processbody", NULL, 37, body, &_5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_4); - ZEPHIR_MM_RESTORE(); -} - diff --git a/ext/phalcon/http/message/request.zep.h b/ext/phalcon/http/message/request.zep.h deleted file mode 100644 index f30e29d8242..00000000000 --- a/ext/phalcon/http/message/request.zep.h +++ /dev/null @@ -1,18 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_request_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Request); - -PHP_METHOD(Phalcon_Http_Message_Request, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_request___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) - ZEND_ARG_INFO(0, body) - ZEND_ARG_INFO(0, headers) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_request_method_entry) { - PHP_ME(Phalcon_Http_Message_Request, __construct, arginfo_phalcon_http_message_request___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/requestfactory.zep.c b/ext/phalcon/http/message/requestfactory.zep.c deleted file mode 100644 index 294f577f4c8..00000000000 --- a/ext/phalcon/http/message/requestfactory.zep.c +++ /dev/null @@ -1,91 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/operators.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-17 RequestFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, RequestFactory, phalcon, http_message_requestfactory, phalcon_http_message_requestfactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_requestfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\requestfactoryinterface"))); - return SUCCESS; -} - -/** - * Create a new request. - * - * @param string $method - * @param UriInterface|string|null $uri - * - * @return RequestInterface - */ -PHP_METHOD(Phalcon_Http_Message_RequestFactory, createRequest) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *uri, uri_sub; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_STR(method) - Z_PARAM_ZVAL(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &method_param, &uri); - if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(&method, method_param); - } else { - ZEPHIR_INIT_VAR(&method); - } - - - object_init_ex(return_value, phalcon_http_message_request_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 354, &method, uri); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/requestfactory.zep.h b/ext/phalcon/http/message/requestfactory.zep.h deleted file mode 100644 index fec3923638f..00000000000 --- a/ext/phalcon/http/message/requestfactory.zep.h +++ /dev/null @@ -1,16 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_requestfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_RequestFactory); - -PHP_METHOD(Phalcon_Http_Message_RequestFactory, createRequest); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_requestfactory_createrequest, 0, 2, Psr\\Http\\Message\\RequestInterface, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_requestfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_RequestFactory, createRequest, arginfo_phalcon_http_message_requestfactory_createrequest, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/response.zep.c b/ext/phalcon/http/message/response.zep.c deleted file mode 100644 index 0805f8fb598..00000000000 --- a/ext/phalcon/http/message/response.zep.c +++ /dev/null @@ -1,523 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/array.h" -#include "kernel/exception.h" -#include "kernel/concat.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-7 Response - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Response) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Response, phalcon, http_message_response, phalcon_http_message_abstractmessage_ce, phalcon_http_message_response_method_entry, ZEND_ACC_FINAL_CLASS); - - /** - * Gets the response reason phrase associated with the status code. - * - * Because a reason phrase is not a required element in a response - * status line, the reason phrase value MAY be empty. Implementations MAY - * choose to return the default RFC 7231 recommended reason phrase (or - * those - * listed in the IANA HTTP Status Code Registry) for the response's - * status code. - * - * @see http://tools.ietf.org/html/rfc7231#section-6 - * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_response_ce, SL("reasonPhrase"), "", ZEND_ACC_PROTECTED); - /** - * Gets the response status code. - * - * The status code is a 3-digit integer result code of the server's attempt - * to understand and satisfy the request. - * - * @var int - */ - zend_declare_property_long(phalcon_http_message_response_ce, SL("statusCode"), 200, ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_response_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\responseinterface"))); - zend_class_implements(phalcon_http_message_response_ce, 1, phalcon_http_message_responsestatuscodeinterface_ce); - return SUCCESS; -} - -/** - * Gets the response reason phrase associated with the status code. - * - * - * Because a reason phrase is not a required element in a response - * status line, the reason phrase value MAY be empty. Implementations MAY - * choose to return the default RFC 7231 recommended reason phrase (or - * those - * listed in the IANA HTTP Status Code Registry) for the response's - * status code. - * - */ -PHP_METHOD(Phalcon_Http_Message_Response, getReasonPhrase) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "reasonPhrase"); -} - -/** - * Gets the response status code. - * - * - * The status code is a 3-digit integer result code of the server's attempt - * to understand and satisfy the request. - * - */ -PHP_METHOD(Phalcon_Http_Message_Response, getStatusCode) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "statusCode"); -} - -/** - * Response constructor. - * - * @param string $body - * @param int $code - * @param array $headers - */ -PHP_METHOD(Phalcon_Http_Message_Response, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval headers; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *body = NULL, body_sub, *code_param = NULL, *headers_param = NULL, _0, _1, _2, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&headers); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 3) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(body) - Z_PARAM_LONG(code) - Z_PARAM_ARRAY(headers) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 3, &body, &code_param, &headers_param); - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://memory"); - } - if (!code_param) { - code = 200; - } else { - code = zephir_get_intval(code_param); - } - if (!headers_param) { - ZEPHIR_INIT_VAR(&headers); - array_init(&headers); - } else { - zephir_get_arrval(&headers, headers_param); - } - - - ZVAL_LONG(&_0, code); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcode", NULL, 355, &_0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processheaders", NULL, 353, &headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_1); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "w+b"); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processbody", NULL, 37, body, &_3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_2); - ZEPHIR_MM_RESTORE(); -} - -/** - * Return an instance with the specified status code and, optionally, - * reason phrase. - * - * If no reason phrase is specified, implementations MAY choose to default - * to the RFC 7231 or IANA recommended reason phrase for the response's - * status code. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated status and reason phrase. - * - * @see http://tools.ietf.org/html/rfc7231#section-6 - * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * - * @param int $code - * @param string $reasonPhrase - * - * @return Response - */ -PHP_METHOD(Phalcon_Http_Message_Response, withStatus) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *code, code_sub, *reasonPhrase = NULL, reasonPhrase_sub, newInstance; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); - ZVAL_UNDEF(&reasonPhrase_sub); - ZVAL_UNDEF(&newInstance); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(code) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(reasonPhrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &code, &reasonPhrase); - if (!reasonPhrase) { - reasonPhrase = &reasonPhrase_sub; - ZEPHIR_INIT_VAR(reasonPhrase); - ZVAL_STRING(reasonPhrase, ""); - } - - - ZEPHIR_INIT_VAR(&newInstance); - if (zephir_clone(&newInstance, this_ptr) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CALL_METHOD(NULL, &newInstance, "processcode", NULL, 0, code, reasonPhrase); - zephir_check_call_status(); - RETURN_CCTOR(&newInstance); -} - -/** - * Returns the list of status codes available - */ -PHP_METHOD(Phalcon_Http_Message_Response, getPhrases) -{ - zval *this_ptr = getThis(); - - - - zephir_create_array(return_value, 89, 0); - add_index_stringl(return_value, 100, SL("Continue")); - add_index_stringl(return_value, 101, SL("Switching Protocols")); - add_index_stringl(return_value, 102, SL("Processing")); - add_index_stringl(return_value, 103, SL("Early Hints")); - add_index_stringl(return_value, 200, SL("OK")); - add_index_stringl(return_value, 201, SL("Created")); - add_index_stringl(return_value, 202, SL("Accepted")); - add_index_stringl(return_value, 203, SL("Non-Authoritative Information")); - add_index_stringl(return_value, 204, SL("No Content")); - add_index_stringl(return_value, 205, SL("Reset Content")); - add_index_stringl(return_value, 206, SL("Partial Content")); - add_index_stringl(return_value, 207, SL("Multi-status")); - add_index_stringl(return_value, 208, SL("Already Reported")); - add_index_stringl(return_value, 226, SL("IM Used")); - add_index_stringl(return_value, 300, SL("Multiple Choices")); - add_index_stringl(return_value, 301, SL("Moved Permanently")); - add_index_stringl(return_value, 302, SL("Found")); - add_index_stringl(return_value, 303, SL("See Other")); - add_index_stringl(return_value, 304, SL("Not Modified")); - add_index_stringl(return_value, 305, SL("Use Proxy")); - add_index_stringl(return_value, 306, SL("Switch Proxy")); - add_index_stringl(return_value, 307, SL("Temporary Redirect")); - add_index_stringl(return_value, 308, SL("Permanent Redirect")); - add_index_stringl(return_value, 400, SL("Bad Request")); - add_index_stringl(return_value, 401, SL("Unauthorized")); - add_index_stringl(return_value, 402, SL("Payment Required")); - add_index_stringl(return_value, 403, SL("Forbidden")); - add_index_stringl(return_value, 404, SL("Not Found")); - add_index_stringl(return_value, 405, SL("Method Not Allowed")); - add_index_stringl(return_value, 406, SL("Not Acceptable")); - add_index_stringl(return_value, 407, SL("Proxy Authentication Required")); - add_index_stringl(return_value, 408, SL("Request Time-out")); - add_index_stringl(return_value, 409, SL("Conflict")); - add_index_stringl(return_value, 410, SL("Gone")); - add_index_stringl(return_value, 411, SL("Length Required")); - add_index_stringl(return_value, 412, SL("Precondition Failed")); - add_index_stringl(return_value, 413, SL("Request Entity Too Large")); - add_index_stringl(return_value, 414, SL("Request-URI Too Large")); - add_index_stringl(return_value, 415, SL("Unsupported Media Type")); - add_index_stringl(return_value, 416, SL("Requested range not satisfiable")); - add_index_stringl(return_value, 417, SL("Expectation Failed")); - add_index_stringl(return_value, 418, SL("I'm a teapot")); - add_index_stringl(return_value, 421, SL("Misdirected Request")); - add_index_stringl(return_value, 422, SL("Unprocessable Entity")); - add_index_stringl(return_value, 423, SL("Locked")); - add_index_stringl(return_value, 424, SL("Failed Dependency")); - add_index_stringl(return_value, 425, SL("Unordered Collection")); - add_index_stringl(return_value, 426, SL("Upgrade Required")); - add_index_stringl(return_value, 428, SL("Precondition Required")); - add_index_stringl(return_value, 429, SL("Too Many Requests")); - add_index_stringl(return_value, 431, SL("Request Header Fields Too Large")); - add_index_stringl(return_value, 451, SL("Unavailable For Legal Reasons")); - add_index_stringl(return_value, 500, SL("Internal Server Error")); - add_index_stringl(return_value, 501, SL("Not Implemented")); - add_index_stringl(return_value, 502, SL("Bad Gateway")); - add_index_stringl(return_value, 503, SL("Service Unavailable")); - add_index_stringl(return_value, 504, SL("Gateway Time-out")); - add_index_stringl(return_value, 505, SL("HTTP Version not supported")); - add_index_stringl(return_value, 506, SL("Variant Also Negotiates")); - add_index_stringl(return_value, 507, SL("Insufficient Storage")); - add_index_stringl(return_value, 508, SL("Loop Detected")); - add_index_stringl(return_value, 510, SL("Not Extended")); - add_index_stringl(return_value, 511, SL("Network Authentication Required")); - add_index_stringl(return_value, 218, SL("This is fine")); - add_index_stringl(return_value, 419, SL("Page Expired")); - add_index_stringl(return_value, 420, SL("Method Failure")); - add_index_stringl(return_value, 440, SL("Login Time-out")); - add_index_stringl(return_value, 444, SL("No Response")); - add_index_stringl(return_value, 449, SL("Retry With")); - add_index_stringl(return_value, 450, SL("Blocked by Windows Parental Controls (Microsoft)")); - add_index_stringl(return_value, 494, SL("Request header too large")); - add_index_stringl(return_value, 495, SL("SSL Certificate Error")); - add_index_stringl(return_value, 496, SL("SSL Certificate Required")); - add_index_stringl(return_value, 497, SL("HTTP Request Sent to HTTPS Port")); - add_index_stringl(return_value, 498, SL("Invalid Token (Esri)")); - add_index_stringl(return_value, 499, SL("Client Closed Request")); - add_index_stringl(return_value, 509, SL("Bandwidth Limit Exceeded")); - add_index_stringl(return_value, 520, SL("Unknown Error")); - add_index_stringl(return_value, 521, SL("Web Server Is Down")); - add_index_stringl(return_value, 522, SL("Connection Timed Out")); - add_index_stringl(return_value, 523, SL("Origin Is Unreachable")); - add_index_stringl(return_value, 524, SL("A Timeout Occurred")); - add_index_stringl(return_value, 525, SL("SSL Handshake Failed")); - add_index_stringl(return_value, 526, SL("Invalid SSL Certificate")); - add_index_stringl(return_value, 527, SL("Railgun Error")); - add_index_stringl(return_value, 530, SL("Origin DNS Error")); - add_index_stringl(return_value, 598, SL("Network read timeout error")); - add_index_stringl(return_value, 599, SL("Network Connect Timeout Error")); - return; -} - -/** - * Set a valid status code and phrase - * - * @param mixed $code - * @param mixed $phrase - */ -PHP_METHOD(Phalcon_Http_Message_Response, processCode) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS, _0; - zval *code = NULL, code_sub, *phrase = NULL, phrase_sub, phrases, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); - ZVAL_UNDEF(&phrase_sub); - ZVAL_UNDEF(&phrases); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(code) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(phrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &code, &phrase); - ZEPHIR_SEPARATE_PARAM(code); - if (!phrase) { - phrase = &phrase_sub; - ZEPHIR_INIT_VAR(phrase); - ZVAL_STRING(phrase, ""); - } else { - ZEPHIR_SEPARATE_PARAM(phrase); - } - - - ZEPHIR_CALL_METHOD(&phrases, this_ptr, "getphrases", NULL, 356); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcodetype", NULL, 357, code); - zephir_check_call_status(); - _0 = zephir_get_intval(code); - ZEPHIR_INIT_NVAR(code); - ZVAL_LONG(code, _0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkcodevalue", NULL, 358, code); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(phrase) != IS_STRING)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid response reason", "phalcon/Http/Message/Response.zep", 225); - return; - } - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - _2 = ZEPHIR_IS_IDENTICAL(&_1, phrase); - if (_2) { - _2 = zephir_array_isset(&phrases, code); - } - if (EXPECTED(_2)) { - ZEPHIR_OBS_NVAR(phrase); - zephir_array_fetch(phrase, &phrases, code, PH_NOISY, "phalcon/Http/Message/Response.zep", 229); - } - zephir_update_property_zval(this_ptr, ZEND_STRL("statusCode"), code); - zephir_update_property_zval(this_ptr, ZEND_STRL("reasonPhrase"), phrase); - ZEPHIR_MM_RESTORE(); -} - -/** - * Checks if a code is integer or string - * - * @param mixed $code - */ -PHP_METHOD(Phalcon_Http_Message_Response, checkCodeType) -{ - zend_bool _0; - zval *code, code_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&code_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(code) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(1, 0, &code); - - - _0 = Z_TYPE_P(code) != IS_LONG; - if (_0) { - _0 = Z_TYPE_P(code) != IS_STRING; - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid status code; it must be an integer or string", "phalcon/Http/Message/Response.zep", 246); - return; - } -} - -/** - * Checks if a code is integer or string - * - * @param int $code - */ -PHP_METHOD(Phalcon_Http_Message_Response, checkCodeValue) -{ - zval _6$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *code_param = NULL, _0, _1, _2, _3, _4$$3, _5$$3; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(code) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &code_param); - code = zephir_get_intval(code_param); - - - ZVAL_LONG(&_1, code); - ZVAL_LONG(&_2, 100); - ZVAL_LONG(&_3, 599); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isbetween", NULL, 359, &_1, &_2, &_3); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_INIT_VAR(&_4$$3); - object_init_ex(&_4$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_5$$3); - ZVAL_LONG(&_5$$3, code); - ZEPHIR_INIT_VAR(&_6$$3); - ZEPHIR_CONCAT_SVS(&_6$$3, "Invalid status code '", &_5$$3, "', (allowed values 100-599)"); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$3, "phalcon/Http/Message/Response.zep", 260); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * @todo Remove this when we get traits - */ -PHP_METHOD(Phalcon_Http_Message_Response, isBetween) -{ - zend_bool _0; - zval *value_param = NULL, *from_param = NULL, *to_param = NULL; - zend_long value, from, to; - zval *this_ptr = getThis(); - -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_LONG(value) - Z_PARAM_LONG(from) - Z_PARAM_LONG(to) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(3, 0, &value_param, &from_param, &to_param); - value = zephir_get_intval(value_param); - from = zephir_get_intval(from_param); - to = zephir_get_intval(to_param); - - - _0 = value >= from; - if (_0) { - _0 = value <= to; - } - RETURN_BOOL(_0); -} - diff --git a/ext/phalcon/http/message/response.zep.h b/ext/phalcon/http/message/response.zep.h deleted file mode 100644 index 142d446f301..00000000000 --- a/ext/phalcon/http/message/response.zep.h +++ /dev/null @@ -1,73 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_response_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Response); - -PHP_METHOD(Phalcon_Http_Message_Response, getReasonPhrase); -PHP_METHOD(Phalcon_Http_Message_Response, getStatusCode); -PHP_METHOD(Phalcon_Http_Message_Response, __construct); -PHP_METHOD(Phalcon_Http_Message_Response, withStatus); -PHP_METHOD(Phalcon_Http_Message_Response, getPhrases); -PHP_METHOD(Phalcon_Http_Message_Response, processCode); -PHP_METHOD(Phalcon_Http_Message_Response, checkCodeType); -PHP_METHOD(Phalcon_Http_Message_Response, checkCodeValue); -PHP_METHOD(Phalcon_Http_Message_Response, isBetween); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getreasonphrase, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getstatuscode, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_response___construct, 0, 0, 0) - ZEND_ARG_INFO(0, body) - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, headers, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, headers, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_response_withstatus, 0, 1, Phalcon\\Http\\Message\\Response, 0) - ZEND_ARG_INFO(0, code) - ZEND_ARG_INFO(0, reasonPhrase) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_getphrases, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_processcode, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, code) - ZEND_ARG_INFO(0, phrase) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_checkcodetype, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, code) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_checkcodevalue, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_response_isbetween, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, from, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, to, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_response_method_entry) { - PHP_ME(Phalcon_Http_Message_Response, getReasonPhrase, arginfo_phalcon_http_message_response_getreasonphrase, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, getStatusCode, arginfo_phalcon_http_message_response_getstatuscode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, __construct, arginfo_phalcon_http_message_response___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_Response, withStatus, arginfo_phalcon_http_message_response_withstatus, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Response, getPhrases, arginfo_phalcon_http_message_response_getphrases, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_Response, processCode, arginfo_phalcon_http_message_response_processcode, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Message_Response, checkCodeType, arginfo_phalcon_http_message_response_checkcodetype, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Response, checkCodeValue, arginfo_phalcon_http_message_response_checkcodevalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Response, isBetween, arginfo_phalcon_http_message_response_isbetween, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/responsefactory.zep.c b/ext/phalcon/http/message/responsefactory.zep.c deleted file mode 100644 index 9bbfb64ee9e..00000000000 --- a/ext/phalcon/http/message/responsefactory.zep.c +++ /dev/null @@ -1,100 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-17 ResponseFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, ResponseFactory, phalcon, http_message_responsefactory, phalcon_http_message_responsefactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_responsefactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\responsefactoryinterface"))); - return SUCCESS; -} - -/** - * Create a new response. - * - * @param int $code The HTTP status code. Defaults to 200. - * @param string $reasonPhrase The reason phrase to associate with the status - * code in the generated response. If none is - * provided, implementations MAY use the defaults - * as suggested in the HTTP specification. - * - * @return ResponseInterface - */ -PHP_METHOD(Phalcon_Http_Message_ResponseFactory, createResponse) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval reasonPhrase; - zval *code_param = NULL, *reasonPhrase_param = NULL, _0, _1; - zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&reasonPhrase); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 2) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(code) - Z_PARAM_STR(reasonPhrase) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 2, &code_param, &reasonPhrase_param); - if (!code_param) { - code = 200; - } else { - code = zephir_get_intval(code_param); - } - if (!reasonPhrase_param) { - ZEPHIR_INIT_VAR(&reasonPhrase); - ZVAL_STRING(&reasonPhrase, ""); - } else { - zephir_get_strval(&reasonPhrase, reasonPhrase_param); - } - - - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, phalcon_http_message_response_ce); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 360); - zephir_check_call_status(); - ZVAL_LONG(&_1, code); - ZEPHIR_RETURN_CALL_METHOD(&_0, "withstatus", NULL, 361, &_1, &reasonPhrase); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/responsefactory.zep.h b/ext/phalcon/http/message/responsefactory.zep.h deleted file mode 100644 index 70698bad98a..00000000000 --- a/ext/phalcon/http/message/responsefactory.zep.h +++ /dev/null @@ -1,16 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_responsefactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ResponseFactory); - -PHP_METHOD(Phalcon_Http_Message_ResponseFactory, createResponse); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_responsefactory_createresponse, 0, 0, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, reasonPhrase, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_responsefactory_method_entry) { - PHP_ME(Phalcon_Http_Message_ResponseFactory, createResponse, arginfo_phalcon_http_message_responsefactory_createresponse, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/serverrequest.zep.c b/ext/phalcon/http/message/serverrequest.zep.c deleted file mode 100644 index 7147711c933..00000000000 --- a/ext/phalcon/http/message/serverrequest.zep.c +++ /dev/null @@ -1,891 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" -#include "kernel/exception.h" - - -/** -* This file is part of the Phalcon Framework. -* -* (c) Phalcon Team -* -* For the full copyright and license information, please view the LICENSE.txt -* file that was distributed with this source code. -* -* Implementation of this file has been influenced by Zend Diactoros -* @link https://github.com/zendframework/zend-diactoros -* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md -*/ -/** - * PSR-7 ServerRequest - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequest) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, ServerRequest, phalcon, http_message_serverrequest, phalcon_http_message_abstractrequest_ce, phalcon_http_message_serverrequest_method_entry, ZEND_ACC_FINAL_CLASS); - - /** - * @var Collection|CollectionInterface - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("attributes"), ZEND_ACC_PROTECTED); - /** - * Retrieve cookies. - * - * Retrieves cookies sent by the client to the server. - * - * The data MUST be compatible with the structure of the $_COOKIE - * superglobal. - * - * @var array - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("cookieParams"), ZEND_ACC_PROTECTED); - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @var mixed - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("parsedBody"), ZEND_ACC_PROTECTED); - /** - * Retrieve query string arguments. - * - * Retrieves the deserialized query string arguments, if any. - * - * Note: the query params might not be in sync with the URI or server - * params. If you need to ensure you are only getting the original - * values, you may need to parse the query string from - * `getUri()->getQuery()` or from the `QUERY_STRING` server param. - * - * @var array - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("queryParams"), ZEND_ACC_PROTECTED); - /** - * Retrieve server parameters. - * - * Retrieves data related to the incoming request environment, - * typically derived from PHP's $_SERVER superglobal. The data IS NOT - * REQUIRED to originate from $_SERVER. - * - * @var array - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("serverParams"), ZEND_ACC_PROTECTED); - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @var array - */ - zend_declare_property_null(phalcon_http_message_serverrequest_ce, SL("uploadedFiles"), ZEND_ACC_PROTECTED); - phalcon_http_message_serverrequest_ce->create_object = zephir_init_properties_Phalcon_Http_Message_ServerRequest; - - zend_class_implements(phalcon_http_message_serverrequest_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\serverrequestinterface"))); - return SUCCESS; -} - -/** - * Retrieve cookies. - * - * - * Retrieves cookies sent by the client to the server. - * - * The data MUST be compatible with the structure of the $_COOKIE - * superglobal. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getCookieParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "cookieParams"); -} - -/** - * Retrieve any parameters provided in the request body. - * - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getParsedBody) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "parsedBody"); -} - -/** - * Retrieve query string arguments. - * - * - * Retrieves the deserialized query string arguments, if any. - * - * Note: the query params might not be in sync with the URI or server - * params. If you need to ensure you are only getting the original - * values, you may need to parse the query string from - * `getUri()->getQuery()` or from the `QUERY_STRING` server param. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getQueryParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "queryParams"); -} - -/** - * Retrieve server parameters. - * - * - * Retrieves data related to the incoming request environment, - * typically derived from PHP's $_SERVER superglobal. The data IS NOT - * REQUIRED to originate from $_SERVER. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getServerParams) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "serverParams"); -} - -/** - * Retrieve normalized file upload data. - * - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getUploadedFiles) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "uploadedFiles"); -} - -/** - * ServerRequest constructor. - * - * @param string $method - * @param UriInterface|string|null $uri - * @param array $serverParams - * @param StreamInterface|string $body - * @param array $headers - * @param array $cookies - * @param array $queryParams - * @param array $uploadFiles - * @param null|array|object $parsedBody - * @param string $protocol - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval serverParams, cookies, queryParams, uploadFiles; - zval *method_param = NULL, *uri = NULL, uri_sub, *serverParams_param = NULL, *body = NULL, body_sub, *headers = NULL, headers_sub, *cookies_param = NULL, *queryParams_param = NULL, *uploadFiles_param = NULL, *parsedBody = NULL, parsedBody_sub, *protocol_param = NULL, __$null, _0, _1, _2, _3, _4, _5, _6; - zval method, protocol; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&body_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&parsedBody_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&serverParams); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&queryParams); - ZVAL_UNDEF(&uploadFiles); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 10) - Z_PARAM_OPTIONAL - Z_PARAM_STR(method) - Z_PARAM_ZVAL_OR_NULL(uri) - Z_PARAM_ARRAY(serverParams) - Z_PARAM_ZVAL(body) - Z_PARAM_ZVAL(headers) - Z_PARAM_ARRAY(cookies) - Z_PARAM_ARRAY(queryParams) - Z_PARAM_ARRAY(uploadFiles) - Z_PARAM_ZVAL_OR_NULL(parsedBody) - Z_PARAM_STR(protocol) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 10, &method_param, &uri, &serverParams_param, &body, &headers, &cookies_param, &queryParams_param, &uploadFiles_param, &parsedBody, &protocol_param); - if (!method_param) { - ZEPHIR_INIT_VAR(&method); - ZVAL_STRING(&method, "GET"); - } else { - zephir_get_strval(&method, method_param); - } - if (!uri) { - uri = &uri_sub; - uri = &__$null; - } - if (!serverParams_param) { - ZEPHIR_INIT_VAR(&serverParams); - array_init(&serverParams); - } else { - zephir_get_arrval(&serverParams, serverParams_param); - } - if (!body) { - body = &body_sub; - ZEPHIR_INIT_VAR(body); - ZVAL_STRING(body, "php://input"); - } else { - ZEPHIR_SEPARATE_PARAM(body); - } - if (!headers) { - headers = &headers_sub; - ZEPHIR_INIT_VAR(headers); - array_init(headers); - } - if (!cookies_param) { - ZEPHIR_INIT_VAR(&cookies); - array_init(&cookies); - } else { - zephir_get_arrval(&cookies, cookies_param); - } - if (!queryParams_param) { - ZEPHIR_INIT_VAR(&queryParams); - array_init(&queryParams); - } else { - zephir_get_arrval(&queryParams, queryParams_param); - } - if (!uploadFiles_param) { - ZEPHIR_INIT_VAR(&uploadFiles); - array_init(&uploadFiles); - } else { - zephir_get_arrval(&uploadFiles, uploadFiles_param); - } - if (!parsedBody) { - parsedBody = &parsedBody_sub; - parsedBody = &__$null; - } - if (!protocol_param) { - ZEPHIR_INIT_VAR(&protocol); - ZVAL_STRING(&protocol, "1.1"); - } else { - zephir_get_strval(&protocol, protocol_param); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://input"); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, body))) { - ZEPHIR_INIT_NVAR(body); - object_init_ex(body, phalcon_http_message_stream_input_ce); - ZEPHIR_CALL_METHOD(NULL, body, "__construct", NULL, 351); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", NULL, 362, &uploadFiles); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "processprotocol", NULL, 38, &protocol); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("protocolVersion"), &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "processmethod", NULL, 113, &method); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("method"), &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "processheaders", NULL, 353, headers); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("headers"), &_3); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "processuri", NULL, 352, uri); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("uri"), &_4); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "w+b"); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "processbody", NULL, 37, body, &_6); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("body"), &_5); - zephir_update_property_zval(this_ptr, ZEND_STRL("uploadedFiles"), &uploadFiles); - zephir_update_property_zval(this_ptr, ZEND_STRL("parsedBody"), parsedBody); - zephir_update_property_zval(this_ptr, ZEND_STRL("serverParams"), &serverParams); - zephir_update_property_zval(this_ptr, ZEND_STRL("cookieParams"), &cookies); - zephir_update_property_zval(this_ptr, ZEND_STRL("queryParams"), &queryParams); - ZEPHIR_INIT_NVAR(&_6); - object_init_ex(&_6, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &_6, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("attributes"), &_6); - ZEPHIR_MM_RESTORE(); -} - -/** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @param string $name - * @param mixed|null $defaultValue - * - * @return mixed - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &name, &defaultValue); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, name, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Retrieve attributes derived from the request. - * - * The request 'attributes' may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttributes) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "toarray", NULL, 0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @param string $name - * @param mixed $value - * - * @return ServerRequest - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, *value, value_sub, attributes, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&attributes); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(name) - Z_PARAM_ZVAL(value) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name, &value); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&attributes, &_1); - ZEPHIR_CALL_METHOD(NULL, &attributes, "set", NULL, 0, name, value); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "attributes"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &attributes, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified cookies. - * - * The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST - * be compatible with the structure of $_COOKIE. Typically, this data will - * be injected at instantiation. - * - * This method MUST NOT update the related Cookie header of the request - * instance, nor related values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated cookie values. - * - * @param array $cookies - * - * @return ServerRequest - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withCookieParams) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cookies_param = NULL, _0; - zval cookies; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(cookies) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cookies_param); - zephir_get_arrval(&cookies, cookies_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "cookieParams"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &cookies, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or - * objects, or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array|object|null $data - * - * @return ServerRequest - * @throws InvalidArgumentException if an unsupported argument type is provided. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withParsedBody) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "parsedBody"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, data, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query - * - * @return ServerRequest - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withQueryParams) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query_param = NULL, _0; - zval query; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query_param); - zephir_get_arrval(&query, query_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "queryParams"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &query, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles - * - * @return ServerRequest - * @throws InvalidArgumentException if an invalid structure is provided. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withUploadedFiles) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uploadedFiles_param = NULL, _0; - zval uploadedFiles; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uploadedFiles); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(uploadedFiles) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &uploadedFiles_param); - zephir_get_arrval(&uploadedFiles, uploadedFiles_param); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", NULL, 362, &uploadedFiles); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "uploadedFiles"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &uploadedFiles, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @param string $name - * - * @return ServerRequest - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withoutAttribute) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, name_sub, attributes, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name_sub); - ZVAL_UNDEF(&attributes); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("attributes"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - if (zephir_clone(&_1, &_0) == FAILURE) { - RETURN_MM(); - } - ZEPHIR_CPY_WRT(&attributes, &_1); - ZEPHIR_CALL_METHOD(NULL, &attributes, "remove", NULL, 0, name); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "attributes"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, &attributes, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Checks the uploaded files - * - * @param array $files - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequest, checkUploadedFiles) -{ - zend_bool _3$$5, _4$$9; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_2 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *files_param = NULL, file, *_0, _1; - zval files; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &files_param); - zephir_get_arrval(&files, files_param); - - - zephir_is_iterable(&files, 0, "phalcon/Http/Message/ServerRequest.zep", 354); - if (Z_TYPE_P(&files) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&files), _0) - { - ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", &_2, 362, &file); - zephir_check_call_status(); - } else { - _3$$5 = Z_TYPE_P(&file) == IS_OBJECT; - if (_3$$5) { - _3$$5 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(!(_3$$5))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uploaded file", "phalcon/Http/Message/ServerRequest.zep", 350); - return; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &files, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkuploadedfiles", &_2, 362, &file); - zephir_check_call_status(); - } else { - _4$$9 = Z_TYPE_P(&file) == IS_OBJECT; - if (_4$$9) { - _4$$9 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(!(_4$$9))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid uploaded file", "phalcon/Http/Message/ServerRequest.zep", 350); - return; - } - } - ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&file); - ZEPHIR_MM_RESTORE(); -} - -zend_object *zephir_init_properties_Phalcon_Http_Message_ServerRequest(zend_class_entry *class_type) -{ - zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_7$$6); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("uploadedFiles"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("uploadedFiles"), &_1$$3); - } - zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("serverParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("serverParams"), &_3$$4); - } - zephir_read_property_ex(&_4, this_ptr, ZEND_STRL("queryParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_4) == IS_NULL) { - ZEPHIR_INIT_VAR(&_5$$5); - array_init(&_5$$5); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("queryParams"), &_5$$5); - } - zephir_read_property_ex(&_6, this_ptr, ZEND_STRL("cookieParams"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_6) == IS_NULL) { - ZEPHIR_INIT_VAR(&_7$$6); - array_init(&_7$$6); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("cookieParams"), &_7$$6); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } -} - diff --git a/ext/phalcon/http/message/serverrequest.zep.h b/ext/phalcon/http/message/serverrequest.zep.h deleted file mode 100644 index 3a018018283..00000000000 --- a/ext/phalcon/http/message/serverrequest.zep.h +++ /dev/null @@ -1,129 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_serverrequest_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequest); - -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getCookieParams); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getParsedBody); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getQueryParams); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getServerParams); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getUploadedFiles); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, __construct); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttribute); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, getAttributes); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withAttribute); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withCookieParams); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withParsedBody); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withQueryParams); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withUploadedFiles); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, withoutAttribute); -PHP_METHOD(Phalcon_Http_Message_ServerRequest, checkUploadedFiles); -zend_object *zephir_init_properties_Phalcon_Http_Message_ServerRequest(zend_class_entry *class_type); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getcookieparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_getparsedbody, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getqueryparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getserverparams, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getuploadedfiles, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serverParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, serverParams, 0) -#endif - ZEND_ARG_INFO(0, body) - ZEND_ARG_INFO(0, headers) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookies, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, cookies, 0) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, queryParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, queryParams, 0) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uploadFiles, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, uploadFiles, 0) -#endif - ZEND_ARG_INFO(0, parsedBody) - ZEND_ARG_TYPE_INFO(0, protocol, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_getattribute, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_getattributes, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withattribute, 0, 2, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withcookieparams, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, cookies, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withparsedbody, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withqueryparams, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, query, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withuploadedfiles, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_ARRAY_INFO(0, uploadedFiles, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequest_withoutattribute, 0, 1, Phalcon\\Http\\Message\\ServerRequest, 0) - ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequest_checkuploadedfiles, 0, 1, IS_VOID, 0) - - ZEND_ARG_ARRAY_INFO(0, files, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequest_zephir_init_properties_phalcon_http_message_serverrequest, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_serverrequest_method_entry) { - PHP_ME(Phalcon_Http_Message_ServerRequest, getCookieParams, arginfo_phalcon_http_message_serverrequest_getcookieparams, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_ServerRequest, getParsedBody, arginfo_phalcon_http_message_serverrequest_getparsedbody, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_ServerRequest, getParsedBody, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_ServerRequest, getQueryParams, arginfo_phalcon_http_message_serverrequest_getqueryparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getServerParams, arginfo_phalcon_http_message_serverrequest_getserverparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getUploadedFiles, arginfo_phalcon_http_message_serverrequest_getuploadedfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, __construct, arginfo_phalcon_http_message_serverrequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_ServerRequest, getAttribute, arginfo_phalcon_http_message_serverrequest_getattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, getAttributes, arginfo_phalcon_http_message_serverrequest_getattributes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withAttribute, arginfo_phalcon_http_message_serverrequest_withattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withCookieParams, arginfo_phalcon_http_message_serverrequest_withcookieparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withParsedBody, arginfo_phalcon_http_message_serverrequest_withparsedbody, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withQueryParams, arginfo_phalcon_http_message_serverrequest_withqueryparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withUploadedFiles, arginfo_phalcon_http_message_serverrequest_withuploadedfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, withoutAttribute, arginfo_phalcon_http_message_serverrequest_withoutattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequest, checkUploadedFiles, arginfo_phalcon_http_message_serverrequest_checkuploadedfiles, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/serverrequestfactory.zep.c b/ext/phalcon/http/message/serverrequestfactory.zep.c deleted file mode 100644 index 146a4fe7280..00000000000 --- a/ext/phalcon/http/message/serverrequestfactory.zep.c +++ /dev/null @@ -1,1554 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "kernel/memory.h" -#include "kernel/object.h" -#include "kernel/array.h" -#include "kernel/string.h" -#include "kernel/exception.h" -#include "kernel/concat.h" - - -/** -* This file is part of the Phalcon Framework. -* -* (c) Phalcon Team -* -* For the full copyright and license information, please view the LICENSE.txt -* file that was distributed with this source code. -* -* Implementation of this file has been influenced by Zend Diactoros -* @link https://github.com/zendframework/zend-diactoros -* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md -*/ -/** - * PSR-17 ServerRequestFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequestFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, ServerRequestFactory, phalcon, http_message_serverrequestfactory, phalcon_http_message_serverrequestfactory_method_entry, 0); - - zend_class_implements(phalcon_http_message_serverrequestfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\serverrequestfactoryinterface"))); - zend_class_implements(phalcon_http_message_serverrequestfactory_ce, 1, phalcon_http_message_requestmethodinterface_ce); - return SUCCESS; -} - -/** - * Create a new server request. - * - * Note that server-params are taken precisely as given - no - * parsing/processing of the given values is performed, and, in particular, - * no attempt is made to determine the HTTP method or URI, which must be - * provided explicitly. - * - * @param string $method The HTTP method associated with - * the request. - * @param UriInterface|string $uri The URI associated with the - * request. If the value is a - * string, the factory MUST create - * a UriInterface instance based - * on it. - * @param array $serverParams Array of SAPI parameters with - * which to seed the generated - * request instance. - * - * @return ServerRequestInterface - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createServerRequest) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval serverParams; - zval *method_param = NULL, *uri, uri_sub, *serverParams_param = NULL; - zval method; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&uri_sub); - ZVAL_UNDEF(&serverParams); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_STR(method) - Z_PARAM_ZVAL(uri) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(serverParams) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &method_param, &uri, &serverParams_param); - zephir_get_strval(&method, method_param); - if (!serverParams_param) { - ZEPHIR_INIT_VAR(&serverParams); - array_init(&serverParams); - } else { - zephir_get_arrval(&serverParams, serverParams_param); - } - - - object_init_ex(return_value, phalcon_http_message_serverrequest_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 363, &method, uri, &serverParams); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Create a request from the supplied superglobal values. - * - * If any argument is not supplied, the corresponding superglobal value will - * be used. - * - * @param array $server $_SERVER superglobal - * @param array $get $_GET superglobal - * @param array $post $_POST superglobal - * @param array $cookies $_COOKIE superglobal - * @param array $files $_FILES superglobal - * - * @return ServerRequest - * @see fromServer() - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, load) -{ - zend_bool _7; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server_param = NULL, *get_param = NULL, *post_param = NULL, *cookies_param = NULL, *files_param = NULL, _COOKIE, _FILES, _GET, _POST, _SERVER, cookiesCollection, filesCollection, headers, method, protocol, serverCollection, _0, _1, _2, _3, _4, _5, _6, _8, _11, _12, _13, _14, _9$$8, _10$$8; - zval server, get, post, cookies, files, globalCookies, globalFiles, globalGet, globalPost, globalServer; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server); - ZVAL_UNDEF(&get); - ZVAL_UNDEF(&post); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&globalCookies); - ZVAL_UNDEF(&globalFiles); - ZVAL_UNDEF(&globalGet); - ZVAL_UNDEF(&globalPost); - ZVAL_UNDEF(&globalServer); - ZVAL_UNDEF(&_COOKIE); - ZVAL_UNDEF(&_FILES); - ZVAL_UNDEF(&_GET); - ZVAL_UNDEF(&_POST); - ZVAL_UNDEF(&_SERVER); - ZVAL_UNDEF(&cookiesCollection); - ZVAL_UNDEF(&filesCollection); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&method); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&serverCollection); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_13); - ZVAL_UNDEF(&_14); - ZVAL_UNDEF(&_9$$8); - ZVAL_UNDEF(&_10$$8); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 5) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY_OR_NULL(server) - Z_PARAM_ARRAY_OR_NULL(get) - Z_PARAM_ARRAY_OR_NULL(post) - Z_PARAM_ARRAY_OR_NULL(cookies) - Z_PARAM_ARRAY_OR_NULL(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SL("_SERVER")); - zephir_get_global(&_POST, SL("_POST")); - zephir_get_global(&_GET, SL("_GET")); - zephir_get_global(&_FILES, SL("_FILES")); - zephir_get_global(&_COOKIE, SL("_COOKIE")); - zephir_fetch_params(1, 0, 5, &server_param, &get_param, &post_param, &cookies_param, &files_param); - if (!server_param) { - ZEPHIR_INIT_VAR(&server); - } else { - zephir_get_arrval(&server, server_param); - } - if (!get_param) { - ZEPHIR_INIT_VAR(&get); - } else { - zephir_get_arrval(&get, get_param); - } - if (!post_param) { - ZEPHIR_INIT_VAR(&post); - } else { - zephir_get_arrval(&post, post_param); - } - if (!cookies_param) { - ZEPHIR_INIT_VAR(&cookies); - } else { - zephir_get_arrval(&cookies, cookies_param); - } - if (!files_param) { - ZEPHIR_INIT_VAR(&files); - } else { - zephir_get_arrval(&files, files_param); - } - - - ZEPHIR_INIT_VAR(&globalCookies); - array_init(&globalCookies); - ZEPHIR_INIT_VAR(&globalFiles); - array_init(&globalFiles); - ZEPHIR_INIT_VAR(&globalGet); - array_init(&globalGet); - ZEPHIR_INIT_VAR(&globalPost); - array_init(&globalPost); - ZEPHIR_INIT_VAR(&globalServer); - array_init(&globalServer); - if (!(ZEPHIR_IS_EMPTY(&_COOKIE))) { - ZEPHIR_CPY_WRT(&globalCookies, &_COOKIE); - } - if (!(ZEPHIR_IS_EMPTY(&_FILES))) { - ZEPHIR_CPY_WRT(&globalFiles, &_FILES); - } - if (!(ZEPHIR_IS_EMPTY(&_GET))) { - ZEPHIR_CPY_WRT(&globalGet, &_GET); - } - if (!(ZEPHIR_IS_EMPTY(&_POST))) { - ZEPHIR_CPY_WRT(&globalPost, &_POST); - } - if (!(ZEPHIR_IS_EMPTY(&_SERVER))) { - ZEPHIR_CPY_WRT(&globalServer, &_SERVER); - } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "checknullarray", NULL, 364, &server, &globalServer); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&server, &_0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "checknullarray", NULL, 364, &files, &globalFiles); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&files, &_1); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "checknullarray", NULL, 364, &cookies, &globalCookies); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&cookies, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "checknullarray", NULL, 364, &get, &globalGet); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&get, &_3); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "checknullarray", NULL, 364, &post, &globalPost); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&post, &_4); - ZEPHIR_CALL_METHOD(&serverCollection, this_ptr, "parseserver", NULL, 365, &server); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_5); - ZVAL_STRING(&_5, "REQUEST_METHOD"); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "GET"); - ZEPHIR_CALL_METHOD(&method, &serverCollection, "get", NULL, 0, &_5, &_6); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&protocol, this_ptr, "parseprotocol", NULL, 366, &serverCollection); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "parseheaders", NULL, 367, &serverCollection); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&filesCollection, this_ptr, "parseuploadedfiles", NULL, 368, &files); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&cookiesCollection, &cookies); - _7 = ZEPHIR_IS_EMPTY(&cookies); - if (_7) { - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "cookie"); - ZEPHIR_CALL_METHOD(&_8, &headers, "has", NULL, 0, &_5); - zephir_check_call_status(); - _7 = zephir_is_true(&_8); - } - if (UNEXPECTED(_7)) { - ZEPHIR_INIT_VAR(&_10$$8); - ZVAL_STRING(&_10$$8, "cookie"); - ZEPHIR_CALL_METHOD(&_9$$8, &headers, "get", NULL, 0, &_10$$8); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&cookiesCollection, this_ptr, "parsecookieheader", NULL, 369, &_9$$8); - zephir_check_call_status(); - } - object_init_ex(return_value, phalcon_http_message_serverrequest_ce); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "parseuri", NULL, 370, &serverCollection, &headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_12, &serverCollection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13, &headers, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_14, &filesCollection, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_5); - ZVAL_STRING(&_5, "php://input"); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 363, &method, &_11, &_12, &_5, &_13, &cookiesCollection, &get, &_14, &post, &protocol); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Returns the apache_request_headers if it exists - * - * @return array|false - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeaders) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - - - ZEPHIR_MM_GROW(); - - if (EXPECTED((zephir_function_exists_ex(ZEND_STRL("apache_request_headers")) == SUCCESS))) { - ZEPHIR_RETURN_CALL_FUNCTION("apache_request_headers", NULL, 371); - zephir_check_call_status(); - RETURN_MM(); - } - RETURN_MM_BOOL(0); -} - -/** - * Calculates the host and port from the headers or the server superglobal - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost) -{ - zval defaults; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, __$null, host, port, _0, _1, _2, _4, _3$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&port); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&defaults); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&defaults); - zephir_create_array(&defaults, 2, 0); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - zephir_array_fast_append(&defaults, &_0); - zephir_array_fast_append(&defaults, &__$null); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "host"); - ZVAL_BOOL(&_2, 0); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getheader", NULL, 372, headers, &_0, &_2); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_1))) { - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "host"); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getheader", NULL, 372, headers, &_3$$3); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "calculateurihostfromheader", NULL, 373, &host); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_NAME"); - ZEPHIR_CALL_METHOD(&_4, server, "has", NULL, 0, &_0); - zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(&_4))) { - RETURN_CTOR(&defaults); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_NAME"); - ZEPHIR_CALL_METHOD(&host, server, "get", NULL, 0, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "SERVER_PORT"); - ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&port, server, "get", NULL, 0, &_0, &_2); - zephir_check_call_status(); - zephir_create_array(return_value, 2, 0); - zephir_array_fast_append(return_value, &host); - zephir_array_fast_append(return_value, &port); - RETURN_MM(); -} - -/** - * Get the host and calculate the port if present from the header - * - * @param string $host - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *host_param = NULL, matches, port, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3; - zval host; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&host); - ZVAL_UNDEF(&matches); - ZVAL_UNDEF(&port); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(host) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &host_param); - zephir_get_strval(&host, host_param); - - - ZEPHIR_INIT_VAR(&port); - ZVAL_NULL(&port); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "|:(\\d+)$|"); - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "|:(\\d+)$|"); - zephir_preg_match(&_1, &_2, &host, &matches, 0, 0 , 0 ); - if (UNEXPECTED(zephir_is_true(&_1))) { - zephir_array_fetch_long(&_3$$3, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 199); - ZVAL_LONG(&_4$$3, 0); - ZVAL_LONG(&_5$$3, (-1 * ((zephir_fast_strlen_ev(&_3$$3) + 1)))); - ZEPHIR_INIT_VAR(&_6$$3); - zephir_substr(&_6$$3, &host, 0 , zephir_get_intval(&_5$$3), 0); - zephir_get_strval(&host, &_6$$3); - ZEPHIR_OBS_VAR(&_7$$3); - zephir_array_fetch_long(&_7$$3, &matches, 1, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 200); - ZEPHIR_INIT_NVAR(&port); - ZVAL_LONG(&port, zephir_get_intval(&_7$$3)); - } - zephir_create_array(return_value, 2, 0); - zephir_array_fast_append(return_value, &host); - zephir_array_fast_append(return_value, &port); - RETURN_MM(); -} - -/** - * Get the path from the request from IIS7/Rewrite, REQUEST_URL or - * ORIG_PATH_INFO - * - * @param CollectionInterface $server - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath) -{ - zend_bool _4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, iisRewrite, origPathInfo, requestUri, unencodedUrl, _0, _1, _2, _3, _5$$4, _6$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&iisRewrite); - ZVAL_UNDEF(&origPathInfo); - ZVAL_UNDEF(&requestUri); - ZVAL_UNDEF(&unencodedUrl); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "IIS_WasUrlRewritten"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&iisRewrite, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "UNENCODED_URL"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_METHOD(&unencodedUrl, server, "get", NULL, 0, &_0, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "1"); - _4 = ZEPHIR_IS_IDENTICAL(&_3, &iisRewrite); - if (_4) { - _4 = !(ZEPHIR_IS_EMPTY(&unencodedUrl)); - } - if (UNEXPECTED(_4)) { - RETURN_CCTOR(&unencodedUrl); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "REQUEST_URI"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&requestUri, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&requestUri) != IS_NULL)) { - ZEPHIR_INIT_VAR(&_5$$4); - ZVAL_STRING(&_5$$4, "#^[^/:]+://[^/]+#"); - ZEPHIR_INIT_VAR(&_6$$4); - ZVAL_STRING(&_6$$4, ""); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 50, &_5$$4, &_6$$4, &requestUri); - zephir_check_call_status(); - RETURN_MM(); - } - ZEPHIR_INIT_NVAR(&_0); - ZVAL_STRING(&_0, "ORIG_PATH_INFO"); - ZVAL_NULL(&_1); - ZEPHIR_CALL_METHOD(&origPathInfo, server, "get", NULL, 0, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_EMPTY(&origPathInfo))) { - RETURN_MM_STRING("/"); - } - RETURN_CCTOR(&origPathInfo); -} - -/** - * Get the query string from the server array - * - * @param CollectionInterface $server - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "QUERY_STRING"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_METHOD(&_0, server, "get", NULL, 0, &_1, &_2); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "?"); - zephir_fast_trim(return_value, &_0, &_1, ZEPHIR_TRIM_LEFT); - RETURN_MM(); -} - -/** - * Calculates the scheme from the server variables - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme) -{ - double _7$$3; - zend_bool _9; - zval scheme, _5$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, header, isHttps, _0, _1, _8, _10, _2$$3, _3$$3, _4$$3, _6$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&header); - ZVAL_UNDEF(&isHttps); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&_5$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&scheme); - ZVAL_STRING(&scheme, "https"); - ZEPHIR_INIT_VAR(&isHttps); - ZVAL_BOOL(&isHttps, 1); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "HTTPS"); - ZEPHIR_CALL_METHOD(&_0, server, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "HTTPS"); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, "on"); - ZEPHIR_CALL_METHOD(&_2$$3, server, "get", NULL, 0, &_3$$3, &_4$$3); - zephir_check_call_status(); - zephir_cast_to_string(&_5$$3, &_2$$3); - ZEPHIR_CPY_WRT(&isHttps, &_5$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_fast_strtolower(&_3$$3, &isHttps); - ZEPHIR_INIT_VAR(&_6$$3); - ZVAL_STRING(&_6$$3, "off"); - _7$$3 = !ZEPHIR_IS_IDENTICAL(&_6$$3, &_3$$3); - ZEPHIR_INIT_NVAR(&isHttps); - ZVAL_BOOL(&isHttps, _7$$3); - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "x-forwarded-proto"); - ZEPHIR_INIT_VAR(&_8); - ZVAL_STRING(&_8, "https"); - ZEPHIR_CALL_METHOD(&header, this_ptr, "getheader", NULL, 372, headers, &_1, &_8); - zephir_check_call_status(); - _9 = !zephir_is_true(&isHttps); - if (!(_9)) { - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "https"); - _9 = !ZEPHIR_IS_IDENTICAL(&_10, &header); - } - if (UNEXPECTED(_9)) { - ZEPHIR_INIT_NVAR(&scheme); - ZVAL_STRING(&scheme, "http"); - } - RETURN_CTOR(&scheme); -} - -/** - * Checks the source if it null and returns the super, otherwise the source - * array - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, checkNullArray) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval super; - zval *source, source_sub, *super_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&source_sub); - ZVAL_UNDEF(&super); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(source) - Z_PARAM_ARRAY(super) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &source, &super_param); - zephir_get_arrval(&super, super_param); - - - if (UNEXPECTED(ZEPHIR_IS_EMPTY(source))) { - RETURN_CTOR(&super); - } - RETVAL_ZVAL(source, 1, 0); - RETURN_MM(); -} - -/** - * Create an UploadedFile object from an $_FILES array element - * - * @param array $file The $_FILES element - * - * @return UploadedFile - * - * @throws InvalidArgumentException If one of the elements is missing - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile) -{ - zval _3$$3; - zend_bool _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, name, type, _4, _5, _6, _2$$3; - zval file; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&type); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(file) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &file_param); - zephir_get_arrval(&file, file_param); - - - _0 = !(zephir_array_isset_string(&file, SL("tmp_name"))); - if (!(_0)) { - _0 = !(zephir_array_isset_string(&file, SL("size"))); - } - _1 = _0; - if (!(_1)) { - _1 = !(zephir_array_isset_string(&file, SL("error"))); - } - if (UNEXPECTED(_1)) { - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_CONCAT_SS(&_3$$3, "The file array must contain tmp_name, size and error; ", "one or more are missing"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 40, &_3$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$3, "phalcon/Http/Message/ServerRequestFactory.zep", 318); - ZEPHIR_MM_RESTORE(); - return; - } - if (zephir_array_isset_string(&file, SL("name"))) { - ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, &file, SL("name"), PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 321); - } else { - ZEPHIR_INIT_NVAR(&name); - ZVAL_NULL(&name); - } - if (zephir_array_isset_string(&file, SL("type"))) { - ZEPHIR_OBS_VAR(&type); - zephir_array_fetch_string(&type, &file, SL("type"), PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 322); - } else { - ZEPHIR_INIT_NVAR(&type); - ZVAL_NULL(&type); - } - object_init_ex(return_value, phalcon_http_message_uploadedfile_ce); - zephir_array_fetch_string(&_4, &file, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 325); - zephir_array_fetch_string(&_5, &file, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 326); - zephir_array_fetch_string(&_6, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 327); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 374, &_4, &_5, &_6, &name, &type); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Returns a header - * - * @param CollectionInterface $headers - * @param string $name - * @param mixed|null $defaultValue - * - * @return mixed|string - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeader) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval name; - zval *headers, headers_sub, *name_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&name); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &headers, &name_param, &defaultValue); - zephir_get_strval(&name, name_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&value, headers, "get", NULL, 0, &name, defaultValue); - zephir_check_call_status(); - if (Z_TYPE_P(&value) == IS_ARRAY) { - ZEPHIR_INIT_VAR(&_0$$3); - zephir_fast_join_str(&_0$$3, SL(","), &value); - ZEPHIR_CPY_WRT(&value, &_0$$3); - } - RETURN_CCTOR(&value); -} - -/** - * Parse a cookie header according to RFC 6265. - * - * @param string $cookieHeader A string cookie header value. - * - * @return array key/value cookie pairs. - * - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cookieHeader_param = NULL, cookies, _1; - zval cookieHeader; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&cookieHeader); - ZVAL_UNDEF(&cookies); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(cookieHeader) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &cookieHeader_param); - zephir_get_strval(&cookieHeader, cookieHeader_param); - - - ZEPHIR_INIT_VAR(&cookies); - array_init(&cookies); - ZEPHIR_INIT_VAR(&_0); - zephir_create_array(&_0, 3, 0); - add_assoc_stringl_ex(&_0, SL("&"), SL("%26")); - add_assoc_stringl_ex(&_0, SL("+"), SL("%2B")); - add_assoc_stringl_ex(&_0, SL(";"), SL("&")); - ZEPHIR_CALL_FUNCTION(&_1, "strtr", NULL, 5, &cookieHeader, &_0); - zephir_check_call_status(); - ZEPHIR_MAKE_REF(&cookies); - ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 375, &_1, &cookies); - ZEPHIR_UNREF(&cookies); - zephir_check_call_status(); - RETURN_CCTOR(&cookies); -} - -/** - * Processes headers from SAPI - * - * @param CollectionInterface $server - * - * @return CollectionInterface - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseHeaders) -{ - zend_string *_3; - zend_ulong _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_10 = NULL, *_18 = NULL, *_30 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, headers, key, name, serverArray, value, *_0, _1, _4$$3, _5$$4, _6$$4, _11$$4, _12$$4, _19$$4, _20$$4, _7$$5, _8$$5, _9$$5, _13$$7, _14$$7, _15$$7, _16$$7, _17$$7, _21$$8, _22$$8, _23$$8, _24$$9, _25$$10, _26$$10, _31$$10, _32$$10, _38$$10, _39$$10, _27$$11, _28$$11, _29$$11, _33$$13, _34$$13, _35$$13, _36$$13, _37$$13, _40$$14, _41$$14, _42$$14; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&serverArray); - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_11$$4); - ZVAL_UNDEF(&_12$$4); - ZVAL_UNDEF(&_19$$4); - ZVAL_UNDEF(&_20$$4); - ZVAL_UNDEF(&_7$$5); - ZVAL_UNDEF(&_8$$5); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_13$$7); - ZVAL_UNDEF(&_14$$7); - ZVAL_UNDEF(&_15$$7); - ZVAL_UNDEF(&_16$$7); - ZVAL_UNDEF(&_17$$7); - ZVAL_UNDEF(&_21$$8); - ZVAL_UNDEF(&_22$$8); - ZVAL_UNDEF(&_23$$8); - ZVAL_UNDEF(&_24$$9); - ZVAL_UNDEF(&_25$$10); - ZVAL_UNDEF(&_26$$10); - ZVAL_UNDEF(&_31$$10); - ZVAL_UNDEF(&_32$$10); - ZVAL_UNDEF(&_38$$10); - ZVAL_UNDEF(&_39$$10); - ZVAL_UNDEF(&_27$$11); - ZVAL_UNDEF(&_28$$11); - ZVAL_UNDEF(&_29$$11); - ZVAL_UNDEF(&_33$$13); - ZVAL_UNDEF(&_34$$13); - ZVAL_UNDEF(&_35$$13); - ZVAL_UNDEF(&_36$$13); - ZVAL_UNDEF(&_37$$13); - ZVAL_UNDEF(&_40$$14); - ZVAL_UNDEF(&_41$$14); - ZVAL_UNDEF(&_42$$14); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&headers); - object_init_ex(&headers, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 24); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&serverArray, server, "toarray", NULL, 0); - zephir_check_call_status(); - zephir_is_iterable(&serverArray, 0, "phalcon/Http/Message/ServerRequestFactory.zep", 437); - if (Z_TYPE_P(&serverArray) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&serverArray), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, ""); - if (EXPECTED(!ZEPHIR_IS_IDENTICAL(&_4$$3, &value))) { - ZEPHIR_INIT_NVAR(&_5$$4); - ZVAL_STRING(&_5$$4, "REDIRECT_"); - ZEPHIR_INIT_NVAR(&_6$$4); - zephir_fast_strpos(&_6$$4, &key, &_5$$4, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_6$$4, 0))) { - ZVAL_LONG(&_7$$5, 9); - ZEPHIR_INIT_NVAR(&_8$$5); - zephir_substr(&_8$$5, &key, 9 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CPY_WRT(&key, &_8$$5); - ZEPHIR_CALL_METHOD(&_9$$5, server, "has", &_10, 0, &key); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_9$$5))) { - continue; - } - } - ZEPHIR_INIT_NVAR(&_11$$4); - ZVAL_STRING(&_11$$4, "HTTP_"); - ZEPHIR_INIT_NVAR(&_12$$4); - zephir_fast_strpos(&_12$$4, &key, &_11$$4, 0 ); - if (EXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_12$$4, 0))) { - ZEPHIR_INIT_NVAR(&_13$$7); - ZVAL_LONG(&_14$$7, 5); - ZEPHIR_INIT_NVAR(&_15$$7); - zephir_substr(&_15$$7, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_13$$7, &_15$$7); - ZEPHIR_INIT_NVAR(&_16$$7); - ZVAL_STRING(&_16$$7, "_"); - ZEPHIR_INIT_NVAR(&_17$$7); - ZVAL_STRING(&_17$$7, "-"); - ZEPHIR_INIT_NVAR(&name); - zephir_fast_str_replace(&name, &_16$$7, &_17$$7, &_13$$7); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - ZEPHIR_INIT_NVAR(&_19$$4); - ZVAL_STRING(&_19$$4, "CONTENT_"); - ZEPHIR_INIT_NVAR(&_20$$4); - zephir_fast_strpos(&_20$$4, &key, &_19$$4, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_20$$4, 0))) { - ZEPHIR_INIT_NVAR(&_21$$8); - ZVAL_LONG(&_22$$8, 8); - ZEPHIR_INIT_NVAR(&_23$$8); - zephir_substr(&_23$$8, &key, 8 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_21$$8, &_23$$8); - ZEPHIR_INIT_NVAR(&name); - ZEPHIR_CONCAT_SV(&name, "content-", &_21$$8); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &serverArray, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &serverArray, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &serverArray, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&value, &serverArray, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_24$$9); - ZVAL_STRING(&_24$$9, ""); - if (EXPECTED(!ZEPHIR_IS_IDENTICAL(&_24$$9, &value))) { - ZEPHIR_INIT_NVAR(&_25$$10); - ZVAL_STRING(&_25$$10, "REDIRECT_"); - ZEPHIR_INIT_NVAR(&_26$$10); - zephir_fast_strpos(&_26$$10, &key, &_25$$10, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_26$$10, 0))) { - ZVAL_LONG(&_27$$11, 9); - ZEPHIR_INIT_NVAR(&_28$$11); - zephir_substr(&_28$$11, &key, 9 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CPY_WRT(&key, &_28$$11); - ZEPHIR_CALL_METHOD(&_29$$11, server, "has", &_30, 0, &key); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_29$$11))) { - continue; - } - } - ZEPHIR_INIT_NVAR(&_31$$10); - ZVAL_STRING(&_31$$10, "HTTP_"); - ZEPHIR_INIT_NVAR(&_32$$10); - zephir_fast_strpos(&_32$$10, &key, &_31$$10, 0 ); - if (EXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_32$$10, 0))) { - ZEPHIR_INIT_NVAR(&_33$$13); - ZVAL_LONG(&_34$$13, 5); - ZEPHIR_INIT_NVAR(&_35$$13); - zephir_substr(&_35$$13, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_33$$13, &_35$$13); - ZEPHIR_INIT_NVAR(&_36$$13); - ZVAL_STRING(&_36$$13, "_"); - ZEPHIR_INIT_NVAR(&_37$$13); - ZVAL_STRING(&_37$$13, "-"); - ZEPHIR_INIT_NVAR(&name); - zephir_fast_str_replace(&name, &_36$$13, &_37$$13, &_33$$13); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - ZEPHIR_INIT_NVAR(&_38$$10); - ZVAL_STRING(&_38$$10, "CONTENT_"); - ZEPHIR_INIT_NVAR(&_39$$10); - zephir_fast_strpos(&_39$$10, &key, &_38$$10, 0 ); - if (UNEXPECTED(ZEPHIR_IS_LONG_IDENTICAL(&_39$$10, 0))) { - ZEPHIR_INIT_NVAR(&_40$$14); - ZVAL_LONG(&_41$$14, 8); - ZEPHIR_INIT_NVAR(&_42$$14); - zephir_substr(&_42$$14, &key, 8 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_strtolower(&_40$$14, &_42$$14); - ZEPHIR_INIT_NVAR(&name); - ZEPHIR_CONCAT_SV(&name, "content-", &_40$$14); - ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_18, 42, &name, &value); - zephir_check_call_status(); - continue; - } - } - ZEPHIR_CALL_METHOD(NULL, &serverArray, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&value); - ZEPHIR_INIT_NVAR(&key); - RETURN_CCTOR(&headers); -} - -/** - * Parse the $_SERVER array amd check the server protocol. Raise an - * - * @param CollectionInterface $server The server variables - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseProtocol) -{ - zval _4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, localProtocol, protocol, protocols, _0, _1, _2, _3, _5, _6, _9, _10, _7$$4, _8$$4, _11$$5, _12$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&localProtocol); - ZVAL_UNDEF(&protocol); - ZVAL_UNDEF(&protocols); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_7$$4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_11$$5); - ZVAL_UNDEF(&_12$$5); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server); - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "SERVER_PROTOCOL"); - ZEPHIR_CALL_METHOD(&_0, server, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - RETURN_MM_STRING("1.1"); - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "SERVER_PROTOCOL"); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "HTTP/1.1"); - ZEPHIR_CALL_METHOD(&_2, server, "get", NULL, 0, &_1, &_3); - zephir_check_call_status(); - zephir_cast_to_string(&_4, &_2); - ZEPHIR_CPY_WRT(&protocol, &_4); - ZEPHIR_INIT_VAR(&localProtocol); - zephir_fast_strtolower(&localProtocol, &protocol); - ZEPHIR_INIT_VAR(&protocols); - zephir_create_array(&protocols, 4, 0); - add_assoc_long_ex(&protocols, SL("1.0"), 1); - add_assoc_long_ex(&protocols, SL("1.1"), 1); - add_assoc_long_ex(&protocols, SL("2.0"), 1); - add_assoc_long_ex(&protocols, SL("3.0"), 1); - ZVAL_LONG(&_5, 0); - ZVAL_LONG(&_6, 5); - ZEPHIR_INIT_NVAR(&_1); - zephir_substr(&_1, &localProtocol, 0 , 5 , 0); - if (!ZEPHIR_IS_STRING_IDENTICAL(&_1, "http/")) { - ZEPHIR_INIT_VAR(&_7$$4); - object_init_ex(&_7$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_8$$4); - ZEPHIR_CONCAT_SV(&_8$$4, "Incorrect protocol value ", &protocol); - ZEPHIR_CALL_METHOD(NULL, &_7$$4, "__construct", NULL, 40, &_8$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_7$$4, "phalcon/Http/Message/ServerRequestFactory.zep", 467); - ZEPHIR_MM_RESTORE(); - return; - } - ZEPHIR_INIT_NVAR(&_3); - ZEPHIR_INIT_VAR(&_9); - ZVAL_STRING(&_9, "http/"); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, ""); - zephir_fast_str_replace(&_3, &_9, &_10, &localProtocol); - ZEPHIR_CPY_WRT(&localProtocol, &_3); - if (UNEXPECTED(!(zephir_array_isset(&protocols, &localProtocol)))) { - ZEPHIR_INIT_VAR(&_11$$5); - object_init_ex(&_11$$5, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_12$$5); - ZEPHIR_CONCAT_SV(&_12$$5, "Unsupported protocol ", &protocol); - ZEPHIR_CALL_METHOD(NULL, &_11$$5, "__construct", NULL, 40, &_12$$5); - zephir_check_call_status(); - zephir_throw_exception_debug(&_11$$5, "phalcon/Http/Message/ServerRequestFactory.zep", 475); - ZEPHIR_MM_RESTORE(); - return; - } - RETURN_CCTOR(&localProtocol); -} - -/** - * Parse the $_SERVER array amd return it back after looking for the - * authorization header - * - * @param array $server Either verbatim, or with an added - * HTTP_AUTHORIZATION header. - * - * @return CollectionInterface - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseServer) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server_param = NULL, collection, headers, headersCollection, _0, _1, _3$$3, _4$$3, _5$$4, _6$$4; - zval server; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&headers); - ZVAL_UNDEF(&headersCollection); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(server) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &server_param); - zephir_get_arrval(&server, server_param); - - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24, &server); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_0, &collection, "has", NULL, 376, &_1); - zephir_check_call_status(); - _2 = !zephir_is_true(&_0); - if (_2) { - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&headers); - } - if (UNEXPECTED(_2)) { - ZEPHIR_INIT_VAR(&headersCollection); - object_init_ex(&headersCollection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &headersCollection, "__construct", NULL, 24, &headers); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, "Authorization"); - ZEPHIR_CALL_METHOD(&_3$$3, &headersCollection, "has", NULL, 376, &_4$$3); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_3$$3))) { - ZEPHIR_INIT_VAR(&_6$$4); - ZVAL_STRING(&_6$$4, "Authorization"); - ZEPHIR_CALL_METHOD(&_5$$4, &headersCollection, "get", NULL, 377, &_6$$4); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_6$$4); - ZVAL_STRING(&_6$$4, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", NULL, 42, &_6$$4, &_5$$4); - zephir_check_call_status(); - } - } - RETURN_CCTOR(&collection); -} - -/** - * Traverses a $_FILES and creates UploadedFile objects from it. It is used - * recursively - * - * @param array $files - * - * @return CollectionInterface - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles) -{ - zend_bool _5$$3, _7$$3, _13$$7, _14$$7; - zval _4$$3, _12$$7; - zend_string *_3; - zend_ulong _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_10 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *files_param = NULL, collection, data, key, file, *_0, _1, _8$$5, _11$$6, _15$$9, _16$$10; - zval files; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&files); - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&file); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_8$$5); - ZVAL_UNDEF(&_11$$6); - ZVAL_UNDEF(&_15$$9); - ZVAL_UNDEF(&_16$$10); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_12$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(files) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &files_param); - zephir_get_arrval(&files, files_param); - - - ZEPHIR_INIT_VAR(&collection); - object_init_ex(&collection, phalcon_support_collection_ce); - ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 24); - zephir_check_call_status(); - zephir_is_iterable(&files, 0, "phalcon/Http/Message/ServerRequestFactory.zep", 558); - if (Z_TYPE_P(&files) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&files), _2, _3, _0) - { - ZEPHIR_INIT_NVAR(&key); - if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); - } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - zephir_cast_to_string(&_4$$3, &key); - ZEPHIR_CPY_WRT(&key, &_4$$3); - _5$$3 = Z_TYPE_P(&file) == IS_OBJECT; - if (_5$$3) { - _5$$3 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(_5$$3)) { - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &file); - zephir_check_call_status(); - continue; - } - _7$$3 = Z_TYPE_P(&file) == IS_ARRAY; - if (_7$$3) { - _7$$3 = zephir_array_isset_string(&file, SL("tmp_name")); - } - if (EXPECTED(_7$$3)) { - ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "createuploadedfile", &_9, 378, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_8$$5); - zephir_check_call_status(); - continue; - } - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&data, this_ptr, "parseuploadedfiles", &_10, 368, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$6, &data, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_11$$6); - zephir_check_call_status(); - continue; - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &files, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &files, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &files, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&file, &files, "current", NULL, 0); - zephir_check_call_status(); - zephir_cast_to_string(&_12$$7, &key); - ZEPHIR_CPY_WRT(&key, &_12$$7); - _13$$7 = Z_TYPE_P(&file) == IS_OBJECT; - if (_13$$7) { - _13$$7 = zephir_is_instance_of(&file, SL("Psr\\Http\\Message\\UploadedFileInterface")); - } - if (UNEXPECTED(_13$$7)) { - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &file); - zephir_check_call_status(); - continue; - } - _14$$7 = Z_TYPE_P(&file) == IS_ARRAY; - if (_14$$7) { - _14$$7 = zephir_array_isset_string(&file, SL("tmp_name")); - } - if (EXPECTED(_14$$7)) { - ZEPHIR_CALL_METHOD(&_15$$9, this_ptr, "createuploadedfile", &_9, 378, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_15$$9); - zephir_check_call_status(); - continue; - } - if (UNEXPECTED(Z_TYPE_P(&file) == IS_ARRAY)) { - ZEPHIR_CALL_METHOD(&data, this_ptr, "parseuploadedfiles", &_10, 368, &file); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$10, &data, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_6, 42, &key, &_16$$10); - zephir_check_call_status(); - continue; - } - ZEPHIR_CALL_METHOD(NULL, &files, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&file); - ZEPHIR_INIT_NVAR(&key); - RETURN_CCTOR(&collection); -} - -/** - * Calculates the Uri from the server superglobal or the headers - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return Uri - */ -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUri) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *server, server_sub, *headers, headers_sub, path, query, scheme, split, uri, _0, _1, _7, _8, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _9$$5, _10$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&server_sub); - ZVAL_UNDEF(&headers_sub); - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&split); - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_10$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_OBJECT_OF_CLASS(server, phalcon_support_collection_collectioninterface_ce) - Z_PARAM_OBJECT_OF_CLASS(headers, phalcon_support_collection_collectioninterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &server, &headers); - - - ZEPHIR_INIT_VAR(&uri); - object_init_ex(&uri, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, &uri, "__construct", NULL, 114); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&scheme, this_ptr, "calculateurischeme", NULL, 379, server, headers); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, &uri, "withscheme", NULL, 380, &scheme); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - ZEPHIR_CALL_METHOD(&split, this_ptr, "calculateurihost", NULL, 381, server, headers); - zephir_check_call_status(); - ZEPHIR_OBS_VAR(&_1); - zephir_array_fetch_long(&_1, &split, 0, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 585); - if (EXPECTED(!(ZEPHIR_IS_EMPTY(&_1)))) { - zephir_array_fetch_long(&_3$$3, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 586); - ZEPHIR_CALL_METHOD(&_2$$3, &uri, "withhost", NULL, 382, &_3$$3); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_2$$3); - ZEPHIR_OBS_VAR(&_4$$3); - zephir_array_fetch_long(&_4$$3, &split, 1, PH_NOISY, "phalcon/Http/Message/ServerRequestFactory.zep", 587); - if (UNEXPECTED(!(ZEPHIR_IS_EMPTY(&_4$$3)))) { - zephir_array_fetch_long(&_6$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 588); - ZEPHIR_CALL_METHOD(&_5$$4, &uri, "withport", NULL, 383, &_6$$4); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_5$$4); - } - } - ZEPHIR_CALL_METHOD(&path, this_ptr, "calculateuripath", NULL, 384, server); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&split); - zephir_fast_explode_str(&split, SL("#"), &path, LONG_MAX); - zephir_array_fetch_long(&_7, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 597); - ZEPHIR_INIT_NVAR(&path); - zephir_fast_explode_str(&path, SL("?"), &_7, LONG_MAX); - zephir_array_fetch_long(&_8, &path, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 598); - ZEPHIR_CALL_METHOD(&_0, &uri, "withpath", NULL, 385, &_8); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - if (UNEXPECTED(zephir_fast_count_int(&split) > 1)) { - zephir_array_fetch_long(&_10$$5, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/ServerRequestFactory.zep", 601); - ZEPHIR_CALL_METHOD(&_9$$5, &uri, "withfragment", NULL, 386, &_10$$5); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_9$$5); - } - ZEPHIR_CALL_METHOD(&query, this_ptr, "calculateuriquery", NULL, 387, server); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, &uri, "withquery", NULL, 388, &query); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(&uri, &_0); - RETURN_CCTOR(&uri); -} - diff --git a/ext/phalcon/http/message/serverrequestfactory.zep.h b/ext/phalcon/http/message/serverrequestfactory.zep.h deleted file mode 100644 index 05a4b1b265f..00000000000 --- a/ext/phalcon/http/message/serverrequestfactory.zep.h +++ /dev/null @@ -1,150 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_serverrequestfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_ServerRequestFactory); - -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createServerRequest); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, load); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeaders); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, checkNullArray); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, getHeader); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseHeaders); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseProtocol); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseServer); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles); -PHP_METHOD(Phalcon_Http_Message_ServerRequestFactory, parseUri); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_createserverrequest, 0, 2, Psr\\Http\\Message\\ServerRequestInterface, 0) - ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) - ZEND_ARG_INFO(0, uri) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, serverParams, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, serverParams, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_load, 0, 0, Phalcon\\Http\\Message\\ServerRequest, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, server, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, server, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, get, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, get, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, post, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, post, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cookies, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, cookies, 1) -#endif -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, files, IS_ARRAY, 1, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, files, 1) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_getheaders, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurihost, 0, 2, IS_ARRAY, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurihostfromheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateuripath, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateuriquery, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_calculateurischeme, 0, 2, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_checknullarray, 0, 2, IS_ARRAY, 0) - ZEND_ARG_INFO(0, source) - ZEND_ARG_ARRAY_INFO(0, super, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_createuploadedfile, 0, 1, Phalcon\\Http\\Message\\UploadedFile, 0) - ZEND_ARG_ARRAY_INFO(0, file, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_getheader, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parsecookieheader, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, cookieHeader, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseheaders, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseprotocol, 0, 1, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseserver, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, server, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseuploadedfiles, 0, 1, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_ARRAY_INFO(0, files, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_serverrequestfactory_parseuri, 0, 2, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_OBJ_INFO(0, server, Phalcon\\Support\\Collection\\CollectionInterface, 0) - ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Support\\Collection\\CollectionInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_serverrequestfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, createServerRequest, arginfo_phalcon_http_message_serverrequestfactory_createserverrequest, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, load, arginfo_phalcon_http_message_serverrequestfactory_load, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeaders, arginfo_phalcon_http_message_serverrequestfactory_getheaders, ZEND_ACC_PROTECTED) -#else - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeaders, NULL, ZEND_ACC_PROTECTED) -#endif - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriHost, arginfo_phalcon_http_message_serverrequestfactory_calculateurihost, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriHostFromHeader, arginfo_phalcon_http_message_serverrequestfactory_calculateurihostfromheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriPath, arginfo_phalcon_http_message_serverrequestfactory_calculateuripath, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriQuery, arginfo_phalcon_http_message_serverrequestfactory_calculateuriquery, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, calculateUriScheme, arginfo_phalcon_http_message_serverrequestfactory_calculateurischeme, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, checkNullArray, arginfo_phalcon_http_message_serverrequestfactory_checknullarray, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, createUploadedFile, arginfo_phalcon_http_message_serverrequestfactory_createuploadedfile, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, getHeader, arginfo_phalcon_http_message_serverrequestfactory_getheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseCookieHeader, arginfo_phalcon_http_message_serverrequestfactory_parsecookieheader, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseHeaders, arginfo_phalcon_http_message_serverrequestfactory_parseheaders, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseProtocol, arginfo_phalcon_http_message_serverrequestfactory_parseprotocol, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseServer, arginfo_phalcon_http_message_serverrequestfactory_parseserver, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseUploadedFiles, arginfo_phalcon_http_message_serverrequestfactory_parseuploadedfiles, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_ServerRequestFactory, parseUri, arginfo_phalcon_http_message_serverrequestfactory_parseuri, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/stream.zep.c b/ext/phalcon/http/message/stream.zep.c deleted file mode 100644 index c37b142bcb6..00000000000 --- a/ext/phalcon/http/message/stream.zep.c +++ /dev/null @@ -1,887 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/operators.h" -#include "kernel/object.h" -#include "kernel/file.h" -#include "kernel/array.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-7 Stream - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, Stream, phalcon, http_message_stream, phalcon_http_message_stream_method_entry, 0); - - /** - * @var resource | null - */ - zend_declare_property_null(phalcon_http_message_stream_ce, SL("handle"), ZEND_ACC_PROTECTED); - /** - * @var resource | string - */ - zend_declare_property_null(phalcon_http_message_stream_ce, SL("stream"), ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_stream_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))); - return SUCCESS; -} - -/** - * Stream constructor. - * - * @param mixed $stream - * @param string $mode - */ -PHP_METHOD(Phalcon_Http_Message_Stream, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *stream, stream_sub, *mode_param = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &stream, &mode_param); - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "rb"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstream", NULL, 0, stream, &mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Closes the stream when the destructed. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, __destruct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "close", NULL, 0); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - */ -PHP_METHOD(Phalcon_Http_Message_Stream, __toString) -{ - zval _0$$3, _1$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$4); - - - ZEPHIR_MM_GROW(); - - - /* try_start_1: */ - - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "isreadable", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - if (UNEXPECTED(zephir_is_true(&_0$$3))) { - ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "isseekable", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - if (UNEXPECTED(zephir_is_true(&_1$$4))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcontents", NULL, 0); - zephir_check_call_status_or_jump(try_end_1); - RETURN_MM(); - } - - try_end_1: - - zend_clear_exception(); - RETURN_MM_STRING(""); -} - -/** - * Closes the stream and any underlying resources. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, close) -{ - zval handle, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (EXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&handle, this_ptr, "detach", NULL, 0); - zephir_check_call_status(); - zephir_fclose(&handle); - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Separates any underlying resources from the stream. - * - * After the stream has been detached, the stream is in an unusable state. - * - * @return resource | null - */ -PHP_METHOD(Phalcon_Http_Message_Stream, detach) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval __$null, handle, _0; - zval *this_ptr = getThis(); - - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&handle, &_0); - zephir_update_property_zval(this_ptr, ZEND_STRL("handle"), &__$null); - RETURN_CCTOR(&handle); -} - -/** - * Returns true if the stream is at the end of the stream. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, eof) -{ - zval _0, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - RETURN_BOOL(zephir_feof(&_1$$3)); - } - RETURN_BOOL(1); -} - -/** - * Returns the remaining contents in a string - */ -PHP_METHOD(Phalcon_Http_Message_Stream, getContents) -{ - zval data, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkreadable", NULL, 78); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&data, "stream_get_contents", NULL, 79, &_0); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&data))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not read from the file/stream", "phalcon/Http/Message/Stream.zep", 139); - return; - } - RETURN_CCTOR(&data); -} - -/** - * Get stream metadata as an associative array or retrieve a specific key. - * - * The keys returned are identical to the keys returned from PHP's - * stream_get_meta_data() function. - * - * @param mixed|null $key - * - * @return array|mixed|null - */ -PHP_METHOD(Phalcon_Http_Message_Stream, getMetadata) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL, key_sub, __$null, metadata, _0, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&metadata); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(key) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &key); - if (!key) { - key = &key_sub; - key = &__$null; - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { - RETURN_MM_NULL(); - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&metadata, "stream_get_meta_data", NULL, 80, &_1); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(key) == IS_NULL)) { - RETURN_CCTOR(&metadata); - } - ZEPHIR_INIT_VAR(&_2); - array_init(&_2); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getarrval", NULL, 81, &metadata, key, &_2); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Get the size of the stream if known. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, getSize) -{ - zval stats, _0, _1$$3, _2$$4, _3$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stats); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (EXPECTED(Z_TYPE_P(&_0) != IS_NULL)) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&stats, "fstat", NULL, 82, &_1$$3); - zephir_check_call_status(); - if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&stats))) { - ZEPHIR_INIT_VAR(&_2$$4); - ZVAL_STRING(&_2$$4, "size"); - ZVAL_NULL(&_3$$4); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getarrval", NULL, 81, &stats, &_2$$4, &_3$$4); - zephir_check_call_status(); - RETURN_MM(); - } - } - RETURN_MM_NULL(); -} - -/** - * Returns whether or not the stream is readable. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, isReadable) -{ - zval _2; - zval mode, _0, _1, _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "mode"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - zephir_cast_to_string(&_2, &_0); - ZEPHIR_CPY_WRT(&mode, &_2); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "r+"); - ZEPHIR_CALL_FUNCTION(&_3, "strpbrk", NULL, 83, &mode, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); -} - -/** - * Returns whether or not the stream is seekable. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, isSeekable) -{ - zval _0, _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "seekable"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(&_0)); -} - -/** - * Returns whether or not the stream is writable. - */ -PHP_METHOD(Phalcon_Http_Message_Stream, isWritable) -{ - zval _2; - zval mode, _0, _1, _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "mode"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmetadata", NULL, 0, &_1); - zephir_check_call_status(); - zephir_cast_to_string(&_2, &_0); - ZEPHIR_CPY_WRT(&mode, &_2); - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "xwca+"); - ZEPHIR_CALL_FUNCTION(&_3, "strpbrk", NULL, 83, &mode, &_1); - zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); -} - -/** - * Read data from the stream. - * - * @param int $length - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Stream, read) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *length, length_sub, data, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&length_sub); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &length); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkreadable", NULL, 78); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&data, "fread", NULL, 84, &_0, length); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&data))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not read from the file/stream", "phalcon/Http/Message/Stream.zep", 239); - return; - } - RETURN_CCTOR(&data); -} - -/** - * Seek to the beginning of the stream. - * - * If the stream is not seekable, this method will raise an exception; - * otherwise, it will perform a seek(0). - */ -PHP_METHOD(Phalcon_Http_Message_Stream, rewind) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 0, &_0); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Seek to a position in the stream. - * - * @param int $offset - * @param int $whence - */ -PHP_METHOD(Phalcon_Http_Message_Stream, seek) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *offset, offset_sub, *whence = NULL, whence_sub, seeker, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&offset_sub); - ZVAL_UNDEF(&whence_sub); - ZVAL_UNDEF(&seeker); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(offset) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(whence) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &offset, &whence); - if (!whence) { - whence = &whence_sub; - ZEPHIR_INIT_VAR(whence); - ZVAL_LONG(whence, 0); - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkseekable", NULL, 85); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&seeker, "fseek", NULL, 86, &_0, offset, whence); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&seeker, 0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not seek on the file pointer", "phalcon/Http/Message/Stream.zep", 272); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Sets the stream - existing instance - * - * @param mixed $stream - * @param string $mode - */ -PHP_METHOD(Phalcon_Http_Message_Stream, setStream) -{ - zend_bool _7, _8; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval mode; - zval *stream, stream_sub, *mode_param = NULL, __$false, handle, version, _9, _10, _0$$3, _1$$3, _2$$3, _3$$4, _4$$4, _5$$5, _6$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&version); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &stream, &mode_param); - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "rb"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - ZEPHIR_CPY_WRT(&handle, stream); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - if (EXPECTED(Z_TYPE_P(stream) == IS_STRING)) { - ZEPHIR_INIT_VAR(&_0$$3); - ZVAL_STRING(&_0$$3, "8.0"); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, ">="); - ZEPHIR_CALL_FUNCTION(&_2$$3, "version_compare", NULL, 88, &version, &_0$$3, &_1$$3); - zephir_check_call_status(); - if (zephir_is_true(&_2$$3)) { - ZEPHIR_INIT_VAR(&_3$$4); - ZEPHIR_INIT_NVAR(&_3$$4); - zephir_create_closure_ex(&_3$$4, NULL, phalcon_0__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$4, &_4$$4); - zephir_check_call_status(); - } else { - ZEPHIR_INIT_VAR(&_5$$5); - ZEPHIR_INIT_NVAR(&_5$$5); - zephir_create_closure_ex(&_5$$5, NULL, phalcon_1__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$5, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$5, &_6$$5); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, stream, &mode); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); - zephir_check_call_status(); - } - _7 = ZEPHIR_GLOBAL(warning).enable; - if (!(_7)) { - _7 = Z_TYPE_P(&handle) != IS_RESOURCE; - } - _8 = _7; - if (!(_8)) { - ZEPHIR_CALL_FUNCTION(&_9, "get_resource_type", NULL, 92, &handle); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "stream"); - _8 = !ZEPHIR_IS_IDENTICAL(&_10, &_9); - } - if (UNEXPECTED(_8)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The stream provided is not valid (string/resource) or could not be opened.", "phalcon/Http/Message/Stream.zep", 320); - return; - } - zephir_update_property_zval(this_ptr, ZEND_STRL("handle"), &handle); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), stream); - ZEPHIR_MM_RESTORE(); -} - -/** - * Returns the current position of the file read/write pointer - * - * @return int - */ -PHP_METHOD(Phalcon_Http_Message_Stream, tell) -{ - zval position, _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&position); - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&position, "ftell", NULL, 93, &_0); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&position) != IS_LONG)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_ce_exception, "Could not retrieve the pointer position", "phalcon/Http/Message/Stream.zep", 341); - return; - } - RETURN_CCTOR(&position); -} - -/** - * Write data to the stream. - * - * @param string $data - * - * @return int - */ -PHP_METHOD(Phalcon_Http_Message_Stream, write) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, bytes, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&bytes); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkhandle", NULL, 77); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkwritable", NULL, 94); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&bytes); - zephir_fwrite(&bytes, &_0, data); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&bytes))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "Could not write to the file/stream", "phalcon/Http/Message/Stream.zep", 364); - return; - } - RETURN_CCTOR(&bytes); -} - -/** - * Checks if a handle is available and throws an exception otherwise - */ -PHP_METHOD(Phalcon_Http_Message_Stream, checkHandle) -{ - zval _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_0) == IS_NULL)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(spl_ce_RuntimeException, "A valid resource is required.", "phalcon/Http/Message/Stream.zep", 376); - return; - } -} - -/** - * Checks if a handle is readable and throws an exception otherwise - */ -PHP_METHOD(Phalcon_Http_Message_Stream, checkReadable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isreadable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not readable.", "phalcon/Http/Message/Stream.zep", 386); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Checks if a handle is seekable and throws an exception otherwise - */ -PHP_METHOD(Phalcon_Http_Message_Stream, checkSeekable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isseekable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not seekable.", "phalcon/Http/Message/Stream.zep", 396); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Checks if a handle is writeable and throws an exception otherwise - */ -PHP_METHOD(Phalcon_Http_Message_Stream, checkWritable) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "iswritable", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_RuntimeException, "The resource is not writable.", "phalcon/Http/Message/Stream.zep", 406); - return; - } - ZEPHIR_MM_RESTORE(); -} - -/** - * @todo Remove this when we get traits - */ -PHP_METHOD(Phalcon_Http_Message_Stream, getArrVal) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; - zval collection; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ARRAY(collection) - Z_PARAM_ZVAL(index) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); - ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - RETURN_CTOR(&value); -} - diff --git a/ext/phalcon/http/message/stream.zep.h b/ext/phalcon/http/message/stream.zep.h deleted file mode 100644 index ec5316f8a1a..00000000000 --- a/ext/phalcon/http/message/stream.zep.h +++ /dev/null @@ -1,146 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_stream_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream); - -PHP_METHOD(Phalcon_Http_Message_Stream, __construct); -PHP_METHOD(Phalcon_Http_Message_Stream, __destruct); -PHP_METHOD(Phalcon_Http_Message_Stream, __toString); -PHP_METHOD(Phalcon_Http_Message_Stream, close); -PHP_METHOD(Phalcon_Http_Message_Stream, detach); -PHP_METHOD(Phalcon_Http_Message_Stream, eof); -PHP_METHOD(Phalcon_Http_Message_Stream, getContents); -PHP_METHOD(Phalcon_Http_Message_Stream, getMetadata); -PHP_METHOD(Phalcon_Http_Message_Stream, getSize); -PHP_METHOD(Phalcon_Http_Message_Stream, isReadable); -PHP_METHOD(Phalcon_Http_Message_Stream, isSeekable); -PHP_METHOD(Phalcon_Http_Message_Stream, isWritable); -PHP_METHOD(Phalcon_Http_Message_Stream, read); -PHP_METHOD(Phalcon_Http_Message_Stream, rewind); -PHP_METHOD(Phalcon_Http_Message_Stream, seek); -PHP_METHOD(Phalcon_Http_Message_Stream, setStream); -PHP_METHOD(Phalcon_Http_Message_Stream, tell); -PHP_METHOD(Phalcon_Http_Message_Stream, write); -PHP_METHOD(Phalcon_Http_Message_Stream, checkHandle); -PHP_METHOD(Phalcon_Http_Message_Stream, checkReadable); -PHP_METHOD(Phalcon_Http_Message_Stream, checkSeekable); -PHP_METHOD(Phalcon_Http_Message_Stream, checkWritable); -PHP_METHOD(Phalcon_Http_Message_Stream, getArrVal); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream___construct, 0, 0, 1) - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream___destruct, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_close, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_detach, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_eof, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_getcontents, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_getmetadata, 0, 0, 0) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_getsize, 0, 0, IS_LONG, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_isreadable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_isseekable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_iswritable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_rewind, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_seek, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, whence) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_setstream, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_tell, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_write, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, data) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkhandle, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkreadable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkseekable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_checkwritable, 0, 0, IS_VOID, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_getarrval, 0, 0, 2) - ZEND_ARG_ARRAY_INFO(0, collection, 0) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream, __construct, arginfo_phalcon_http_message_stream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream, __destruct, arginfo_phalcon_http_message_stream___destruct, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) -#else - PHP_ME(Phalcon_Http_Message_Stream, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) -#endif - PHP_ME(Phalcon_Http_Message_Stream, __toString, arginfo_phalcon_http_message_stream___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, close, arginfo_phalcon_http_message_stream_close, ZEND_ACC_PUBLIC) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream, detach, arginfo_phalcon_http_message_stream_detach, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_Stream, detach, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_Stream, eof, arginfo_phalcon_http_message_stream_eof, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getContents, arginfo_phalcon_http_message_stream_getcontents, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getMetadata, arginfo_phalcon_http_message_stream_getmetadata, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, getSize, arginfo_phalcon_http_message_stream_getsize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isReadable, arginfo_phalcon_http_message_stream_isreadable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isSeekable, arginfo_phalcon_http_message_stream_isseekable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, isWritable, arginfo_phalcon_http_message_stream_iswritable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, read, arginfo_phalcon_http_message_stream_read, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, rewind, arginfo_phalcon_http_message_stream_rewind, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, seek, arginfo_phalcon_http_message_stream_seek, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, setStream, arginfo_phalcon_http_message_stream_setstream, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, tell, arginfo_phalcon_http_message_stream_tell, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, write, arginfo_phalcon_http_message_stream_write, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream, checkHandle, arginfo_phalcon_http_message_stream_checkhandle, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkReadable, arginfo_phalcon_http_message_stream_checkreadable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkSeekable, arginfo_phalcon_http_message_stream_checkseekable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, checkWritable, arginfo_phalcon_http_message_stream_checkwritable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Stream, getArrVal, arginfo_phalcon_http_message_stream_getarrval, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/stream/input.zep.c b/ext/phalcon/http/message/stream/input.zep.c deleted file mode 100644 index d1d0fb110cd..00000000000 --- a/ext/phalcon/http/message/stream/input.zep.c +++ /dev/null @@ -1,243 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../../ext_config.h" -#endif - -#include -#include "../../../../php_ext.h" -#include "../../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/object.h" -#include "kernel/operators.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Describes a data stream from "php://input" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Input) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Input, phalcon, http_message_stream_input, phalcon_http_message_stream_ce, phalcon_http_message_stream_input_method_entry, 0); - - /** - * @var string - */ - zend_declare_property_string(phalcon_http_message_stream_input_ce, SL("data"), "", ZEND_ACC_PRIVATE); - /** - * @var bool - */ - zend_declare_property_bool(phalcon_http_message_stream_input_ce, SL("eof"), 0, ZEND_ACC_PRIVATE); - return SUCCESS; -} - -/** - * Input constructor. - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Input, __construct) -{ - zval _1, _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://input"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "rb"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_input_ce, getThis(), "__construct", &_0, 0, &_1, &_2); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Input, __toString) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "getcontents", NULL, 0); - zephir_check_call_status(); - RETURN_MM_MEMBER(getThis(), "data"); -} - -/** - * Returns the remaining contents in a string - * - * @param int $length - * - * @throws \RuntimeException If unable to read or if error occurs while reading. - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Input, getContents) -{ - zend_bool _3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *length_param = NULL, __$true, __$false, data, _0, _1, _2, _4; - zend_long length, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_LONG(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &length_param); - if (!length_param) { - length = -1; - } else { - length = zephir_get_intval(length_param); - } - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("handle"), PH_NOISY_CC | PH_READONLY); - ZVAL_LONG(&_2, length); - ZEPHIR_CALL_FUNCTION(&data, "stream_get_contents", NULL, 79, &_1, &_2); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); - _3 = -1 == length; - if (!(_3)) { - ZEPHIR_CALL_METHOD(&_4, this_ptr, "eof", NULL, 0); - zephir_check_call_status(); - _3 = zephir_is_true(&_4); - } - if (UNEXPECTED(_3)) { - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$false); - } - } - RETURN_MM_MEMBER(getThis(), "data"); -} - -/** - * Returns whether or not the stream is writeable. - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Input, isWritable) -{ - zval *this_ptr = getThis(); - - - - RETURN_BOOL(0); -} - -/** - * Read data from the stream. - * - * @param int $length - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Input, read) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *length, length_sub, __$true, __$false, data, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&length_sub); - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(length) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &length); - - - ZEPHIR_CALL_PARENT(&data, phalcon_http_message_stream_input_ce, getThis(), "read", &_0, 0, length); - zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("eof"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_1))) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); - } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "eof", NULL, 0); - zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_2))) { - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("eof"), &__$false); - } - } - RETURN_CCTOR(&data); -} - diff --git a/ext/phalcon/http/message/stream/input.zep.h b/ext/phalcon/http/message/stream/input.zep.h deleted file mode 100644 index 6d16ae15d6d..00000000000 --- a/ext/phalcon/http/message/stream/input.zep.h +++ /dev/null @@ -1,40 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_stream_input_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Input); - -PHP_METHOD(Phalcon_Http_Message_Stream_Input, __construct); -PHP_METHOD(Phalcon_Http_Message_Stream_Input, __toString); -PHP_METHOD(Phalcon_Http_Message_Stream_Input, getContents); -PHP_METHOD(Phalcon_Http_Message_Stream_Input, isWritable); -PHP_METHOD(Phalcon_Http_Message_Stream_Input, read); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_input___construct, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_getcontents, 0, 0, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_iswritable, 0, 0, _IS_BOOL, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_stream_input_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, length) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_input_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_Stream_Input, __construct, arginfo_phalcon_http_message_stream_input___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#else - PHP_ME(Phalcon_Http_Message_Stream_Input, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#endif - PHP_ME(Phalcon_Http_Message_Stream_Input, __toString, arginfo_phalcon_http_message_stream_input___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, getContents, arginfo_phalcon_http_message_stream_input_getcontents, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, isWritable, arginfo_phalcon_http_message_stream_input_iswritable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Stream_Input, read, arginfo_phalcon_http_message_stream_input_read, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/stream/memory.zep.c b/ext/phalcon/http/message/stream/memory.zep.c deleted file mode 100644 index 9f6b43c5d6f..00000000000 --- a/ext/phalcon/http/message/stream/memory.zep.c +++ /dev/null @@ -1,83 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../../ext_config.h" -#endif - -#include -#include "../../../../php_ext.h" -#include "../../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Describes a data stream from "php://memory" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Memory) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Memory, phalcon, http_message_stream_memory, phalcon_http_message_stream_ce, phalcon_http_message_stream_memory_method_entry, 0); - - return SUCCESS; -} - -/** - * Constructor - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Memory, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *mode = NULL, mode_sub, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode_sub); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &mode); - if (!mode) { - mode = &mode_sub; - ZEPHIR_INIT_VAR(mode); - ZVAL_STRING(mode, "rb"); - } - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://memory"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_memory_ce, getThis(), "__construct", &_0, 0, &_1, mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - diff --git a/ext/phalcon/http/message/stream/memory.zep.h b/ext/phalcon/http/message/stream/memory.zep.h deleted file mode 100644 index f32a6d40c73..00000000000 --- a/ext/phalcon/http/message/stream/memory.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_stream_memory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Memory); - -PHP_METHOD(Phalcon_Http_Message_Stream_Memory, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_memory___construct, 0, 0, 0) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_memory_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream_Memory, __construct, arginfo_phalcon_http_message_stream_memory___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/stream/temp.zep.c b/ext/phalcon/http/message/stream/temp.zep.c deleted file mode 100644 index 41a8f242885..00000000000 --- a/ext/phalcon/http/message/stream/temp.zep.c +++ /dev/null @@ -1,83 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../../ext_config.h" -#endif - -#include -#include "../../../../php_ext.h" -#include "../../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * Describes a data stream from "php://temp" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Temp) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message\\Stream, Temp, phalcon, http_message_stream_temp, phalcon_http_message_stream_ce, phalcon_http_message_stream_temp_method_entry, 0); - - return SUCCESS; -} - -/** - * Constructor - */ -PHP_METHOD(Phalcon_Http_Message_Stream_Temp, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *mode = NULL, mode_sub, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&mode_sub); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &mode); - if (!mode) { - mode = &mode_sub; - ZEPHIR_INIT_VAR(mode); - ZVAL_STRING(mode, "rb"); - } - - - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "php://temp"); - ZEPHIR_CALL_PARENT(NULL, phalcon_http_message_stream_temp_ce, getThis(), "__construct", &_0, 0, &_1, mode); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - diff --git a/ext/phalcon/http/message/stream/temp.zep.h b/ext/phalcon/http/message/stream/temp.zep.h deleted file mode 100644 index c24fbc139d1..00000000000 --- a/ext/phalcon/http/message/stream/temp.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_stream_temp_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Stream_Temp); - -PHP_METHOD(Phalcon_Http_Message_Stream_Temp, __construct); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_stream_temp___construct, 0, 0, 0) - ZEND_ARG_INFO(0, mode) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_stream_temp_method_entry) { - PHP_ME(Phalcon_Http_Message_Stream_Temp, __construct, arginfo_phalcon_http_message_stream_temp___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/streamfactory.zep.c b/ext/phalcon/http/message/streamfactory.zep.c deleted file mode 100644 index cfa3c4db821..00000000000 --- a/ext/phalcon/http/message/streamfactory.zep.c +++ /dev/null @@ -1,226 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "kernel/exception.h" -#include "kernel/file.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-17 StreamFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_StreamFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, StreamFactory, phalcon, http_message_streamfactory, phalcon_http_message_streamfactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_streamfactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\streamfactoryinterface"))); - return SUCCESS; -} - -/** - * Create a new stream from a string. - * - * The stream SHOULD be created with a temporary resource. - * - * @param string $content String content with which to populate the stream. - * - * @return StreamInterface - */ -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStream) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content_param = NULL, handle, _0, _1; - zval content; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(content) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &content_param); - if (!content_param) { - ZEPHIR_INIT_VAR(&content); - ZVAL_STRING(&content, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(&content, content_param); - } else { - ZEPHIR_INIT_VAR(&content); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "php://temp"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "r+b"); - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, &_0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&handle))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Cannot write to file.", "phalcon/Http/Message/StreamFactory.zep", 41); - return; - } - zephir_fwrite(NULL, &handle, &content); - ZEPHIR_CALL_FUNCTION(NULL, "rewind", NULL, 389, &handle); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createstreamfromresource", NULL, 390, &handle); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Create a stream from an existing file. - * - * The file MUST be opened using the given mode, which may be any mode - * supported by the `fopen` function. - * - * The `$filename` MAY be any string supported by `fopen()`. - * - * @param string $filename The filename or stream URI to use as basis of - * stream. - * @param string $mode The mode with which to open the underlying - * filename/stream. - * - * @return StreamInterface - */ -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filename_param = NULL, *mode_param = NULL; - zval filename, mode; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&filename); - ZVAL_UNDEF(&mode); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(filename) - Z_PARAM_OPTIONAL - Z_PARAM_STR(mode) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &filename_param, &mode_param); - if (UNEXPECTED(Z_TYPE_P(filename_param) != IS_STRING && Z_TYPE_P(filename_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filename' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(filename_param) == IS_STRING)) { - zephir_get_strval(&filename, filename_param); - } else { - ZEPHIR_INIT_VAR(&filename); - } - if (!mode_param) { - ZEPHIR_INIT_VAR(&mode); - ZVAL_STRING(&mode, "r+b"); - } else { - if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(&mode, mode_param); - } else { - ZEPHIR_INIT_VAR(&mode); - } - } - - - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, &filename, &mode); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Create a new stream from an existing resource. - * - * The stream MUST be readable and may be writable. - */ -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromResource) -{ - zend_bool _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *phpResource, phpResource_sub, _1, _2; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&phpResource_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(phpResource) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &phpResource); - - - _0 = Z_TYPE_P(phpResource) != IS_RESOURCE; - if (!(_0)) { - ZEPHIR_CALL_FUNCTION(&_1, "get_resource_type", NULL, 92, phpResource); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "stream"); - _0 = !ZEPHIR_IS_IDENTICAL(&_2, &_1); - } - if (UNEXPECTED(_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream provided", "phalcon/Http/Message/StreamFactory.zep", 79); - return; - } - object_init_ex(return_value, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 43, phpResource); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/streamfactory.zep.h b/ext/phalcon/http/message/streamfactory.zep.h deleted file mode 100644 index ef993540613..00000000000 --- a/ext/phalcon/http/message/streamfactory.zep.h +++ /dev/null @@ -1,28 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_streamfactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_StreamFactory); - -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStream); -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromFile); -PHP_METHOD(Phalcon_Http_Message_StreamFactory, createStreamFromResource); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstream, 0, 0, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstreamfromfile, 0, 1, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_streamfactory_createstreamfromresource, 0, 1, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_INFO(0, phpResource) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_streamfactory_method_entry) { - PHP_ME(Phalcon_Http_Message_StreamFactory, createStream, arginfo_phalcon_http_message_streamfactory_createstream, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_StreamFactory, createStreamFromFile, arginfo_phalcon_http_message_streamfactory_createstreamfromfile, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_StreamFactory, createStreamFromResource, arginfo_phalcon_http_message_streamfactory_createstreamfromresource, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/uploadedfile.zep.c b/ext/phalcon/http/message/uploadedfile.zep.c deleted file mode 100644 index dec8d2092ea..00000000000 --- a/ext/phalcon/http/message/uploadedfile.zep.c +++ /dev/null @@ -1,729 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/exception.h" -#include "kernel/string.h" -#include "kernel/array.h" -#include "kernel/file.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-7 UploadedFile - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFile) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UploadedFile, phalcon, http_message_uploadedfile, phalcon_http_message_uploadedfile_method_entry, ZEND_ACC_FINAL_CLASS); - - /** - * If the file has already been moved, we hold that status here - * - * @var bool - */ - zend_declare_property_bool(phalcon_http_message_uploadedfile_ce, SL("alreadyMoved"), 0, ZEND_ACC_PRIVATE); - /** - * Retrieve the filename sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious filename with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'name' key of - * the file in the $_FILES array. - * - * @var string | null - */ - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("clientFilename"), ZEND_ACC_PRIVATE); - /** - * Retrieve the media type sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious media type with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'type' key of - * the file in the $_FILES array. - * - * @var string | null - */ - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("clientMediaType"), ZEND_ACC_PRIVATE); - /** - * Retrieve the error associated with the uploaded file. - * - * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants. - * - * If the file was uploaded successfully, this method MUST return - * UPLOAD_ERR_OK. - * - * Implementations SHOULD return the value stored in the 'error' key of - * the file in the $_FILES array. - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @var int - */ - zend_declare_property_long(phalcon_http_message_uploadedfile_ce, SL("error"), 0, ZEND_ACC_PRIVATE); - /** - * If the stream is a string (file name) we store it here - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uploadedfile_ce, SL("fileName"), "", ZEND_ACC_PRIVATE); - /** - * Retrieve the file size. - * - * Implementations SHOULD return the value stored in the 'size' key of - * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. - * - * @var int | null - */ - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("size"), ZEND_ACC_PRIVATE); - /** - * Holds the stream/string for the uploaded file - * - * @var StreamInterface|string|null - */ - zend_declare_property_null(phalcon_http_message_uploadedfile_ce, SL("stream"), ZEND_ACC_PRIVATE); - zend_class_implements(phalcon_http_message_uploadedfile_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uploadedfileinterface"))); - return SUCCESS; -} - -/** - * Retrieve the filename sent by the client. - * - * - * Do not trust the value returned by this method. A client could send - * a malicious filename with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'name' key of - * the file in the $_FILES array. - * - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientFilename) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "clientFilename"); -} - -/** - * Retrieve the media type sent by the client. - * - * - * Do not trust the value returned by this method. A client could send - * a malicious media type with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'type' key of - * the file in the $_FILES array. - * - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientMediaType) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "clientMediaType"); -} - -/** - * Retrieve the error associated with the uploaded file. - * - * - * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants. - * - * If the file was uploaded successfully, this method MUST return - * UPLOAD_ERR_OK. - * - * Implementations SHOULD return the value stored in the 'error' key of - * the file in the $_FILES array. - * - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getError) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "error"); -} - -/** - * Retrieve the file size. - * - * - * Implementations SHOULD return the value stored in the 'size' key of - * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. - * - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getSize) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "size"); -} - -/** - * UploadedFile constructor. - * - * @param StreamInterface|string|null $stream - * @param int|null $size - * @param int $error - * @param string|null $clientFilename - * @param string|null $clientMediaType - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval clientFilename, clientMediaType; - zend_long size, error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *size_param = NULL, *error_param = NULL, *clientFilename_param = NULL, *clientMediaType_param = NULL, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&clientFilename); - ZVAL_UNDEF(&clientMediaType); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 5) - Z_PARAM_ZVAL(stream) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(size, is_null_true) - Z_PARAM_LONG(error) - Z_PARAM_STR_OR_NULL(clientFilename) - Z_PARAM_STR_OR_NULL(clientMediaType) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 4, &stream, &size_param, &error_param, &clientFilename_param, &clientMediaType_param); - if (!size_param) { - size = 0; - } else { - size = zephir_get_intval(size_param); - } - if (!error_param) { - error = 0; - } else { - error = zephir_get_intval(error_param); - } - if (!clientFilename_param) { - ZEPHIR_INIT_VAR(&clientFilename); - } else { - zephir_get_strval(&clientFilename, clientFilename_param); - } - if (!clientMediaType_param) { - ZEPHIR_INIT_VAR(&clientMediaType); - } else { - zephir_get_strval(&clientMediaType, clientMediaType_param); - } - - - ZVAL_LONG(&_0, error); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstream", NULL, 391, stream, &_0); - zephir_check_call_status(); - ZVAL_LONG(&_0, error); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkerror", NULL, 392, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(&_0, size); - zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_0); - zephir_update_property_zval(this_ptr, ZEND_STRL("clientFilename"), &clientFilename); - zephir_update_property_zval(this_ptr, ZEND_STRL("clientMediaType"), &clientMediaType); - ZEPHIR_MM_RESTORE(); -} - -/** - * Retrieve a stream representing the uploaded file. - * - * This method MUST return a StreamInterface instance, representing the - * uploaded file. The purpose of this method is to allow utilizing native - * PHP stream functionality to manipulate the file upload, such as - * stream_copy_to_stream() (though the result will need to be decorated in - * a native PHP stream wrapper to work with such functions). - * - * If the moveTo() method has been called previously, this method MUST - * raise an exception. - * - * @return StreamInterface Stream representation of the uploaded file. - * @throws RuntimeException in cases when no stream is available or can be created. - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getStream) -{ - zval _0, _4, _5, _1$$3, _2$$3, _3$$3, _6$$5, _7$$5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_6$$5); - ZVAL_UNDEF(&_7$$5); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_0, 0))) { - ZEPHIR_INIT_VAR(&_1$$3); - object_init_ex(&_1$$3, phalcon_http_message_exception_invalidargumentexception_ce); - zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "geterrordescription", NULL, 393, &_3$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 40, &_2$$3); - zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Http/Message/UploadedFile.zep", 156); - ZEPHIR_MM_RESTORE(); - return; - } - zephir_read_property(&_4, this_ptr, ZEND_STRL("alreadyMoved"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_4))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "The file has already been moved to the target location", "phalcon/Http/Message/UploadedFile.zep", 162); - return; - } - ZEPHIR_OBS_VAR(&_5); - zephir_read_property(&_5, this_ptr, ZEND_STRL("stream"), PH_NOISY_CC); - if (UNEXPECTED(!(zephir_is_instance_of(&_5, SL("Psr\\Http\\Message\\StreamInterface"))))) { - ZEPHIR_INIT_VAR(&_6$$5); - object_init_ex(&_6$$5, phalcon_http_message_stream_ce); - zephir_read_property(&_7$$5, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 43, &_7$$5); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), &_6$$5); - } - RETURN_MM_MEMBER(getThis(), "stream"); -} - -/** - * Move the uploaded file to a new location. - * - * Use this method as an alternative to move_uploaded_file(). This method is - * guaranteed to work in both SAPI and non-SAPI environments. - * Implementations must determine which environment they are in, and use the - * appropriate method (move_uploaded_file(), rename(), or a stream - * operation) to perform the operation. - * - * $targetPath may be an absolute path, or a relative path. If it is a - * relative path, resolution should be the same as used by PHP's rename() - * function. - * - * The original file or stream MUST be removed on completion. - * - * If this method is called more than once, any subsequent calls MUST raise - * an exception. - * - * When used in an SAPI environment where $_FILES is populated, when writing - * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be - * used to ensure permissions and upload status are verified correctly. - * - * If you wish to move to a stream, use getStream(), as SAPI operations - * cannot guarantee writing to stream destinations. - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws InvalidArgumentException if the $targetPath specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, moveTo) -{ - zend_bool _5, _6, _9, _13, _15, _16; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *targetPath, targetPath_sub, __$true, __$false, sapi, _0, _1, _7, _8, _10, _11, _12, _14, _2$$4, _3$$4, _4$$4, _17$$7, _18$$7; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&targetPath_sub); - ZVAL_BOOL(&__$true, 1); - ZVAL_BOOL(&__$false, 0); - ZVAL_UNDEF(&sapi); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_14); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_17$$7); - ZVAL_UNDEF(&_18$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(targetPath) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &targetPath); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("alreadyMoved"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "File has already been moved", "phalcon/Http/Message/UploadedFile.zep", 211); - return; - } - zephir_read_property(&_1, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_1, 0))) { - ZEPHIR_INIT_VAR(&_2$$4); - object_init_ex(&_2$$4, phalcon_http_message_exception_invalidargumentexception_ce); - zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("error"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "geterrordescription", NULL, 393, &_4$$4); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 40, &_3$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_2$$4, "phalcon/Http/Message/UploadedFile.zep", 217); - ZEPHIR_MM_RESTORE(); - return; - } - _5 = Z_TYPE_P(targetPath) == IS_STRING; - if (_5) { - _5 = !(ZEPHIR_IS_EMPTY(targetPath)); - } - _6 = _5; - if (_6) { - ZEPHIR_CALL_FUNCTION(&_7, "dirname", NULL, 394, targetPath); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8, "is_dir", NULL, 155, &_7); - zephir_check_call_status(); - _6 = zephir_is_true(&_8); - } - _9 = _6; - if (_9) { - ZEPHIR_CALL_FUNCTION(&_10, "dirname", NULL, 394, targetPath); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_11, "is_writable", NULL, 395, &_10); - zephir_check_call_status(); - _9 = zephir_is_true(&_11); - } - if (UNEXPECTED(!(_9))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Target folder is empty string, not a folder or not writable", "phalcon/Http/Message/UploadedFile.zep", 229); - return; - } - ZEPHIR_INIT_VAR(&_12); - ZVAL_STRING(&_12, "PHP_SAPI"); - ZEPHIR_CALL_FUNCTION(&sapi, "constant", NULL, 142, &_12); - zephir_check_call_status(); - _13 = ZEPHIR_IS_EMPTY(&sapi); - if (!(_13)) { - ZEPHIR_OBS_VAR(&_14); - zephir_read_property(&_14, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC); - _13 = !(ZEPHIR_IS_EMPTY(&_14)); - } - _15 = _13; - if (!(_15)) { - _15 = zephir_start_with_str(&sapi, SL("cli")); - } - _16 = _15; - if (!(_16)) { - _16 = zephir_start_with_str(&sapi, SL("phpdbg")); - } - if (UNEXPECTED(_16)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "storefile", NULL, 396, targetPath); - zephir_check_call_status(); - } else { - zephir_read_property(&_17$$7, this_ptr, ZEND_STRL("fileName"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_18$$7, "move_uploaded_file", NULL, 397, &_17$$7, targetPath); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_18$$7)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "The file cannot be moved to the target folder", "phalcon/Http/Message/UploadedFile.zep", 243); - return; - } - } - if (1) { - zephir_update_property_zval(this_ptr, ZEND_STRL("alreadyMoved"), &__$true); - } else { - zephir_update_property_zval(this_ptr, ZEND_STRL("alreadyMoved"), &__$false); - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Checks the passed error code and if not in the range throws an exception - * - * @param int $error - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkError) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *error_param = NULL, _0, _1, _2, _3; - zend_long error, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &error_param); - error = zephir_get_intval(error_param); - - - ZVAL_LONG(&_1, error); - ZVAL_LONG(&_2, 0); - ZVAL_LONG(&_3, 8); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isbetween", NULL, 398, &_1, &_2, &_3); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid error. Must be one of the UPLOAD_ERR_* constants", "phalcon/Http/Message/UploadedFile.zep", 260); - return; - } - ZEPHIR_INIT_ZVAL_NREF(_1); - ZVAL_LONG(&_1, error); - zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_1); - ZEPHIR_MM_RESTORE(); -} - -/** - * Checks the passed error code and if not in the range throws an exception - * - * @param StreamInterface|resource|string $stream - * @param int $error - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkStream) -{ - zend_bool _0$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *error_param = NULL, _1$$5; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_1$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(stream) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &stream, &error_param); - error = zephir_get_intval(error_param); - - - if (UNEXPECTED(0 == error)) { - do { - _0$$3 = 1; - if (_0$$3 == (Z_TYPE_P(stream) == IS_STRING)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("fileName"), stream); - break; - } - if (_0$$3 == (Z_TYPE_P(stream) == IS_RESOURCE)) { - ZEPHIR_INIT_VAR(&_1$$5); - object_init_ex(&_1$$5, phalcon_http_message_stream_ce); - ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 43, stream); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), &_1$$5); - break; - } - if (_0$$3 == (zephir_is_instance_of(stream, SL("Psr\\Http\\Message\\StreamInterface")))) { - zephir_update_property_zval(this_ptr, ZEND_STRL("stream"), stream); - break; - } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Invalid stream or file passed", "phalcon/Http/Message/UploadedFile.zep", 286); - return; - } while(0); - - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Returns a description string depending on the upload error code passed - * - * @param int $error - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getErrorDescription) -{ - zval errors; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *error_param = NULL, _0$$3; - zend_long error; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&errors); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(error) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &error_param); - error = zephir_get_intval(error_param); - - - ZEPHIR_INIT_VAR(&errors); - zephir_create_array(&errors, 8, 0); - add_index_stringl(&errors, 0, SL("There is no error, the file uploaded with success.")); - add_index_stringl(&errors, 1, SL("The uploaded file exceeds the upload_max_filesize directive in php.ini.")); - add_index_stringl(&errors, 2, SL("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.")); - add_index_stringl(&errors, 3, SL("The uploaded file was only partially uploaded.")); - add_index_stringl(&errors, 4, SL("No file was uploaded.")); - add_index_stringl(&errors, 6, SL("Missing a temporary folder.")); - add_index_stringl(&errors, 7, SL("Failed to write file to disk.")); - add_index_stringl(&errors, 8, SL("A PHP extension stopped the file upload.")); - if (EXPECTED((1 == zephir_array_isset_long(&errors, error)))) { - zephir_array_fetch_long(&_0$$3, &errors, error, PH_NOISY | PH_READONLY, "phalcon/Http/Message/UploadedFile.zep", 314); - RETURN_CTOR(&_0$$3); - } - RETURN_MM_STRING("Unknown upload error"); -} - -/** - * Store a file in the new location (stream) - * - * @param string $targetPath - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, storeFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *targetPath_param = NULL, data, handle, stream, _0, _1, _2$$4; - zval targetPath; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&targetPath); - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&handle); - ZVAL_UNDEF(&stream); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(targetPath) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &targetPath_param); - zephir_get_strval(&targetPath, targetPath_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "w+b"); - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 90, &targetPath, &_0); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&handle))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Cannot write to file.", "phalcon/Http/Message/UploadedFile.zep", 331); - return; - } - ZEPHIR_CALL_METHOD(&stream, this_ptr, "getstream", NULL, 399); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &stream, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &stream, "eof", NULL, 0); - zephir_check_call_status(); - if (!(!ZEPHIR_IS_TRUE_IDENTICAL(&_1))) { - break; - } - ZVAL_LONG(&_2$$4, 2048); - ZEPHIR_CALL_METHOD(&data, &stream, "read", &_3, 0, &_2$$4); - zephir_check_call_status(); - zephir_fwrite(NULL, &handle, &data); - } - zephir_fclose(&handle); - ZEPHIR_MM_RESTORE(); -} - -/** - * @todo Remove this when we get traits - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFile, isBetween) -{ - zend_bool _0; - zval *value_param = NULL, *from_param = NULL, *to_param = NULL; - zend_long value, from, to; - zval *this_ptr = getThis(); - -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_LONG(value) - Z_PARAM_LONG(from) - Z_PARAM_LONG(to) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - zephir_fetch_params_without_memory_grow(3, 0, &value_param, &from_param, &to_param); - value = zephir_get_intval(value_param); - from = zephir_get_intval(from_param); - to = zephir_get_intval(to_param); - - - _0 = value >= from; - if (_0) { - _0 = value <= to; - } - RETURN_BOOL(_0); -} - diff --git a/ext/phalcon/http/message/uploadedfile.zep.h b/ext/phalcon/http/message/uploadedfile.zep.h deleted file mode 100644 index 3eb852ee863..00000000000 --- a/ext/phalcon/http/message/uploadedfile.zep.h +++ /dev/null @@ -1,91 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_uploadedfile_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFile); - -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientFilename); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getClientMediaType); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getError); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getSize); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, __construct); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getStream); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, moveTo); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkError); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, checkStream); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, getErrorDescription); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, storeFile); -PHP_METHOD(Phalcon_Http_Message_UploadedFile, isBetween); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getclientfilename, 0, 0, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getclientmediatype, 0, 0, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_geterror, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getsize, 0, 0, IS_LONG, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uploadedfile___construct, 0, 0, 1) - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, clientFilename, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, clientMediaType, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uploadedfile_getstream, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_moveto, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, targetPath) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_checkerror, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_checkstream, 0, 2, IS_VOID, 0) - - ZEND_ARG_INFO(0, stream) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_geterrordescription, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_storefile, 0, 1, IS_VOID, 0) - - ZEND_ARG_TYPE_INFO(0, targetPath, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uploadedfile_isbetween, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, from, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, to, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_uploadedfile_method_entry) { - PHP_ME(Phalcon_Http_Message_UploadedFile, getClientFilename, arginfo_phalcon_http_message_uploadedfile_getclientfilename, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getClientMediaType, arginfo_phalcon_http_message_uploadedfile_getclientmediatype, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getError, arginfo_phalcon_http_message_uploadedfile_geterror, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, getSize, arginfo_phalcon_http_message_uploadedfile_getsize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, __construct, arginfo_phalcon_http_message_uploadedfile___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Http_Message_UploadedFile, getStream, arginfo_phalcon_http_message_uploadedfile_getstream, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Http_Message_UploadedFile, getStream, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Http_Message_UploadedFile, moveTo, arginfo_phalcon_http_message_uploadedfile_moveto, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_UploadedFile, checkError, arginfo_phalcon_http_message_uploadedfile_checkerror, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, checkStream, arginfo_phalcon_http_message_uploadedfile_checkstream, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, getErrorDescription, arginfo_phalcon_http_message_uploadedfile_geterrordescription, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, storeFile, arginfo_phalcon_http_message_uploadedfile_storefile, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_UploadedFile, isBetween, arginfo_phalcon_http_message_uploadedfile_isbetween, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/uploadedfilefactory.zep.c b/ext/phalcon/http/message/uploadedfilefactory.zep.c deleted file mode 100644 index fd45c4d1107..00000000000 --- a/ext/phalcon/http/message/uploadedfilefactory.zep.c +++ /dev/null @@ -1,119 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/operators.h" -#include "kernel/memory.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-17 UploadedFileFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFileFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UploadedFileFactory, phalcon, http_message_uploadedfilefactory, phalcon_http_message_uploadedfilefactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_uploadedfilefactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uploadedfilefactoryinterface"))); - return SUCCESS; -} - -/** - * Create a new uploaded file. - * - * If a size is not provided it will be determined by checking the size of - * the stream. - * - * @link http://php.net/manual/features.file-upload.post-method.php - * @link http://php.net/manual/features.file-upload.errors.php - * - * @param StreamInterface $stream The underlying stream representing the - * uploaded file content. - * @param int $size The size of the file in bytes. - * @param int $error The PHP file upload error. - * @param string $clientFilename The filename as provided by the client, if any. - * @param string $clientMediaType The media type as provided by the client, if any. - * - * @throws \InvalidArgumentException If the file resource is not readable. - */ -PHP_METHOD(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval clientFilename, clientMediaType; - zend_long size, error, ZEPHIR_LAST_CALL_STATUS; - zval *stream, stream_sub, *size_param = NULL, *error_param = NULL, *clientFilename_param = NULL, *clientMediaType_param = NULL, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&stream_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&clientFilename); - ZVAL_UNDEF(&clientMediaType); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 5) - Z_PARAM_OBJECT_OF_CLASS(stream, zephir_get_internal_ce(SL("psr\\http\\message\\streaminterface"))) - Z_PARAM_OPTIONAL - Z_PARAM_LONG_OR_NULL(size, is_null_true) - Z_PARAM_LONG(error) - Z_PARAM_STR_OR_NULL(clientFilename) - Z_PARAM_STR_OR_NULL(clientMediaType) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 4, &stream, &size_param, &error_param, &clientFilename_param, &clientMediaType_param); - if (!size_param) { - size = 0; - } else { - size = zephir_get_intval(size_param); - } - if (!error_param) { - error = 0; - } else { - error = zephir_get_intval(error_param); - } - if (!clientFilename_param) { - ZEPHIR_INIT_VAR(&clientFilename); - } else { - zephir_get_strval(&clientFilename, clientFilename_param); - } - if (!clientMediaType_param) { - ZEPHIR_INIT_VAR(&clientMediaType); - } else { - zephir_get_strval(&clientMediaType, clientMediaType_param); - } - - - object_init_ex(return_value, phalcon_http_message_uploadedfile_ce); - ZVAL_LONG(&_0, size); - ZVAL_LONG(&_1, error); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 374, stream, &_0, &_1, &clientFilename, &clientMediaType); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/uploadedfilefactory.zep.h b/ext/phalcon/http/message/uploadedfilefactory.zep.h deleted file mode 100644 index 39a79c07213..00000000000 --- a/ext/phalcon/http/message/uploadedfilefactory.zep.h +++ /dev/null @@ -1,19 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_uploadedfilefactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UploadedFileFactory); - -PHP_METHOD(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uploadedfilefactory_createuploadedfile, 0, 1, Psr\\Http\\Message\\UploadedFileInterface, 0) - ZEND_ARG_OBJ_INFO(0, stream, Psr\\Http\\Message\\StreamInterface, 0) - ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 1) - ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, clientFilename, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, clientMediaType, IS_STRING, 1) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_uploadedfilefactory_method_entry) { - PHP_ME(Phalcon_Http_Message_UploadedFileFactory, createUploadedFile, arginfo_phalcon_http_message_uploadedfilefactory_createuploadedfile, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/uri.zep.c b/ext/phalcon/http/message/uri.zep.c deleted file mode 100644 index 1abeedbb0a0..00000000000 --- a/ext/phalcon/http/message/uri.zep.c +++ /dev/null @@ -1,1584 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/memory.h" -#include "kernel/operators.h" -#include "kernel/fcall.h" -#include "kernel/string.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/concat.h" -#include "kernel/array.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-7 Uri - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Uri) -{ - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Http\\Message, Uri, phalcon, http_message_uri, phalcon_http_message_abstractcommon_ce, phalcon_http_message_uri_method_entry, ZEND_ACC_FINAL_CLASS); - - /** - * Returns the fragment of the URL - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("fragment"), "", ZEND_ACC_PROTECTED); - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("host"), "", ZEND_ACC_PROTECTED); - /** - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("pass"), "", ZEND_ACC_PROTECTED); - /** - * Returns the path of the URL - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("path"), "", ZEND_ACC_PROTECTED); - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard - * port used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @var int|null - */ - zend_declare_property_null(phalcon_http_message_uri_ce, SL("port"), ZEND_ACC_PROTECTED); - /** - * Returns the query of the URL - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("query"), "", ZEND_ACC_PROTECTED); - /** - * Retrieve the scheme component of the URI. - * - * If no scheme is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.1 - * - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("scheme"), "https", ZEND_ACC_PROTECTED); - /** - * @var string - */ - zend_declare_property_string(phalcon_http_message_uri_ce, SL("user"), "", ZEND_ACC_PROTECTED); - zend_class_implements(phalcon_http_message_uri_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\uriinterface"))); - return SUCCESS; -} - -/** - * Returns the fragment of the URL - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getFragment) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "fragment"); -} - -/** - * Retrieve the host component of the URI. - * - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getHost) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "host"); -} - -/** - * Returns the path of the URL - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getPath) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "path"); -} - -/** - * Retrieve the port component of the URI. - * - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard - * port used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getPort) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "port"); -} - -/** - * Returns the query of the URL - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getQuery) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "query"); -} - -/** - * Retrieve the scheme component of the URI. - * - * - * If no scheme is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getScheme) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "scheme"); -} - -/** - * Uri constructor. - * - * @param string $uri - */ -PHP_METHOD(Phalcon_Http_Message_Uri, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, urlParts, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3, _13$$3, _14$$3, _15$$3, _16$$3, _17$$3, _18$$3, _19$$3; - zval uri; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&urlParts); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$3); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_9$$3); - ZVAL_UNDEF(&_10$$3); - ZVAL_UNDEF(&_11$$3); - ZVAL_UNDEF(&_12$$3); - ZVAL_UNDEF(&_13$$3); - ZVAL_UNDEF(&_14$$3); - ZVAL_UNDEF(&_15$$3); - ZVAL_UNDEF(&_16$$3); - ZVAL_UNDEF(&_17$$3); - ZVAL_UNDEF(&_18$$3); - ZVAL_UNDEF(&_19$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &uri_param); - if (!uri_param) { - ZEPHIR_INIT_VAR(&uri); - ZVAL_STRING(&uri, ""); - } else { - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(&uri, uri_param); - } else { - ZEPHIR_INIT_VAR(&uri); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_0, &uri))) { - ZEPHIR_CALL_FUNCTION(&urlParts, "parse_url", NULL, 125, &uri); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&urlParts))) { - ZEPHIR_INIT_NVAR(&urlParts); - array_init(&urlParts); - } - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "fragment"); - ZEPHIR_INIT_VAR(&_4$$3); - ZVAL_STRING(&_4$$3, ""); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_3$$3, &_4$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "filterfragment", NULL, 401, &_2$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("fragment"), &_1$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "host"); - ZEPHIR_INIT_VAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - zephir_fast_strtolower(&_3$$3, &_5$$3); - zephir_update_property_zval(this_ptr, ZEND_STRL("host"), &_3$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "pass"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_7$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8$$3, "rawurlencode", NULL, 345, &_7$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("pass"), &_8$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "path"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_10$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$3, this_ptr, "filterpath", NULL, 402, &_10$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_9$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "port"); - ZVAL_NULL(&_13$$3); - ZEPHIR_CALL_METHOD(&_12$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_13$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$3, this_ptr, "filterport", NULL, 403, &_12$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("port"), &_11$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "query"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_15$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_14$$3, this_ptr, "filterquery", NULL, 404, &_15$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("query"), &_14$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "scheme"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_17$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16$$3, this_ptr, "filterscheme", NULL, 405, &_17$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("scheme"), &_16$$3); - ZEPHIR_INIT_NVAR(&_4$$3); - ZVAL_STRING(&_4$$3, "user"); - ZEPHIR_INIT_NVAR(&_6$$3); - ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_METHOD(&_18$$3, this_ptr, "getarrval", NULL, 400, &urlParts, &_4$$3, &_6$$3); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_19$$3, "rawurlencode", NULL, 345, &_18$$3); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("user"), &_19$$3); - } - ZEPHIR_MM_RESTORE(); -} - -/** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Uri, __toString) -{ - zend_bool _2, _3; - zval authority, path, uri, _0, _1, _4, _6, _7, _8, _9, _10, _11, _12, _13, _5$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&authority); - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&uri); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_8); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_13); - ZVAL_UNDEF(&_5$$3); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_CALL_METHOD(&authority, this_ptr, "getauthority", NULL, 406); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&path, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - _2 = !ZEPHIR_IS_IDENTICAL(&_1, &path); - if (_2) { - _2 = 1 != zephir_start_with_str(&path, SL("/")); - } - _3 = _2; - if (_3) { - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, ""); - _3 = !ZEPHIR_IS_IDENTICAL(&_4, &authority); - } - if (UNEXPECTED(_3)) { - ZEPHIR_INIT_VAR(&_5$$3); - ZEPHIR_CONCAT_SV(&_5$$3, "/", &path); - ZEPHIR_CPY_WRT(&path, &_5$$3); - } - zephir_read_property(&_0, this_ptr, ZEND_STRL("scheme"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_7); - ZVAL_STRING(&_7, ""); - ZEPHIR_INIT_VAR(&_8); - ZVAL_STRING(&_8, ":"); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "checkvalue", NULL, 407, &_0, &_7, &_8); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "//"); - ZEPHIR_CALL_METHOD(&_9, this_ptr, "checkvalue", NULL, 407, &authority, &_7); - zephir_check_call_status(); - zephir_read_property(&_11, this_ptr, ZEND_STRL("query"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "?"); - ZEPHIR_CALL_METHOD(&_10, this_ptr, "checkvalue", NULL, 407, &_11, &_7); - zephir_check_call_status(); - zephir_read_property(&_13, this_ptr, ZEND_STRL("fragment"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_NVAR(&_7); - ZVAL_STRING(&_7, "#"); - ZEPHIR_CALL_METHOD(&_12, this_ptr, "checkvalue", NULL, 407, &_13, &_7); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&uri); - ZEPHIR_CONCAT_VVVVV(&uri, &_6, &_9, &path, &_10, &_12); - RETURN_CCTOR(&uri); -} - -/** - * Retrieve the authority component of the URI. - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getAuthority) -{ - zval authority, userInfo, _0, _1, _2, _4, _3$$4, _5$$5, _6$$5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&authority); - ZVAL_UNDEF(&userInfo); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_3$$4); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$5); - - - ZEPHIR_MM_GROW(); - - zephir_read_property(&_0, this_ptr, ZEND_STRL("host"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_1, &_0))) { - RETURN_MM_STRING(""); - } - ZEPHIR_OBS_VAR(&authority); - zephir_read_property(&authority, this_ptr, ZEND_STRL("host"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&userInfo, this_ptr, "getuserinfo", NULL, 408); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_2, &userInfo))) { - ZEPHIR_INIT_VAR(&_3$$4); - ZEPHIR_CONCAT_VSV(&_3$$4, &userInfo, "@", &authority); - ZEPHIR_CPY_WRT(&authority, &_3$$4); - } - zephir_read_property(&_4, this_ptr, ZEND_STRL("port"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(Z_TYPE_P(&_4) != IS_NULL)) { - zephir_read_property(&_5$$5, this_ptr, ZEND_STRL("port"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_6$$5); - ZEPHIR_CONCAT_SV(&_6$$5, ":", &_5$$5); - zephir_concat_self(&authority, &_6$$5); - } - RETURN_CCTOR(&authority); -} - -/** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getUserInfo) -{ - zval _0, _1$$3, _2$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("pass"), PH_NOISY_CC); - if (UNEXPECTED(1 != ZEPHIR_IS_EMPTY(&_0))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("user"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("pass"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CONCAT_VSV(return_value, &_1$$3, ":", &_2$$3); - RETURN_MM(); - } - RETURN_MM_MEMBER(getThis(), "user"); -} - -/** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment - * - * @return Uri - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withFragment) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fragment = NULL, fragment_sub, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&fragment_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(fragment) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &fragment); - ZEPHIR_SEPARATE_PARAM(fragment); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, fragment); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "filterfragment", NULL, 401, fragment); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(fragment, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "fragment"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, fragment, &_1); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If an HTTP path is intended to be host-relative rather than path-relative - * then it must begin with a slash ("/"). HTTP paths not starting with a - * slash are assumed to be relative to some base path known to the - * application or consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path - * - * @return Uri - * @throws InvalidArgumentException for invalid paths. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withPath) -{ - zend_bool _2; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path = NULL, path_sub, _0, _1, _3, _4, _5, _6; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&path_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(path) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &path); - ZEPHIR_SEPARATE_PARAM(path); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, path); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "?"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, path, &_0, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_1); - if (!(_2)) { - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "#"); - ZEPHIR_INIT_VAR(&_4); - zephir_fast_strpos(&_4, path, &_3, 0 ); - _2 = !ZEPHIR_IS_FALSE_IDENTICAL(&_4); - } - if (UNEXPECTED(_2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Path cannot contain a query string or fragment", "phalcon/Http/Message/Uri.zep", 288); - return; - } - ZEPHIR_CALL_METHOD(&_5, this_ptr, "filterpath", NULL, 402, path); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(path, &_5); - ZEPHIR_INIT_VAR(&_6); - ZVAL_STRING(&_6, "path"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, path, &_6); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param int|null $port - * - * @return Uri - * @throws InvalidArgumentException for invalid ports. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withPort) -{ - zend_bool _1$$3, _2$$3; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *port = NULL, port_sub, _0$$3, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&port_sub); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(port) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &port); - ZEPHIR_SEPARATE_PARAM(port); - - - if (UNEXPECTED(Z_TYPE_P(port) != IS_NULL)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "filterport", NULL, 403, port); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(port, &_0$$3); - _1$$3 = Z_TYPE_P(port) != IS_NULL; - if (_1$$3) { - _2$$3 = ZEPHIR_LT_LONG(port, 1); - if (!(_2$$3)) { - _2$$3 = ZEPHIR_GT_LONG(port, 65535); - } - _1$$3 = _2$$3; - } - if (UNEXPECTED(_1$$3)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Method expects valid port (1-65535)", "phalcon/Http/Message/Uri.zep", 321); - return; - } - } - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "port"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, port, &_3); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query - * - * @return Uri - * @throws InvalidArgumentException for invalid query strings. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withQuery) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query = NULL, query_sub, _0, _1, _2, _3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query); - ZEPHIR_SEPARATE_PARAM(query); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, query); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "#"); - ZEPHIR_INIT_VAR(&_1); - zephir_fast_strpos(&_1, query, &_0, 0 ); - if (UNEXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&_1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_message_exception_invalidargumentexception_ce, "Query cannot contain a query fragment", "phalcon/Http/Message/Uri.zep", 351); - return; - } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "filterquery", NULL, 404, query); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(query, &_2); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, "query"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "cloneinstance", NULL, 21, query, &_3); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme - * - * @return Uri - * @throws InvalidArgumentException for invalid schemes. - * @throws InvalidArgumentException for unsupported schemes. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withScheme) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *scheme = NULL, scheme_sub, _0, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&scheme_sub); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(scheme) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &scheme); - ZEPHIR_SEPARATE_PARAM(scheme); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, scheme); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "filterscheme", NULL, 405, scheme); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(scheme, &_0); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "scheme"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processwith", NULL, 409, scheme, &_1); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Return an instance with the specified user information. - * - * @param string $user - * @param string|null $password - * - * @return Uri - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withUserInfo) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *user = NULL, user_sub, *password = NULL, password_sub, __$null, newInstance, _0, _2, _1$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&user_sub); - ZVAL_UNDEF(&password_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&newInstance); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(user) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(password) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &user, &password); - ZEPHIR_SEPARATE_PARAM(user); - if (!password) { - password = &password_sub; - ZEPHIR_CPY_WRT(password, &__$null); - } else { - ZEPHIR_SEPARATE_PARAM(password); - } - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, user); - zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(password) != IS_NULL)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checkstringparameter", NULL, 20, user); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_0, "rawurlencode", NULL, 345, user); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(user, &_0); - if (UNEXPECTED(Z_TYPE_P(password) != IS_NULL)) { - ZEPHIR_CALL_FUNCTION(&_1$$4, "rawurlencode", NULL, 345, password); - zephir_check_call_status(); - ZEPHIR_CPY_WRT(password, &_1$$4); - } - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "user"); - ZEPHIR_CALL_METHOD(&newInstance, this_ptr, "cloneinstance", NULL, 21, user, &_2); - zephir_check_call_status(); - zephir_update_property_zval(&newInstance, ZEND_STRL("pass"), password); - RETURN_CCTOR(&newInstance); -} - -/** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host - * - * @return Uri - * @throws InvalidArgumentException for invalid hostnames. - * - */ -PHP_METHOD(Phalcon_Http_Message_Uri, withHost) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *host, host_sub, _0; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&host_sub); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(host) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &host); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "host"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "processwith", NULL, 409, host, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * If the value passed is empty it returns it prefixed and suffixed with - * the passed parameters - * - * @param string $value - * @param string $prefix - * @param string $suffix - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Uri, checkValue) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *value_param = NULL, *prefix_param = NULL, *suffix_param = NULL, _0; - zval value, prefix, suffix, _1$$3; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&value); - ZVAL_UNDEF(&prefix); - ZVAL_UNDEF(&suffix); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_STR(value) - Z_PARAM_OPTIONAL - Z_PARAM_STR(prefix) - Z_PARAM_STR(suffix) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 2, &value_param, &prefix_param, &suffix_param); - if (UNEXPECTED(Z_TYPE_P(value_param) != IS_STRING && Z_TYPE_P(value_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'value' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(value_param) == IS_STRING)) { - zephir_get_strval(&value, value_param); - } else { - ZEPHIR_INIT_VAR(&value); - } - if (!prefix_param) { - ZEPHIR_INIT_VAR(&prefix); - ZVAL_STRING(&prefix, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(&prefix, prefix_param); - } else { - ZEPHIR_INIT_VAR(&prefix); - } - } - if (!suffix_param) { - ZEPHIR_INIT_VAR(&suffix); - ZVAL_STRING(&suffix, ""); - } else { - if (UNEXPECTED(Z_TYPE_P(suffix_param) != IS_STRING && Z_TYPE_P(suffix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'suffix' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(suffix_param) == IS_STRING)) { - zephir_get_strval(&suffix, suffix_param); - } else { - ZEPHIR_INIT_VAR(&suffix); - } - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(!ZEPHIR_IS_IDENTICAL(&_0, &value))) { - ZEPHIR_INIT_VAR(&_1$$3); - ZEPHIR_CONCAT_VVV(&_1$$3, &prefix, &value, &suffix); - ZEPHIR_CPY_WRT(&value, &_1$$3); - } - RETURN_CTOR(&value); -} - -/** - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * - * @param string $fragment - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Uri, filterFragment) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fragment_param = NULL; - zval fragment; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&fragment); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(fragment) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &fragment_param); - if (UNEXPECTED(Z_TYPE_P(fragment_param) != IS_STRING && Z_TYPE_P(fragment_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'fragment' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(fragment_param) == IS_STRING)) { - zephir_get_strval(&fragment, fragment_param); - } else { - ZEPHIR_INIT_VAR(&fragment); - } - - - ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 345, &fragment); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * - * @param string $path - * - * @return string The URI path. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, filterPath) -{ - zend_string *_5; - zend_ulong _4; - zend_bool _1; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_7 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, element, key, parts, _0, *_2, _3, _9, _10, _6$$4, _8$$5; - zval path; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&path); - ZVAL_UNDEF(&element); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&parts); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_8$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(path) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &path_param); - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(&path, path_param); - } else { - ZEPHIR_INIT_VAR(&path); - } - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - _1 = ZEPHIR_IS_IDENTICAL(&_0, &path); - if (!(_1)) { - _1 = 1 != zephir_start_with_str(&path, SL("/")); - } - if (UNEXPECTED(_1)) { - RETURN_CTOR(&path); - } - ZEPHIR_INIT_VAR(&parts); - zephir_fast_explode_str(&parts, SL("/"), &path, LONG_MAX); - zephir_is_iterable(&parts, 1, "phalcon/Http/Message/Uri.zep", 522); - if (Z_TYPE_P(&parts) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _4, _5, _2) - { - ZEPHIR_INIT_NVAR(&key); - if (_5 != NULL) { - ZVAL_STR_COPY(&key, _5); - } else { - ZVAL_LONG(&key, _4); - } - ZEPHIR_INIT_NVAR(&element); - ZVAL_COPY(&element, _2); - ZEPHIR_CALL_FUNCTION(&_6$$4, "rawurlencode", &_7, 345, &element); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &key, &_6$$4, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_3, &parts, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_3)) { - break; - } - ZEPHIR_CALL_METHOD(&key, &parts, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&element, &parts, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_8$$5, "rawurlencode", &_7, 345, &element); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &key, &_8$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&element); - ZEPHIR_INIT_NVAR(&key); - ZEPHIR_INIT_NVAR(&path); - zephir_fast_join_str(&path, SL("/"), &parts); - ZEPHIR_INIT_VAR(&_9); - ZEPHIR_INIT_VAR(&_10); - ZVAL_STRING(&_10, "/"); - zephir_fast_trim(&_9, &path, &_10, ZEPHIR_TRIM_LEFT); - ZEPHIR_CONCAT_SV(return_value, "/", &_9); - RETURN_MM(); -} - -/** - * Checks the port. If it is a standard one (80,443) then it returns null - * - * @param int|null $port - * - * @return int|null - */ -PHP_METHOD(Phalcon_Http_Message_Uri, filterPort) -{ - zend_long _0$$3; - zval ports; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *port = NULL, port_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&port_sub); - ZVAL_UNDEF(&ports); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(port) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &port); - ZEPHIR_SEPARATE_PARAM(port); - - - ZEPHIR_INIT_VAR(&ports); - zephir_create_array(&ports, 2, 0); - add_index_long(&ports, 80, 1); - add_index_long(&ports, 443, 1); - if (UNEXPECTED(Z_TYPE_P(port) != IS_NULL)) { - _0$$3 = zephir_get_intval(port); - ZEPHIR_INIT_NVAR(port); - ZVAL_LONG(port, _0$$3); - if (UNEXPECTED(zephir_array_isset(&ports, port))) { - ZEPHIR_INIT_NVAR(port); - ZVAL_NULL(port); - } - } - RETVAL_ZVAL(port, 1, 0); - RETURN_MM(); -} - -/** - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * - * @param string $query - * - * @return string The URI query string. - */ -PHP_METHOD(Phalcon_Http_Message_Uri, filterQuery) -{ - zend_string *_6; - zend_ulong _5; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *query_param = NULL, index, part, parts, split, _0, _1, _2, *_3, _4, _8$$4, _12$$4, _13$$4, _14$$4, _15$$4, _16$$4, _9$$5, _10$$5, _17$$6, _20$$6, _21$$6, _22$$6, _23$$6, _24$$6, _18$$7, _19$$7; - zval query; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&query); - ZVAL_UNDEF(&index); - ZVAL_UNDEF(&part); - ZVAL_UNDEF(&parts); - ZVAL_UNDEF(&split); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_12$$4); - ZVAL_UNDEF(&_13$$4); - ZVAL_UNDEF(&_14$$4); - ZVAL_UNDEF(&_15$$4); - ZVAL_UNDEF(&_16$$4); - ZVAL_UNDEF(&_9$$5); - ZVAL_UNDEF(&_10$$5); - ZVAL_UNDEF(&_17$$6); - ZVAL_UNDEF(&_20$$6); - ZVAL_UNDEF(&_21$$6); - ZVAL_UNDEF(&_22$$6); - ZVAL_UNDEF(&_23$$6); - ZVAL_UNDEF(&_24$$6); - ZVAL_UNDEF(&_18$$7); - ZVAL_UNDEF(&_19$$7); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(query) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &query_param); - zephir_get_strval(&query, query_param); - - - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_0, &query))) { - RETURN_MM_STRING(""); - } - ZEPHIR_INIT_VAR(&_1); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, "?"); - zephir_fast_trim(&_1, &query, &_2, ZEPHIR_TRIM_LEFT); - zephir_get_strval(&query, &_1); - ZEPHIR_INIT_VAR(&parts); - zephir_fast_explode_str(&parts, SL("&"), &query, LONG_MAX); - zephir_is_iterable(&parts, 1, "phalcon/Http/Message/Uri.zep", 595); - if (Z_TYPE_P(&parts) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _5, _6, _3) - { - ZEPHIR_INIT_NVAR(&index); - if (_6 != NULL) { - ZVAL_STR_COPY(&index, _6); - } else { - ZVAL_LONG(&index, _5); - } - ZEPHIR_INIT_NVAR(&part); - ZVAL_COPY(&part, _3); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitqueryvalue", &_7, 410, &part); - zephir_check_call_status(); - zephir_array_fetch_long(&_8$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 587); - if (UNEXPECTED(Z_TYPE_P(&_8$$4) == IS_NULL)) { - zephir_array_fetch_long(&_9$$5, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 588); - ZEPHIR_CALL_FUNCTION(&_10$$5, "rawurlencode", &_11, 345, &_9$$5); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &index, &_10$$5, PH_COPY | PH_SEPARATE); - continue; - } - zephir_array_fetch_long(&_12$$4, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_13$$4, "rawurlencode", &_11, 345, &_12$$4); - zephir_check_call_status(); - zephir_array_fetch_long(&_14$$4, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_15$$4, "rawurlencode", &_11, 345, &_14$$4); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_16$$4); - ZEPHIR_CONCAT_VSV(&_16$$4, &_13$$4, "=", &_15$$4); - zephir_array_update_zval(&parts, &index, &_16$$4, PH_COPY | PH_SEPARATE); - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &parts, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_4, &parts, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_4)) { - break; - } - ZEPHIR_CALL_METHOD(&index, &parts, "key", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&part, &parts, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&split, this_ptr, "splitqueryvalue", &_7, 410, &part); - zephir_check_call_status(); - zephir_array_fetch_long(&_17$$6, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 587); - if (UNEXPECTED(Z_TYPE_P(&_17$$6) == IS_NULL)) { - zephir_array_fetch_long(&_18$$7, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 588); - ZEPHIR_CALL_FUNCTION(&_19$$7, "rawurlencode", &_11, 345, &_18$$7); - zephir_check_call_status(); - zephir_array_update_zval(&parts, &index, &_19$$7, PH_COPY | PH_SEPARATE); - continue; - } - zephir_array_fetch_long(&_20$$6, &split, 0, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_21$$6, "rawurlencode", &_11, 345, &_20$$6); - zephir_check_call_status(); - zephir_array_fetch_long(&_22$$6, &split, 1, PH_NOISY | PH_READONLY, "phalcon/Http/Message/Uri.zep", 592); - ZEPHIR_CALL_FUNCTION(&_23$$6, "rawurlencode", &_11, 345, &_22$$6); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_24$$6); - ZEPHIR_CONCAT_VSV(&_24$$6, &_21$$6, "=", &_23$$6); - zephir_array_update_zval(&parts, &index, &_24$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, &parts, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&part); - ZEPHIR_INIT_NVAR(&index); - zephir_fast_join_str(return_value, SL("&"), &parts); - RETURN_MM(); -} - -/** - * Filters the passed scheme - only allowed schemes - * - * @param string $scheme - * - * @return string - */ -PHP_METHOD(Phalcon_Http_Message_Uri, filterScheme) -{ - zval schemes; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *scheme_param = NULL, filtered, _0, _1, _2, _3, _4$$4, _5$$4, _6$$4, _7$$4; - zval scheme; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&scheme); - ZVAL_UNDEF(&filtered); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_7$$4); - ZVAL_UNDEF(&schemes); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(scheme) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &scheme_param); - if (UNEXPECTED(Z_TYPE_P(scheme_param) != IS_STRING && Z_TYPE_P(scheme_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'scheme' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(scheme_param) == IS_STRING)) { - zephir_get_strval(&scheme, scheme_param); - } else { - ZEPHIR_INIT_VAR(&scheme); - } - - - ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, &scheme); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "#:(//)?$#"); - ZEPHIR_INIT_VAR(&_2); - ZVAL_STRING(&_2, ""); - ZEPHIR_CALL_FUNCTION(&filtered, "preg_replace", NULL, 50, &_1, &_2, &_0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&schemes); - zephir_create_array(&schemes, 2, 0); - add_assoc_long_ex(&schemes, SL("http"), 1); - add_assoc_long_ex(&schemes, SL("https"), 1); - ZEPHIR_INIT_VAR(&_3); - ZVAL_STRING(&_3, ""); - if (UNEXPECTED(ZEPHIR_IS_IDENTICAL(&_3, &filtered))) { - RETURN_MM_STRING(""); - } - if (UNEXPECTED(!(zephir_array_isset(&schemes, &filtered)))) { - ZEPHIR_INIT_VAR(&_4$$4); - object_init_ex(&_4$$4, phalcon_http_message_exception_invalidargumentexception_ce); - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_VAR(&_6$$4); - zephir_array_keys(&_6$$4, &schemes); - zephir_fast_join_str(&_5$$4, SL(", "), &_6$$4); - ZEPHIR_INIT_VAR(&_7$$4); - ZEPHIR_CONCAT_SVSSVS(&_7$$4, "Unsupported scheme [", &filtered, "]. ", "Scheme must be one of [", &_5$$4, "]"); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 40, &_7$$4); - zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$4, "phalcon/Http/Message/Uri.zep", 625); - ZEPHIR_MM_RESTORE(); - return; - } - RETURN_CTOR(&scheme); -} - -/** - * @param string $element - * - * @return array - */ -PHP_METHOD(Phalcon_Http_Message_Uri, splitQueryValue) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *element_param = NULL, __$null, data; - zval element; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&element); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&data); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(element) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &element_param); - zephir_get_strval(&element, element_param); - - - ZEPHIR_INIT_VAR(&data); - zephir_fast_explode_str(&data, SL("="), &element, 2 ); - if (UNEXPECTED(!(zephir_array_isset_long(&data, 1)))) { - zephir_array_append(&data, &__$null, PH_SEPARATE, "phalcon/Http/Message/Uri.zep", 642); - } - RETURN_CCTOR(&data); -} - -/** - * @todo Remove this when we get traits - */ -PHP_METHOD(Phalcon_Http_Message_Uri, getArrVal) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, value; - zval collection; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&collection); - ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&value); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_ARRAY(collection) - Z_PARAM_ZVAL(index) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &collection_param, &index, &defaultValue); - ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 1)))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - RETURN_CTOR(&value); -} - diff --git a/ext/phalcon/http/message/uri.zep.h b/ext/phalcon/http/message/uri.zep.h deleted file mode 100644 index af8388c2dd2..00000000000 --- a/ext/phalcon/http/message/uri.zep.h +++ /dev/null @@ -1,155 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_uri_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_Uri); - -PHP_METHOD(Phalcon_Http_Message_Uri, getFragment); -PHP_METHOD(Phalcon_Http_Message_Uri, getHost); -PHP_METHOD(Phalcon_Http_Message_Uri, getPath); -PHP_METHOD(Phalcon_Http_Message_Uri, getPort); -PHP_METHOD(Phalcon_Http_Message_Uri, getQuery); -PHP_METHOD(Phalcon_Http_Message_Uri, getScheme); -PHP_METHOD(Phalcon_Http_Message_Uri, __construct); -PHP_METHOD(Phalcon_Http_Message_Uri, __toString); -PHP_METHOD(Phalcon_Http_Message_Uri, getAuthority); -PHP_METHOD(Phalcon_Http_Message_Uri, getUserInfo); -PHP_METHOD(Phalcon_Http_Message_Uri, withFragment); -PHP_METHOD(Phalcon_Http_Message_Uri, withPath); -PHP_METHOD(Phalcon_Http_Message_Uri, withPort); -PHP_METHOD(Phalcon_Http_Message_Uri, withQuery); -PHP_METHOD(Phalcon_Http_Message_Uri, withScheme); -PHP_METHOD(Phalcon_Http_Message_Uri, withUserInfo); -PHP_METHOD(Phalcon_Http_Message_Uri, withHost); -PHP_METHOD(Phalcon_Http_Message_Uri, checkValue); -PHP_METHOD(Phalcon_Http_Message_Uri, filterFragment); -PHP_METHOD(Phalcon_Http_Message_Uri, filterPath); -PHP_METHOD(Phalcon_Http_Message_Uri, filterPort); -PHP_METHOD(Phalcon_Http_Message_Uri, filterQuery); -PHP_METHOD(Phalcon_Http_Message_Uri, filterScheme); -PHP_METHOD(Phalcon_Http_Message_Uri, splitQueryValue); -PHP_METHOD(Phalcon_Http_Message_Uri, getArrVal); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getfragment, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_gethost, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getpath, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getport, 0, 0, IS_LONG, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getquery, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getscheme, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uri___construct, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri___tostring, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getauthority, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_getuserinfo, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withfragment, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, fragment) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withpath, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, path) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withport, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, port) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withquery, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, query) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withscheme, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, scheme) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withuserinfo, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, user) - ZEND_ARG_INFO(0, password) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withhost, 0, 1, Phalcon\\Http\\Message\\Uri, 0) - ZEND_ARG_INFO(0, host) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_checkvalue, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, suffix, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterfragment, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, fragment, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterpath, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterport, 0, 1, IS_LONG, 1) - ZEND_ARG_INFO(0, port) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterquery, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_filterscheme, 0, 1, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, scheme, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_message_uri_splitqueryvalue, 0, 1, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_message_uri_getarrval, 0, 0, 2) - ZEND_ARG_ARRAY_INFO(0, collection, 0) - ZEND_ARG_INFO(0, index) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_uri_method_entry) { - PHP_ME(Phalcon_Http_Message_Uri, getFragment, arginfo_phalcon_http_message_uri_getfragment, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getHost, arginfo_phalcon_http_message_uri_gethost, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getPath, arginfo_phalcon_http_message_uri_getpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getPort, arginfo_phalcon_http_message_uri_getport, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getQuery, arginfo_phalcon_http_message_uri_getquery, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getScheme, arginfo_phalcon_http_message_uri_getscheme, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, __construct, arginfo_phalcon_http_message_uri___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Message_Uri, __toString, arginfo_phalcon_http_message_uri___tostring, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getAuthority, arginfo_phalcon_http_message_uri_getauthority, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, getUserInfo, arginfo_phalcon_http_message_uri_getuserinfo, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withFragment, arginfo_phalcon_http_message_uri_withfragment, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withPath, arginfo_phalcon_http_message_uri_withpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withPort, arginfo_phalcon_http_message_uri_withport, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withQuery, arginfo_phalcon_http_message_uri_withquery, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withScheme, arginfo_phalcon_http_message_uri_withscheme, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withUserInfo, arginfo_phalcon_http_message_uri_withuserinfo, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, withHost, arginfo_phalcon_http_message_uri_withhost, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Message_Uri, checkValue, arginfo_phalcon_http_message_uri_checkvalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterFragment, arginfo_phalcon_http_message_uri_filterfragment, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterPath, arginfo_phalcon_http_message_uri_filterpath, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterPort, arginfo_phalcon_http_message_uri_filterport, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterQuery, arginfo_phalcon_http_message_uri_filterquery, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, filterScheme, arginfo_phalcon_http_message_uri_filterscheme, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, splitQueryValue, arginfo_phalcon_http_message_uri_splitqueryvalue, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Http_Message_Uri, getArrVal, arginfo_phalcon_http_message_uri_getarrval, ZEND_ACC_PRIVATE) - PHP_FE_END -}; diff --git a/ext/phalcon/http/message/urifactory.zep.c b/ext/phalcon/http/message/urifactory.zep.c deleted file mode 100644 index a944ce204a3..00000000000 --- a/ext/phalcon/http/message/urifactory.zep.c +++ /dev/null @@ -1,91 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/operators.h" -#include "kernel/object.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ -/** - * PSR-17 UriFactory - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UriFactory) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Message, UriFactory, phalcon, http_message_urifactory, phalcon_http_message_urifactory_method_entry, ZEND_ACC_FINAL_CLASS); - - zend_class_implements(phalcon_http_message_urifactory_ce, 1, zephir_get_internal_ce(SL("psr\\http\\message\\urifactoryinterface"))); - return SUCCESS; -} - -/** - * Returns a Locator object with all the helpers defined in anonynous - * functions - */ -PHP_METHOD(Phalcon_Http_Message_UriFactory, createUri) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL; - zval uri; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&uri); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_STR(uri) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &uri_param); - if (!uri_param) { - ZEPHIR_INIT_VAR(&uri); - ZVAL_STRING(&uri, ""); - } else { - if (UNEXPECTED(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 of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(&uri, uri_param); - } else { - ZEPHIR_INIT_VAR(&uri); - } - } - - - object_init_ex(return_value, phalcon_http_message_uri_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 114, &uri); - zephir_check_call_status(); - RETURN_MM(); -} - diff --git a/ext/phalcon/http/message/urifactory.zep.h b/ext/phalcon/http/message/urifactory.zep.h deleted file mode 100644 index e9182f32b23..00000000000 --- a/ext/phalcon/http/message/urifactory.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_http_message_urifactory_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Message_UriFactory); - -PHP_METHOD(Phalcon_Http_Message_UriFactory, createUri); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_urifactory_createuri, 0, 0, Psr\\Http\\Message\\UriInterface, 0) - ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_message_urifactory_method_entry) { - PHP_ME(Phalcon_Http_Message_UriFactory, createUri, arginfo_phalcon_http_message_urifactory_createuri, ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/request.zep.c b/ext/phalcon/http/request.zep.c index f1707b75a9d..d12fa669e30 100644 --- a/ext/phalcon/http/request.zep.c +++ b/ext/phalcon/http/request.zep.c @@ -221,7 +221,7 @@ PHP_METHOD(Phalcon_Http_Request, get) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_REQUEST, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_REQUEST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -247,7 +247,7 @@ PHP_METHOD(Phalcon_Http_Request, getAcceptableContent) ZVAL_STRING(&_0, "HTTP_ACCEPT"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "accept"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -274,13 +274,13 @@ PHP_METHOD(Phalcon_Http_Request, getBasicAuth) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "PHP_AUTH_USER"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = !zephir_is_true(&_0); if (!(_2)) { ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "PHP_AUTH_PW"); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = !zephir_is_true(&_3); } @@ -322,7 +322,7 @@ PHP_METHOD(Phalcon_Http_Request, getBestAccept) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "accept"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -348,7 +348,7 @@ PHP_METHOD(Phalcon_Http_Request, getBestCharset) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "charset"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -374,7 +374,7 @@ PHP_METHOD(Phalcon_Http_Request, getBestLanguage) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "language"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 414, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbestquality", NULL, 336, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -463,7 +463,7 @@ PHP_METHOD(Phalcon_Http_Request, getClientAddress) ZEPHIR_INIT_VAR(&address); ZVAL_NULL(&address); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (trustForwardedHeader) { ZEPHIR_OBS_NVAR(&address); @@ -510,7 +510,7 @@ PHP_METHOD(Phalcon_Http_Request, getClientCharsets) ZVAL_STRING(&_0, "HTTP_ACCEPT_CHARSET"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "charset"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -531,7 +531,7 @@ PHP_METHOD(Phalcon_Http_Request, getContentType) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_string_fetch(&contentType, &server, SL("CONTENT_TYPE"), 1))) { RETURN_MM_NULL(); @@ -570,7 +570,7 @@ PHP_METHOD(Phalcon_Http_Request, getDigestAuth) ZEPHIR_INIT_VAR(&auth); array_init(&auth); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&digest); if (zephir_array_isset_string_fetch(&digest, &server, SL("PHP_AUTH_DIGEST"), 0)) { @@ -925,7 +925,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeader) zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); zephir_fast_strtoupper(&name, &_2); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&value); if (zephir_array_isset_fetch(&value, &server, &name, 0)) { @@ -1019,7 +1019,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) zephir_array_update_string(&contentHeaders, SL("CONTENT_TYPE"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&contentHeaders, SL("CONTENT_LENGTH"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&contentHeaders, SL("CONTENT_MD5"), &__$true, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); zephir_is_iterable(&server, 0, "phalcon/Http/Request.zep", 441); if (Z_TYPE_P(&server) == IS_ARRAY) { @@ -1045,7 +1045,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_9$$4, " "); zephir_fast_str_replace(&_5$$4, &_8$$4, &_9$$4, &_7$$4); zephir_fast_strtolower(&_4$$4, &_5$$4); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_4$$4); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_4$$4); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_INIT_NVAR(&_12$$4); @@ -1069,7 +1069,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_18$$5, " "); zephir_fast_str_replace(&_16$$5, &_17$$5, &_18$$5, &name); zephir_fast_strtolower(&_15$$5, &_16$$5); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_15$$5); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_15$$5); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$5); ZEPHIR_INIT_NVAR(&_20$$5); @@ -1106,7 +1106,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_27$$7, " "); zephir_fast_str_replace(&_23$$7, &_26$$7, &_27$$7, &_25$$7); zephir_fast_strtolower(&_22$$7, &_23$$7); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_22$$7); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_22$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_28$$7); ZEPHIR_INIT_NVAR(&_29$$7); @@ -1130,7 +1130,7 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) ZVAL_STRING(&_35$$8, " "); zephir_fast_str_replace(&_33$$8, &_34$$8, &_35$$8, &name); zephir_fast_strtolower(&_32$$8, &_33$$8); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 302, &_32$$8); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_10, 284, &_32$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$8); ZEPHIR_INIT_NVAR(&_37$$8); @@ -1251,7 +1251,7 @@ PHP_METHOD(Phalcon_Http_Request, getHttpHost) ZVAL_STRING(&_5$$6, "/:[[:digit:]]+$/"); ZEPHIR_INIT_VAR(&_6$$6); ZVAL_STRING(&_6$$6, ""); - ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 50, &_5$$6, &_6$$6, &cleanHost); + ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 37, &_5$$6, &_6$$6, &cleanHost); zephir_check_call_status(); ZEPHIR_CPY_WRT(&cleanHost, &_7$$6); } @@ -1259,7 +1259,7 @@ PHP_METHOD(Phalcon_Http_Request, getHttpHost) ZVAL_STRING(&_8$$5, "/[a-z0-9-]+\\.?/"); ZEPHIR_INIT_VAR(&_9$$5); ZVAL_STRING(&_9$$5, ""); - ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 50, &_8$$5, &_9$$5, &cleanHost); + ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 37, &_8$$5, &_9$$5, &cleanHost); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11$$5); ZVAL_STRING(&_11$$5, ""); @@ -1268,7 +1268,7 @@ PHP_METHOD(Phalcon_Http_Request, getHttpHost) object_init_ex(&_12$$7, spl_ce_UnexpectedValueException); ZEPHIR_INIT_VAR(&_13$$7); ZEPHIR_CONCAT_SV(&_13$$7, "Invalid host ", &host); - ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 416, &_13$$7); + ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 338, &_13$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$7, "phalcon/Http/Request.zep", 525); ZEPHIR_MM_RESTORE(); @@ -1297,7 +1297,7 @@ PHP_METHOD(Phalcon_Http_Request, getHTTPReferer) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_string_fetch(&httpReferer, &server, SL("HTTP_REFERER"), 1))) { RETURN_MM_STRING(""); @@ -1367,7 +1367,7 @@ PHP_METHOD(Phalcon_Http_Request, getLanguages) ZVAL_STRING(&_0, "HTTP_ACCEPT_LANGUAGE"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "language"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 412, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualityheader", NULL, 334, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -1407,7 +1407,7 @@ PHP_METHOD(Phalcon_Http_Request, getMethod) zephir_get_global(&_REQUEST, SL("_REQUEST")); ZEPHIR_INIT_VAR(&returnMethod); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); ZEPHIR_OBS_VAR(&requestMethod); if (EXPECTED(zephir_array_isset_string_fetch(&requestMethod, &server, SL("REQUEST_METHOD"), 0))) { @@ -1421,7 +1421,7 @@ PHP_METHOD(Phalcon_Http_Request, getMethod) if (ZEPHIR_IS_IDENTICAL(&_0, &returnMethod)) { ZEPHIR_INIT_VAR(&_1$$5); ZVAL_STRING(&_1$$5, "X-HTTP-METHOD-OVERRIDE"); - ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 417, &_1$$5); + ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 339, &_1$$5); zephir_check_call_status(); zephir_read_property(&_2$$5, this_ptr, ZEND_STRL("httpMethodParameterOverride"), PH_NOISY_CC | PH_READONLY); if (!(ZEPHIR_IS_EMPTY(&overridedMethod))) { @@ -1481,7 +1481,7 @@ PHP_METHOD(Phalcon_Http_Request, getPort) if (zephir_memnstr_str(&host, SL(":"), "phalcon/Http/Request.zep", 634)) { ZEPHIR_INIT_VAR(&_3$$4); ZVAL_STRING(&_3$$4, ":"); - ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 123, &host, &_3$$4); + ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 237, &host, &_3$$4); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&pos)) { ZVAL_LONG(&_4$$5, (zephir_get_numberval(&pos) + 1)); @@ -1590,7 +1590,7 @@ PHP_METHOD(Phalcon_Http_Request, getPost) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_POST, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_POST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -1684,7 +1684,7 @@ PHP_METHOD(Phalcon_Http_Request, getPut) if (_0$$3) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "json"); - ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 418, &contentType, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 340, &contentType, &_1$$3); zephir_check_call_status(); _0$$3 = !ZEPHIR_IS_FALSE(&_2$$3); } @@ -1702,7 +1702,7 @@ PHP_METHOD(Phalcon_Http_Request, getPut) ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getrawbody", NULL, 0); zephir_check_call_status(); ZEPHIR_MAKE_REF(&put); - ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 375, &_4$$6, &put); + ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 341, &_4$$6, &put); ZEPHIR_UNREF(&put); zephir_check_call_status(); } @@ -1718,7 +1718,7 @@ PHP_METHOD(Phalcon_Http_Request, getPut) } else { ZVAL_BOOL(&_6, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &put, &name, filters, defaultValue, &_5, &_6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &put, &name, filters, defaultValue, &_5, &_6); zephir_check_call_status(); RETURN_MM(); } @@ -1813,7 +1813,7 @@ PHP_METHOD(Phalcon_Http_Request, getQuery) } else { ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 411, &_GET, &name, filters, defaultValue, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 333, &_GET, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -1914,7 +1914,7 @@ PHP_METHOD(Phalcon_Http_Request, getServer) } - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (!(zephir_array_isset_fetch(&serverValue, &server, &name, 1))) { RETURN_MM_NULL(); @@ -1946,7 +1946,7 @@ PHP_METHOD(Phalcon_Http_Request, getServerAddress) if (Z_TYPE_P(&serverAddr) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "localhost"); - ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 419, &_1$$3); + ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 342, &_1$$3); zephir_check_call_status(); RETURN_MM(); } @@ -2103,7 +2103,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) zephir_array_fetch_string(&_7$$5, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 861); zephir_array_fetch_string(&_8$$5, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 862); zephir_array_fetch_string(&_9$$5, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 863); - ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 420, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &prefix); + ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 343, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &prefix); zephir_check_call_status(); zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 890); if (Z_TYPE_P(&smoothInput) == IS_ARRAY) { @@ -2138,7 +2138,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_16$$8); object_init_ex(&_16$$8, phalcon_http_request_file_ce); zephir_array_fetch_string(&_17$$8, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_16$$8, "__construct", &_18, 421, &dataFile, &_17$$8); + ZEPHIR_CALL_METHOD(NULL, &_16$$8, "__construct", &_18, 344, &dataFile, &_17$$8); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_19$$8); zephir_array_fetch_string(&_19$$8, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -2147,7 +2147,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_20$$9); object_init_ex(&_20$$9, phalcon_http_request_file_ce); zephir_array_fetch_string(&_21$$9, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_20$$9, "__construct", &_18, 421, &dataFile, &_21$$9); + ZEPHIR_CALL_METHOD(NULL, &_20$$9, "__construct", &_18, 344, &dataFile, &_21$$9); zephir_check_call_status(); zephir_array_append(&files, &_20$$9, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -2192,7 +2192,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_26$$12); object_init_ex(&_26$$12, phalcon_http_request_file_ce); zephir_array_fetch_string(&_27$$12, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_18, 421, &dataFile, &_27$$12); + ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_18, 344, &dataFile, &_27$$12); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_28$$12); zephir_array_fetch_string(&_28$$12, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -2201,7 +2201,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_29$$13); object_init_ex(&_29$$13, phalcon_http_request_file_ce); zephir_array_fetch_string(&_30$$13, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_29$$13, "__construct", &_18, 421, &dataFile, &_30$$13); + ZEPHIR_CALL_METHOD(NULL, &_29$$13, "__construct", &_18, 344, &dataFile, &_30$$13); zephir_check_call_status(); zephir_array_append(&files, &_29$$13, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -2221,13 +2221,13 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) if (namedKeys == 1) { ZEPHIR_INIT_NVAR(&_33$$16); object_init_ex(&_33$$16, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_33$$16, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_33$$16, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_update_zval(&files, &prefix, &_33$$16, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(&_34$$17); object_init_ex(&_34$$17, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_34$$17, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_34$$17, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_append(&files, &_34$$17, PH_SEPARATE, "phalcon/Http/Request.zep", 895); } @@ -2255,7 +2255,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) zephir_array_fetch_string(&_38$$19, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 861); zephir_array_fetch_string(&_39$$19, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 862); zephir_array_fetch_string(&_40$$19, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 863); - ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 420, &_36$$19, &_37$$19, &_38$$19, &_39$$19, &_40$$19, &prefix); + ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_10, 343, &_36$$19, &_37$$19, &_38$$19, &_39$$19, &_40$$19, &prefix); zephir_check_call_status(); zephir_is_iterable(&smoothInput, 0, "phalcon/Http/Request.zep", 890); if (Z_TYPE_P(&smoothInput) == IS_ARRAY) { @@ -2291,7 +2291,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_47$$22); object_init_ex(&_47$$22, phalcon_http_request_file_ce); zephir_array_fetch_string(&_48$$22, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_47$$22, "__construct", &_18, 421, &dataFile, &_48$$22); + ZEPHIR_CALL_METHOD(NULL, &_47$$22, "__construct", &_18, 344, &dataFile, &_48$$22); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_49$$22); zephir_array_fetch_string(&_49$$22, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -2300,7 +2300,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_50$$23); object_init_ex(&_50$$23, phalcon_http_request_file_ce); zephir_array_fetch_string(&_51$$23, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_50$$23, "__construct", &_18, 421, &dataFile, &_51$$23); + ZEPHIR_CALL_METHOD(NULL, &_50$$23, "__construct", &_18, 344, &dataFile, &_51$$23); zephir_check_call_status(); zephir_array_append(&files, &_50$$23, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -2345,7 +2345,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_56$$26); object_init_ex(&_56$$26, phalcon_http_request_file_ce); zephir_array_fetch_string(&_57$$26, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 881); - ZEPHIR_CALL_METHOD(NULL, &_56$$26, "__construct", &_18, 421, &dataFile, &_57$$26); + ZEPHIR_CALL_METHOD(NULL, &_56$$26, "__construct", &_18, 344, &dataFile, &_57$$26); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&_58$$26); zephir_array_fetch_string(&_58$$26, &file, SL("key"), PH_NOISY, "phalcon/Http/Request.zep", 878); @@ -2354,7 +2354,7 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) ZEPHIR_INIT_NVAR(&_59$$27); object_init_ex(&_59$$27, phalcon_http_request_file_ce); zephir_array_fetch_string(&_60$$27, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 886); - ZEPHIR_CALL_METHOD(NULL, &_59$$27, "__construct", &_18, 421, &dataFile, &_60$$27); + ZEPHIR_CALL_METHOD(NULL, &_59$$27, "__construct", &_18, 344, &dataFile, &_60$$27); zephir_check_call_status(); zephir_array_append(&files, &_59$$27, PH_SEPARATE, "phalcon/Http/Request.zep", 886); } @@ -2374,13 +2374,13 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) if (namedKeys == 1) { ZEPHIR_INIT_NVAR(&_63$$30); object_init_ex(&_63$$30, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_63$$30, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_63$$30, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_update_zval(&files, &prefix, &_63$$30, PH_COPY | PH_SEPARATE); } else { ZEPHIR_INIT_NVAR(&_64$$31); object_init_ex(&_64$$31, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, &_64$$31, "__construct", &_18, 421, &input, &prefix); + ZEPHIR_CALL_METHOD(NULL, &_64$$31, "__construct", &_18, 344, &input, &prefix); zephir_check_call_status(); zephir_array_append(&files, &_64$$31, PH_SEPARATE, "phalcon/Http/Request.zep", 895); } @@ -2593,13 +2593,13 @@ PHP_METHOD(Phalcon_Http_Request, hasHeader) zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); zephir_fast_strtoupper(&name, &_2); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 413, &name); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "hasserver", NULL, 335, &name); zephir_check_call_status(); _4 = zephir_is_true(&_3); if (!(_4)) { ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SV(&_6, "HTTP_", &name); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "hasserver", NULL, 413, &_6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "hasserver", NULL, 335, &_6); zephir_check_call_status(); _4 = zephir_is_true(&_5); } @@ -2753,7 +2753,7 @@ PHP_METHOD(Phalcon_Http_Request, hasServer) } - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); RETURN_MM_BOOL(zephir_array_isset(&server, &name)); } @@ -2778,7 +2778,7 @@ PHP_METHOD(Phalcon_Http_Request, isAjax) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "HTTP_X_REQUESTED_WITH"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); _2 = zephir_is_true(&_0); if (_2) { @@ -2807,7 +2807,7 @@ PHP_METHOD(Phalcon_Http_Request, isConnect) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "CONNECT")); } @@ -2828,7 +2828,7 @@ PHP_METHOD(Phalcon_Http_Request, isDelete) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "DELETE")); } @@ -2849,7 +2849,7 @@ PHP_METHOD(Phalcon_Http_Request, isGet) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "GET")); } @@ -2870,7 +2870,7 @@ PHP_METHOD(Phalcon_Http_Request, isHead) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "HEAD")); } @@ -2918,7 +2918,7 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) } - ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); if (Z_TYPE_P(methods) == IS_STRING) { _0$$3 = strict; @@ -2932,7 +2932,7 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) object_init_ex(&_2$$4, phalcon_http_request_exception_ce); ZEPHIR_INIT_VAR(&_3$$4); ZEPHIR_CONCAT_SV(&_3$$4, "Invalid HTTP method: ", methods); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 31, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 29, &_3$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$4, "phalcon/Http/Request.zep", 1075); ZEPHIR_MM_RESTORE(); @@ -2952,7 +2952,7 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) } else { ZVAL_BOOL(&_7$$6, 0); } - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "ismethod", &_8, 423, &method, &_7$$6); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "ismethod", &_8, 346, &method, &_7$$6); zephir_check_call_status(); if (zephir_is_true(&_6$$6)) { RETURN_MM_BOOL(1); @@ -2974,7 +2974,7 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) } else { ZVAL_BOOL(&_10$$8, 0); } - ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "ismethod", &_8, 423, &method, &_10$$8); + ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "ismethod", &_8, 346, &method, &_10$$8); zephir_check_call_status(); if (zephir_is_true(&_9$$8)) { RETURN_MM_BOOL(1); @@ -3009,7 +3009,7 @@ PHP_METHOD(Phalcon_Http_Request, isOptions) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "OPTIONS")); } @@ -3030,7 +3030,7 @@ PHP_METHOD(Phalcon_Http_Request, isPatch) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PATCH")); } @@ -3051,7 +3051,7 @@ PHP_METHOD(Phalcon_Http_Request, isPost) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "POST")); } @@ -3072,7 +3072,7 @@ PHP_METHOD(Phalcon_Http_Request, isPut) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PUT")); } @@ -3093,7 +3093,7 @@ PHP_METHOD(Phalcon_Http_Request, isPurge) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PURGE")); } @@ -3150,7 +3150,7 @@ PHP_METHOD(Phalcon_Http_Request, isSoap) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "HTTP_SOAPACTION"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_1); zephir_check_call_status(); if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); @@ -3179,7 +3179,7 @@ PHP_METHOD(Phalcon_Http_Request, isTrace) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 422); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 345); zephir_check_call_status(); RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "TRACE")); } @@ -3288,7 +3288,7 @@ PHP_METHOD(Phalcon_Http_Request, numFiles) } else { ZVAL_BOOL(&_4$$8, 0); } - ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "hasfilehelper", &_5, 424, &error, &_4$$8); + ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "hasfilehelper", &_5, 347, &error, &_4$$8); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_3$$8); } @@ -3322,7 +3322,7 @@ PHP_METHOD(Phalcon_Http_Request, numFiles) } else { ZVAL_BOOL(&_8$$13, 0); } - ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "hasfilehelper", &_5, 424, &error, &_8$$13); + ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "hasfilehelper", &_5, 347, &error, &_8$$13); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_7$$13); } @@ -3410,13 +3410,13 @@ PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_0$$3, phalcon_http_request_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_SVS(&_1$$3, "Filters have not been defined for '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Http/Request.zep", 1259); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 425); + ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 348); zephir_check_call_status(); zephir_is_iterable(&filters, 0, "phalcon/Http/Request.zep", 1272); if (Z_TYPE_P(&filters) == IS_ARRAY) { @@ -3431,7 +3431,7 @@ PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_6$$5, phalcon_http_request_exception_ce); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVS(&_7$$5, "Sanitizer '", &sanitizer, "' does not exist in the filter locator"); - ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 29, &_7$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$5, "phalcon/Http/Request.zep", 1268); ZEPHIR_MM_RESTORE(); @@ -3456,7 +3456,7 @@ PHP_METHOD(Phalcon_Http_Request, setParameterFilters) object_init_ex(&_10$$7, phalcon_http_request_exception_ce); ZEPHIR_INIT_NVAR(&_11$$7); ZEPHIR_CONCAT_SVS(&_11$$7, "Sanitizer '", &sanitizer, "' does not exist in the filter locator"); - ZEPHIR_CALL_METHOD(NULL, &_10$$7, "__construct", NULL, 31, &_11$$7); + ZEPHIR_CALL_METHOD(NULL, &_10$$7, "__construct", NULL, 29, &_11$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$7, "phalcon/Http/Request.zep", 1268); ZEPHIR_MM_RESTORE(); @@ -3754,7 +3754,7 @@ PHP_METHOD(Phalcon_Http_Request, getHelper) RETURN_MM(); } if (Z_TYPE_P(filters) != IS_NULL) { - ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 425); + ZEPHIR_CALL_METHOD(&filterService, this_ptr, "getfilterservice", NULL, 348); zephir_check_call_status(); if (noRecursive) { ZVAL_BOOL(&_3$$6, 1); @@ -3826,7 +3826,7 @@ PHP_METHOD(Phalcon_Http_Request, hasFileHelper) } else { ZVAL_BOOL(&_4$$7, 0); } - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "hasfilehelper", &_5, 424, &value, &_4$$7); + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "hasfilehelper", &_5, 347, &value, &_4$$7); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_3$$7); } @@ -3857,7 +3857,7 @@ PHP_METHOD(Phalcon_Http_Request, hasFileHelper) } else { ZVAL_BOOL(&_8$$11, 0); } - ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "hasfilehelper", &_5, 424, &value, &_8$$11); + ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "hasfilehelper", &_5, 347, &value, &_8$$11); zephir_check_call_status(); numberFiles += zephir_get_numberval(&_7$$11); } @@ -3976,7 +3976,7 @@ PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_1, "/,\\s*/"); ZVAL_LONG(&_2, -1); ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_FUNCTION(&parts, "preg_split", NULL, 98, &_1, &_0, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&parts, "preg_split", NULL, 67, &_1, &_0, &_2, &_3); zephir_check_call_status(); zephir_is_iterable(&parts, 0, "phalcon/Http/Request.zep", 1430); if (Z_TYPE_P(&parts) == IS_ARRAY) { @@ -3992,7 +3992,7 @@ PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_7$$3, "/\\s*;\\s*/"); ZVAL_LONG(&_8$$3, -1); ZVAL_LONG(&_9$$3, 1); - ZEPHIR_CALL_FUNCTION(&_10$$3, "preg_split", NULL, 98, &_7$$3, &_6$$3, &_8$$3, &_9$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "preg_split", NULL, 67, &_7$$3, &_6$$3, &_8$$3, &_9$$3); zephir_check_call_status(); zephir_is_iterable(&_10$$3, 0, "phalcon/Http/Request.zep", 1427); if (Z_TYPE_P(&_10$$3) == IS_ARRAY) { @@ -4090,7 +4090,7 @@ PHP_METHOD(Phalcon_Http_Request, getQualityHeader) ZVAL_STRING(&_30$$14, "/\\s*;\\s*/"); ZVAL_LONG(&_31$$14, -1); ZVAL_LONG(&_32$$14, 1); - ZEPHIR_CALL_FUNCTION(&_33$$14, "preg_split", NULL, 98, &_30$$14, &_29$$14, &_31$$14, &_32$$14); + ZEPHIR_CALL_FUNCTION(&_33$$14, "preg_split", NULL, 67, &_30$$14, &_29$$14, &_31$$14, &_32$$14); zephir_check_call_status(); zephir_is_iterable(&_33$$14, 0, "phalcon/Http/Request.zep", 1427); if (Z_TYPE_P(&_33$$14) == IS_ARRAY) { @@ -4243,7 +4243,7 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); ZEPHIR_CPY_WRT(&container, &_0); - ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 415); + ZEPHIR_CALL_METHOD(&server, this_ptr, "getserverarray", NULL, 337); zephir_check_call_status(); if (Z_TYPE_P(&container) == IS_OBJECT) { ZEPHIR_INIT_VAR(&_2$$3); @@ -4279,13 +4279,13 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) } ZEPHIR_INIT_VAR(&_9); ZVAL_STRING(&_9, "PHP_AUTH_USER"); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 413, &_9); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "hasserver", NULL, 335, &_9); zephir_check_call_status(); _10 = zephir_is_true(&_0); if (_10) { ZEPHIR_INIT_NVAR(&_9); ZVAL_STRING(&_9, "PHP_AUTH_PW"); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "hasserver", NULL, 413, &_9); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "hasserver", NULL, 335, &_9); zephir_check_call_status(); _10 = zephir_is_true(&_11); } @@ -4303,11 +4303,11 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) } else { ZEPHIR_INIT_VAR(&_16$$8); ZVAL_STRING(&_16$$8, "HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_15$$8, this_ptr, "hasserver", NULL, 413, &_16$$8); + ZEPHIR_CALL_METHOD(&_15$$8, this_ptr, "hasserver", NULL, 335, &_16$$8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$8); ZVAL_STRING(&_16$$8, "REDIRECT_HTTP_AUTHORIZATION"); - ZEPHIR_CALL_METHOD(&_17$$8, this_ptr, "hasserver", NULL, 413, &_16$$8); + ZEPHIR_CALL_METHOD(&_17$$8, this_ptr, "hasserver", NULL, 335, &_16$$8); zephir_check_call_status(); if (zephir_is_true(&_15$$8)) { ZEPHIR_INIT_VAR(&_18$$9); @@ -4323,29 +4323,29 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) if (zephir_is_true(&authHeader)) { ZEPHIR_INIT_VAR(&_20$$11); ZVAL_STRING(&_20$$11, "basic "); - ZEPHIR_CALL_FUNCTION(&_21$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_21$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "digest "); - ZEPHIR_CALL_FUNCTION(&_22$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_22$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); _23$$11 = ZEPHIR_IS_LONG_IDENTICAL(&_22$$11, 0); if (_23$$11) { ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "PHP_AUTH_DIGEST"); - ZEPHIR_CALL_METHOD(&_24$$11, this_ptr, "hasserver", NULL, 413, &_20$$11); + ZEPHIR_CALL_METHOD(&_24$$11, this_ptr, "hasserver", NULL, 335, &_20$$11); zephir_check_call_status(); _23$$11 = !zephir_is_true(&_24$$11); } ZEPHIR_INIT_NVAR(&_20$$11); ZVAL_STRING(&_20$$11, "bearer "); - ZEPHIR_CALL_FUNCTION(&_25$$11, "stripos", NULL, 418, &authHeader, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_25$$11, "stripos", NULL, 340, &authHeader, &_20$$11); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_21$$11, 0)) { ZVAL_LONG(&_26$$12, 6); ZEPHIR_INIT_VAR(&_27$$12); zephir_substr(&_27$$12, &authHeader, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_28$$12, "base64_decode", NULL, 244, &_27$$12); + ZEPHIR_CALL_FUNCTION(&_28$$12, "base64_decode", NULL, 225, &_27$$12); zephir_check_call_status(); ZEPHIR_INIT_VAR(&exploded); zephir_fast_explode_str(&exploded, SL(":"), &_28$$12, 2 ); @@ -4369,7 +4369,7 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) zephir_array_fetch_string(&_32$$17, &headers, SL("Php-Auth-Pw"), PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1502); ZEPHIR_INIT_VAR(&_33$$17); ZEPHIR_CONCAT_VSV(&_33$$17, &_31$$17, ":", &_32$$17); - ZEPHIR_CALL_FUNCTION(&_34$$17, "base64_encode", NULL, 245, &_33$$17); + ZEPHIR_CALL_FUNCTION(&_34$$17, "base64_encode", NULL, 226, &_33$$17); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_35$$17); ZEPHIR_CONCAT_SV(&_35$$17, "Basic ", &_34$$17); @@ -4508,7 +4508,7 @@ PHP_METHOD(Phalcon_Http_Request, smoothFiles) zephir_array_fetch(&_8$$5, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1554); zephir_array_fetch(&_9$$5, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1555); zephir_array_fetch(&_10$$5, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1556); - ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 420, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &_10$$5, &p); + ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 343, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &_10$$5, &p); zephir_check_call_status(); zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1563); if (Z_TYPE_P(&parentFiles) == IS_ARRAY) { @@ -4577,7 +4577,7 @@ PHP_METHOD(Phalcon_Http_Request, smoothFiles) zephir_array_fetch(&_18$$10, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1554); zephir_array_fetch(&_19$$10, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1555); zephir_array_fetch(&_20$$10, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/Http/Request.zep", 1556); - ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 420, &_16$$10, &_17$$10, &_18$$10, &_19$$10, &_20$$10, &p); + ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_11, 343, &_16$$10, &_17$$10, &_18$$10, &_19$$10, &_20$$10, &p); zephir_check_call_status(); zephir_is_iterable(&parentFiles, 0, "phalcon/Http/Request.zep", 1563); if (Z_TYPE_P(&parentFiles) == IS_ARRAY) { diff --git a/ext/phalcon/http/request/file.zep.c b/ext/phalcon/http/request/file.zep.c index fc8c13b0727..cd787330c8c 100644 --- a/ext/phalcon/http/request/file.zep.c +++ b/ext/phalcon/http/request/file.zep.c @@ -173,33 +173,33 @@ PHP_METHOD(Phalcon_Http_Request_File, __construct) zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); ZEPHIR_INIT_VAR(&_0$$3); ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION"); - ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 141, &_0$$3); + ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 113, &_0$$3); zephir_check_call_status(); if (zephir_is_true(&_1$$3)) { ZVAL_LONG(&_2$$4, 4); - ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 116, &name, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 85, &name, &_2$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("extension"), &_3$$4); } } ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, "tmp_name"); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 426, &file, &_5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getarrval", NULL, 349, &file, &_5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("tmp"), &_4); ZEPHIR_INIT_NVAR(&_5); ZVAL_STRING(&_5, "size"); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 426, &file, &_5); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "getarrval", NULL, 349, &file, &_5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("size"), &_6); ZEPHIR_INIT_NVAR(&_5); ZVAL_STRING(&_5, "type"); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 426, &file, &_5); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getarrval", NULL, 349, &file, &_5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_7); ZEPHIR_INIT_NVAR(&_5); ZVAL_STRING(&_5, "error"); - ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 426, &file, &_5); + ZEPHIR_CALL_METHOD(&_8, this_ptr, "getarrval", NULL, 349, &file, &_5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("error"), &_8); if (zephir_is_true(key)) { @@ -238,15 +238,15 @@ PHP_METHOD(Phalcon_Http_Request_File, getRealType) ZEPHIR_MM_GROW(); ZVAL_LONG(&_0, 16); - ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 325, &_0); + ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 307, &_0); zephir_check_call_status(); - if (Z_TYPE_P(&finfo) != IS_RESOURCE) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&finfo)) { RETURN_MM_STRING(""); } zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 326, &finfo, &_0); + ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 308, &finfo, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 327, &finfo); + ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 309, &finfo); zephir_check_call_status(); RETURN_CCTOR(&mime); } @@ -351,7 +351,7 @@ PHP_METHOD(Phalcon_Http_Request_File, moveTo) zephir_read_property(&_0, this_ptr, ZEND_STRL("tmp"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 397, &_0, &destination); + ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 350, &_0, &destination); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/http/response.zep.c b/ext/phalcon/http/response.zep.c index 2a7de1ed960..7117d692d94 100644 --- a/ext/phalcon/http/response.zep.c +++ b/ext/phalcon/http/response.zep.c @@ -502,7 +502,7 @@ PHP_METHOD(Phalcon_Http_Response, redirect) if (_0$$5) { ZEPHIR_INIT_VAR(&_1$$5); ZVAL_STRING(&_1$$5, "://"); - ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 427, location, &_1$$5); + ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 351, location, &_1$$5); zephir_check_call_status(); _0$$5 = zephir_is_true(&_2$$5); } @@ -667,7 +667,7 @@ PHP_METHOD(Phalcon_Http_Response, send) _3$$5 = ((zephir_fast_strlen_ev(&file)) ? 1 : 0); } if (_3$$5) { - ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 428, &file); + ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 352, &file); zephir_check_call_status(); } } @@ -1159,16 +1159,16 @@ PHP_METHOD(Phalcon_Http_Response, setFileToSend) ZEPHIR_INIT_VAR(&basePathEncoding); ZVAL_STRING(&basePathEncoding, "ASCII"); if (Z_TYPE_P(attachmentName) != IS_STRING) { - ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 429, &filePath); + ZEPHIR_CALL_METHOD(&basePath, this_ptr, "getbasename", NULL, 353, &filePath); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&basePath, attachmentName); } if (zephir_is_true(attachment)) { if ((zephir_function_exists_ex(ZEND_STRL("mb_detect_encoding")) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 430); + ZEPHIR_CALL_FUNCTION(&_0$$6, "mb_detect_order", NULL, 354); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 341, &basePath, &_0$$6, &__$true); + ZEPHIR_CALL_FUNCTION(&basePathEncoding, "mb_detect_encoding", NULL, 323, &basePath, &_0$$6, &__$true); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_1$$5); @@ -1184,7 +1184,7 @@ PHP_METHOD(Phalcon_Http_Response, setFileToSend) ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5); zephir_check_call_status(); if (!ZEPHIR_IS_STRING(&basePathEncoding, "ASCII")) { - ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 345, &basePath); + ZEPHIR_CALL_FUNCTION(&_2$$7, "rawurlencode", NULL, 327, &basePath); zephir_check_call_status(); ZEPHIR_CPY_WRT(&basePath, &_2$$7); ZEPHIR_INIT_VAR(&_3$$7); @@ -1196,7 +1196,7 @@ PHP_METHOD(Phalcon_Http_Response, setFileToSend) } else { ZEPHIR_INIT_VAR(&_5$$8); ZVAL_STRING(&_5$$8, "\15\17\\\""); - ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 229, &basePath, &_5$$8); + ZEPHIR_CALL_FUNCTION(&_6$$8, "addcslashes", NULL, 210, &basePath, &_5$$8); zephir_check_call_status(); ZEPHIR_CPY_WRT(&basePath, &_6$$8); ZEPHIR_INIT_VAR(&_7$$8); @@ -1376,7 +1376,7 @@ PHP_METHOD(Phalcon_Http_Response, setJsonContent) zephir_check_call_status(); ZVAL_LONG(&_2, jsonOptions); ZVAL_LONG(&_3, depth); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 431, content, &_2, &_3); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "encode", NULL, 355, content, &_2, &_3); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &_1); zephir_check_call_status(); @@ -1546,7 +1546,7 @@ PHP_METHOD(Phalcon_Http_Response, setStatusCode) if (_6$$3) { ZEPHIR_INIT_NVAR(&_7$$3); ZVAL_STRING(&_7$$3, "HTTP/"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 427, &key, &_7$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "strstr", &_9, 351, &key, &_7$$3); zephir_check_call_status(); _6$$3 = zephir_is_true(&_8$$3); } @@ -1573,7 +1573,7 @@ PHP_METHOD(Phalcon_Http_Response, setStatusCode) if (_11$$5) { ZEPHIR_INIT_NVAR(&_12$$5); ZVAL_STRING(&_12$$5, "HTTP/"); - ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 427, &key, &_12$$5); + ZEPHIR_CALL_FUNCTION(&_13$$5, "strstr", &_9, 351, &key, &_12$$5); zephir_check_call_status(); _11$$5 = zephir_is_true(&_13$$5); } @@ -1804,7 +1804,7 @@ PHP_METHOD(Phalcon_Http_Response, getBasename) ZVAL_STRING(&_2, "/"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "@"); - ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 432, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 356, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@"); @@ -1820,13 +1820,13 @@ PHP_METHOD(Phalcon_Http_Response, getBasename) if (zephir_is_true(suffix)) { ZEPHIR_INIT_VAR(&_6$$3); ZVAL_STRING(&_6$$3, "@"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 432, suffix, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 356, suffix, &_6$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$3); ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@"); ZEPHIR_INIT_NVAR(&_6$$3); ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 50, &_8$$3, &_6$$3, &filename); + ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 37, &_8$$3, &_6$$3, &filename); zephir_check_call_status(); ZEPHIR_CPY_WRT(&filename, &_9$$3); } @@ -1880,16 +1880,16 @@ PHP_METHOD(Phalcon_Http_Response, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Http/Response.zep", 885); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/http/response/cookies.zep.c b/ext/phalcon/http/response/cookies.zep.c index 6ae178a5e05..c8e6c420941 100644 --- a/ext/phalcon/http/response/cookies.zep.c +++ b/ext/phalcon/http/response/cookies.zep.c @@ -403,7 +403,7 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, send) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 433); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 357); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0); if (!(_1)) { diff --git a/ext/phalcon/http/response/headers.zep.c b/ext/phalcon/http/response/headers.zep.c index af716aeefdb..c861d684566 100644 --- a/ext/phalcon/http/response/headers.zep.c +++ b/ext/phalcon/http/response/headers.zep.c @@ -217,7 +217,7 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 433); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 357); zephir_check_call_status(); _1 = ZEPHIR_IS_TRUE_IDENTICAL(&_0); if (!(_1)) { @@ -243,7 +243,7 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) if (Z_TYPE_P(&value) != IS_NULL) { ZEPHIR_INIT_NVAR(&_8$$5); ZEPHIR_CONCAT_VSV(&_8$$5, &header, ": ", &value); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_8$$5, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_8$$5, &__$true); zephir_check_call_status(); } else { _10$$6 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99); @@ -255,12 +255,12 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) _10$$6 = ZEPHIR_IS_STRING(&_13$$6, "HTTP/"); } if (_10$$6) { - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &header, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &header, &__$true); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_14$$8); ZEPHIR_CONCAT_VS(&_14$$8, &header, ": "); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_14$$8, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_14$$8, &__$true); zephir_check_call_status(); } } @@ -281,7 +281,7 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) if (Z_TYPE_P(&value) != IS_NULL) { ZEPHIR_INIT_NVAR(&_15$$10); ZEPHIR_CONCAT_VSV(&_15$$10, &header, ": ", &value); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_15$$10, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_15$$10, &__$true); zephir_check_call_status(); } else { _16$$11 = zephir_memnstr_str(&header, SL(":"), "phalcon/Http/Response/Headers.zep", 99); @@ -293,12 +293,12 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) _16$$11 = ZEPHIR_IS_STRING(&_19$$11, "HTTP/"); } if (_16$$11) { - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &header, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &header, &__$true); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&_20$$13); ZEPHIR_CONCAT_VS(&_20$$13, &header, ": "); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 434, &_20$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_9, 358, &_20$$13, &__$true); zephir_check_call_status(); } } diff --git a/ext/phalcon/http/server/abstractmiddleware.zep.c b/ext/phalcon/http/server/abstractmiddleware.zep.c deleted file mode 100644 index 858cfc6a72b..00000000000 --- a/ext/phalcon/http/server/abstractmiddleware.zep.c +++ /dev/null @@ -1,50 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Participant in processing a server request and response. - * - * An HTTP middleware component participates in processing an HTTP message: - * by acting on the request, generating the response, or forwarding the - * request to a subsequent middleware and possibly acting on its response. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractMiddleware) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Server, AbstractMiddleware, phalcon, http_server_abstractmiddleware, phalcon_http_server_abstractmiddleware_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_class_implements(phalcon_http_server_abstractmiddleware_ce, 1, zephir_get_internal_ce(SL("psr\\http\\server\\middlewareinterface"))); - return SUCCESS; -} - -/** - * Process an incoming server request. - * - * Processes an incoming server request in order to produce a response. - * If unable to produce the response itself, it may delegate to the provided - * request handler to do so. - */ -PHP_METHOD(Phalcon_Http_Server_AbstractMiddleware, process) -{ -} - diff --git a/ext/phalcon/http/server/abstractmiddleware.zep.h b/ext/phalcon/http/server/abstractmiddleware.zep.h deleted file mode 100644 index f6e7abee178..00000000000 --- a/ext/phalcon/http/server/abstractmiddleware.zep.h +++ /dev/null @@ -1,16 +0,0 @@ - -extern zend_class_entry *phalcon_http_server_abstractmiddleware_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractMiddleware); - -PHP_METHOD(Phalcon_Http_Server_AbstractMiddleware, process); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_server_abstractmiddleware_process, 0, 2, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) - ZEND_ARG_OBJ_INFO(0, handler, Psr\\Http\\Server\\RequestHandlerInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_server_abstractmiddleware_method_entry) { - PHP_ME(Phalcon_Http_Server_AbstractMiddleware, process, arginfo_phalcon_http_server_abstractmiddleware_process, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/http/server/abstractrequesthandler.zep.c b/ext/phalcon/http/server/abstractrequesthandler.zep.c deleted file mode 100644 index 9b73ffa1c0b..00000000000 --- a/ext/phalcon/http/server/abstractrequesthandler.zep.c +++ /dev/null @@ -1,47 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include "../../../ext_config.h" -#endif - -#include -#include "../../../php_ext.h" -#include "../../../ext.h" - -#include -#include -#include - -#include "kernel/main.h" - - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ -/** - * Handles a server request and produces a response. - * - * An HTTP request handler process an HTTP request in order to produce an - * HTTP response. - */ -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractRequestHandler) -{ - ZEPHIR_REGISTER_CLASS(Phalcon\\Http\\Server, AbstractRequestHandler, phalcon, http_server_abstractrequesthandler, phalcon_http_server_abstractrequesthandler_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - - zend_class_implements(phalcon_http_server_abstractrequesthandler_ce, 1, zephir_get_internal_ce(SL("psr\\http\\server\\requesthandlerinterface"))); - return SUCCESS; -} - -/** - * Handles a request and produces a response. - * - * May call other collaborating code to generate the response. - */ -PHP_METHOD(Phalcon_Http_Server_AbstractRequestHandler, handle) -{ -} - diff --git a/ext/phalcon/http/server/abstractrequesthandler.zep.h b/ext/phalcon/http/server/abstractrequesthandler.zep.h deleted file mode 100644 index 6ffb062b983..00000000000 --- a/ext/phalcon/http/server/abstractrequesthandler.zep.h +++ /dev/null @@ -1,15 +0,0 @@ - -extern zend_class_entry *phalcon_http_server_abstractrequesthandler_ce; - -ZEPHIR_INIT_CLASS(Phalcon_Http_Server_AbstractRequestHandler); - -PHP_METHOD(Phalcon_Http_Server_AbstractRequestHandler, handle); - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_server_abstractrequesthandler_handle, 0, 1, Psr\\Http\\Message\\ResponseInterface, 0) - ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) -ZEND_END_ARG_INFO() - -ZEPHIR_INIT_FUNCS(phalcon_http_server_abstractrequesthandler_method_entry) { - PHP_ME(Phalcon_Http_Server_AbstractRequestHandler, handle, arginfo_phalcon_http_server_abstractrequesthandler_handle, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_FE_END -}; diff --git a/ext/phalcon/image/adapter/abstractadapter.zep.c b/ext/phalcon/image/adapter/abstractadapter.zep.c index 381422871dd..bcc810f9b58 100644 --- a/ext/phalcon/image/adapter/abstractadapter.zep.c +++ b/ext/phalcon/image/adapter/abstractadapter.zep.c @@ -31,8 +31,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Image\Adapter - * * All image adapters must use this class */ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AbstractAdapter) @@ -226,20 +224,20 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, background) ZVAL_STRING(&_6$$4, "/./"); ZEPHIR_INIT_VAR(&_7$$4); ZVAL_STRING(&_7$$4, "$0$0"); - ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 50, &_6$$4, &_7$$4, &color); + ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 37, &_6$$4, &_7$$4, &color); zephir_check_call_status(); zephir_get_strval(&color, &_8$$4); } ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &color, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11); ZVAL_STRING(&_11, "hexdec"); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 97, &_11, &_10); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 66, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); - zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); - zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 93); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 91); ZVAL_LONG(&_9, opacity); ZEPHIR_CALL_METHOD(NULL, this_ptr, "processbackground", NULL, 0, &_12, &_13, &_14, &_9); zephir_check_call_status(); @@ -657,7 +655,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, render) if (ZEPHIR_IS_EMPTY(&ext)) { zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 4); - ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 116, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 85, &_0$$3, &_1$$3); zephir_check_call_status(); zephir_cast_to_string(&_3$$3, &_2$$3); ZEPHIR_CPY_WRT(&ext, &_3$$3); @@ -752,7 +750,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _0$$3 = !height; } if (UNEXPECTED(_0$$3)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 277); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 275); return; } } else { @@ -762,7 +760,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _1$$6 = !height; } if (UNEXPECTED(_1$$6)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 284); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 282); return; } ZEPHIR_INIT_VAR(&_2$$6); @@ -783,7 +781,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _5$$8 = !height; } if (UNEXPECTED(_5$$8)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 293); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 291); return; } ZEPHIR_INIT_VAR(&_6$$8); @@ -801,7 +799,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) do { if (master == 2) { if (UNEXPECTED(!width)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 303); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 301); return; } zephir_read_property(&_9$$10, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); @@ -811,7 +809,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) } if (master == 3) { if (UNEXPECTED(!height)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 312); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 310); return; } zephir_read_property(&_11$$12, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -825,7 +823,7 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) _13$$14 = !height; } if (UNEXPECTED(_13$$14)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 323); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/Image/Adapter/AbstractAdapter.zep", 321); return; } zephir_read_property(&_14$$14, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -864,14 +862,14 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, resize) ZVAL_LONG(&_24, width); zephir_round(&_23, &_24, NULL, NULL); ZVAL_LONG(&_25, 1); - ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 117, &_23, &_25); + ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 86, &_23, &_25); zephir_check_call_status(); width = zephir_get_intval(&_26); ZEPHIR_INIT_VAR(&_27); ZVAL_LONG(&_25, height); zephir_round(&_27, &_25, NULL, NULL); ZVAL_LONG(&_28, 1); - ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 117, &_27, &_28); + ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 86, &_27, &_28); zephir_check_call_status(); height = zephir_get_intval(&_29); ZVAL_LONG(&_28, width); @@ -1119,20 +1117,20 @@ PHP_METHOD(Phalcon_Image_Adapter_AbstractAdapter, text) ZVAL_STRING(&_6$$7, "/./"); ZEPHIR_INIT_VAR(&_7$$7); ZVAL_STRING(&_7$$7, "$0$0"); - ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 50, &_6$$7, &_7$$7, &color); + ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 37, &_6$$7, &_7$$7, &color); zephir_check_call_status(); zephir_get_strval(&color, &_8$$7); } ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 115, &color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 84, &color, &_9); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_11); ZVAL_STRING(&_11, "hexdec"); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 97, &_11, &_10); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 66, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 449); - zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 450); - zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 451); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 447); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 448); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/AbstractAdapter.zep", 449); ZVAL_LONG(&_9, opacity); ZVAL_LONG(&_15, size); ZEPHIR_CALL_METHOD(NULL, this_ptr, "processtext", NULL, 0, &text, offsetX, offsetY, &_9, &_12, &_13, &_14, &_15, &fontfile); diff --git a/ext/phalcon/image/adapter/adapterinterface.zep.c b/ext/phalcon/image/adapter/adapterinterface.zep.c index 789b58c5f1a..56e817fc00c 100644 --- a/ext/phalcon/image/adapter/adapterinterface.zep.c +++ b/ext/phalcon/image/adapter/adapterinterface.zep.c @@ -20,6 +20,9 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ +/** + * Interface for Phalcon\Image\Adapter classes + */ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_AdapterInterface) { ZEPHIR_REGISTER_INTERFACE(Phalcon\\Image\\Adapter, AdapterInterface, phalcon, image_adapter_adapterinterface, phalcon_image_adapter_adapterinterface_method_entry); diff --git a/ext/phalcon/image/adapter/gd.zep.c b/ext/phalcon/image/adapter/gd.zep.c index d94788ac0f8..cfa6ff01212 100644 --- a/ext/phalcon/image/adapter/gd.zep.c +++ b/ext/phalcon/image/adapter/gd.zep.c @@ -133,11 +133,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_1, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); if ((zephir_file_exists(&_1) == SUCCESS)) { zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 102, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 71, &_2$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_3$$4); zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 328, &_4$$4); + ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 310, &_4$$4); zephir_check_call_status(); if (zephir_is_true(&imageinfo)) { zephir_array_fetch_long(&_5$$5, &imageinfo, 0, PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 38); @@ -153,35 +153,35 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) do { if (ZEPHIR_IS_LONG(&_9$$4, 1)) { zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 435, &_10$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 359, &_10$$6); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_11$$6); break; } if (ZEPHIR_IS_LONG(&_9$$4, 2)) { zephir_read_property(&_12$$7, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 436, &_12$$7); + ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 360, &_12$$7); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_13$$7); break; } if (ZEPHIR_IS_LONG(&_9$$4, 3)) { zephir_read_property(&_14$$8, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 437, &_14$$8); + ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 361, &_14$$8); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_15$$8); break; } if (ZEPHIR_IS_LONG(&_9$$4, 15)) { zephir_read_property(&_16$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 438, &_16$$9); + ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 362, &_16$$9); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_17$$9); break; } if (ZEPHIR_IS_LONG(&_9$$4, 16)) { zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 439, &_18$$10); + ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 363, &_18$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_19$$10); break; @@ -193,7 +193,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_22$$12, this_ptr, ZEND_STRL("mime"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_23$$12); ZEPHIR_CONCAT_SVS(&_23$$12, "Installed GD does not support ", &_22$$12, " images"); - ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 31, &_23$$12); + ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 29, &_23$$12); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$12, "phalcon/Image/Adapter/Gd.zep", 69); ZEPHIR_MM_RESTORE(); @@ -204,7 +204,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) } while(0); zephir_read_property(&_24$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &_24$$4, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &_24$$4, &__$true); zephir_check_call_status(); } else { _25$$13 = !width; @@ -217,7 +217,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) zephir_read_property(&_27$$14, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_28$$14); ZEPHIR_CONCAT_SV(&_28$$14, "Failed to create image from file ", &_27$$14); - ZEPHIR_CALL_METHOD(NULL, &_26$$14, "__construct", NULL, 31, &_28$$14); + ZEPHIR_CALL_METHOD(NULL, &_26$$14, "__construct", NULL, 29, &_28$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_26$$14, "phalcon/Image/Adapter/Gd.zep", 83); ZEPHIR_MM_RESTORE(); @@ -225,14 +225,14 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) } ZVAL_LONG(&_29$$13, width); ZVAL_LONG(&_30$$13, height); - ZEPHIR_CALL_FUNCTION(&_31$$13, "imagecreatetruecolor", NULL, 441, &_29$$13, &_30$$13); + ZEPHIR_CALL_FUNCTION(&_31$$13, "imagecreatetruecolor", NULL, 365, &_29$$13, &_30$$13); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &_31$$13); zephir_read_property(&_29$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &_29$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &_29$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_30$$13, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &_30$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &_30$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_32$$13, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_32$$13); @@ -269,7 +269,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct) zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&image, &_0); if (Z_TYPE_P(&image) == IS_RESOURCE) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &image); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &image); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -309,14 +309,14 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, check) ZVAL_STRING(&_1, "2.0.1"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, ">="); - ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 88, &version, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 128, &version, &_1, &_2); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_3))) { ZEPHIR_INIT_VAR(&_4$$5); object_init_ex(&_4$$5, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_5$$5); ZEPHIR_CONCAT_SV(&_5$$5, "Phalcon\\Image\\Adapter\\GD requires GD version '2.0.1' or greater, you have ", &version); - ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 31, &_5$$5); + ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 29, &_5$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$5, "phalcon/Image/Adapter/Gd.zep", 129); ZEPHIR_MM_RESTORE(); @@ -355,13 +355,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, getVersion) ZVAL_NULL(&version); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "GD_VERSION"); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_1)) { ZEPHIR_INIT_NVAR(&version); ZEPHIR_GET_CONSTANT(&version, "GD_VERSION"); } else { - ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 444); + ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 368); zephir_check_call_status(); ZEPHIR_INIT_VAR(&matches); ZVAL_NULL(&matches); @@ -424,7 +424,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); @@ -436,9 +436,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZVAL_LONG(&_5, g); ZVAL_LONG(&_6, b); ZVAL_LONG(&_7, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &background, &_4, &_5, &_6, &_7); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &background, &_4, &_5, &_6, &_7); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &background, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &background, &__$true); zephir_check_call_status(); zephir_read_property(&_4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); @@ -447,11 +447,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processBackground) ZVAL_LONG(&_8, 0); ZVAL_LONG(&_9, 0); ZVAL_LONG(&_10, 0); - ZEPHIR_CALL_FUNCTION(&_11, "imagecopy", NULL, 446, &background, &_4, &_7, &_8, &_9, &_10, &_5, &_6); + ZEPHIR_CALL_FUNCTION(&_11, "imagecopy", NULL, 370, &background, &_4, &_7, &_8, &_9, &_10, &_5, &_6); zephir_check_call_status(); if (zephir_is_true(&_11)) { zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_12$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_12$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &background); } @@ -488,7 +488,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processBlur) } zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 7); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 447, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 371, &_0$$3, &_1$$3); zephir_check_call_status(); i++; } @@ -524,11 +524,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processCreate) ZVAL_LONG(&_0, width); ZVAL_LONG(&_1, height); - ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 441, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 365, &_0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &image, &__$false); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &image, &__$false); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &image, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &image, &__$true); zephir_check_call_status(); RETURN_CCTOR(&image); } @@ -581,16 +581,16 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processCrop) ZVAL_LONG(&_0, height); zephir_array_update_string(&rect, SL("height"), &_0, PH_COPY | PH_SEPARATE); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 448, &_1, &rect); + ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 372, &_1, &rect); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_2); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); - ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 373, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3); - ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4); ZEPHIR_MM_RESTORE(); @@ -623,12 +623,12 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processFlip) if (direction == 11) { zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 451, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 375, &_0$$3, &_1$$3); zephir_check_call_status(); } else { zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 451, &_2$$4, &_3$$4); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 375, &_2$$4, &_3$$4); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -693,32 +693,32 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZEPHIR_CALL_METHOD(&_0, mask, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 452, &_0); + ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 376, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 449, &maskImage); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 373, &maskImage); zephir_check_call_status(); mask_width = zephir_get_intval(&_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 450, &maskImage); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 374, &maskImage); zephir_check_call_status(); mask_height = zephir_get_intval(&_2); alpha = 127; - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &maskImage, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &maskImage, &__$true); zephir_check_call_status(); zephir_read_property(&_3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_4, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&newimage, this_ptr, "processcreate", NULL, 0, &_3, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &newimage, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &newimage, &__$true); zephir_check_call_status(); ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &newimage, &_5, &_6, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &newimage, &_5, &_6, &_7, &_8); zephir_check_call_status(); ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 453, &newimage, &_5, &_6, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 377, &newimage, &_5, &_6, &color); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); _9 = !ZEPHIR_IS_LONG(&_5, mask_width); @@ -729,7 +729,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) if (_9) { zephir_read_property(&_10$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 441, &_10$$3, &_11$$3); + ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 365, &_10$$3, &_11$$3); zephir_check_call_status(); zephir_read_property(&_12$$3, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_13$$3, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); @@ -739,9 +739,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZVAL_LONG(&_17$$3, 0); ZVAL_LONG(&_18$$3, mask_width); ZVAL_LONG(&_19$$3, mask_height); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 454, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 378, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &maskImage); zephir_check_call_status(); ZEPHIR_CPY_WRT(&maskImage, &tempImage); } @@ -759,9 +759,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) } ZVAL_LONG(&_21$$5, x); ZVAL_LONG(&_22$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 455, &maskImage, &_21$$5, &_22$$5); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 379, &maskImage, &_21$$5, &_22$$5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 456, &maskImage, &index); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 380, &maskImage, &index); zephir_check_call_status(); if (zephir_array_isset_string(&color, SL("red"))) { zephir_array_fetch_string(&_25$$6, &color, SL("red"), PH_NOISY | PH_READONLY, "phalcon/Image/Adapter/Gd.zep", 291); @@ -771,10 +771,10 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) zephir_read_property(&_21$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_22$$5, x); ZVAL_LONG(&_27$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 455, &_21$$5, &_22$$5, &_27$$5); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 379, &_21$$5, &_22$$5, &_27$$5); zephir_check_call_status(); zephir_read_property(&_22$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 456, &_22$$5, &index); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 380, &_22$$5, &index); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&r); zephir_array_fetch_string(&r, &color, SL("red"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 296); @@ -783,20 +783,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processMask) ZEPHIR_OBS_NVAR(&b); zephir_array_fetch_string(&b, &color, SL("blue"), PH_NOISY, "phalcon/Image/Adapter/Gd.zep", 298); ZVAL_LONG(&_27$$5, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &newimage, &r, &g, &b, &_27$$5); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &newimage, &r, &g, &b, &_27$$5); zephir_check_call_status(); ZVAL_LONG(&_27$$5, x); ZVAL_LONG(&_28$$5, y); - ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 457, &newimage, &_27$$5, &_28$$5, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 381, &newimage, &_27$$5, &_28$$5, &color); zephir_check_call_status(); y++; } x++; } zephir_read_property(&_8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_8); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_8); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &maskImage); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &newimage); ZEPHIR_MM_RESTORE(); @@ -861,7 +861,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate) zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_6$$4, x1); ZVAL_LONG(&_7$$4, y1); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_8, 455, &_5$$4, &_6$$4, &_7$$4); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_8, 379, &_5$$4, &_6$$4, &_7$$4); zephir_check_call_status(); x2 = (x + amount); y2 = (y + amount); @@ -870,7 +870,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processPixelate) ZVAL_LONG(&_9$$4, y); ZVAL_LONG(&_10$$4, x2); ZVAL_LONG(&_11$$4, y2); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_12, 458, &_6$$4, &_7$$4, &_9$$4, &_10$$4, &_11$$4, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_12, 382, &_6$$4, &_7$$4, &_9$$4, &_10$$4, &_11$$4, &color); zephir_check_call_status(); y += amount; } @@ -937,7 +937,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); @@ -958,7 +958,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_8, 0); ZVAL_LONG(&_9, 0); ZVAL_LONG(&_10, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6); zephir_check_call_status(); offset = 0; while (1) { @@ -991,14 +991,14 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_22$$5, 0); ZVAL_LONG(&_23$$5, src_y); ZVAL_LONG(&_24$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5); zephir_check_call_status(); ZVAL_LONG(&_20$$5, 4); ZVAL_LONG(&_21$$5, 0); ZVAL_LONG(&_22$$5, 0); ZVAL_LONG(&_23$$5, 0); ZVAL_LONG(&_24$$5, dst_opacity); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 447, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 371, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5); zephir_check_call_status(); zephir_read_property(&_20$$5, this_ptr, ZEND_STRL("width"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_21$$5, 0); @@ -1006,18 +1006,18 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processReflection) ZVAL_LONG(&_23$$5, 0); ZVAL_LONG(&_24$$5, 0); ZVAL_LONG(&_26$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 446, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 370, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5); zephir_check_call_status(); offset++; } zephir_read_property(&_7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_7); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_7); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &reflection); - ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 449, &reflection); + ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 373, &reflection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_27); - ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 450, &reflection); + ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 374, &reflection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_28); ZEPHIR_MM_RESTORE(); @@ -1068,69 +1068,69 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processRender) ZEPHIR_INIT_VAR(&_0); zephir_fast_strtolower(&_0, &ext); zephir_get_strval(&ext, &_0); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 459); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 383); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "gif"); - ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "jpg"); - ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); _4 = ZEPHIR_IS_LONG(&_3, 0); if (!(_4)) { ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_5, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_5, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); _4 = ZEPHIR_IS_LONG(&_5, 0); } ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "png"); - ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "wbmp"); - ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "xbm"); - ZEPHIR_CALL_FUNCTION(&_8, "strcmp", NULL, 308, &ext, &_1); + ZEPHIR_CALL_FUNCTION(&_8, "strcmp", NULL, 290, &ext, &_1); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_2, 0)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 460, &_9$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 384, &_9$$3); zephir_check_call_status(); } else if (_4) { zephir_read_property(&_10$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_11$$4, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_10$$4, &__$null, &_11$$4); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_10$$4, &__$null, &_11$$4); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_6, 0)) { zephir_read_property(&_12$$5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 462, &_12$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 386, &_12$$5); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_7, 0)) { zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 463, &_13$$6); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 387, &_13$$6); zephir_check_call_status(); } else if (ZEPHIR_IS_LONG(&_8, 0)) { zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 464, &_14$$7, &__$null); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 388, &_14$$7, &__$null); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_15$$8); object_init_ex(&_15$$8, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_16$$8); ZEPHIR_CONCAT_SVS(&_16$$8, "Installed GD does not support '", &ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, &_15$$8, "__construct", NULL, 31, &_16$$8); + ZEPHIR_CALL_METHOD(NULL, &_15$$8, "__construct", NULL, 29, &_16$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$8, "phalcon/Image/Adapter/Gd.zep", 454); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 465); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 389); zephir_check_call_status(); RETURN_MM(); } @@ -1166,16 +1166,16 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processResize) zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1, width); ZVAL_LONG(&_2, height); - ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 466, &_0, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 390, &_0, &_1, &_2); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_1); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); - ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&_3, "imagesx", NULL, 373, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_3); - ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&_4, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_4); ZEPHIR_MM_RESTORE(); @@ -1221,18 +1221,18 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate) ZVAL_LONG(&_2, 0); ZVAL_LONG(&_3, 0); ZVAL_LONG(&_4, 127); - ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 445, &_0, &_1, &_2, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 369, &_0, &_1, &_2, &_3, &_4); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2, (360 - degrees)); ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 467, &_1, &_2, &transparent, &_3); + ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 391, &_1, &_2, &transparent, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &image, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &image, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 449, &image); + ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 373, &image); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 450, &image); + ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 374, &image); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3, 0); @@ -1240,11 +1240,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processRotate) ZVAL_LONG(&_5, 0); ZVAL_LONG(&_6, 0); ZVAL_LONG(&_7, 100); - ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 468, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 392, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7); zephir_check_call_status(); if (zephir_is_true(&_8)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &_9$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &_9$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("image"), &image); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &width); @@ -1308,11 +1308,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); if (!(zephir_is_true(&ext))) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 469, &_1$$3, &__$false); + ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 393, &_1$$3, &__$false); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_2); @@ -1320,30 +1320,30 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZEPHIR_CPY_WRT(&ext, &_2); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "gif"); - ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_3, 0)) { ZEPHIR_INIT_ZVAL_NREF(_4$$4); ZVAL_LONG(&_4$$4, 1); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_4$$4); zephir_read_property(&_4$$4, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 470, &_4$$4); + ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 394, &_4$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_5$$4); zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 460, &_6$$4, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 384, &_6$$4, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "jpg"); - ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); _8 = ZEPHIR_IS_LONG(&_7, 0); if (!(_8)) { ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); _8 = ZEPHIR_IS_LONG(&_9, 0); } @@ -1352,7 +1352,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) ZVAL_LONG(&_10$$5, 2); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_10$$5); zephir_read_property(&_10$$5, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 470, &_10$$5); + ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 394, &_10$$5); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_11$$5); if (quality >= 0) { @@ -1363,63 +1363,63 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) } zephir_read_property(&_12$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_13$$6, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_12$$6, &file, &_13$$6); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_12$$6, &file, &_13$$6); zephir_check_call_status(); } else { zephir_read_property(&_14$$9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 461, &_14$$9, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 385, &_14$$9, &file); zephir_check_call_status(); } RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "png"); - ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_15, 0)) { ZEPHIR_INIT_ZVAL_NREF(_16$$10); ZVAL_LONG(&_16$$10, 3); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_16$$10); zephir_read_property(&_16$$10, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 470, &_16$$10); + ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 394, &_16$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_17$$10); zephir_read_property(&_18$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 462, &_18$$10, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 386, &_18$$10, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "wbmp"); - ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_19, 0)) { ZEPHIR_INIT_ZVAL_NREF(_20$$11); ZVAL_LONG(&_20$$11, 15); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_20$$11); zephir_read_property(&_20$$11, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 470, &_20$$11); + ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 394, &_20$$11); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_21$$11); zephir_read_property(&_22$$11, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 463, &_22$$11, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 387, &_22$$11, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "xbm"); - ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 308, &ext, &_2); + ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 290, &ext, &_2); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_23, 0)) { ZEPHIR_INIT_ZVAL_NREF(_24$$12); ZVAL_LONG(&_24$$12, 16); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_24$$12); zephir_read_property(&_24$$12, this_ptr, ZEND_STRL("type"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 470, &_24$$12); + ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 394, &_24$$12); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_25$$12); zephir_read_property(&_26$$12, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 464, &_26$$12, &file); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 388, &_26$$12, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -1427,7 +1427,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSave) object_init_ex(&_2, phalcon_image_exception_ce); ZEPHIR_INIT_VAR(&_27); ZEPHIR_CONCAT_SVS(&_27, "Installed GD does not support '", &ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 31, &_27); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 29, &_27); zephir_check_call_status(); zephir_throw_exception_debug(&_2, "phalcon/Image/Adapter/Gd.zep", 576); ZEPHIR_MM_RESTORE(); @@ -1471,7 +1471,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen) ZEPHIR_INIT_VAR(&_0); ZVAL_LONG(&_1, (-18 + ((amount * 0.08)))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 2); zephir_round(&_0, &_2, &_1, NULL); @@ -1517,15 +1517,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processSharpen) zephir_read_property(&_5, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_6, (amount - 8)); ZVAL_LONG(&_7, 0); - ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 471, &_5, &matrix, &_6, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 395, &_5, &matrix, &_6, &_7); zephir_check_call_status(); if (zephir_is_true(&_8)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 449, &_9$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 373, &_9$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("width"), &_10$$3); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 450, &_11$$3); + ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 374, &_11$$3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("height"), &_12$$3); } @@ -1605,14 +1605,14 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) topRightY = 0; ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_1); zephir_check_call_status(); zephir_round(&_0, &_2, NULL, NULL); opacity = zephir_get_intval(&_0); if (!(ZEPHIR_IS_EMPTY(&fontfile))) { ZVAL_LONG(&_3$$3, size); ZVAL_LONG(&_4$$3, 0); - ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 472, &_3$$3, &_4$$3, &fontfile, &text); + ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 396, &_3$$3, &_4$$3, &fontfile, &text); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&space)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Call to imagettfbbox() failed", "phalcon/Image/Adapter/Gd.zep", 618); @@ -1633,11 +1633,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) topRightY = zephir_get_intval(&_8$$5); } ZVAL_LONG(&_3$$3, (topRightX - bottomLeftX)); - ZEPHIR_CALL_FUNCTION(&_9$$3, "abs", NULL, 299, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_9$$3, "abs", NULL, 281, &_3$$3); zephir_check_call_status(); width = (zephir_get_numberval(&_9$$3) + 10); ZVAL_LONG(&_3$$3, (topRightY - bottomLeftY)); - ZEPHIR_CALL_FUNCTION(&_10$$3, "abs", NULL, 299, &_3$$3); + ZEPHIR_CALL_FUNCTION(&_10$$3, "abs", NULL, 281, &_3$$3); zephir_check_call_status(); height = (zephir_get_numberval(&_10$$3) + 10); if (offsetX < 0) { @@ -1653,7 +1653,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_13$$3, g); ZVAL_LONG(&_14$$3, b); ZVAL_LONG(&_15$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &_3$$3, &_4$$3, &_13$$3, &_14$$3, &_15$$3); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &_3$$3, &_4$$3, &_13$$3, &_14$$3, &_15$$3); zephir_check_call_status(); angle = 0; zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -1661,15 +1661,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_14$$3, angle); ZVAL_LONG(&_15$$3, offsetX); ZVAL_LONG(&_16$$3, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 473, &_4$$3, &_13$$3, &_14$$3, &_15$$3, &_16$$3, &color, &fontfile, &text); + ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 397, &_4$$3, &_13$$3, &_14$$3, &_15$$3, &_16$$3, &color, &fontfile, &text); zephir_check_call_status(); } else { ZVAL_LONG(&_17$$8, size); - ZEPHIR_CALL_FUNCTION(&_18$$8, "imagefontwidth", NULL, 474, &_17$$8); + ZEPHIR_CALL_FUNCTION(&_18$$8, "imagefontwidth", NULL, 398, &_17$$8); zephir_check_call_status(); width = (zephir_get_intval(&_18$$8) * zephir_fast_strlen_ev(&text)); ZVAL_LONG(&_17$$8, size); - ZEPHIR_CALL_FUNCTION(&_19$$8, "imagefontheight", NULL, 475, &_17$$8); + ZEPHIR_CALL_FUNCTION(&_19$$8, "imagefontheight", NULL, 399, &_17$$8); zephir_check_call_status(); height = zephir_get_intval(&_19$$8); if (offsetX < 0) { @@ -1685,13 +1685,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processText) ZVAL_LONG(&_23$$8, g); ZVAL_LONG(&_24$$8, b); ZVAL_LONG(&_25$$8, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &_17$$8, &_22$$8, &_23$$8, &_24$$8, &_25$$8); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &_17$$8, &_22$$8, &_23$$8, &_24$$8, &_25$$8); zephir_check_call_status(); zephir_read_property(&_22$$8, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_23$$8, size); ZVAL_LONG(&_24$$8, offsetX); ZVAL_LONG(&_25$$8, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 476, &_22$$8, &_23$$8, &_24$$8, &_25$$8, &text, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 400, &_22$$8, &_23$$8, &_24$$8, &_25$$8, &text, &color); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -1746,20 +1746,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZEPHIR_CALL_METHOD(&_0, watermark, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 452, &_0); + ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 376, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 440, &overlay, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 364, &overlay, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 449, &overlay); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 373, &overlay); zephir_check_call_status(); width = zephir_get_intval(&_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 450, &overlay); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 374, &overlay); zephir_check_call_status(); height = zephir_get_intval(&_2); if (opacity < 100) { ZEPHIR_INIT_VAR(&_3$$3); ZVAL_DOUBLE(&_4$$3, ((zephir_safe_div_long_long((opacity * 127), 100)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 299, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 281, &_4$$3); zephir_check_call_status(); zephir_round(&_3$$3, &_5$$3, NULL, NULL); opacity = zephir_get_intval(&_3$$3); @@ -1767,20 +1767,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZVAL_LONG(&_6$$3, 127); ZVAL_LONG(&_7$$3, 127); ZVAL_LONG(&_8$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 445, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 369, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, 3); - ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 477, &overlay, &_4$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 401, &overlay, &_4$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, 0); ZVAL_LONG(&_6$$3, 0); ZVAL_LONG(&_7$$3, width); ZVAL_LONG(&_8$$3, height); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 458, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 382, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color); zephir_check_call_status(); } zephir_read_property(&_9, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 442, &_9, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 366, &_9, &__$true); zephir_check_call_status(); zephir_read_property(&_10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_11, offsetX); @@ -1789,10 +1789,10 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, processWatermark) ZVAL_LONG(&_14, 0); ZVAL_LONG(&_15, width); ZVAL_LONG(&_16, height); - ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 446, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16); + ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 370, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16); zephir_check_call_status(); if (zephir_is_true(&_17)) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 443, &overlay); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 367, &overlay); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/image/adapter/imagick.zep.c b/ext/phalcon/image/adapter/imagick.zep.c index e134524de1c..c56ad1c4554 100644 --- a/ext/phalcon/image/adapter/imagick.zep.c +++ b/ext/phalcon/image/adapter/imagick.zep.c @@ -160,7 +160,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_2, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); if ((zephir_file_exists(&_2) == SUCCESS)) { zephir_read_property(&_3$$4, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 102, &_3$$4); + ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 71, &_3$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("realpath"), &_4$$4); zephir_read_property(&_5$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -173,7 +173,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_9$$5, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_10$$5); ZEPHIR_CONCAT_SVS(&_10$$5, "Imagick::readImage ", &_9$$5, " failed"); - ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 31, &_10$$5); + ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 29, &_10$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$5, "phalcon/Image/Adapter/Imagick.zep", 63); ZEPHIR_MM_RESTORE(); @@ -186,7 +186,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_13$$6, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$6); ZVAL_STRING(&_14$$6, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 142, &_14$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 114, &_14$$6); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_13$$6, "setimagealphachannel", NULL, 0, &_15$$6); zephir_check_call_status(); @@ -215,7 +215,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) zephir_read_property(&_22$$9, this_ptr, ZEND_STRL("file"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_23$$9); ZEPHIR_CONCAT_SV(&_23$$9, "Failed to create image from file ", &_22$$9); - ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 31, &_23$$9); + ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 29, &_23$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_21$$9, "phalcon/Image/Adapter/Imagick.zep", 84); ZEPHIR_MM_RESTORE(); @@ -330,12 +330,12 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, check) } ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "Imagick::IMAGICK_EXTNUM"); - ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 141, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 113, &_2); zephir_check_call_status(); if (zephir_is_true(&_3)) { ZEPHIR_INIT_VAR(&_4$$5); ZVAL_STRING(&_4$$5, "Imagick::IMAGICK_EXTNUM"); - ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 142, &_4$$5); + ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 114, &_4$$5); zephir_check_call_status(); zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, ZEND_STRL("version"), &_5$$5); } @@ -454,7 +454,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) ZVAL_LONG(&_1, r); ZVAL_LONG(&_2, g); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 140, &_0, &_1, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 112, &_0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&pixel1); object_init_ex(&pixel1, zephir_get_internal_ce(SL("imagickpixel"))); @@ -484,7 +484,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) if (!(zephir_is_true(&_7$$3))) { ZEPHIR_INIT_NVAR(&_9$$4); ZVAL_STRING(&_9$$4, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 142, &_9$$4); + ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 114, &_9$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &background, "setimagealphachannel", &_12, 0, &_10$$4); zephir_check_call_status(); @@ -493,11 +493,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZVAL_LONG(&_17$$3, opacity); ZEPHIR_CALL_METHOD(NULL, &background, "evaluateimage", &_18, 0, &_15$$3, &_17$$3, &_16$$3); @@ -510,7 +510,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processBackground) zephir_read_property(&_21$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_14$$3); ZVAL_STRING(&_14$$3, "Imagick::COMPOSITE_DISSOLVE"); - ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 142, &_14$$3); + ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 114, &_14$$3); zephir_check_call_status(); ZVAL_LONG(&_23$$3, 0); ZVAL_LONG(&_24$$3, 0); @@ -846,7 +846,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processMask) zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_5$$3); ZVAL_STRING(&_5$$3, "Imagick::COMPOSITE_DSTIN"); - ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 142, &_5$$3); + ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 114, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_8$$3, 0); ZVAL_LONG(&_9$$3, 0); @@ -1080,7 +1080,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) while (1) { ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::COMPOSITE_DSTOUT"); - ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZVAL_LONG(&_22$$7, 0); ZVAL_LONG(&_23$$7, 0); @@ -1092,11 +1092,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) } ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_19$$7); ZVAL_STRING(&_19$$7, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 142, &_19$$7); + ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 114, &_19$$7); zephir_check_call_status(); ZVAL_LONG(&_22$$7, opacity); ZEPHIR_CALL_METHOD(NULL, &reflection, "evaluateimage", &_27, 0, &_25$$7, &_22$$7, &_26$$7); @@ -1132,7 +1132,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_36$$10); ZVAL_STRING(&_36$$10, "Imagick::ALPHACHANNEL_SET"); - ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 142, &_36$$10); + ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 114, &_36$$10); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &image, "setimagealphachannel", &_38, 0, &_37$$10); zephir_check_call_status(); @@ -1149,7 +1149,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) zephir_read_property(&_44$$10, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_36$$10); ZVAL_STRING(&_36$$10, "Imagick::COMPOSITE_SRC"); - ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 142, &_36$$10); + ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 114, &_36$$10); zephir_check_call_status(); ZVAL_LONG(&_46$$10, 0); ZVAL_LONG(&_47$$10, 0); @@ -1175,7 +1175,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processReflection) while (1) { ZEPHIR_INIT_NVAR(&_50$$13); ZVAL_STRING(&_50$$13, "Imagick::COMPOSITE_OVER"); - ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 142, &_50$$13); + ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 114, &_50$$13); zephir_check_call_status(); zephir_read_property(&_52$$13, this_ptr, ZEND_STRL("height"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_53$$13, 0); @@ -1276,7 +1276,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender) zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_3); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "gif"); - ZEPHIR_CALL_FUNCTION(&_5, "strcasecmp", NULL, 47, &extension, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "strcasecmp", NULL, 35, &extension, &_4); zephir_check_call_status(); if (ZEPHIR_IS_LONG_IDENTICAL(&_5, 0)) { ZEPHIR_CALL_METHOD(NULL, &image, "optimizeimagelayers", NULL, 0); @@ -1284,20 +1284,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processRender) } else { ZEPHIR_INIT_VAR(&_6$$4); ZVAL_STRING(&_6$$4, "jpg"); - ZEPHIR_CALL_FUNCTION(&_7$$4, "strcasecmp", NULL, 47, &extension, &_6$$4); + ZEPHIR_CALL_FUNCTION(&_7$$4, "strcasecmp", NULL, 35, &extension, &_6$$4); zephir_check_call_status(); _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_7$$4, 0); if (!(_8$$4)) { ZEPHIR_INIT_NVAR(&_6$$4); ZVAL_STRING(&_6$$4, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_9$$4, "strcasecmp", NULL, 47, &extension, &_6$$4); + ZEPHIR_CALL_FUNCTION(&_9$$4, "strcasecmp", NULL, 35, &extension, &_6$$4); zephir_check_call_status(); _8$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_9$$4, 0); } if (_8$$4) { ZEPHIR_INIT_VAR(&_10$$5); ZVAL_STRING(&_10$$5, "Imagick::COMPRESSION_JPEG"); - ZEPHIR_CALL_FUNCTION(&_11$$5, "constant", NULL, 142, &_10$$5); + ZEPHIR_CALL_FUNCTION(&_11$$5, "constant", NULL, 114, &_10$$5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompression", NULL, 0, &_11$$5); zephir_check_call_status(); @@ -1494,7 +1494,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_0, "setformat", NULL, 0, &ext); @@ -1514,7 +1514,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_update_property_zval(this_ptr, ZEND_STRL("mime"), &_6); ZEPHIR_INIT_VAR(&_7); ZVAL_STRING(&_7, "gif"); - ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&_8, 0)) { zephir_read_property(&_9$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); @@ -1522,7 +1522,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_10$$3); ZVAL_STRING(&_10$$3, "w"); - ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 90, &file, &_10$$3); + ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 134, &file, &_10$$3); zephir_check_call_status(); zephir_read_property(&_11$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_11$$3, "writeimagesfile", NULL, 0, &fp); @@ -1532,13 +1532,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) } ZEPHIR_INIT_NVAR(&_7); ZVAL_STRING(&_7, "jpg"); - ZEPHIR_CALL_FUNCTION(&_12, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_12, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); _13 = ZEPHIR_IS_LONG(&_12, 0); if (!(_13)) { ZEPHIR_INIT_NVAR(&_7); ZVAL_STRING(&_7, "jpeg"); - ZEPHIR_CALL_FUNCTION(&_14, "strcasecmp", NULL, 47, &ext, &_7); + ZEPHIR_CALL_FUNCTION(&_14, "strcasecmp", NULL, 35, &ext, &_7); zephir_check_call_status(); _13 = ZEPHIR_IS_LONG(&_14, 0); } @@ -1546,7 +1546,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processSave) zephir_read_property(&_15$$4, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_16$$4); ZVAL_STRING(&_16$$4, "Imagick::COMPRESSION_JPEG"); - ZEPHIR_CALL_FUNCTION(&_17$$4, "constant", NULL, 142, &_16$$4); + ZEPHIR_CALL_FUNCTION(&_17$$4, "constant", NULL, 114, &_16$$4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &_15$$4, "setimagecompression", NULL, 0, &_17$$4); zephir_check_call_status(); @@ -1707,7 +1707,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(&_1, r); ZVAL_LONG(&_2, g); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 140, &_0, &_1, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 112, &_0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); object_init_ex(&_0, zephir_get_internal_ce(SL("imagickpixel"))); @@ -1739,7 +1739,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_6$$7); ZVAL_STRING(&_6$$7, "Imagick::GRAVITY_CENTER"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_6$$7); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_6$$7); zephir_check_call_status(); } else { if (Z_TYPE_P(offsetY) == IS_LONG) { @@ -1752,13 +1752,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_7$$11); ZVAL_STRING(&_7$$11, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_7$$11); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_7$$11); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_8$$12); ZVAL_STRING(&_8$$12, "Imagick::GRAVITY_NORTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_8$$12); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_8$$12); zephir_check_call_status(); } } else { @@ -1769,13 +1769,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_9$$14); ZVAL_STRING(&_9$$14, "Imagick::GRAVITY_SOUTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_9$$14); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_9$$14); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_10$$15); ZVAL_STRING(&_10$$15, "Imagick::GRAVITY_NORTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_10$$15); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_10$$15); zephir_check_call_status(); } } @@ -1794,13 +1794,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_11$$21); ZVAL_STRING(&_11$$21, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_11$$21); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_11$$21); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_12$$22); ZVAL_STRING(&_12$$22, "Imagick::GRAVITY_SOUTH"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_12$$22); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_12$$22); zephir_check_call_status(); } } else { @@ -1811,13 +1811,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_13$$24); ZVAL_STRING(&_13$$24, "Imagick::GRAVITY_EAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_13$$24); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_13$$24); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); ZEPHIR_INIT_VAR(&_14$$25); ZVAL_STRING(&_14$$25, "Imagick::GRAVITY_WEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_14$$25); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_14$$25); zephir_check_call_status(); } } @@ -1833,13 +1833,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_15$$29); ZVAL_STRING(&_15$$29, "Imagick::GRAVITY_SOUTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_15$$29); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_15$$29); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, (x * -1)); ZEPHIR_INIT_VAR(&_16$$30); ZVAL_STRING(&_16$$30, "Imagick::GRAVITY_NORTHEAST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_16$$30); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_16$$30); zephir_check_call_status(); } } else { @@ -1850,13 +1850,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processText) ZVAL_LONG(offsetY, (y * -1)); ZEPHIR_INIT_VAR(&_17$$32); ZVAL_STRING(&_17$$32, "Imagick::GRAVITY_SOUTHWEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_17$$32); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_17$$32); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_VAR(&_18$$33); ZVAL_STRING(&_18$$33, "Imagick::GRAVITY_NORTHWEST"); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 142, &_18$$33); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 114, &_18$$33); zephir_check_call_status(); } } @@ -1942,11 +1942,11 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "Imagick::EVALUATE_MULTIPLY"); - ZEPHIR_CALL_FUNCTION(&_2, "constant", NULL, 142, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "constant", NULL, 114, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "Imagick::CHANNEL_ALPHA"); - ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 142, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "constant", NULL, 114, &_1); zephir_check_call_status(); ZVAL_LONG(&_4, opacity); ZEPHIR_CALL_METHOD(NULL, &watermark, "evaluateimage", NULL, 0, &_2, &_4, &_3); @@ -1959,7 +1959,7 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, processWatermark) zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$3); ZVAL_STRING(&_7$$3, "Imagick::COMPOSITE_OVER"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "constant", NULL, 142, &_7$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "constant", NULL, 114, &_7$$3); zephir_check_call_status(); ZVAL_LONG(&_9$$3, offsetX); ZVAL_LONG(&_10$$3, offsetY); diff --git a/ext/phalcon/image/exception.zep.c b/ext/phalcon/image/exception.zep.c index a454ecaeda3..c4b8a0694dd 100644 --- a/ext/phalcon/image/exception.zep.c +++ b/ext/phalcon/image/exception.zep.c @@ -22,6 +22,9 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ +/** + * Exceptions thrown in Phalcon\Image will use this class + */ ZEPHIR_INIT_CLASS(Phalcon_Image_Exception) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image, Exception, phalcon, image_exception, zend_ce_exception, NULL, 0); diff --git a/ext/phalcon/image/imagefactory.zep.c b/ext/phalcon/image/imagefactory.zep.c index f27ef163a7c..8a988c38070 100644 --- a/ext/phalcon/image/imagefactory.zep.c +++ b/ext/phalcon/image/imagefactory.zep.c @@ -29,9 +29,6 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -/** - * Phalcon\Image/ImageFactory - */ ZEPHIR_INIT_CLASS(Phalcon_Image_ImageFactory) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Image, ImageFactory, phalcon, image_imagefactory, phalcon_factory_abstractfactory_ce, phalcon_image_imagefactory_method_entry, 0); @@ -40,7 +37,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_ImageFactory) } /** - * TagFactory constructor. + * Constructor */ PHP_METHOD(Phalcon_Image_ImageFactory, __construct) { @@ -127,21 +124,21 @@ PHP_METHOD(Phalcon_Image_ImageFactory, load) zephir_check_call_status(); ZEPHIR_CPY_WRT(config, &_0); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 47); + zephir_array_fetch_string(&name, config, SL("adapter"), PH_NOISY, "phalcon/Image/ImageFactory.zep", 44); zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "file"); - ZEPHIR_CALL_METHOD(&file, this_ptr, "getarrval", NULL, 478, config, &_1); + ZEPHIR_CALL_METHOD(&file, this_ptr, "getarrval", NULL, 402, config, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "height"); ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&height, this_ptr, "getarrval", NULL, 478, config, &_1, &_2); + ZEPHIR_CALL_METHOD(&height, this_ptr, "getarrval", NULL, 402, config, &_1, &_2); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); ZVAL_STRING(&_1, "width"); ZVAL_NULL(&_2); - ZEPHIR_CALL_METHOD(&width, this_ptr, "getarrval", NULL, 478, config, &_1, &_2); + ZEPHIR_CALL_METHOD(&width, this_ptr, "getarrval", NULL, 402, config, &_1, &_2); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "newinstance", NULL, 0, &name, &file, &width, &height); zephir_check_call_status(); diff --git a/ext/phalcon/logger/abstractlogger.zep.c b/ext/phalcon/logger/abstractlogger.zep.c new file mode 100644 index 00000000000..b0234b12880 --- /dev/null +++ b/ext/phalcon/logger/abstractlogger.zep.c @@ -0,0 +1,726 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" +#include "kernel/operators.h" +#include "kernel/fcall.h" +#include "kernel/memory.h" +#include "ext/date/php_date.h" +#include "kernel/object.h" +#include "kernel/array.h" +#include "kernel/exception.h" +#include "kernel/string.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Abstract Logger Class + * + * A PSR compatible logger, with various adapters and formatters. A formatter + * interface is available as well as an adapter one. Adapters can be created + * easily using the built in AdapterFactory. A LoggerFactory is also available + * that allows developers to create new instances of the Logger or load them + * from config files (see Phalcon\Config\Config object). + * + * @package Phalcon\Logger + * + * @property AdapterInterface[] $adapters + * @property array $excluded + * @property int $logLevel + * @property string $name + * @property string $timezone + */ +ZEPHIR_INIT_CLASS(Phalcon_Logger_AbstractLogger) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, AbstractLogger, phalcon, logger_abstractlogger, phalcon_logger_abstractlogger_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + /** + * The adapter stack + * + * @var AdapterInterface[] + */ + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("adapters"), ZEND_ACC_PROTECTED); + /** + * The excluded adapters for this log process + * + * @var array + */ + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("excluded"), ZEND_ACC_PROTECTED); + /** + * Minimum log level for the logger + * + * @var int + */ + zend_declare_property_long(phalcon_logger_abstractlogger_ce, SL("logLevel"), 8, ZEND_ACC_PROTECTED); + /** + * @var string + */ + zend_declare_property_string(phalcon_logger_abstractlogger_ce, SL("name"), "", ZEND_ACC_PROTECTED); + /** + * @var DateTimeZone + */ + zend_declare_property_null(phalcon_logger_abstractlogger_ce, SL("timezone"), ZEND_ACC_PROTECTED); + phalcon_logger_abstractlogger_ce->create_object = zephir_init_properties_Phalcon_Logger_AbstractLogger; + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("ALERT"), 2); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("CRITICAL"), 1); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("CUSTOM"), 8); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("DEBUG"), 7); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("EMERGENCY"), 0); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("ERROR"), 3); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("INFO"), 6); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("NOTICE"), 5); + + zephir_declare_class_constant_long(phalcon_logger_abstractlogger_ce, SL("WARNING"), 4); + + return SUCCESS; +} + +/** + * Constructor. + * + * @param string $name The name of the logger + * @param array $adapters The collection of adapters to be used + * for logging (default []) + * @param DateTimeZone|null $timezone Timezone. If omitted, + * date_Default_timezone_get() is used + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, __construct) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval adapters; + zval *name_param = NULL, *adapters_param = NULL, *timezone = NULL, timezone_sub, __$null, defaultTimezone; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&timezone_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&defaultTimezone); + ZVAL_UNDEF(&adapters); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_STR(name) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(adapters) + Z_PARAM_OBJECT_OF_CLASS_OR_NULL(timezone, php_date_get_timezone_ce()) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 2, &name_param, &adapters_param, &timezone); + zephir_get_strval(&name, name_param); + if (!adapters_param) { + ZEPHIR_INIT_VAR(&adapters); + array_init(&adapters); + } else { + zephir_get_arrval(&adapters, adapters_param); + } + if (!timezone) { + timezone = &timezone_sub; + ZEPHIR_CPY_WRT(timezone, &__$null); + } else { + ZEPHIR_SEPARATE_PARAM(timezone); + } + + + if (Z_TYPE_P(timezone) == IS_NULL) { + ZEPHIR_CALL_FUNCTION(&defaultTimezone, "date_default_timezone_get", NULL, 92); + zephir_check_call_status(); + if (UNEXPECTED(1 == ZEPHIR_IS_EMPTY(&defaultTimezone))) { + ZEPHIR_INIT_NVAR(&defaultTimezone); + ZVAL_STRING(&defaultTimezone, "UTC"); + } + ZEPHIR_INIT_NVAR(timezone); + object_init_ex(timezone, php_date_get_timezone_ce()); + ZEPHIR_CALL_METHOD(NULL, timezone, "__construct", NULL, 0, &defaultTimezone); + zephir_check_call_status(); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); + zephir_update_property_zval(this_ptr, ZEND_STRL("timezone"), timezone); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setadapters", NULL, 0, &adapters); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); +} + +/** + * Add an adapter to the stack. For processing we use FIFO + * + * @param string $name The name of the adapter + * @param AdapterInterface $adapter The adapter to add to the stack + * + * @return AbstractLogger + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, addAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, *adapter, adapter_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&adapter_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(name) + Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_logger_adapter_adapterinterface_ce) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &name_param, &adapter); + zephir_get_strval(&name, name_param); + + + zephir_update_property_array(this_ptr, SL("adapters"), &name, adapter); + RETURN_THIS(); +} + +/** + * Exclude certain adapters. + * + * @param array $adapters + * + * @return AbstractLogger + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, excludeAdapters) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *adapters_param = NULL, __$true, adapter, registered, *_0, _1; + zval adapters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapters); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(®istered); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(adapters) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 0, 1, &adapters_param); + if (!adapters_param) { + ZEPHIR_INIT_VAR(&adapters); + array_init(&adapters); + } else { + zephir_get_arrval(&adapters, adapters_param); + } + + + zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&adapters, 0, "phalcon/Logger/AbstractLogger.zep", 155); + if (Z_TYPE_P(&adapters) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _0) + { + ZEPHIR_INIT_NVAR(&adapter); + ZVAL_COPY(&adapter, _0); + if (1 == zephir_array_isset(®istered, &adapter)) { + zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_1, &adapters, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_1)) { + break; + } + ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_array_isset(®istered, &adapter)) { + zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); + } + ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&adapter); + RETURN_THIS(); +} + +/** + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + * @throws LoggerException + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, _0, _1, _2; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (1 != zephir_array_isset(&_0, &name)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/AbstractLogger.zep", 171); + return; + } + zephir_read_property(&_1, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_2, &_1, &name, PH_NOISY | PH_READONLY, "phalcon/Logger/AbstractLogger.zep", 174); + RETURN_CTOR(&_2); +} + +/** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapters) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "adapters"); +} + +/** + * Returns the log level + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLogLevel) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "logLevel"); +} + +/** + * Returns the name of the logger + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getName) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "name"); +} + +/** + * Removes an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AbstractLogger + * @throws LoggerException + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, removeAdapter) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *name_param = NULL, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(name) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &name_param); + zephir_get_strval(&name, name_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (1 != zephir_array_isset(&_0, &name)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/AbstractLogger.zep", 216); + return; + } + zephir_unset_property_array(this_ptr, ZEND_STRL("adapters"), &name); + zephir_read_property(&_1, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1, &name, PH_SEPARATE); + RETURN_THIS(); +} + +/** + * Sets the adapters stack overriding what is already there + * + * @param array $adapters An array of adapters + * + * @return AbstractLogger + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, setAdapters) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *adapters_param = NULL; + zval adapters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapters); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(adapters) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &adapters_param); + zephir_get_arrval(&adapters, adapters_param); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); + RETURN_THIS(); +} + +/** + * Sets the adapters stack overriding what is already there + * + * @param int $level + * + * @return AbstractLogger + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, setLogLevel) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *level_param = NULL, levels, _0; + zend_long level, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_LONG(level) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &level_param); + level = zephir_get_intval(level_param); + + + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_0); + if (1 == zephir_array_isset_long(&levels, level)) { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, level); + } else { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 8); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); + RETURN_THIS(); +} + +/** + * Adds a message to each handler for processing + * + * @param int level + * @param string $message + * @param array $context + * + * @return bool + * @throws Exception + * @throws LoggerException + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, addMessage) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval context; + zval message; + zval *level_param = NULL, *message_param = NULL, *context_param = NULL, adapter, collection, item, levelName, levels, method, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, *_7$$3, _8$$3, _9$$5, _10$$7; + zend_long level, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&levelName); + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_LONG(level) + Z_PARAM_STR(message) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &level_param, &message_param, &context_param); + level = zephir_get_intval(level_param); + zephir_get_strval(&message, message_param); + if (!context_param) { + ZEPHIR_INIT_VAR(&context); + array_init(&context); + } else { + zephir_get_arrval(&context, context_param); + } + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("logLevel"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GE_LONG(&_0, level)) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (zephir_fast_count_int(&_1$$3) == 0) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "No adapters specified", "phalcon/Logger/AbstractLogger.zep", 275); + return; + } + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + if (1 == zephir_array_isset_long(&levels, level)) { + ZEPHIR_OBS_VAR(&levelName); + zephir_array_fetch_long(&levelName, &levels, level, PH_NOISY, "phalcon/Logger/AbstractLogger.zep", 279); + } else { + ZEPHIR_OBS_NVAR(&levelName); + zephir_array_fetch_long(&levelName, &levels, 8, PH_NOISY, "phalcon/Logger/AbstractLogger.zep", 279); + } + ZEPHIR_INIT_VAR(&item); + object_init_ex(&item, phalcon_logger_item_ce); + ZEPHIR_INIT_VAR(&_2$$3); + object_init_ex(&_2$$3, php_date_get_immutable_ce()); + zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("timezone"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "now"); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, &_4$$3, &_3$$3); + zephir_check_call_status(); + ZVAL_LONG(&_5$$3, level); + ZEPHIR_CALL_METHOD(NULL, &item, "__construct", NULL, 93, &message, &levelName, &_5$$3, &_2$$3, &context); + zephir_check_call_status(); + zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_6$$3, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&collection, "array_diff_key", NULL, 94, &_5$$3, &_6$$3); + zephir_check_call_status(); + zephir_is_iterable(&collection, 0, "phalcon/Logger/AbstractLogger.zep", 305); + if (Z_TYPE_P(&collection) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&collection), _7$$3) + { + ZEPHIR_INIT_NVAR(&adapter); + ZVAL_COPY(&adapter, _7$$3); + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "process"); + ZEPHIR_CALL_METHOD(&_9$$5, &adapter, "intransaction", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_9$$5)) { + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "add"); + } + ZEPHIR_CALL_METHOD_ZVAL(NULL, &adapter, &method, NULL, 0, &item); + zephir_check_call_status(); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &collection, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_8$$3, &collection, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_8$$3)) { + break; + } + ZEPHIR_CALL_METHOD(&adapter, &collection, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "process"); + ZEPHIR_CALL_METHOD(&_10$$7, &adapter, "intransaction", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_10$$7)) { + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "add"); + } + ZEPHIR_CALL_METHOD_ZVAL(NULL, &adapter, &method, NULL, 0, &item); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(NULL, &collection, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&adapter); + ZEPHIR_INIT_NVAR(&_4$$3); + array_init(&_4$$3); + zephir_update_property_zval(this_ptr, ZEND_STRL("excluded"), &_4$$3); + } + RETURN_MM_BOOL(1); +} + +/** + * Converts the level from string/word to an integer + * + * @param mixed $level + * + * @return int + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevelNumber) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *level, level_sub, levelName, levels, _0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&level_sub); + ZVAL_UNDEF(&levelName); + ZVAL_UNDEF(&levels); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(level) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &level); + + + if (1 == Z_TYPE_P(level) == IS_STRING) { + ZEPHIR_INIT_VAR(&levelName); + zephir_fast_strtoupper(&levelName, level); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(&levels, "array_flip", NULL, 95, &_0$$3); + zephir_check_call_status(); + if (zephir_array_isset(&levels, &levelName)) { + zephir_array_fetch(&_1$$4, &levels, &levelName, PH_NOISY | PH_READONLY, "phalcon/Logger/AbstractLogger.zep", 330); + RETURN_CTOR(&_1$$4); + } + } else if (1 == zephir_is_numeric(level)) { + ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); + zephir_check_call_status(); + if (zephir_array_isset(&levels, level)) { + RETURN_MM_LONG(zephir_get_intval(level)); + } + } + RETURN_MM_LONG(8); +} + +/** + * Returns an array of log levels with integer to string conversion + * + * @return string[] + */ +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevels) +{ + zval *this_ptr = getThis(); + + + + zephir_create_array(return_value, 9, 0); + add_index_stringl(return_value, 2, SL("ALERT")); + add_index_stringl(return_value, 1, SL("CRITICAL")); + add_index_stringl(return_value, 7, SL("DEBUG")); + add_index_stringl(return_value, 0, SL("EMERGENCY")); + add_index_stringl(return_value, 3, SL("ERROR")); + add_index_stringl(return_value, 6, SL("INFO")); + add_index_stringl(return_value, 5, SL("NOTICE")); + add_index_stringl(return_value, 4, SL("WARNING")); + add_index_stringl(return_value, 8, SL("CUSTOM")); + return; +} + +zend_object *zephir_init_properties_Phalcon_Logger_AbstractLogger(zend_class_entry *class_type) +{ + zval _0, _2, _1$$3, _3$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + + + ZEPHIR_MM_GROW(); + + { + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("excluded"), &_1$$3); + } + zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval_ex(this_ptr, ZEND_STRL("adapters"), &_3$$4); + } + ZEPHIR_MM_RESTORE(); + return Z_OBJ_P(this_ptr); + } +} + diff --git a/ext/phalcon/logger/abstractlogger.zep.h b/ext/phalcon/logger/abstractlogger.zep.h new file mode 100644 index 00000000000..ade5529fc17 --- /dev/null +++ b/ext/phalcon/logger/abstractlogger.zep.h @@ -0,0 +1,104 @@ + +extern zend_class_entry *phalcon_logger_abstractlogger_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Logger_AbstractLogger); + +PHP_METHOD(Phalcon_Logger_AbstractLogger, __construct); +PHP_METHOD(Phalcon_Logger_AbstractLogger, addAdapter); +PHP_METHOD(Phalcon_Logger_AbstractLogger, excludeAdapters); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapter); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getAdapters); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLogLevel); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getName); +PHP_METHOD(Phalcon_Logger_AbstractLogger, removeAdapter); +PHP_METHOD(Phalcon_Logger_AbstractLogger, setAdapters); +PHP_METHOD(Phalcon_Logger_AbstractLogger, setLogLevel); +PHP_METHOD(Phalcon_Logger_AbstractLogger, addMessage); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevelNumber); +PHP_METHOD(Phalcon_Logger_AbstractLogger, getLevels); +zend_object *zephir_init_properties_Phalcon_Logger_AbstractLogger(zend_class_entry *class_type); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_abstractlogger___construct, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +#endif + ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_addadapter, 0, 2, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_excludeadapters, 0, 0, Phalcon\\Logger\\AbstractLogger, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getloglevel, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getname, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_removeadapter, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_setadapters, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_ARRAY_INFO(0, adapters, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_abstractlogger_setloglevel, 0, 1, Phalcon\\Logger\\AbstractLogger, 0) + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_addmessage, 0, 2, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getlevelnumber, 0, 1, IS_LONG, 0) + ZEND_ARG_INFO(0, level) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_abstractlogger_getlevels, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_abstractlogger_zephir_init_properties_phalcon_logger_abstractlogger, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_logger_abstractlogger_method_entry) { + PHP_ME(Phalcon_Logger_AbstractLogger, __construct, arginfo_phalcon_logger_abstractlogger___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + PHP_ME(Phalcon_Logger_AbstractLogger, addAdapter, arginfo_phalcon_logger_abstractlogger_addadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, excludeAdapters, arginfo_phalcon_logger_abstractlogger_excludeadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getAdapter, arginfo_phalcon_logger_abstractlogger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getAdapters, arginfo_phalcon_logger_abstractlogger_getadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getLogLevel, arginfo_phalcon_logger_abstractlogger_getloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, getName, arginfo_phalcon_logger_abstractlogger_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, removeAdapter, arginfo_phalcon_logger_abstractlogger_removeadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, setAdapters, arginfo_phalcon_logger_abstractlogger_setadapters, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, setLogLevel, arginfo_phalcon_logger_abstractlogger_setloglevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_AbstractLogger, addMessage, arginfo_phalcon_logger_abstractlogger_addmessage, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Logger_AbstractLogger, getLevelNumber, arginfo_phalcon_logger_abstractlogger_getlevelnumber, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Logger_AbstractLogger, getLevels, arginfo_phalcon_logger_abstractlogger_getlevels, ZEND_ACC_PROTECTED) + PHP_FE_END +}; diff --git a/ext/phalcon/logger/adapter/abstractadapter.zep.c b/ext/phalcon/logger/adapter/abstractadapter.zep.c index d36f1f798eb..ee386b360f6 100644 --- a/ext/phalcon/logger/adapter/abstractadapter.zep.c +++ b/ext/phalcon/logger/adapter/abstractadapter.zep.c @@ -208,7 +208,7 @@ PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, commit) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 95); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 64); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("queue"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&queue, &_0); @@ -239,7 +239,7 @@ PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, commit) } } ZEPHIR_INIT_NVAR(&item); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 96); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 65); zephir_check_call_status(); RETURN_THIS(); } @@ -261,9 +261,8 @@ PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, getFormatter) ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("formatter"), PH_NOISY_CC); - if (Z_TYPE_P(&_0) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("formatter"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("defaultFormatter"), PH_NOISY_CC | PH_READONLY); ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&_1$$3, &_2$$3); @@ -311,9 +310,9 @@ PHP_METHOD(Phalcon_Logger_Adapter_AbstractAdapter, rollback) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 95); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "checktransaction", NULL, 64); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 96); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "resettransaction", NULL, 65); zephir_check_call_status(); RETURN_THIS(); } diff --git a/ext/phalcon/logger/adapter/stream.zep.c b/ext/phalcon/logger/adapter/stream.zep.c index 364727d03e5..399ce1b2fdf 100644 --- a/ext/phalcon/logger/adapter/stream.zep.c +++ b/ext/phalcon/logger/adapter/stream.zep.c @@ -15,11 +15,10 @@ #include "kernel/object.h" #include "kernel/array.h" #include "kernel/memory.h" -#include "kernel/string.h" -#include "kernel/exception.h" +#include "kernel/fcall.h" #include "kernel/operators.h" +#include "kernel/exception.h" #include "kernel/file.h" -#include "kernel/fcall.h" #include "ext/spl/spl_exceptions.h" #include "kernel/concat.h" @@ -106,13 +105,16 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, getName) PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval options; - zval *name_param = NULL, *options_param = NULL, mode; + zval *name_param = NULL, *options_param = NULL, mode, _0, _1; zval name; zval *this_ptr = getThis(); ZVAL_UNDEF(&name); ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -135,17 +137,21 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) } - ZEPHIR_OBS_VAR(&mode); - if (zephir_array_isset_string_fetch(&mode, &options, SL("mode"), 0)) { - if (zephir_memnstr_str(&mode, SL("r"), "phalcon/Logger/Adapter/Stream.zep", 83)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter cannot be opened in read mode", "phalcon/Logger/Adapter/Stream.zep", 84); - return; - } - } - if (Z_TYPE_P(&mode) == IS_NULL) { + if (1 == zephir_array_isset_string(&options, SL("mode"))) { + ZEPHIR_OBS_VAR(&mode); + zephir_array_fetch_string(&mode, &options, SL("mode"), PH_NOISY, "phalcon/Logger/Adapter/Stream.zep", 82); + } else { ZEPHIR_INIT_NVAR(&mode); ZVAL_STRING(&mode, "ab"); } + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "r"); + ZEPHIR_CALL_FUNCTION(&_1, "mb_strpos", NULL, 82, &mode, &_0); + zephir_check_call_status(); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter cannot be opened in read mode", "phalcon/Logger/Adapter/Stream.zep", 84); + return; + } zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); zephir_update_property_zval(this_ptr, ZEND_STRL("mode"), &mode); ZEPHIR_MM_RESTORE(); @@ -185,16 +191,16 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *item, item_sub, __$null, message, _0, _10, _11, _12, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4; + zval *item, item_sub, __$null, message, _0, _9, _10, _11, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&item_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_9); ZVAL_UNDEF(&_10); ZVAL_UNDEF(&_11); - ZVAL_UNDEF(&_12); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_3$$3); @@ -203,7 +209,6 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) ZVAL_UNDEF(&_6$$4); ZVAL_UNDEF(&_7$$4); ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_9$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -231,24 +236,22 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, process) zephir_read_property(&_6$$4, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_7$$4, this_ptr, ZEND_STRL("mode"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_8$$4); - ZVAL_STRING(&_8$$4, "The file '%s' cannot be opened with mode '%s'"); - ZEPHIR_CALL_FUNCTION(&_9$$4, "sprintf", NULL, 140, &_8$$4, &_6$$4, &_7$$4); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_5$$4, "__construct", NULL, 479, &_9$$4); + ZEPHIR_CONCAT_SVSVS(&_8$$4, "The file '", &_6$$4, "' cannot be opened with mode '", &_7$$4, "'"); + ZEPHIR_CALL_METHOD(NULL, &_5$$4, "__construct", NULL, 403, &_8$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$4, "phalcon/Logger/Adapter/Stream.zep", 133); + zephir_throw_exception_debug(&_5$$4, "phalcon/Logger/Adapter/Stream.zep", 128); ZEPHIR_MM_RESTORE(); return; } } - ZEPHIR_CALL_METHOD(&_10, this_ptr, "getformatteditem", NULL, 0, item); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "getformatteditem", NULL, 0, item); zephir_check_call_status(); - ZEPHIR_INIT_VAR(&_11); - ZEPHIR_GET_CONSTANT(&_11, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_GET_CONSTANT(&_10, "PHP_EOL"); ZEPHIR_INIT_VAR(&message); - ZEPHIR_CONCAT_VV(&message, &_10, &_11); - zephir_read_property(&_12, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY); - zephir_fwrite(NULL, &_12, &message); + ZEPHIR_CONCAT_VV(&message, &_9, &_10); + zephir_read_property(&_11, this_ptr, ZEND_STRL("handler"), PH_NOISY_CC | PH_READONLY); + zephir_fwrite(NULL, &_11, &message); ZEPHIR_MM_RESTORE(); } @@ -280,7 +283,7 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, phpFopen) zephir_get_strval(&mode, mode_param); - ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 90, &filename, &mode); + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/logger/adapter/syslog.zep.c b/ext/phalcon/logger/adapter/syslog.zep.c index fc6bbaee0de..09a28900993 100644 --- a/ext/phalcon/logger/adapter/syslog.zep.c +++ b/ext/phalcon/logger/adapter/syslog.zep.c @@ -143,7 +143,7 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, close) if (!(zephir_is_true(&_0))) { RETURN_MM_BOOL(1); } - ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 480); + ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 404); zephir_check_call_status(); RETURN_MM(); } @@ -207,9 +207,9 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, process) zephir_cast_to_string(&_6$$3, &_5$$3); ZEPHIR_INIT_VAR(&_7$$3); ZVAL_STRING(&_7$$3, "Cannot open syslog for name [%s] and facility [%s]"); - ZEPHIR_CALL_FUNCTION(&_8$$3, "sprintf", NULL, 140, &_7$$3, &_4$$3, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_8$$3, "sprintf", NULL, 112, &_7$$3, &_4$$3, &_6$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 479, &_8$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 403, &_8$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Logger/Adapter/Syslog.zep", 106); ZEPHIR_MM_RESTORE(); @@ -222,9 +222,9 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, process) } ZEPHIR_CALL_METHOD(&_9, item, "getlevel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&level, this_ptr, "logleveltosyslog", NULL, 481, &_9); + ZEPHIR_CALL_METHOD(&level, this_ptr, "logleveltosyslog", NULL, 405, &_9); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 482, &level, &message); + ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 406, &level, &message); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -270,7 +270,7 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, openlog) ZVAL_LONG(&_0, option); ZVAL_LONG(&_1, facility); - ZEPHIR_RETURN_CALL_FUNCTION("openlog", NULL, 483, &ident, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("openlog", NULL, 407, &ident, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/logger/enum.zep.c b/ext/phalcon/logger/enum.zep.c new file mode 100644 index 00000000000..fd9cf0460fa --- /dev/null +++ b/ext/phalcon/logger/enum.zep.c @@ -0,0 +1,52 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Log Level Enum constants + */ +ZEPHIR_INIT_CLASS(Phalcon_Logger_Enum) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Enum, phalcon, logger_enum, NULL, 0); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("ALERT"), 2); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("CRITICAL"), 1); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("CUSTOM"), 8); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("DEBUG"), 7); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("EMERGENCY"), 0); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("ERROR"), 3); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("INFO"), 6); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("NOTICE"), 5); + + zephir_declare_class_constant_long(phalcon_logger_enum_ce, SL("WARNING"), 4); + + return SUCCESS; +} + diff --git a/ext/phalcon/logger/enum.zep.h b/ext/phalcon/logger/enum.zep.h new file mode 100644 index 00000000000..74dc753349d --- /dev/null +++ b/ext/phalcon/logger/enum.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_logger_enum_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Logger_Enum); + diff --git a/ext/phalcon/logger/formatter/formatterinterface.zep.h b/ext/phalcon/logger/formatter/formatterinterface.zep.h index 26c583fc3c9..6302b526a87 100644 --- a/ext/phalcon/logger/formatter/formatterinterface.zep.h +++ b/ext/phalcon/logger/formatter/formatterinterface.zep.h @@ -3,7 +3,7 @@ extern zend_class_entry *phalcon_logger_formatter_formatterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_FormatterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_formatterinterface_format, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_formatterinterface_format, 0, 1, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, item, Phalcon\\Logger\\Item, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/logger.zep.c b/ext/phalcon/logger/logger.zep.c index 47fd3a41572..f3c5cc739c9 100644 --- a/ext/phalcon/logger/logger.zep.c +++ b/ext/phalcon/logger/logger.zep.c @@ -12,15 +12,10 @@ #include #include "kernel/main.h" -#include "kernel/object.h" -#include "kernel/operators.h" #include "kernel/fcall.h" +#include "kernel/operators.h" #include "kernel/memory.h" -#include "ext/date/php_date.h" -#include "ext/spl/spl_exceptions.h" -#include "kernel/exception.h" -#include "kernel/array.h" -#include "kernel/string.h" +#include "kernel/object.h" /** @@ -34,221 +29,20 @@ /** * Phalcon Logger. * - * A PSR compatible logger, with various adapters and formatters. A formatter + * A logger, with various adapters and formatters. A formatter * interface is available as well as an adapter one. Adapters can be created - * easily using the built in AdapterFactory. A LoggerFactory is also available + * easily using the built-in AdapterFactory. A LoggerFactory is also available * that allows developers to create new instances of the Logger or load them * from config files (see Phalcon\Config\Config object). - * - * @package Phalcon\Logger - * - * @property AdapterInterface[] $adapters - * @property array $excluded - * @property int $logLevel - * @property string $name - * @property string $timezone */ ZEPHIR_INIT_CLASS(Phalcon_Logger_Logger) { - ZEPHIR_REGISTER_CLASS(Phalcon\\Logger, Logger, phalcon, logger_logger, phalcon_logger_logger_method_entry, 0); - - /** - * The adapter stack - * - * @var AdapterInterface[] - */ - zend_declare_property_null(phalcon_logger_logger_ce, SL("adapters"), ZEND_ACC_PROTECTED); - /** - * The excluded adapters for this log process - * - * @var array - */ - zend_declare_property_null(phalcon_logger_logger_ce, SL("excluded"), ZEND_ACC_PROTECTED); - /** - * Minimum log level for the logger - * - * @var int - */ - zend_declare_property_long(phalcon_logger_logger_ce, SL("logLevel"), 8, ZEND_ACC_PROTECTED); - /** - * @var string - */ - zend_declare_property_string(phalcon_logger_logger_ce, SL("name"), "", ZEND_ACC_PROTECTED); - /** - * @var DateTimeZone - */ - zend_declare_property_null(phalcon_logger_logger_ce, SL("timezone"), ZEND_ACC_PROTECTED); - phalcon_logger_logger_ce->create_object = zephir_init_properties_Phalcon_Logger_Logger; - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("ALERT"), 2); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("CRITICAL"), 1); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("CUSTOM"), 8); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("DEBUG"), 7); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("EMERGENCY"), 0); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("ERROR"), 3); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Logger, Logger, phalcon, logger_logger, phalcon_logger_abstractlogger_ce, phalcon_logger_logger_method_entry, 0); - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("INFO"), 6); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("NOTICE"), 5); - - zephir_declare_class_constant_long(phalcon_logger_logger_ce, SL("WARNING"), 4); - - zend_class_implements(phalcon_logger_logger_ce, 1, zephir_get_internal_ce(SL("psr\\log\\loggerinterface"))); + zend_class_implements(phalcon_logger_logger_ce, 1, phalcon_logger_loggerinterface_ce); return SUCCESS; } -/** - * The adapter stack - */ -PHP_METHOD(Phalcon_Logger_Logger, getAdapters) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "adapters"); -} - -/** - * Minimum log level for the logger - */ -PHP_METHOD(Phalcon_Logger_Logger, getLogLevel) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "logLevel"); -} - -/** - */ -PHP_METHOD(Phalcon_Logger_Logger, getName) -{ - zval *this_ptr = getThis(); - - - - RETURN_MEMBER(getThis(), "name"); -} - -/** - * Constructor. - * - * @param string $name The name of the logger - * @param array $adapters The collection of adapters to be used - * for logging (default []) - * @param DateTimeZone|null $timezone Timezone. If omitted, - * date_Default_timezone_get() is used - */ -PHP_METHOD(Phalcon_Logger_Logger, __construct) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval adapters; - zval *name_param = NULL, *adapters_param = NULL, *timezone = NULL, timezone_sub, __$null, localTimeZone, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&timezone_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&localTimeZone); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&adapters); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 3) - Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(adapters) - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(timezone, php_date_get_timezone_ce()) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 2, &name_param, &adapters_param, &timezone); - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - } - if (!adapters_param) { - ZEPHIR_INIT_VAR(&adapters); - array_init(&adapters); - } else { - ZEPHIR_OBS_COPY_OR_DUP(&adapters, adapters_param); - } - if (!timezone) { - timezone = &timezone_sub; - timezone = &__$null; - } - - - ZEPHIR_CPY_WRT(&localTimeZone, timezone); - if (ZEPHIR_IS_EMPTY(timezone)) { - ZEPHIR_CALL_FUNCTION(&localTimeZone, "date_default_timezone_get", NULL, 484); - zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(&localTimeZone)) { - ZEPHIR_INIT_NVAR(&localTimeZone); - ZVAL_STRING(&localTimeZone, "UTC"); - } - } - zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); - ZEPHIR_INIT_VAR(&_0); - object_init_ex(&_0, php_date_get_timezone_ce()); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &localTimeZone); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("timezone"), &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setadapters", NULL, 0, &adapters); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Add an adapter to the stack. For processing we use FIFO - * - * @param string $name The name of the adapter - * @param AdapterInterface $adapter The adapter to add to the stack - * - * @return Logger - */ -PHP_METHOD(Phalcon_Logger_Logger, addAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, *adapter, adapter_sub; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapter_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_STR(name) - Z_PARAM_OBJECT_OF_CLASS(adapter, phalcon_logger_adapter_adapterinterface_ce) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &name_param, &adapter); - zephir_get_strval(&name, name_param); - - - zephir_update_property_array(this_ptr, SL("adapters"), &name, adapter); - RETURN_THIS(); -} - /** * Action must be taken immediately. * @@ -259,24 +53,25 @@ PHP_METHOD(Phalcon_Logger_Logger, addAdapter) * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, alert) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -284,7 +79,8 @@ PHP_METHOD(Phalcon_Logger_Logger, alert) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -293,9 +89,8 @@ PHP_METHOD(Phalcon_Logger_Logger, alert) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -309,24 +104,25 @@ PHP_METHOD(Phalcon_Logger_Logger, alert) * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, critical) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -334,7 +130,8 @@ PHP_METHOD(Phalcon_Logger_Logger, critical) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -343,9 +140,8 @@ PHP_METHOD(Phalcon_Logger_Logger, critical) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -357,24 +153,25 @@ PHP_METHOD(Phalcon_Logger_Logger, critical) * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, debug) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -382,7 +179,8 @@ PHP_METHOD(Phalcon_Logger_Logger, debug) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -391,39 +189,38 @@ PHP_METHOD(Phalcon_Logger_Logger, debug) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 7); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 7); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. + * System is unusable. * * @param string $message * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ -PHP_METHOD(Phalcon_Logger_Logger, error) +PHP_METHOD(Phalcon_Logger_Logger, emergency) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -431,7 +228,8 @@ PHP_METHOD(Phalcon_Logger_Logger, error) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -440,38 +238,39 @@ PHP_METHOD(Phalcon_Logger_Logger, error) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } /** - * System is unusable. + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. * * @param string $message * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ -PHP_METHOD(Phalcon_Logger_Logger, emergency) +PHP_METHOD(Phalcon_Logger_Logger, error) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -479,7 +278,8 @@ PHP_METHOD(Phalcon_Logger_Logger, emergency) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -488,127 +288,12 @@ PHP_METHOD(Phalcon_Logger_Logger, emergency) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -/** - * Exclude certain adapters. - * - * @param array $adapters - * - * @return Logger - */ -PHP_METHOD(Phalcon_Logger_Logger, excludeAdapters) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *adapters_param = NULL, __$true, adapter, registered, *_0, _1; - zval adapters; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapters); - ZVAL_BOOL(&__$true, 1); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(®istered); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(0, 1) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(adapters) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &adapters_param); - if (!adapters_param) { - ZEPHIR_INIT_VAR(&adapters); - array_init(&adapters); - } else { - zephir_get_arrval(&adapters, adapters_param); - } - - - zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&adapters, 0, "phalcon/Logger/Logger.zep", 227); - if (Z_TYPE_P(&adapters) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _0) - { - ZEPHIR_INIT_NVAR(&adapter); - ZVAL_COPY(&adapter, _0); - if (zephir_array_isset(®istered, &adapter)) { - zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_1, &adapters, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_1)) { - break; - } - ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); - zephir_check_call_status(); - if (zephir_array_isset(®istered, &adapter)) { - zephir_update_property_array(this_ptr, SL("excluded"), &adapter, &__$true); - } - ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&adapter); - RETURN_THIS(); -} - -/** - * Returns an adapter from the stack - * - * @param string $name The name of the adapter - * - * @return AdapterInterface - * @throws LoggerException - */ -PHP_METHOD(Phalcon_Logger_Logger, getAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, adapter, adapters, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&adapters, &_0); - ZEPHIR_OBS_VAR(&adapter); - if (!(zephir_array_isset_fetch(&adapter, &adapters, &name, 0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/Logger.zep", 245); - return; - } - RETURN_CCTOR(&adapter); -} - /** * Interesting events. * @@ -618,24 +303,25 @@ PHP_METHOD(Phalcon_Logger_Logger, getAdapter) * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, info) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -643,7 +329,8 @@ PHP_METHOD(Phalcon_Logger_Logger, info) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -652,9 +339,8 @@ PHP_METHOD(Phalcon_Logger_Logger, info) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 6); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -662,31 +348,33 @@ PHP_METHOD(Phalcon_Logger_Logger, info) /** * Logs with an arbitrary level. * - * @param mixed $level - * @param mixed $message - * @param array $context + * @param mixed $level + * @param string $message + * @param array $context * + * @return void + * @throws Exception * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, log) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *level, level_sub, *message, message_sub, *context_param = NULL, intLevel; + zval message, _0; + zval *level, level_sub, *message_param = NULL, *context_param = NULL, intLevel; zval *this_ptr = getThis(); ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&intLevel); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_ZVAL(level) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -694,7 +382,8 @@ PHP_METHOD(Phalcon_Logger_Logger, log) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level, &message, &context_param); + zephir_fetch_params(1, 2, 1, &level, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -703,9 +392,9 @@ PHP_METHOD(Phalcon_Logger_Logger, log) } - ZEPHIR_CALL_METHOD(&intLevel, this_ptr, "getlevelnumber", NULL, 485, level); + ZEPHIR_CALL_METHOD(&intLevel, this_ptr, "getlevelnumber", NULL, 0, level); zephir_check_call_status(); - zephir_cast_to_string(&_0, message); + zephir_cast_to_string(&_0, &message); ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &intLevel, &_0, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -718,24 +407,25 @@ PHP_METHOD(Phalcon_Logger_Logger, log) * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ PHP_METHOD(Phalcon_Logger_Logger, notice) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval context; - zval *message, message_sub, *context_param = NULL, _1; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; zval *this_ptr = getThis(); - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); + ZVAL_UNDEF(&message); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) + Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); @@ -743,7 +433,8 @@ PHP_METHOD(Phalcon_Logger_Logger, notice) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); + zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); array_init(&context); @@ -752,127 +443,12 @@ PHP_METHOD(Phalcon_Logger_Logger, notice) } - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 5); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -/** - * Removes an adapter from the stack - * - * @param string $name The name of the adapter - * - * @return Logger - * @throws LoggerException - */ -PHP_METHOD(Phalcon_Logger_Logger, removeAdapter) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *name_param = NULL, adapters, _0; - zval name; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(name) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(&name, name_param); - - - zephir_read_property(&_0, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&adapters, &_0); - if (1 != zephir_array_isset(&adapters, &name)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Adapter does not exist for this logger", "phalcon/Logger/Logger.zep", 312); - return; - } - zephir_array_unset(&adapters, &name, PH_SEPARATE); - zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); - RETURN_THIS(); -} - -/** - * Sets the adapters stack overriding what is already there - * - * @param array $adapters An array of adapters - * - * @return Logger - */ -PHP_METHOD(Phalcon_Logger_Logger, setAdapters) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *adapters_param = NULL; - zval adapters; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&adapters); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(adapters) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &adapters_param); - ZEPHIR_OBS_COPY_OR_DUP(&adapters, adapters_param); - - - zephir_update_property_zval(this_ptr, ZEND_STRL("adapters"), &adapters); - RETURN_THIS(); -} - -/** - * Sets the adapters stack overriding what is already there - * - * @param int $level - * - * @return Logger - */ -PHP_METHOD(Phalcon_Logger_Logger, setLogLevel) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *level_param = NULL, levels, _0; - zend_long level, ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_LONG(level) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &level_param); - level = zephir_get_intval(level_param); - - - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (!(zephir_array_isset_long(&levels, level))) { - level = 8; - } - ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(&_0, level); - zephir_update_property_zval(this_ptr, ZEND_STRL("logLevel"), &_0); - RETURN_THIS(); -} - /** * Exceptional occurrences that are not errors. * @@ -883,88 +459,24 @@ PHP_METHOD(Phalcon_Logger_Logger, setLogLevel) * @param array $context * * @return void - */ -PHP_METHOD(Phalcon_Logger_Logger, warning) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval context; - zval *message, message_sub, *context_param = NULL, _1; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&message_sub); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&context); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_ZVAL(message) - Z_PARAM_OPTIONAL - Z_PARAM_ARRAY(context) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &message, &context_param); - if (!context_param) { - ZEPHIR_INIT_VAR(&context); - array_init(&context); - } else { - zephir_get_arrval(&context, context_param); - } - - - zephir_cast_to_string(&_0, message); - ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_1, &_0, &context); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** - * Adds a message to each handler for processing - * - * @param int $level - * @param string $message - * @param array $context - * - * @return bool * @throws Exception * @throws LoggerException */ -PHP_METHOD(Phalcon_Logger_Logger, addMessage) +PHP_METHOD(Phalcon_Logger_Logger, warning) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; zval context; + zval *message_param = NULL, *context_param = NULL, _0; zval message; - zval *level_param = NULL, *message_param = NULL, *context_param = NULL, adapter, adapters, excluded, item, levelName, levels, registered, _0, _1$$3, _2$$3, _3$$3, _4$$3, *_5$$3, _6$$3, _7$$6, _8$$9; - zend_long level, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&adapter); - ZVAL_UNDEF(&adapters); - ZVAL_UNDEF(&excluded); - ZVAL_UNDEF(&item); - ZVAL_UNDEF(&levelName); - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(®istered); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_6$$3); - ZVAL_UNDEF(&_7$$6); - ZVAL_UNDEF(&_8$$9); ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); ZVAL_UNDEF(&context); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(2, 3) - Z_PARAM_LONG(level) + ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) @@ -973,8 +485,7 @@ PHP_METHOD(Phalcon_Logger_Logger, addMessage) ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 1, &level_param, &message_param, &context_param); - level = zephir_get_intval(level_param); + zephir_fetch_params(1, 1, 1, &message_param, &context_param); zephir_get_strval(&message, message_param); if (!context_param) { ZEPHIR_INIT_VAR(&context); @@ -984,191 +495,9 @@ PHP_METHOD(Phalcon_Logger_Logger, addMessage) } - zephir_read_property(&_0, this_ptr, ZEND_STRL("logLevel"), PH_NOISY_CC | PH_READONLY); - if (ZEPHIR_GE_LONG(&_0, level)) { - ZEPHIR_OBS_VAR(®istered); - zephir_read_property(®istered, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC); - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&excluded, &_1$$3); - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (1 == ZEPHIR_IS_EMPTY(®istered)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "No adapters specified", "phalcon/Logger/Logger.zep", 397); - return; - } - ZEPHIR_OBS_VAR(&levelName); - if (UNEXPECTED(!(zephir_array_isset_long_fetch(&levelName, &levels, level, 0)))) { - ZEPHIR_OBS_NVAR(&levelName); - zephir_array_fetch_long(&levelName, &levels, 8, PH_NOISY, "phalcon/Logger/Logger.zep", 401); - } - ZEPHIR_INIT_VAR(&item); - object_init_ex(&item, phalcon_logger_item_ce); - ZEPHIR_INIT_VAR(&_2$$3); - object_init_ex(&_2$$3, php_date_get_immutable_ce()); - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("timezone"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_INIT_VAR(&_3$$3); - ZVAL_STRING(&_3$$3, "now"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 0, &_3$$3, &_1$$3); - zephir_check_call_status(); - ZVAL_LONG(&_4$$3, level); - ZEPHIR_CALL_METHOD(NULL, &item, "__construct", NULL, 486, &message, &levelName, &_4$$3, &_2$$3, &context); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&adapters, "array_diff_key", NULL, 487, ®istered, &excluded); - zephir_check_call_status(); - zephir_is_iterable(&adapters, 0, "phalcon/Logger/Logger.zep", 427); - if (Z_TYPE_P(&adapters) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&adapters), _5$$3) - { - ZEPHIR_INIT_NVAR(&adapter); - ZVAL_COPY(&adapter, _5$$3); - ZEPHIR_CALL_METHOD(&_7$$6, &adapter, "intransaction", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$6)) { - ZEPHIR_CALL_METHOD(NULL, &adapter, "add", NULL, 0, &item); - zephir_check_call_status(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapter, "process", NULL, 0, &item); - zephir_check_call_status(); - } - } ZEND_HASH_FOREACH_END(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapters, "rewind", NULL, 0); - zephir_check_call_status(); - while (1) { - ZEPHIR_CALL_METHOD(&_6$$3, &adapters, "valid", NULL, 0); - zephir_check_call_status(); - if (!zend_is_true(&_6$$3)) { - break; - } - ZEPHIR_CALL_METHOD(&adapter, &adapters, "current", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$9, &adapter, "intransaction", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$9)) { - ZEPHIR_CALL_METHOD(NULL, &adapter, "add", NULL, 0, &item); - zephir_check_call_status(); - } else { - ZEPHIR_CALL_METHOD(NULL, &adapter, "process", NULL, 0, &item); - zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, &adapters, "next", NULL, 0); - zephir_check_call_status(); - } - } - ZEPHIR_INIT_NVAR(&adapter); - ZEPHIR_INIT_NVAR(&_3$$3); - array_init(&_3$$3); - zephir_update_property_zval(this_ptr, ZEND_STRL("excluded"), &_3$$3); - } - RETURN_MM_BOOL(1); -} - -/** - * Returns an array of log levels with integer to string conversion - * - * @return string[] - */ -PHP_METHOD(Phalcon_Logger_Logger, getLevels) -{ - zval *this_ptr = getThis(); - - - - zephir_create_array(return_value, 9, 0); - add_index_stringl(return_value, 2, SL("ALERT")); - add_index_stringl(return_value, 1, SL("CRITICAL")); - add_index_stringl(return_value, 7, SL("DEBUG")); - add_index_stringl(return_value, 0, SL("EMERGENCY")); - add_index_stringl(return_value, 3, SL("ERROR")); - add_index_stringl(return_value, 6, SL("INFO")); - add_index_stringl(return_value, 5, SL("NOTICE")); - add_index_stringl(return_value, 4, SL("WARNING")); - add_index_stringl(return_value, 8, SL("CUSTOM")); - return; -} - -/** - * Converts the level from string/word to an integer - * - * @param mixed $level - * - * @return int - * @throws InvalidArgumentException - */ -PHP_METHOD(Phalcon_Logger_Logger, getLevelNumber) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *level, level_sub, levelName, levels, _0$$3, _1$$4; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&level_sub); - ZVAL_UNDEF(&levelName); - ZVAL_UNDEF(&levels); - ZVAL_UNDEF(&_0$$3); - ZVAL_UNDEF(&_1$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(level) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &level); - - - if (Z_TYPE_P(level) == IS_STRING) { - ZEPHIR_INIT_VAR(&levelName); - zephir_fast_strtoupper(&levelName, level); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&levels, "array_flip", NULL, 203, &_0$$3); - zephir_check_call_status(); - if (zephir_array_isset(&levels, &levelName)) { - zephir_array_fetch(&_1$$4, &levels, &levelName, PH_NOISY | PH_READONLY, "phalcon/Logger/Logger.zep", 473); - RETURN_CTOR(&_1$$4); - } - } else if (zephir_is_numeric(level)) { - ZEPHIR_CALL_METHOD(&levels, this_ptr, "getlevels", NULL, 0); - zephir_check_call_status(); - if (zephir_array_isset(&levels, level)) { - RETURN_MM_LONG(zephir_get_intval(level)); - } - } - RETURN_MM_LONG(8); -} - -zend_object *zephir_init_properties_Phalcon_Logger_Logger(zend_class_entry *class_type) -{ - zval _0, _2, _1$$3, _3$$4; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); - - - ZEPHIR_MM_GROW(); - - { - zval local_this_ptr, *this_ptr = &local_this_ptr; - ZEPHIR_CREATE_OBJECT(this_ptr, class_type); - zephir_read_property_ex(&_0, this_ptr, ZEND_STRL("excluded"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_0) == IS_NULL) { - ZEPHIR_INIT_VAR(&_1$$3); - array_init(&_1$$3); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("excluded"), &_1$$3); - } - zephir_read_property_ex(&_2, this_ptr, ZEND_STRL("adapters"), PH_NOISY_CC | PH_READONLY); - if (Z_TYPE_P(&_2) == IS_NULL) { - ZEPHIR_INIT_VAR(&_3$$4); - array_init(&_3$$4); - zephir_update_property_zval_ex(this_ptr, ZEND_STRL("adapters"), &_3$$4); - } - ZEPHIR_MM_RESTORE(); - return Z_OBJ_P(this_ptr); - } + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addmessage", NULL, 0, &_0, &message, &context); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/logger/logger.zep.h b/ext/phalcon/logger/logger.zep.h index 5a532347ffa..70bf381c8a2 100644 --- a/ext/phalcon/logger/logger.zep.h +++ b/ext/phalcon/logger/logger.zep.h @@ -3,57 +3,19 @@ extern zend_class_entry *phalcon_logger_logger_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_Logger); -PHP_METHOD(Phalcon_Logger_Logger, getAdapters); -PHP_METHOD(Phalcon_Logger_Logger, getLogLevel); -PHP_METHOD(Phalcon_Logger_Logger, getName); -PHP_METHOD(Phalcon_Logger_Logger, __construct); -PHP_METHOD(Phalcon_Logger_Logger, addAdapter); PHP_METHOD(Phalcon_Logger_Logger, alert); PHP_METHOD(Phalcon_Logger_Logger, critical); PHP_METHOD(Phalcon_Logger_Logger, debug); -PHP_METHOD(Phalcon_Logger_Logger, error); PHP_METHOD(Phalcon_Logger_Logger, emergency); -PHP_METHOD(Phalcon_Logger_Logger, excludeAdapters); -PHP_METHOD(Phalcon_Logger_Logger, getAdapter); +PHP_METHOD(Phalcon_Logger_Logger, error); PHP_METHOD(Phalcon_Logger_Logger, info); PHP_METHOD(Phalcon_Logger_Logger, log); PHP_METHOD(Phalcon_Logger_Logger, notice); -PHP_METHOD(Phalcon_Logger_Logger, removeAdapter); -PHP_METHOD(Phalcon_Logger_Logger, setAdapters); -PHP_METHOD(Phalcon_Logger_Logger, setLogLevel); PHP_METHOD(Phalcon_Logger_Logger, warning); -PHP_METHOD(Phalcon_Logger_Logger, addMessage); -PHP_METHOD(Phalcon_Logger_Logger, getLevels); -PHP_METHOD(Phalcon_Logger_Logger, getLevelNumber); -zend_object *zephir_init_properties_Phalcon_Logger_Logger(zend_class_entry *class_type); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger_getadapters, 0, 0, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getloglevel, 0, 0, IS_LONG, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getname, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -#endif - ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 1) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_addadapter, 0, 2, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, adapter, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) -ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_alert, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -63,7 +25,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_critical, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -73,7 +35,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_debug, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -81,9 +43,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_debug, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, 1, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -91,9 +53,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, 0, 1, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_error, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -101,21 +63,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_emergency, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_excludeadapters, 0, 0, Phalcon\\Logger\\Logger, 0) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, adapters, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_info, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -126,7 +76,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_log, 0, 2, IS_VOID, 0) ZEND_ARG_INFO(0, level) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -136,7 +86,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_notice, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #else @@ -144,30 +94,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_notice, 0, #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_removeadapter, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_setadapters, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_ARRAY_INFO(0, adapters, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_logger_setloglevel, 0, 1, Phalcon\\Logger\\Logger, 0) - ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_warning, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, message) -#if PHP_VERSION_ID >= 80000 - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") -#else - ZEND_ARG_ARRAY_INFO(0, context, 0) -#endif -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_addmessage, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) #if PHP_VERSION_ID >= 80000 ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") @@ -176,42 +104,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_addmessage #endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getlevels, 0, 0, IS_ARRAY, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_logger_getlevelnumber, 0, 1, IS_LONG, 0) - ZEND_ARG_INFO(0, level) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_logger_zephir_init_properties_phalcon_logger_logger, 0, 0, 0) -ZEND_END_ARG_INFO() - ZEPHIR_INIT_FUNCS(phalcon_logger_logger_method_entry) { -#if PHP_VERSION_ID >= 80000 - PHP_ME(Phalcon_Logger_Logger, getAdapters, arginfo_phalcon_logger_logger_getadapters, ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Logger_Logger, getAdapters, NULL, ZEND_ACC_PUBLIC) -#endif - PHP_ME(Phalcon_Logger_Logger, getLogLevel, arginfo_phalcon_logger_logger_getloglevel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, getName, arginfo_phalcon_logger_logger_getname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, __construct, arginfo_phalcon_logger_logger___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Logger_Logger, addAdapter, arginfo_phalcon_logger_logger_addadapter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, alert, arginfo_phalcon_logger_logger_alert, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, critical, arginfo_phalcon_logger_logger_critical, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, debug, arginfo_phalcon_logger_logger_debug, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, error, arginfo_phalcon_logger_logger_error, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, emergency, arginfo_phalcon_logger_logger_emergency, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, excludeAdapters, arginfo_phalcon_logger_logger_excludeadapters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, getAdapter, arginfo_phalcon_logger_logger_getadapter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Logger, error, arginfo_phalcon_logger_logger_error, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, info, arginfo_phalcon_logger_logger_info, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, log, arginfo_phalcon_logger_logger_log, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, notice, arginfo_phalcon_logger_logger_notice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, removeAdapter, arginfo_phalcon_logger_logger_removeadapter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, setAdapters, arginfo_phalcon_logger_logger_setadapters, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, setLogLevel, arginfo_phalcon_logger_logger_setloglevel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Logger, warning, arginfo_phalcon_logger_logger_warning, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Logger, addMessage, arginfo_phalcon_logger_logger_addmessage, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Logger_Logger, getLevels, arginfo_phalcon_logger_logger_getlevels, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Logger_Logger, getLevelNumber, arginfo_phalcon_logger_logger_getlevelnumber, ZEND_ACC_PRIVATE) PHP_FE_END }; diff --git a/ext/phalcon/logger/loggerfactory.zep.c b/ext/phalcon/logger/loggerfactory.zep.c index bda81a5831a..6cfce4c421a 100644 --- a/ext/phalcon/logger/loggerfactory.zep.c +++ b/ext/phalcon/logger/loggerfactory.zep.c @@ -282,7 +282,7 @@ PHP_METHOD(Phalcon_Logger_LoggerFactory, newInstance) object_init_ex(return_value, phalcon_logger_logger_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 488, &name, &adapters, timezone); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 408, &name, &adapters, timezone); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/logger/loggerinterface.zep.c b/ext/phalcon/logger/loggerinterface.zep.c new file mode 100644 index 00000000000..16eda65124f --- /dev/null +++ b/ext/phalcon/logger/loggerinterface.zep.c @@ -0,0 +1,147 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Interface for Phalcon based logger objects. + */ +ZEPHIR_INIT_CLASS(Phalcon_Logger_LoggerInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Logger, LoggerInterface, phalcon, logger_loggerinterface, phalcon_logger_loggerinterface_method_entry); + + return SUCCESS; +} + +/** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, alert); +/** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, critical); +/** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, debug); +/** + * System is unusable. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, emergency); +/** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, error); +/** + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + * @throws Exception + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getAdapter); +/** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getAdapters); +/** + * Returns the log level + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getLogLevel); +/** + * Returns the name of the logger + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, getName); +/** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, info); +/** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws Exception + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, log); +/** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, notice); +/** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ +ZEPHIR_DOC_METHOD(Phalcon_Logger_LoggerInterface, warning); diff --git a/ext/phalcon/logger/loggerinterface.zep.h b/ext/phalcon/logger/loggerinterface.zep.h new file mode 100644 index 00000000000..3dfecf6a698 --- /dev/null +++ b/ext/phalcon/logger/loggerinterface.zep.h @@ -0,0 +1,125 @@ + +extern zend_class_entry *phalcon_logger_loggerinterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Logger_LoggerInterface); + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_alert, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_critical, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_debug, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_emergency, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_error, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_loggerinterface_getadapter, 0, 1, Phalcon\\Logger\\Adapter\\AdapterInterface, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getadapters, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getloglevel, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_getname, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_info, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_log, 0, 2, IS_VOID, 0) + + ZEND_ARG_INFO(0, level) + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_notice, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_loggerinterface_warning, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, context, 0) +#endif +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_logger_loggerinterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, alert, arginfo_phalcon_logger_loggerinterface_alert) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, critical, arginfo_phalcon_logger_loggerinterface_critical) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, debug, arginfo_phalcon_logger_loggerinterface_debug) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, emergency, arginfo_phalcon_logger_loggerinterface_emergency) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, error, arginfo_phalcon_logger_loggerinterface_error) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getAdapter, arginfo_phalcon_logger_loggerinterface_getadapter) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getAdapters, arginfo_phalcon_logger_loggerinterface_getadapters) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getLogLevel, arginfo_phalcon_logger_loggerinterface_getloglevel) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, getName, arginfo_phalcon_logger_loggerinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, info, arginfo_phalcon_logger_loggerinterface_info) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, log, arginfo_phalcon_logger_loggerinterface_log) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, notice, arginfo_phalcon_logger_loggerinterface_notice) + PHP_ABSTRACT_ME(Phalcon_Logger_LoggerInterface, warning, arginfo_phalcon_logger_loggerinterface_warning) + PHP_FE_END +}; diff --git a/ext/phalcon/messages/messages.zep.c b/ext/phalcon/messages/messages.zep.c index 163bb61ecaf..db2ba3a55ff 100644 --- a/ext/phalcon/messages/messages.zep.c +++ b/ext/phalcon/messages/messages.zep.c @@ -429,7 +429,8 @@ PHP_METHOD(Phalcon_Messages_Messages, next) */ PHP_METHOD(Phalcon_Messages_Messages, offsetExists) { - zval *index, index_sub, _0; + zval index_sub, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -461,7 +462,8 @@ PHP_METHOD(Phalcon_Messages_Messages, offsetExists) PHP_METHOD(Phalcon_Messages_Messages, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *index, index_sub, message, returnValue, _0; + zval index_sub, message, returnValue, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -500,11 +502,14 @@ PHP_METHOD(Phalcon_Messages_Messages, offsetGet) */ PHP_METHOD(Phalcon_Messages_Messages, offsetSet) { - zval *index, index_sub, *message, message_sub; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval index_sub, message_sub, _0; + zval *index, *message; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) @@ -514,14 +519,18 @@ PHP_METHOD(Phalcon_Messages_Messages, offsetSet) #endif - zephir_fetch_params_without_memory_grow(2, 0, &index, &message); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &index, &message); - if (Z_TYPE_P(message) != IS_OBJECT) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241); + ZEPHIR_INIT_VAR(&_0); + zephir_gettype(&_0, message); + if (!ZEPHIR_IS_STRING(&_0, "object")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_messages_exception_ce, "The message must be an object", "phalcon/Messages/Messages.zep", 241); return; } zephir_update_property_array(this_ptr, SL("messages"), index, message); + ZEPHIR_MM_RESTORE(); } /** @@ -535,7 +544,8 @@ PHP_METHOD(Phalcon_Messages_Messages, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index, index_sub, _0, _1$$3, _2$$3; + zval index_sub, _0, _1$$3, _2$$3; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -559,7 +569,7 @@ PHP_METHOD(Phalcon_Messages_Messages, offsetUnset) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("messages"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2$$3, 1); ZEPHIR_MAKE_REF(&_1$$3); - ZEPHIR_CALL_FUNCTION(NULL, "array_splice", NULL, 489, &_1$$3, index, &_2$$3); + ZEPHIR_CALL_FUNCTION(NULL, "array_splice", NULL, 409, &_1$$3, index, &_2$$3); ZEPHIR_UNREF(&_1$$3); zephir_check_call_status(); } diff --git a/ext/phalcon/messages/messages.zep.h b/ext/phalcon/messages/messages.zep.h index c64b597390a..63991220055 100644 --- a/ext/phalcon/messages/messages.zep.h +++ b/ext/phalcon/messages/messages.zep.h @@ -58,7 +58,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offset ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_messages_messages_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/application.zep.c b/ext/phalcon/mvc/application.zep.c index 50ce319e021..d0e57595505 100644 --- a/ext/phalcon/mvc/application.zep.c +++ b/ext/phalcon/mvc/application.zep.c @@ -13,10 +13,10 @@ #include "kernel/main.h" #include "kernel/object.h" +#include "kernel/operators.h" #include "kernel/exception.h" #include "kernel/memory.h" #include "kernel/fcall.h" -#include "kernel/operators.h" #include "Zend/zend_closures.h" #include "kernel/array.h" #include "kernel/file.h" @@ -103,12 +103,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Application) */ PHP_METHOD(Phalcon_Mvc_Application, handle) { - zval _17$$21; - zend_class_entry *_6$$8; - zend_bool returnedResponse = 0, _10$$7, _13$$12, _31$$31, _33$$31; + zval _17$$20; + zend_class_entry *_6$$7; + zend_bool returnedResponse = 0, _1, _10$$6, _13$$11, _31$$30, _33$$30; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, __$false, container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, controller, possibleResponse, renderStatus, matchedRoute, match, _0, _3, _4, _21, _22, _23, _24, _41, _1$$4, _2$$4, _5$$8, _7$$7, _8$$9, _9$$9, _11$$13, _12$$13, _14$$19, _15$$19, _16$$16, _18$$23, _19$$24, _20$$24, _25$$26, _26$$26, _27$$28, _28$$28, _29$$30, _30$$30, _32$$32, _34$$35, _35$$36, _36$$36, _37$$39, _38$$39, _39$$40, _40$$41; + zval *uri_param = NULL, __$false, container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, controller, possibleResponse, renderStatus, matchedRoute, match, _0, _2, _3, _4, _21, _22, _23, _24, _41, _5$$7, _7$$6, _8$$8, _9$$8, _11$$12, _12$$12, _14$$18, _15$$18, _16$$15, _18$$22, _19$$23, _20$$23, _25$$25, _26$$25, _27$$27, _28$$27, _29$$29, _30$$29, _32$$31, _34$$34, _35$$35, _36$$35, _37$$38, _38$$38, _39$$39, _40$$40; zval uri; zval *this_ptr = getThis(); @@ -132,6 +132,7 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_UNDEF(&matchedRoute); ZVAL_UNDEF(&match); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_21); @@ -139,35 +140,33 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_UNDEF(&_23); ZVAL_UNDEF(&_24); ZVAL_UNDEF(&_41); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_5$$8); - ZVAL_UNDEF(&_7$$7); - ZVAL_UNDEF(&_8$$9); - ZVAL_UNDEF(&_9$$9); - ZVAL_UNDEF(&_11$$13); - ZVAL_UNDEF(&_12$$13); - ZVAL_UNDEF(&_14$$19); - ZVAL_UNDEF(&_15$$19); - ZVAL_UNDEF(&_16$$16); - ZVAL_UNDEF(&_18$$23); - ZVAL_UNDEF(&_19$$24); - ZVAL_UNDEF(&_20$$24); - ZVAL_UNDEF(&_25$$26); - ZVAL_UNDEF(&_26$$26); - ZVAL_UNDEF(&_27$$28); - ZVAL_UNDEF(&_28$$28); - ZVAL_UNDEF(&_29$$30); - ZVAL_UNDEF(&_30$$30); - ZVAL_UNDEF(&_32$$32); - ZVAL_UNDEF(&_34$$35); - ZVAL_UNDEF(&_35$$36); - ZVAL_UNDEF(&_36$$36); - ZVAL_UNDEF(&_37$$39); - ZVAL_UNDEF(&_38$$39); - ZVAL_UNDEF(&_39$$40); - ZVAL_UNDEF(&_40$$41); - ZVAL_UNDEF(&_17$$21); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_14$$18); + ZVAL_UNDEF(&_15$$18); + ZVAL_UNDEF(&_16$$15); + ZVAL_UNDEF(&_18$$22); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$23); + ZVAL_UNDEF(&_25$$25); + ZVAL_UNDEF(&_26$$25); + ZVAL_UNDEF(&_27$$27); + ZVAL_UNDEF(&_28$$27); + ZVAL_UNDEF(&_29$$29); + ZVAL_UNDEF(&_30$$29); + ZVAL_UNDEF(&_32$$31); + ZVAL_UNDEF(&_34$$34); + ZVAL_UNDEF(&_35$$35); + ZVAL_UNDEF(&_36$$35); + ZVAL_UNDEF(&_37$$38); + ZVAL_UNDEF(&_38$$38); + ZVAL_UNDEF(&_39$$39); + ZVAL_UNDEF(&_40$$40); + ZVAL_UNDEF(&_17$$20); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -191,26 +190,28 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&container, &_0); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { + if (Z_TYPE_P(&container) == IS_NULL) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "A dependency injection container is required to access internal services", "phalcon/Mvc/Application.zep", 100); return; } zephir_read_property(&_0, this_ptr, ZEND_STRL("eventsManager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&eventsManager, &_0); - if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_2$$4); - ZVAL_STRING(&_2$$4, "application:boot"); - ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr); + _1 = Z_TYPE_P(&eventsManager) != IS_NULL; + if (_1) { + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "application:boot"); + ZEPHIR_CALL_METHOD(&_2, &eventsManager, "fire", NULL, 0, &_3, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) { - RETURN_MM_BOOL(0); - } + _1 = ZEPHIR_IS_FALSE_IDENTICAL(&_2); + } + if (_1) { + RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(&_4); - ZVAL_STRING(&_4, "router"); - ZEPHIR_CALL_METHOD(&_3, &container, "getshared", NULL, 0, &_4); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "router"); + ZEPHIR_CALL_METHOD(&_4, &container, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&router, &_3); + ZEPHIR_CPY_WRT(&router, &_4); ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &uri); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&matchedRoute, &router, "getmatchedroute", NULL, 0); @@ -220,31 +221,31 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_check_call_status(); if (Z_TYPE_P(&match) != IS_NULL) { if (zephir_is_instance_of(&match, SL("Closure"))) { - _6$$8 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); - ZEPHIR_CALL_CE_STATIC(&_5$$8, _6$$8, "bind", NULL, 0, &match, &container); + _6$$7 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_CE_STATIC(&_5$$7, _6$$7, "bind", NULL, 0, &match, &container); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&match, &_5$$8); + ZEPHIR_CPY_WRT(&match, &_5$$7); } - ZEPHIR_CALL_METHOD(&_7$$7, &router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$6, &router, "getparams", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&possibleResponse); - ZEPHIR_CALL_USER_FUNC_ARRAY(&possibleResponse, &match, &_7$$7); + ZEPHIR_CALL_USER_FUNC_ARRAY(&possibleResponse, &match, &_7$$6); zephir_check_call_status(); if (Z_TYPE_P(&possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(&_9$$9); - ZVAL_STRING(&_9$$9, "response"); - ZEPHIR_CALL_METHOD(&_8$$9, &container, "getshared", NULL, 0, &_9$$9); + ZEPHIR_INIT_VAR(&_9$$8); + ZVAL_STRING(&_9$$8, "response"); + ZEPHIR_CALL_METHOD(&_8$$8, &container, "getshared", NULL, 0, &_9$$8); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_8$$9); + ZEPHIR_CPY_WRT(&response, &_8$$8); ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); RETURN_CCTOR(&response); } - _10$$7 = Z_TYPE_P(&possibleResponse) == IS_OBJECT; - if (_10$$7) { - _10$$7 = zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce); + _10$$6 = Z_TYPE_P(&possibleResponse) == IS_OBJECT; + if (_10$$6) { + _10$$6 = zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce); } - if (_10$$7) { + if (_10$$6) { ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendheaders", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendcookies", NULL, 0); @@ -263,22 +264,22 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) ZVAL_NULL(&moduleObject); if (zephir_is_true(&moduleName)) { if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_12$$13); - ZVAL_STRING(&_12$$13, "application:beforeStartModule"); - ZEPHIR_CALL_METHOD(&_11$$13, &eventsManager, "fire", NULL, 0, &_12$$13, this_ptr, &moduleName); + ZEPHIR_INIT_VAR(&_12$$12); + ZVAL_STRING(&_12$$12, "application:beforeStartModule"); + ZEPHIR_CALL_METHOD(&_11$$12, &eventsManager, "fire", NULL, 0, &_12$$12, this_ptr, &moduleName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_11$$13)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_11$$12)) { RETURN_MM_BOOL(0); } } ZEPHIR_CALL_METHOD(&module, this_ptr, "getmodule", NULL, 0, &moduleName); zephir_check_call_status(); - _13$$12 = Z_TYPE_P(&module) != IS_ARRAY; - if (_13$$12) { - _13$$12 = Z_TYPE_P(&module) != IS_OBJECT; + _13$$11 = Z_TYPE_P(&module) != IS_ARRAY; + if (_13$$11) { + _13$$11 = Z_TYPE_P(&module) != IS_OBJECT; } - if (UNEXPECTED(_13$$12)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 198); + if (UNEXPECTED(_13$$11)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 196); return; } if (Z_TYPE_P(&module) == IS_ARRAY) { @@ -290,13 +291,13 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) ZEPHIR_OBS_VAR(&path); if (zephir_array_isset_string_fetch(&path, &module, SL("path"), 0)) { if (UNEXPECTED(!((zephir_file_exists(&path) == SUCCESS)))) { - ZEPHIR_INIT_VAR(&_14$$19); - object_init_ex(&_14$$19, phalcon_mvc_application_exception_ce); - ZEPHIR_INIT_VAR(&_15$$19); - ZEPHIR_CONCAT_SVS(&_15$$19, "Module definition path '", &path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_14$$19, "__construct", NULL, 31, &_15$$19); + ZEPHIR_INIT_VAR(&_14$$18); + object_init_ex(&_14$$18, phalcon_mvc_application_exception_ce); + ZEPHIR_INIT_VAR(&_15$$18); + ZEPHIR_CONCAT_SVS(&_15$$18, "Module definition path '", &path, "' doesn't exist"); + ZEPHIR_CALL_METHOD(NULL, &_14$$18, "__construct", NULL, 29, &_15$$18); zephir_check_call_status(); - zephir_throw_exception_debug(&_14$$19, "phalcon/Mvc/Application.zep", 220); + zephir_throw_exception_debug(&_14$$18, "phalcon/Mvc/Application.zep", 218); ZEPHIR_MM_RESTORE(); return; } @@ -306,49 +307,49 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) } } } - ZEPHIR_CALL_METHOD(&_16$$16, &container, "get", NULL, 0, &className); + ZEPHIR_CALL_METHOD(&_16$$15, &container, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&moduleObject, &_16$$16); + ZEPHIR_CPY_WRT(&moduleObject, &_16$$15); ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerautoloaders", NULL, 0, &container); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerservices", NULL, 0, &container); zephir_check_call_status(); } else { if (UNEXPECTED(!((zephir_is_instance_of(&module, SL("Closure")))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 241); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/Mvc/Application.zep", 239); return; } - ZEPHIR_INIT_VAR(&_17$$21); - zephir_create_array(&_17$$21, 1, 0); - zephir_array_fast_append(&_17$$21, &container); + ZEPHIR_INIT_VAR(&_17$$20); + zephir_create_array(&_17$$20, 1, 0); + zephir_array_fast_append(&_17$$20, &container); ZEPHIR_INIT_NVAR(&moduleObject); - ZEPHIR_CALL_USER_FUNC_ARRAY(&moduleObject, &module, &_17$$21); + ZEPHIR_CALL_USER_FUNC_ARRAY(&moduleObject, &module, &_17$$20); zephir_check_call_status(); } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_18$$23); - ZVAL_STRING(&_18$$23, "application:afterStartModule"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_18$$23, this_ptr, &moduleObject); + ZEPHIR_INIT_VAR(&_18$$22); + ZVAL_STRING(&_18$$22, "application:afterStartModule"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_18$$22, this_ptr, &moduleObject); zephir_check_call_status(); } } zephir_read_property(&_0, this_ptr, ZEND_STRL("implicitView"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&implicitView, &_0); if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { - ZEPHIR_INIT_VAR(&_20$$24); - ZVAL_STRING(&_20$$24, "view"); - ZEPHIR_CALL_METHOD(&_19$$24, &container, "getshared", NULL, 0, &_20$$24); + ZEPHIR_INIT_VAR(&_20$$23); + ZVAL_STRING(&_20$$23, "view"); + ZEPHIR_CALL_METHOD(&_19$$23, &container, "getshared", NULL, 0, &_20$$23); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&view, &_19$$24); + ZEPHIR_CPY_WRT(&view, &_19$$23); } - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "dispatcher"); - ZEPHIR_CALL_METHOD(&_3, &container, "getshared", NULL, 0, &_4); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "dispatcher"); + ZEPHIR_CALL_METHOD(&_4, &container, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&dispatcher, &_3); - ZEPHIR_CALL_METHOD(&_3, &router, "getmodulename", NULL, 0); + ZEPHIR_CPY_WRT(&dispatcher, &_4); + ZEPHIR_CALL_METHOD(&_4, &router, "getmodulename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setmodulename", NULL, 0, &_3); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setmodulename", NULL, 0, &_4); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_21, &router, "getnamespacename", NULL, 0); zephir_check_call_status(); @@ -371,11 +372,11 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) zephir_check_call_status(); } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_26$$26); - ZVAL_STRING(&_26$$26, "application:beforeHandleRequest"); - ZEPHIR_CALL_METHOD(&_25$$26, &eventsManager, "fire", NULL, 0, &_26$$26, this_ptr, &dispatcher); + ZEPHIR_INIT_VAR(&_26$$25); + ZVAL_STRING(&_26$$25, "application:beforeHandleRequest"); + ZEPHIR_CALL_METHOD(&_25$$25, &eventsManager, "fire", NULL, 0, &_26$$25, this_ptr, &dispatcher); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$26)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$25)) { RETURN_MM_BOOL(0); } } @@ -384,52 +385,52 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) ZEPHIR_CALL_METHOD(&possibleResponse, &dispatcher, "getreturnedvalue", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&possibleResponse)) { - ZEPHIR_INIT_VAR(&_28$$28); - ZVAL_STRING(&_28$$28, "response"); - ZEPHIR_CALL_METHOD(&_27$$28, &container, "getshared", NULL, 0, &_28$$28); + ZEPHIR_INIT_VAR(&_28$$27); + ZVAL_STRING(&_28$$27, "response"); + ZEPHIR_CALL_METHOD(&_27$$27, &container, "getshared", NULL, 0, &_28$$27); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_27$$28); + ZEPHIR_CPY_WRT(&response, &_27$$27); } else { if (Z_TYPE_P(&possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(&_30$$30); - ZVAL_STRING(&_30$$30, "response"); - ZEPHIR_CALL_METHOD(&_29$$30, &container, "getshared", NULL, 0, &_30$$30); + ZEPHIR_INIT_VAR(&_30$$29); + ZVAL_STRING(&_30$$29, "response"); + ZEPHIR_CALL_METHOD(&_29$$29, &container, "getshared", NULL, 0, &_30$$29); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_29$$30); + ZEPHIR_CPY_WRT(&response, &_29$$29); ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); } else { - _31$$31 = (Z_TYPE_P(&possibleResponse) == IS_OBJECT); - if (_31$$31) { - _31$$31 = (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce)); + _31$$30 = (Z_TYPE_P(&possibleResponse) == IS_OBJECT); + if (_31$$30) { + _31$$30 = (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce)); } - returnedResponse = _31$$31; + returnedResponse = _31$$30; if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_32$$32); - ZVAL_STRING(&_32$$32, "application:afterHandleRequest"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$32, this_ptr, &controller); + ZEPHIR_INIT_VAR(&_32$$31); + ZVAL_STRING(&_32$$31, "application:afterHandleRequest"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$31, this_ptr, &controller); zephir_check_call_status(); } - _33$$31 = returnedResponse == 0; - if (_33$$31) { - _33$$31 = ZEPHIR_IS_TRUE_IDENTICAL(&implicitView); + _33$$30 = returnedResponse == 0; + if (_33$$30) { + _33$$30 = ZEPHIR_IS_TRUE_IDENTICAL(&implicitView); } - if (_33$$31) { + if (_33$$30) { if (Z_TYPE_P(&controller) == IS_OBJECT) { ZEPHIR_INIT_VAR(&renderStatus); ZVAL_BOOL(&renderStatus, 1); if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_34$$35); - ZVAL_STRING(&_34$$35, "application:viewRender"); - ZEPHIR_CALL_METHOD(&renderStatus, &eventsManager, "fire", NULL, 0, &_34$$35, this_ptr, &view); + ZEPHIR_INIT_VAR(&_34$$34); + ZVAL_STRING(&_34$$34, "application:viewRender"); + ZEPHIR_CALL_METHOD(&renderStatus, &eventsManager, "fire", NULL, 0, &_34$$34, this_ptr, &view); zephir_check_call_status(); } if (!ZEPHIR_IS_FALSE_IDENTICAL(&renderStatus)) { - ZEPHIR_CALL_METHOD(&_35$$36, &dispatcher, "getcontrollername", NULL, 0); + ZEPHIR_CALL_METHOD(&_35$$35, &dispatcher, "getcontrollername", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_36$$36, &dispatcher, "getactionname", NULL, 0); + ZEPHIR_CALL_METHOD(&_36$$35, &dispatcher, "getactionname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &_35$$36, &_36$$36); + ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &_35$$35, &_36$$35); zephir_check_call_status(); } } @@ -441,24 +442,24 @@ PHP_METHOD(Phalcon_Mvc_Application, handle) if (returnedResponse == 1) { ZEPHIR_CPY_WRT(&response, &possibleResponse); } else { - ZEPHIR_INIT_VAR(&_38$$39); - ZVAL_STRING(&_38$$39, "response"); - ZEPHIR_CALL_METHOD(&_37$$39, &container, "getshared", NULL, 0, &_38$$39); + ZEPHIR_INIT_VAR(&_38$$38); + ZVAL_STRING(&_38$$38, "response"); + ZEPHIR_CALL_METHOD(&_37$$38, &container, "getshared", NULL, 0, &_38$$38); zephir_check_call_status(); - ZEPHIR_CPY_WRT(&response, &_37$$39); + ZEPHIR_CPY_WRT(&response, &_37$$38); if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { - ZEPHIR_CALL_METHOD(&_39$$40, &view, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&_39$$39, &view, "getcontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &_39$$40); + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &_39$$39); zephir_check_call_status(); } } } } if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(&_40$$41); - ZVAL_STRING(&_40$$41, "application:beforeSendResponse"); - ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_40$$41, this_ptr, &response); + ZEPHIR_INIT_VAR(&_40$$40); + ZVAL_STRING(&_40$$40, "application:beforeSendResponse"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_40$$40, this_ptr, &response); zephir_check_call_status(); } zephir_read_property(&_0, this_ptr, ZEND_STRL("sendHeaders"), PH_NOISY_CC | PH_READONLY); diff --git a/ext/phalcon/mvc/dispatcher.zep.c b/ext/phalcon/mvc/dispatcher.zep.c index 871fcf6834d..fb359a2c9a4 100644 --- a/ext/phalcon/mvc/dispatcher.zep.c +++ b/ext/phalcon/mvc/dispatcher.zep.c @@ -454,7 +454,7 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "A dependency injection container is required to access the 'response' service"); ZVAL_LONG(&_3$$3, 0); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Dispatcher.zep", 228); ZEPHIR_MM_RESTORE(); @@ -473,7 +473,7 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, throwDispatchException) ZEPHIR_INIT_VAR(&exception); object_init_ex(&exception, phalcon_mvc_dispatcher_exception_ce); ZVAL_LONG(&_0, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 31, &message, &_0); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 29, &message, &_0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, this_ptr, "handleexception", NULL, 0, &exception); zephir_check_call_status(); diff --git a/ext/phalcon/mvc/micro.zep.c b/ext/phalcon/mvc/micro.zep.c index 6f6eff43174..bf8cbedfd01 100644 --- a/ext/phalcon/mvc/micro.zep.c +++ b/ext/phalcon/mvc/micro.zep.c @@ -581,11 +581,11 @@ PHP_METHOD(Phalcon_Mvc_Micro, getService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "get", NULL, 491, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "get", NULL, 411, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -632,11 +632,11 @@ PHP_METHOD(Phalcon_Mvc_Micro, getSharedService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "getshared", NULL, 492, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "getshared", NULL, 412, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -822,7 +822,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_8$$8, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_9$$8); ZVAL_STRING(&_9$$8, "Matched route doesn't have an associated handler"); - ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 31, &_9$$8); + ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 29, &_9$$8); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_8$$8, "phalcon/Mvc/Micro.zep", 455); goto try_end_1; @@ -866,7 +866,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_16$$14, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_17$$14); ZVAL_STRING(&_17$$14, "'before' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_16$$14, "__construct", NULL, 31, &_17$$14); + ZEPHIR_CALL_METHOD(NULL, &_16$$14, "__construct", NULL, 29, &_17$$14); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_16$$14, "phalcon/Mvc/Micro.zep", 491); goto try_end_1; @@ -905,7 +905,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_20$$19, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_21$$19); ZVAL_STRING(&_21$$19, "'before' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_20$$19, "__construct", NULL, 31, &_21$$19); + ZEPHIR_CALL_METHOD(NULL, &_20$$19, "__construct", NULL, 29, &_21$$19); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_20$$19, "phalcon/Mvc/Micro.zep", 491); goto try_end_1; @@ -1026,7 +1026,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_40$$34, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_41$$34); ZVAL_STRING(&_41$$34, "'afterBinding' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_40$$34, "__construct", NULL, 31, &_41$$34); + ZEPHIR_CALL_METHOD(NULL, &_40$$34, "__construct", NULL, 29, &_41$$34); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_40$$34, "phalcon/Mvc/Micro.zep", 602); goto try_end_1; @@ -1065,7 +1065,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_44$$39, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_45$$39); ZVAL_STRING(&_45$$39, "'afterBinding' handler is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_44$$39, "__construct", NULL, 31, &_45$$39); + ZEPHIR_CALL_METHOD(NULL, &_44$$39, "__construct", NULL, 29, &_45$$39); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_44$$39, "phalcon/Mvc/Micro.zep", 602); goto try_end_1; @@ -1117,7 +1117,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_51$$45, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_52$$45); ZVAL_STRING(&_52$$45, "One of the 'after' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_51$$45, "__construct", NULL, 31, &_52$$45); + ZEPHIR_CALL_METHOD(NULL, &_51$$45, "__construct", NULL, 29, &_52$$45); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_51$$45, "phalcon/Mvc/Micro.zep", 648); goto try_end_1; @@ -1156,7 +1156,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_55$$50, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_56$$50); ZVAL_STRING(&_56$$50, "One of the 'after' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_55$$50, "__construct", NULL, 31, &_56$$50); + ZEPHIR_CALL_METHOD(NULL, &_55$$50, "__construct", NULL, 29, &_56$$50); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_55$$50, "phalcon/Mvc/Micro.zep", 648); goto try_end_1; @@ -1194,7 +1194,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_61$$55, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_62$$55); ZVAL_STRING(&_62$$55, "Not-Found handler is not callable or is not defined"); - ZEPHIR_CALL_METHOD(NULL, &_61$$55, "__construct", NULL, 31, &_62$$55); + ZEPHIR_CALL_METHOD(NULL, &_61$$55, "__construct", NULL, 29, &_62$$55); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_61$$55, "phalcon/Mvc/Micro.zep", 681); goto try_end_1; @@ -1236,7 +1236,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_67$$60, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_68$$60); ZVAL_STRING(&_68$$60, "One of the 'finish' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_67$$60, "__construct", NULL, 31, &_68$$60); + ZEPHIR_CALL_METHOD(NULL, &_67$$60, "__construct", NULL, 29, &_68$$60); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_67$$60, "phalcon/Mvc/Micro.zep", 717); goto try_end_1; @@ -1278,7 +1278,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) object_init_ex(&_72$$65, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_NVAR(&_73$$65); ZVAL_STRING(&_73$$65, "One of the 'finish' handlers is not callable"); - ZEPHIR_CALL_METHOD(NULL, &_72$$65, "__construct", NULL, 31, &_73$$65); + ZEPHIR_CALL_METHOD(NULL, &_72$$65, "__construct", NULL, 29, &_73$$65); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_72$$65, "phalcon/Mvc/Micro.zep", 717); goto try_end_1; @@ -1436,11 +1436,11 @@ PHP_METHOD(Phalcon_Mvc_Micro, hasService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } - ZEPHIR_RETURN_CALL_METHOD(&container, "has", NULL, 493, &serviceName); + ZEPHIR_RETURN_CALL_METHOD(&container, "has", NULL, 413, &serviceName); zephir_check_call_status(); RETURN_MM(); } @@ -1602,7 +1602,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, mount) if (zephir_is_true(&_0)) { ZEPHIR_INIT_VAR(&lazyHandler); object_init_ex(&lazyHandler, phalcon_mvc_micro_lazyloader_ce); - ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 494, &mainHandler); + ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 414, &mainHandler); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&lazyHandler, &mainHandler); @@ -1754,28 +1754,31 @@ PHP_METHOD(Phalcon_Mvc_Micro, notFound) /** * Check if a service is registered in the internal services container using * the array syntax + * + * @param mixed offset */ PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&offset_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasservice", NULL, 0, alias); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "hasservice", NULL, 0, offset); zephir_check_call_status(); RETURN_MM(); } @@ -1789,28 +1792,31 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) * $app["request"] * ); *``` + * + * @param mixed offset */ PHP_METHOD(Phalcon_Mvc_Micro, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&offset_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getservice", NULL, 0, alias); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getservice", NULL, 0, offset); zephir_check_call_status(); RETURN_MM(); } @@ -1827,25 +1833,26 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetSet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub, *definition, definition_sub; + zval offset_sub, value_sub; + zval *offset, *value; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); - ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&value_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(alias) - Z_PARAM_ZVAL(definition) + Z_PARAM_ZVAL(offset) + Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &alias, &definition); + zephir_fetch_params(1, 2, 0, &offset, &value); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setservice", NULL, 0, alias, definition); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setservice", NULL, 0, offset, value); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -1858,34 +1865,36 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, alias_sub, container, _0; + zval offset_sub, _0, _2, _1$$3; + zval *offset; zval *this_ptr = getThis(); - ZVAL_UNDEF(&alias_sub); - ZVAL_UNDEF(&container); + ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(alias) + Z_PARAM_ZVAL(offset) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &alias); + zephir_fetch_params(1, 1, 0, &offset); 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_OBJECT) { - ZEPHIR_INIT_NVAR(&container); - object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 410); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &_1$$3); } - ZEPHIR_CALL_METHOD(NULL, &container, "remove", NULL, 495, alias); + zephir_read_property(&_2, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_2, "remove", NULL, 0, offset); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -2288,7 +2297,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, setService) if (Z_TYPE_P(&container) != IS_OBJECT) { ZEPHIR_INIT_NVAR(&container); object_init_ex(&container, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 490); + ZEPHIR_CALL_METHOD(NULL, &container, "__construct", NULL, 410); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); } @@ -2297,7 +2306,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, setService) } else { ZVAL_BOOL(&_0, 0); } - ZEPHIR_RETURN_CALL_METHOD(&container, "set", NULL, 496, &serviceName, definition, &_0); + ZEPHIR_RETURN_CALL_METHOD(&container, "set", NULL, 415, &serviceName, definition, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/micro.zep.h b/ext/phalcon/mvc/micro.zep.h index 8502a09313c..1f07723c876 100644 --- a/ext/phalcon/mvc/micro.zep.h +++ b/ext/phalcon/mvc/micro.zep.h @@ -138,22 +138,26 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_notfound, 0, 1, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetexists, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 0, 1) - ZEND_ARG_INFO(0, alias) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetget, 0, 1, IS_NULL, 0) +#endif + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetset, 0, 2, IS_VOID, 0) - ZEND_ARG_INFO(0, alias) - ZEND_ARG_INFO(0, definition) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetunset, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, alias) + ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_options, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) diff --git a/ext/phalcon/mvc/micro/collection.zep.c b/ext/phalcon/mvc/micro/collection.zep.c index c9fd4c4b713..a938b2e0f67 100644 --- a/ext/phalcon/mvc/micro/collection.zep.c +++ b/ext/phalcon/mvc/micro/collection.zep.c @@ -775,7 +775,7 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setPrefix) * @param string|array method * @param string routePattern * @param callable handler - * @param string name + * @param string|null name */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, addMap) { @@ -792,17 +792,18 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, addMap) ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(4, 4) + ZEND_PARSE_PARAMETERS_START(3, 4) Z_PARAM_ZVAL(method) Z_PARAM_STR(routePattern) Z_PARAM_ZVAL(handler) - Z_PARAM_STR(name) + Z_PARAM_OPTIONAL + Z_PARAM_STR_OR_NULL(name) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 0, &method, &routePattern_param, &handler, &name_param); + zephir_fetch_params(1, 3, 1, &method, &routePattern_param, &handler, &name_param); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string")); RETURN_MM_NULL(); @@ -812,7 +813,11 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, addMap) } else { ZEPHIR_INIT_VAR(&routePattern); } - zephir_get_strval(&name, name_param); + if (!name_param) { + ZEPHIR_INIT_VAR(&name); + } else { + zephir_get_strval(&name, name_param); + } ZEPHIR_INIT_VAR(&_0); diff --git a/ext/phalcon/mvc/micro/collection.zep.h b/ext/phalcon/mvc/micro/collection.zep.h index 6a3fe7d933b..04eda9a7d75 100644 --- a/ext/phalcon/mvc/micro/collection.zep.h +++ b/ext/phalcon/mvc/micro/collection.zep.h @@ -102,12 +102,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_setp ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_addmap, 0, 4, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_addmap, 0, 3, IS_VOID, 0) ZEND_ARG_INFO(0, method) ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) ZEND_ARG_INFO(0, handler) - ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_zephir_init_properties_phalcon_mvc_micro_collection, 0, 0, 0) diff --git a/ext/phalcon/mvc/micro/lazyloader.zep.c b/ext/phalcon/mvc/micro/lazyloader.zep.c index 5ee80656894..fbdc59308d5 100644 --- a/ext/phalcon/mvc/micro/lazyloader.zep.c +++ b/ext/phalcon/mvc/micro/lazyloader.zep.c @@ -174,7 +174,7 @@ PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, callMethod) object_init_ex(&_1$$4, phalcon_mvc_micro_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SVS(&_2$$4, "Handler '", &definition, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/Micro/LazyLoader.zep", 55); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model.zep.c b/ext/phalcon/mvc/model.zep.c index 7c4f771c6eb..22925c1404c 100644 --- a/ext/phalcon/mvc/model.zep.c +++ b/ext/phalcon/mvc/model.zep.c @@ -288,7 +288,7 @@ PHP_METHOD(Phalcon_Mvc_Model, __call) zephir_get_arrval(&arguments, arguments_param); - ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 497, &method, &arguments); + ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 416, &method, &arguments); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&records)) { RETURN_CCTOR(&records); @@ -310,7 +310,7 @@ PHP_METHOD(Phalcon_Mvc_Model, __call) object_init_ex(&_2, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3); ZEPHIR_CONCAT_SVSVS(&_3, "The method '", &method, "' doesn't exist on model '", &modelName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 31, &_3); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 29, &_3); zephir_check_call_status(); zephir_throw_exception_debug(&_2, "phalcon/Mvc/Model.zep", 266); ZEPHIR_MM_RESTORE(); @@ -354,7 +354,7 @@ PHP_METHOD(Phalcon_Mvc_Model, __callStatic) zephir_get_arrval(&arguments, arguments_param); - ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 497, &method, &arguments); + ZEPHIR_CALL_SELF(&records, "invokefinder", &_0, 416, &method, &arguments); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&records)) { RETURN_CCTOR(&records); @@ -365,7 +365,7 @@ PHP_METHOD(Phalcon_Mvc_Model, __callStatic) object_init_ex(&_1, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVSVS(&_2, "The method '", &method, "' doesn't exist on model '", &modelName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 31, &_2); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 29, &_2); zephir_check_call_status(); zephir_throw_exception_debug(&_1, "phalcon/Mvc/Model.zep", 292); ZEPHIR_MM_RESTORE(); @@ -696,13 +696,13 @@ PHP_METHOD(Phalcon_Mvc_Model, __set) } } - ZEPHIR_CALL_METHOD(&_14, this_ptr, "possiblesetter", NULL, 498, &property, value); + ZEPHIR_CALL_METHOD(&_14, this_ptr, "possiblesetter", NULL, 417, &property, value); zephir_check_call_status(); if (zephir_is_true(&_14)) { RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_15, "property_exists", NULL, 304, this_ptr, &property); + ZEPHIR_CALL_FUNCTION(&_15, "property_exists", NULL, 286, this_ptr, &property); zephir_check_call_status(); if (zephir_is_true(&_15)) { ZEPHIR_CALL_METHOD(&manager, this_ptr, "getmodelsmanager", NULL, 0); @@ -714,7 +714,7 @@ PHP_METHOD(Phalcon_Mvc_Model, __set) object_init_ex(&_17$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_18$$21); ZEPHIR_CONCAT_SVS(&_18$$21, "Cannot access property '", &property, "' (not public)."); - ZEPHIR_CALL_METHOD(NULL, &_17$$21, "__construct", NULL, 31, &_18$$21); + ZEPHIR_CALL_METHOD(NULL, &_17$$21, "__construct", NULL, 29, &_18$$21); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$21, "phalcon/Mvc/Model.zep", 499); ZEPHIR_MM_RESTORE(); @@ -1015,7 +1015,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) _7$$12 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_7$$12) { - ZEPHIR_CALL_SELF(&_8$$13, "caseinsensitivecolumnmap", &_9, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_8$$13, "caseinsensitivecolumnmap", &_9, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_8$$13); } @@ -1027,7 +1027,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) object_init_ex(&_10$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$16); ZEPHIR_CONCAT_SVS(&_11$$16, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$16, "__construct", &_12, 31, &_11$$16); + ZEPHIR_CALL_METHOD(NULL, &_10$$16, "__construct", &_12, 29, &_11$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$16, "phalcon/Mvc/Model.zep", 676); ZEPHIR_MM_RESTORE(); @@ -1047,7 +1047,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) } _13$$18 = zephir_is_true(&disableAssignSetters); if (!(_13$$18)) { - ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "possiblesetter", &_15, 498, &attributeField, &value); + ZEPHIR_CALL_METHOD(&_14$$18, this_ptr, "possiblesetter", &_15, 417, &attributeField, &value); zephir_check_call_status(); _13$$18 = !zephir_is_true(&_14$$18); } @@ -1072,7 +1072,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) _16$$22 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_16$$22) { - ZEPHIR_CALL_SELF(&_17$$23, "caseinsensitivecolumnmap", &_9, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_17$$23, "caseinsensitivecolumnmap", &_9, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_17$$23); } @@ -1084,7 +1084,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) object_init_ex(&_18$$26, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_19$$26); ZEPHIR_CONCAT_SVS(&_19$$26, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_18$$26, "__construct", &_12, 31, &_19$$26); + ZEPHIR_CALL_METHOD(NULL, &_18$$26, "__construct", &_12, 29, &_19$$26); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$26, "phalcon/Mvc/Model.zep", 676); ZEPHIR_MM_RESTORE(); @@ -1104,7 +1104,7 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) } _20$$28 = zephir_is_true(&disableAssignSetters); if (!(_20$$28)) { - ZEPHIR_CALL_METHOD(&_21$$28, this_ptr, "possiblesetter", &_15, 498, &attributeField, &value); + ZEPHIR_CALL_METHOD(&_21$$28, this_ptr, "possiblesetter", &_15, 417, &attributeField, &value); zephir_check_call_status(); _20$$28 = !zephir_is_true(&_21$$28); } @@ -1437,7 +1437,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_6$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$9); ZEPHIR_CONCAT_SVS(&_7$$9, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$9, "__construct", &_8, 31, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_6$$9, "__construct", &_8, 29, &_7$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$9, "phalcon/Mvc/Model.zep", 852); ZEPHIR_MM_RESTORE(); @@ -1451,7 +1451,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_9$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$11); ZEPHIR_CONCAT_SVS(&_10$$11, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 31, &_10$$11); + ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 29, &_10$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model.zep", 861); ZEPHIR_MM_RESTORE(); @@ -1473,7 +1473,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) do { if (ZEPHIR_IS_LONG(&_12$$13, 0) || ZEPHIR_IS_LONG(&_12$$13, 21) || ZEPHIR_IS_LONG(&_12$$13, 22) || ZEPHIR_IS_LONG(&_12$$13, 26)) { ZVAL_LONG(&_13$$14, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 51, &value, &_13$$14); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 38, &value, &_13$$14); zephir_check_call_status(); break; } @@ -1547,7 +1547,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_17$$27, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$27); ZEPHIR_CONCAT_SVS(&_18$$27, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 31, &_18$$27); + ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 29, &_18$$27); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model.zep", 852); ZEPHIR_MM_RESTORE(); @@ -1561,7 +1561,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) object_init_ex(&_19$$29, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$29); ZEPHIR_CONCAT_SVS(&_20$$29, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_19$$29, "__construct", &_8, 31, &_20$$29); + ZEPHIR_CALL_METHOD(NULL, &_19$$29, "__construct", &_8, 29, &_20$$29); zephir_check_call_status(); zephir_throw_exception_debug(&_19$$29, "phalcon/Mvc/Model.zep", 861); ZEPHIR_MM_RESTORE(); @@ -1583,7 +1583,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) do { if (ZEPHIR_IS_LONG(&_22$$31, 0) || ZEPHIR_IS_LONG(&_22$$31, 21) || ZEPHIR_IS_LONG(&_22$$31, 22) || ZEPHIR_IS_LONG(&_22$$31, 26)) { ZVAL_LONG(&_23$$32, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 51, &value, &_23$$32); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_14, 38, &value, &_23$$32); zephir_check_call_status(); break; } @@ -1718,7 +1718,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) _4$$7 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_4$$7) { - ZEPHIR_CALL_SELF(&_5$$8, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_5$$8, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_5$$8); } @@ -1729,7 +1729,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) object_init_ex(&_7$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$10); ZEPHIR_CONCAT_SVS(&_8$$10, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_9, 31, &_8$$10); + ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_9, 29, &_8$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$10, "phalcon/Mvc/Model.zep", 988); ZEPHIR_MM_RESTORE(); @@ -1770,7 +1770,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) _10$$16 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_10$$16) { - ZEPHIR_CALL_SELF(&_11$$17, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_11$$17, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_11$$17); } @@ -1781,7 +1781,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) object_init_ex(&_12$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$19); ZEPHIR_CONCAT_SVS(&_13$$19, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_12$$19, "__construct", &_9, 31, &_13$$19); + ZEPHIR_CALL_METHOD(NULL, &_12$$19, "__construct", &_9, 29, &_13$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$19, "phalcon/Mvc/Model.zep", 988); ZEPHIR_MM_RESTORE(); @@ -2022,7 +2022,7 @@ PHP_METHOD(Phalcon_Mvc_Model, create) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &metaData, &_1); zephir_check_call_status(); @@ -2121,7 +2121,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_INIT_ZVAL_NREF(_0); ZVAL_LONG(&_0, 3); @@ -2130,7 +2130,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) array_init(&_1); zephir_update_property_zval(this_ptr, ZEND_STRL("errorMessages"), &_1); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checkforeignkeysreverserestrict", NULL, 501); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "checkforeignkeysreverserestrict", NULL, 420); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_2$$3)) { RETURN_MM_BOOL(0); @@ -2169,7 +2169,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_5$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_6$$9); ZEPHIR_CONCAT_SVS(&_6$$9, "Column '", &primaryKey, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_7, 31, &_6$$9); + ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_7, 29, &_6$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model.zep", 1217); ZEPHIR_MM_RESTORE(); @@ -2182,7 +2182,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_8$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_9$$11); ZEPHIR_CONCAT_SVS(&_9$$11, "Column '", &primaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_8$$11, "__construct", &_7, 31, &_9$$11); + ZEPHIR_CALL_METHOD(NULL, &_8$$11, "__construct", &_7, 29, &_9$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_8$$11, "phalcon/Mvc/Model.zep", 1227); ZEPHIR_MM_RESTORE(); @@ -2197,7 +2197,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_10$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$13); ZEPHIR_CONCAT_SVS(&_11$$13, "Cannot delete the record because the primary key attribute: '", &attributeField, "' was not set"); - ZEPHIR_CALL_METHOD(NULL, &_10$$13, "__construct", &_7, 31, &_11$$13); + ZEPHIR_CALL_METHOD(NULL, &_10$$13, "__construct", &_7, 29, &_11$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$13, "phalcon/Mvc/Model.zep", 1240); ZEPHIR_MM_RESTORE(); @@ -2228,7 +2228,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_15$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$15); ZEPHIR_CONCAT_SVS(&_16$$15, "Column '", &primaryKey, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_15$$15, "__construct", &_7, 31, &_16$$15); + ZEPHIR_CALL_METHOD(NULL, &_15$$15, "__construct", &_7, 29, &_16$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$15, "phalcon/Mvc/Model.zep", 1217); ZEPHIR_MM_RESTORE(); @@ -2241,7 +2241,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_17$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$17); ZEPHIR_CONCAT_SVS(&_18$$17, "Column '", &primaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$17, "__construct", &_7, 31, &_18$$17); + ZEPHIR_CALL_METHOD(NULL, &_17$$17, "__construct", &_7, 29, &_18$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$17, "phalcon/Mvc/Model.zep", 1227); ZEPHIR_MM_RESTORE(); @@ -2256,7 +2256,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) object_init_ex(&_19$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$19); ZEPHIR_CONCAT_SVS(&_20$$19, "Cannot delete the record because the primary key attribute: '", &attributeField, "' was not set"); - ZEPHIR_CALL_METHOD(NULL, &_19$$19, "__construct", &_7, 31, &_20$$19); + ZEPHIR_CALL_METHOD(NULL, &_19$$19, "__construct", &_7, 29, &_20$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_19$$19, "phalcon/Mvc/Model.zep", 1240); ZEPHIR_MM_RESTORE(); @@ -2292,9 +2292,9 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) RETURN_MM_BOOL(1); } } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -2309,7 +2309,7 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) ZEPHIR_CALL_METHOD(&success, &writeConnection, "delete", NULL, 0, &table, &_27, &values, &bindTypes); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_28$$25, this_ptr, "checkforeignkeysreversecascade", NULL, 504); + ZEPHIR_CALL_METHOD(&_28$$25, this_ptr, "checkforeignkeysreversecascade", NULL, 423); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_28$$25)) { RETURN_MM_BOOL(0); @@ -2349,7 +2349,7 @@ PHP_METHOD(Phalcon_Mvc_Model, dump) ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 505, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 424, this_ptr); zephir_check_call_status(); RETURN_MM(); } @@ -2514,10 +2514,10 @@ PHP_METHOD(Phalcon_Mvc_Model, dump) * ``` * * @param array|string|int|null parameters = [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -2571,7 +2571,7 @@ PHP_METHOD(Phalcon_Mvc_Model, find) } else { ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 506, ¶ms); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 425, ¶ms); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&resultset, &query, "execute", NULL, 0); zephir_check_call_status(); @@ -2652,10 +2652,10 @@ PHP_METHOD(Phalcon_Mvc_Model, find) * ``` * * @param array|string|int|null parameters = [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -2722,7 +2722,7 @@ PHP_METHOD(Phalcon_Mvc_Model, findFirst) return; } ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_2, 506, ¶ms, &_3); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_2, 425, ¶ms, &_3); zephir_check_call_status(); ZVAL_BOOL(&_3, 1); ZEPHIR_CALL_METHOD(NULL, &query, "setuniquerow", NULL, 0, &_3); @@ -3270,7 +3270,7 @@ PHP_METHOD(Phalcon_Mvc_Model, getRelated) object_init_ex(&_2$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3$$3); ZEPHIR_CONCAT_SVSVS(&_3$$3, "There is no defined relations for the model '", &className, "' using alias '", &alias, "'"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$3, "phalcon/Mvc/Model.zep", 1950); ZEPHIR_MM_RESTORE(); @@ -3615,7 +3615,7 @@ PHP_METHOD(Phalcon_Mvc_Model, hasChanged) RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &changedFields)); } if (Z_TYPE_P(fieldName) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 507, fieldName, &changedFields); + ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 426, fieldName, &changedFields); zephir_check_call_status(); if (allFields) { RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&intersect, fieldName)); @@ -3688,7 +3688,7 @@ PHP_METHOD(Phalcon_Mvc_Model, hasUpdated) RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &updatedFields)); } if (Z_TYPE_P(fieldName) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 507, fieldName, &updatedFields); + ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect", NULL, 426, fieldName, &updatedFields); zephir_check_call_status(); if (allFields) { RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&intersect, fieldName)); @@ -3903,12 +3903,12 @@ PHP_METHOD(Phalcon_Mvc_Model, query) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 508, container); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 427, container); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_3); zephir_get_called_class(&_3); - ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 509, &_3); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 428, &_3); zephir_check_call_status(); RETURN_CCTOR(&criteria); } @@ -4008,13 +4008,13 @@ PHP_METHOD(Phalcon_Mvc_Model, refresh) } ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_1); - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -4173,7 +4173,7 @@ PHP_METHOD(Phalcon_Mvc_Model, save) ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 500); + ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 419); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "prepareSave"); @@ -4189,9 +4189,9 @@ PHP_METHOD(Phalcon_Mvc_Model, save) RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -4201,7 +4201,7 @@ PHP_METHOD(Phalcon_Mvc_Model, save) } else { ZEPHIR_CPY_WRT(&table, &source); } - ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&exists, this_ptr, "has", NULL, 0, &metaData, &readConnection); zephir_check_call_status(); @@ -4232,7 +4232,7 @@ PHP_METHOD(Phalcon_Mvc_Model, save) object_init_ex(&_6$$11, phalcon_mvc_model_validationfailed_ce); ZEPHIR_CALL_METHOD(&_7$$11, this_ptr, "getmessages", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", NULL, 511, this_ptr, &_7$$11); + ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", NULL, 430, this_ptr, &_7$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$11, "phalcon/Mvc/Model.zep", 2561); ZEPHIR_MM_RESTORE(); @@ -4685,7 +4685,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_4$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_5$$7); ZEPHIR_CONCAT_SVS(&_5$$7, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_6, 31, &_5$$7); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_6, 29, &_5$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$7, "phalcon/Mvc/Model.zep", 2818); ZEPHIR_MM_RESTORE(); @@ -4701,7 +4701,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_7$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$10); ZEPHIR_CONCAT_SVS(&_8$$10, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_6, 31, &_8$$10); + ZEPHIR_CALL_METHOD(NULL, &_7$$10, "__construct", &_6, 29, &_8$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$10, "phalcon/Mvc/Model.zep", 2829); ZEPHIR_MM_RESTORE(); @@ -4735,7 +4735,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_9$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$14); ZEPHIR_CONCAT_SVS(&_10$$14, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_9$$14, "__construct", &_6, 31, &_10$$14); + ZEPHIR_CALL_METHOD(NULL, &_9$$14, "__construct", &_6, 29, &_10$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$14, "phalcon/Mvc/Model.zep", 2818); ZEPHIR_MM_RESTORE(); @@ -4751,7 +4751,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) object_init_ex(&_11$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SVS(&_12$$17, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_6, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_6, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$17, "phalcon/Mvc/Model.zep", 2829); ZEPHIR_MM_RESTORE(); @@ -4853,7 +4853,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) _4$$4 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_4$$4) { - ZEPHIR_CALL_SELF(&_5$$6, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_5$$6, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_5$$6); } @@ -4864,7 +4864,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_7$$8, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$8); ZEPHIR_CONCAT_SVS(&_8$$8, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_7$$8, "__construct", &_9, 31, &_8$$8); + ZEPHIR_CALL_METHOD(NULL, &_7$$8, "__construct", &_9, 29, &_8$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$8, "phalcon/Mvc/Model.zep", 2883); ZEPHIR_MM_RESTORE(); @@ -4880,7 +4880,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_10$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$11); ZEPHIR_CONCAT_SVS(&_11$$11, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", &_9, 31, &_11$$11); + ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", &_9, 29, &_11$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$11, "phalcon/Mvc/Model.zep", 2894); ZEPHIR_MM_RESTORE(); @@ -4912,7 +4912,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) _12$$12 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_12$$12) { - ZEPHIR_CALL_SELF(&_13$$14, "caseinsensitivecolumnmap", &_6, 499, columnMap, &key); + ZEPHIR_CALL_SELF(&_13$$14, "caseinsensitivecolumnmap", &_6, 418, columnMap, &key); zephir_check_call_status(); ZEPHIR_CPY_WRT(&key, &_13$$14); } @@ -4923,7 +4923,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_14$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_15$$16); ZEPHIR_CONCAT_SVS(&_15$$16, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_14$$16, "__construct", &_9, 31, &_15$$16); + ZEPHIR_CALL_METHOD(NULL, &_14$$16, "__construct", &_9, 29, &_15$$16); zephir_check_call_status(); zephir_throw_exception_debug(&_14$$16, "phalcon/Mvc/Model.zep", 2883); ZEPHIR_MM_RESTORE(); @@ -4939,7 +4939,7 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) object_init_ex(&_16$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_17$$19); ZEPHIR_CONCAT_SVS(&_17$$19, "Column '", &key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_16$$19, "__construct", &_9, 31, &_17$$19); + ZEPHIR_CALL_METHOD(NULL, &_16$$19, "__construct", &_9, 29, &_17$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_16$$19, "phalcon/Mvc/Model.zep", 2894); ZEPHIR_MM_RESTORE(); @@ -5333,7 +5333,7 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) _3$$4 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_3$$4) { - ZEPHIR_CALL_SELF(&_4$$5, "caseinsensitivecolumnmap", &_5, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_4$$5, "caseinsensitivecolumnmap", &_5, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_4$$5); } @@ -5344,7 +5344,7 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) object_init_ex(&_6$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$7); ZEPHIR_CONCAT_SVS(&_7$$7, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", &_8, 31, &_7$$7); + ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", &_8, 29, &_7$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$7, "phalcon/Mvc/Model.zep", 3153); ZEPHIR_MM_RESTORE(); @@ -5384,7 +5384,7 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) _9$$14 = ZEPHIR_GLOBAL(orm).case_insensitive_column_map; } if (_9$$14) { - ZEPHIR_CALL_SELF(&_10$$15, "caseinsensitivecolumnmap", &_5, 499, &columnMap, &attribute); + ZEPHIR_CALL_SELF(&_10$$15, "caseinsensitivecolumnmap", &_5, 418, &columnMap, &attribute); zephir_check_call_status(); ZEPHIR_CPY_WRT(&attribute, &_10$$15); } @@ -5395,7 +5395,7 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) object_init_ex(&_11$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_12$$17); ZEPHIR_CONCAT_SVS(&_12$$17, "Column '", &attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_8, 31, &_12$$17); + ZEPHIR_CALL_METHOD(NULL, &_11$$17, "__construct", &_8, 29, &_12$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_11$$17, "phalcon/Mvc/Model.zep", 3153); ZEPHIR_MM_RESTORE(); @@ -5464,7 +5464,7 @@ PHP_METHOD(Phalcon_Mvc_Model, update) if (zephir_is_true(&_0)) { ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getreadconnection", NULL, 510); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getreadconnection", NULL, 429); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "has", NULL, 0, &metaData, &_2$$3); zephir_check_call_status(); @@ -6341,7 +6341,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_4$$7); ZEPHIR_CONCAT_SVS(&_4$$7, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 31, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 29, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model.zep", 3604); ZEPHIR_MM_RESTORE(); @@ -6379,7 +6379,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_12$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$15); ZEPHIR_CONCAT_SVS(&_13$$15, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_12$$15, "__construct", &_5, 31, &_13$$15); + ZEPHIR_CALL_METHOD(NULL, &_12$$15, "__construct", &_5, 29, &_13$$15); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$15, "phalcon/Mvc/Model.zep", 3639); ZEPHIR_MM_RESTORE(); @@ -6430,7 +6430,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_20$$22, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_21$$22); ZEPHIR_CONCAT_SVS(&_21$$22, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_20$$22, "__construct", &_5, 31, &_21$$22); + ZEPHIR_CALL_METHOD(NULL, &_20$$22, "__construct", &_5, 29, &_21$$22); zephir_check_call_status(); zephir_throw_exception_debug(&_20$$22, "phalcon/Mvc/Model.zep", 3604); ZEPHIR_MM_RESTORE(); @@ -6468,7 +6468,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_28$$30, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_29$$30); ZEPHIR_CONCAT_SVS(&_29$$30, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_28$$30, "__construct", &_5, 31, &_29$$30); + ZEPHIR_CALL_METHOD(NULL, &_28$$30, "__construct", &_5, 29, &_29$$30); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$30, "phalcon/Mvc/Model.zep", 3639); ZEPHIR_MM_RESTORE(); @@ -6521,7 +6521,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_37$$38, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_38$$38); ZEPHIR_CONCAT_SVS(&_38$$38, "Identity column '", identityField, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_37$$38, "__construct", &_5, 31, &_38$$38); + ZEPHIR_CALL_METHOD(NULL, &_37$$38, "__construct", &_5, 29, &_38$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_37$$38, "phalcon/Mvc/Model.zep", 3690); ZEPHIR_MM_RESTORE(); @@ -6551,7 +6551,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) object_init_ex(&_40$$45, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_41$$45); ZEPHIR_CONCAT_SVS(&_41$$45, "Identity column '", identityField, "' isn\'t part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_40$$45, "__construct", &_5, 31, &_41$$45); + ZEPHIR_CALL_METHOD(NULL, &_40$$45, "__construct", &_5, 29, &_41$$45); zephir_check_call_status(); zephir_throw_exception_debug(&_40$$45, "phalcon/Mvc/Model.zep", 3719); ZEPHIR_MM_RESTORE(); @@ -6590,9 +6590,9 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) ZEPHIR_CALL_METHOD(&sequenceName, this_ptr, "getsequencename", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&sequenceName); if (ZEPHIR_IS_EMPTY(&schema)) { @@ -6606,7 +6606,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowInsert) zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_GLOBAL(orm).cast_last_insert_id_to_int)) { ZVAL_LONG(&_47$$55, 10); - ZEPHIR_CALL_FUNCTION(&_48$$55, "intval", NULL, 51, &lastInsertedId, &_47$$55); + ZEPHIR_CALL_FUNCTION(&_48$$55, "intval", NULL, 38, &lastInsertedId, &_47$$55); zephir_check_call_status(); ZEPHIR_CPY_WRT(&lastInsertedId, &_48$$55); } @@ -6809,7 +6809,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_4$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_5$$10); ZEPHIR_CONCAT_SVS(&_5$$10, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", &_6, 31, &_5$$10); + ZEPHIR_CALL_METHOD(NULL, &_4$$10, "__construct", &_6, 29, &_5$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$10, "phalcon/Mvc/Model.zep", 3862); ZEPHIR_MM_RESTORE(); @@ -6826,7 +6826,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_7$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$13); ZEPHIR_CONCAT_SVS(&_8$$13, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_7$$13, "__construct", &_6, 31, &_8$$13); + ZEPHIR_CALL_METHOD(NULL, &_7$$13, "__construct", &_6, 29, &_8$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$13, "phalcon/Mvc/Model.zep", 3876); ZEPHIR_MM_RESTORE(); @@ -6855,7 +6855,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_9$$23, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_10$$23); ZEPHIR_CONCAT_SVS(&_10$$23, "Column '", &field, "' have not defined a data type"); - ZEPHIR_CALL_METHOD(NULL, &_9$$23, "__construct", &_6, 31, &_10$$23); + ZEPHIR_CALL_METHOD(NULL, &_9$$23, "__construct", &_6, 29, &_10$$23); zephir_check_call_status(); zephir_throw_exception_debug(&_9$$23, "phalcon/Mvc/Model.zep", 3915); ZEPHIR_MM_RESTORE(); @@ -6938,7 +6938,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_20$$35, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_21$$35); ZEPHIR_CONCAT_SVS(&_21$$35, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_20$$35, "__construct", &_6, 31, &_21$$35); + ZEPHIR_CALL_METHOD(NULL, &_20$$35, "__construct", &_6, 29, &_21$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_20$$35, "phalcon/Mvc/Model.zep", 3862); ZEPHIR_MM_RESTORE(); @@ -6955,7 +6955,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_22$$38, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_23$$38); ZEPHIR_CONCAT_SVS(&_23$$38, "Column '", &field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, &_22$$38, "__construct", &_6, 31, &_23$$38); + ZEPHIR_CALL_METHOD(NULL, &_22$$38, "__construct", &_6, 29, &_23$$38); zephir_check_call_status(); zephir_throw_exception_debug(&_22$$38, "phalcon/Mvc/Model.zep", 3876); ZEPHIR_MM_RESTORE(); @@ -6984,7 +6984,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_24$$48, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_25$$48); ZEPHIR_CONCAT_SVS(&_25$$48, "Column '", &field, "' have not defined a data type"); - ZEPHIR_CALL_METHOD(NULL, &_24$$48, "__construct", &_6, 31, &_25$$48); + ZEPHIR_CALL_METHOD(NULL, &_24$$48, "__construct", &_6, 29, &_25$$48); zephir_check_call_status(); zephir_throw_exception_debug(&_24$$48, "phalcon/Mvc/Model.zep", 3915); ZEPHIR_MM_RESTORE(); @@ -7086,7 +7086,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_36$$63, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_37$$63); ZEPHIR_CONCAT_SVS(&_37$$63, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_36$$63, "__construct", &_6, 31, &_37$$63); + ZEPHIR_CALL_METHOD(NULL, &_36$$63, "__construct", &_6, 29, &_37$$63); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$63, "phalcon/Mvc/Model.zep", 4021); ZEPHIR_MM_RESTORE(); @@ -7122,7 +7122,7 @@ PHP_METHOD(Phalcon_Mvc_Model, doLowUpdate) object_init_ex(&_38$$69, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_39$$69); ZEPHIR_CONCAT_SVS(&_39$$69, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_38$$69, "__construct", &_6, 31, &_39$$69); + ZEPHIR_CALL_METHOD(NULL, &_38$$69, "__construct", &_6, 29, &_39$$69); zephir_check_call_status(); zephir_throw_exception_debug(&_38$$69, "phalcon/Mvc/Model.zep", 4021); ZEPHIR_MM_RESTORE(); @@ -7296,7 +7296,7 @@ PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_3$$9, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_4$$9); ZEPHIR_CONCAT_SVS(&_4$$9, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_5, 31, &_4$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_5, 29, &_4$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$9, "phalcon/Mvc/Model.zep", 4124); ZEPHIR_MM_RESTORE(); @@ -7327,7 +7327,7 @@ PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_7$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_8$$14); ZEPHIR_CONCAT_SVS(&_8$$14, "Column '", &field, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_7$$14, "__construct", &_5, 31, &_8$$14); + ZEPHIR_CALL_METHOD(NULL, &_7$$14, "__construct", &_5, 29, &_8$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_7$$14, "phalcon/Mvc/Model.zep", 4154); ZEPHIR_MM_RESTORE(); @@ -7358,7 +7358,7 @@ PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_12$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$17); ZEPHIR_CONCAT_SVS(&_13$$17, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_12$$17, "__construct", &_5, 31, &_13$$17); + ZEPHIR_CALL_METHOD(NULL, &_12$$17, "__construct", &_5, 29, &_13$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$17, "phalcon/Mvc/Model.zep", 4124); ZEPHIR_MM_RESTORE(); @@ -7389,7 +7389,7 @@ PHP_METHOD(Phalcon_Mvc_Model, has) object_init_ex(&_15$$22, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$22); ZEPHIR_CONCAT_SVS(&_16$$22, "Column '", &field, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, &_15$$22, "__construct", &_5, 31, &_16$$22); + ZEPHIR_CALL_METHOD(NULL, &_15$$22, "__construct", &_5, 29, &_16$$22); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$22, "phalcon/Mvc/Model.zep", 4154); ZEPHIR_MM_RESTORE(); @@ -7432,9 +7432,9 @@ PHP_METHOD(Phalcon_Mvc_Model, has) zephir_read_property(&_22$$27, this_ptr, ZEND_STRL("uniqueTypes"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&uniqueTypes, &_22$$27); } - ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 502); + ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 421); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 503); + ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 422); zephir_check_call_status(); if (zephir_is_true(&schema)) { ZEPHIR_INIT_VAR(&table); @@ -7817,7 +7817,7 @@ PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_4$$7); ZEPHIR_CONCAT_SVS(&_4$$7, "The static method '", &method, "' requires one argument"); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 31, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 29, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model.zep", 4449); ZEPHIR_MM_RESTORE(); @@ -7837,7 +7837,7 @@ PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) if (zephir_array_isset(&attributes, &extraMethod)) { ZEPHIR_CPY_WRT(&field, &extraMethod); } else { - ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 104, &extraMethod); + ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 73, &extraMethod); zephir_check_call_status(); if (zephir_array_isset(&attributes, &extraMethodFirst)) { ZEPHIR_CPY_WRT(&field, &extraMethodFirst); @@ -7849,7 +7849,7 @@ PHP_METHOD(Phalcon_Mvc_Model, invokeFinder) object_init_ex(&_5$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_6$$13); ZEPHIR_CONCAT_SVS(&_6$$13, "Cannot resolve attribute '", &extraMethod, "' in the model"); - ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", NULL, 31, &_6$$13); + ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", NULL, 29, &_6$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_5$$13, "phalcon/Mvc/Model.zep", 4486); ZEPHIR_MM_RESTORE(); @@ -8041,7 +8041,7 @@ PHP_METHOD(Phalcon_Mvc_Model, preSave) } } if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "checkforeignkeysrestrict", NULL, 0); + ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "checkforeignkeysrestrict", NULL, 431); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$8)) { RETURN_MM_BOOL(0); @@ -8086,7 +8086,7 @@ PHP_METHOD(Phalcon_Mvc_Model, preSave) object_init_ex(&_6$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_7$$19); ZEPHIR_CONCAT_SVS(&_7$$19, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_6$$19, "__construct", &_8, 31, &_7$$19); + ZEPHIR_CALL_METHOD(NULL, &_6$$19, "__construct", &_8, 29, &_7$$19); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$19, "phalcon/Mvc/Model.zep", 4647); ZEPHIR_MM_RESTORE(); @@ -8174,7 +8174,7 @@ PHP_METHOD(Phalcon_Mvc_Model, preSave) object_init_ex(&_17$$39, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$39); ZEPHIR_CONCAT_SVS(&_18$$39, "Column '", &field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$39, "__construct", &_8, 31, &_18$$39); + ZEPHIR_CALL_METHOD(NULL, &_17$$39, "__construct", &_8, 29, &_18$$39); zephir_check_call_status(); zephir_throw_exception_debug(&_17$$39, "phalcon/Mvc/Model.zep", 4647); ZEPHIR_MM_RESTORE(); @@ -8904,7 +8904,7 @@ PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_15$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$10); ZEPHIR_CONCAT_SVS(&_16$$10, "The column '", &columns, "' needs to be present in the model"); - ZEPHIR_CALL_METHOD(NULL, &_15$$10, "__construct", &_17, 31, &_16$$10); + ZEPHIR_CALL_METHOD(NULL, &_15$$10, "__construct", &_17, 29, &_16$$10); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$10, "phalcon/Mvc/Model.zep", 4992); ZEPHIR_MM_RESTORE(); @@ -9243,7 +9243,7 @@ PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_68$$43, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_69$$43); ZEPHIR_CONCAT_SVSVS(&_69$$43, "There are no defined relations for the model '", &className, "' using alias '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_68$$43, "__construct", &_17, 31, &_69$$43); + ZEPHIR_CALL_METHOD(NULL, &_68$$43, "__construct", &_17, 29, &_69$$43); zephir_check_call_status(); zephir_throw_exception_debug(&_68$$43, "phalcon/Mvc/Model.zep", 5144); ZEPHIR_MM_RESTORE(); @@ -9326,7 +9326,7 @@ PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_81$$51, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_82$$51); ZEPHIR_CONCAT_SVS(&_82$$51, "The column '", &columns, "' needs to be present in the model"); - ZEPHIR_CALL_METHOD(NULL, &_81$$51, "__construct", &_17, 31, &_82$$51); + ZEPHIR_CALL_METHOD(NULL, &_81$$51, "__construct", &_17, 29, &_82$$51); zephir_check_call_status(); zephir_throw_exception_debug(&_81$$51, "phalcon/Mvc/Model.zep", 4992); ZEPHIR_MM_RESTORE(); @@ -9665,7 +9665,7 @@ PHP_METHOD(Phalcon_Mvc_Model, postSaveRelatedRecords) object_init_ex(&_132$$84, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_133$$84); ZEPHIR_CONCAT_SVSVS(&_133$$84, "There are no defined relations for the model '", &className, "' using alias '", &name, "'"); - ZEPHIR_CALL_METHOD(NULL, &_132$$84, "__construct", &_17, 31, &_133$$84); + ZEPHIR_CALL_METHOD(NULL, &_132$$84, "__construct", &_17, 29, &_133$$84); zephir_check_call_status(); zephir_throw_exception_debug(&_132$$84, "phalcon/Mvc/Model.zep", 5144); ZEPHIR_MM_RESTORE(); @@ -9816,7 +9816,7 @@ PHP_METHOD(Phalcon_Mvc_Model, cancelOperation) * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -9825,10 +9825,10 @@ PHP_METHOD(Phalcon_Mvc_Model, cancelOperation) * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -9847,16 +9847,16 @@ PHP_METHOD(Phalcon_Mvc_Model, belongsTo) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -9864,13 +9864,13 @@ PHP_METHOD(Phalcon_Mvc_Model, belongsTo) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -9880,14 +9880,16 @@ PHP_METHOD(Phalcon_Mvc_Model, belongsTo) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addbelongsto", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addbelongsto", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -10005,7 +10007,7 @@ PHP_METHOD(Phalcon_Mvc_Model, getPreparedQuery) * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -10014,10 +10016,10 @@ PHP_METHOD(Phalcon_Mvc_Model, getPreparedQuery) * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -10036,16 +10038,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -10053,13 +10055,13 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -10069,14 +10071,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmany", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmany", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -10109,7 +10113,7 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) * @param string|array intermediateReferencedFields * @param string referenceModel * @param string|array referencedFields - * @param array options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -10118,10 +10122,10 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -10140,18 +10144,19 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referenceModel; - zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, _0; + zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(6, 7) @@ -10162,13 +10167,13 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -10187,15 +10192,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - ZEPHIR_INIT_VAR(options); - array_init(options); + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmanytomany", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmanytomany", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -10217,7 +10223,7 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -10226,10 +10232,10 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -10248,16 +10254,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOne) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referenceModel; - zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(3, 4) @@ -10265,13 +10271,13 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOne) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string")); RETURN_MM_NULL(); @@ -10281,14 +10287,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOne) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasone", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasone", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -10315,29 +10323,29 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOne) * } *``` * - * @param string|array fields - * @param string|array intermediateFields - * @param string|array intermediateReferencedFields - * @param string|array referencedFields - * @param array options + * @param string|array $fields + * @param string|array $intermediateFields + * @param string|array $intermediateReferencedFields + * @param string|array $referencedFields + * @param array $options */ PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referenceModel; - zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referenceModel); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(6, 7) @@ -10348,13 +10356,13 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) Z_PARAM_STR(referenceModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options); + zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -10373,14 +10381,16 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOneThrough) } else { ZEPHIR_INIT_VAR(&referenceModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsManager"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasonethrough", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, options); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasonethrough", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, &options); zephir_check_call_status(); RETURN_MM(); } @@ -10979,6 +10989,175 @@ PHP_METHOD(Phalcon_Mvc_Model, caseInsensitiveColumnMap) RETURN_MM(); } +PHP_METHOD(Phalcon_Mvc_Model, __serialize) +{ + zend_bool _2, _3; + zval attributes, manager, dirtyState, snapshot, _0, _1, _4, _5$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&dirtyState); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$3); + + + ZEPHIR_MM_GROW(); + + ZEPHIR_INIT_VAR(&snapshot); + ZVAL_NULL(&snapshot); + ZEPHIR_CALL_METHOD(&attributes, this_ptr, "toarray", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("dirtyState"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dirtyState, &_0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmanager", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&manager, &_1); + ZEPHIR_CALL_METHOD(&_1, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); + zephir_check_call_status(); + _2 = zephir_is_true(&_1); + if (_2) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + _2 = Z_TYPE_P(&_0) != IS_NULL; + } + _3 = _2; + if (_3) { + zephir_read_property(&_4, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + _3 = !ZEPHIR_IS_EQUAL(&attributes, &_4); + } + if (_3) { + zephir_read_property(&_5$$3, this_ptr, ZEND_STRL("snapshot"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&snapshot, &_5$$3); + } + zephir_create_array(return_value, 3, 0); + zephir_array_update_string(return_value, SL("attributes"), &attributes, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("snapshot"), &snapshot, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("dirtyState"), &dirtyState, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Mvc_Model, __unserialize) +{ + zend_string *_7$$6; + zend_ulong _6$$6; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zephir_fcall_cache_entry *_1 = NULL; + zval *data_param = NULL, container, manager, key, value, snapshot, properties, dirtyState, _2, _3, _0$$3, *_4$$6, _5$$6; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&properties); + ZVAL_UNDEF(&dirtyState); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_5$$6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + if (!(zephir_array_isset_string(&data, SL("attributes")))) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_create_array(&_0$$3, 1, 0); + zephir_array_update_string(&_0$$3, SL("attributes"), &data, PH_COPY | PH_SEPARATE); + ZEPHIR_CPY_WRT(&data, &_0$$3); + } + ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_1, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injection container is required to access the services related to the ODM", "phalcon/Mvc/Model.zep", 5857); + return; + } + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &container); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "modelsManager"); + ZEPHIR_CALL_METHOD(&_2, &container, "getshared", NULL, 0, &_3); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&manager, &_2); + if (Z_TYPE_P(&manager) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The injected service 'modelsManager' is not valid", "phalcon/Mvc/Model.zep", 5872); + return; + } + zephir_update_property_zval(this_ptr, ZEND_STRL("modelsManager"), &manager); + ZEPHIR_CALL_METHOD(NULL, &manager, "initialize", NULL, 0, this_ptr); + zephir_check_call_status(); + ZEPHIR_OBS_VAR(&properties); + if (zephir_array_isset_string_fetch(&properties, &data, SL("attributes"), 0)) { + zephir_is_iterable(&properties, 0, "phalcon/Mvc/Model.zep", 5895); + if (Z_TYPE_P(&properties) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&properties), _6$$6, _7$$6, _4$$6) + { + ZEPHIR_INIT_NVAR(&key); + if (_7$$6 != NULL) { + ZVAL_STR_COPY(&key, _7$$6); + } else { + ZVAL_LONG(&key, _6$$6); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _4$$6); + zephir_update_property_zval_zval(this_ptr, &key, &value); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, &properties, "rewind", NULL, 0); + zephir_check_call_status(); + while (1) { + ZEPHIR_CALL_METHOD(&_5$$6, &properties, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_5$$6)) { + break; + } + ZEPHIR_CALL_METHOD(&key, &properties, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&value, &properties, "current", NULL, 0); + zephir_check_call_status(); + zephir_update_property_zval_zval(this_ptr, &key, &value); + ZEPHIR_CALL_METHOD(NULL, &properties, "next", NULL, 0); + zephir_check_call_status(); + } + } + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + } else { + ZEPHIR_INIT_NVAR(&properties); + array_init(&properties); + } + ZEPHIR_OBS_VAR(&dirtyState); + if (zephir_array_isset_string_fetch(&dirtyState, &data, SL("dirtyState"), 0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("dirtyState"), &dirtyState); + } + ZEPHIR_CALL_METHOD(&_2, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); + zephir_check_call_status(); + if (zephir_is_true(&_2)) { + if (zephir_array_isset_string_fetch(&snapshot, &data, SL("snapshot"), 1)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("snapshot"), &snapshot); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("snapshot"), &properties); + } + } + ZEPHIR_MM_RESTORE(); +} + zend_object *zephir_init_properties_Phalcon_Mvc_Model(zend_class_entry *class_type) { zval _0, _2, _4, _6, _8, _10, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8; diff --git a/ext/phalcon/mvc/model.zep.h b/ext/phalcon/mvc/model.zep.h index 384daf12eb5..1d912669b3d 100644 --- a/ext/phalcon/mvc/model.zep.h +++ b/ext/phalcon/mvc/model.zep.h @@ -102,6 +102,8 @@ PHP_METHOD(Phalcon_Mvc_Model, useDynamicUpdate); PHP_METHOD(Phalcon_Mvc_Model, validate); PHP_METHOD(Phalcon_Mvc_Model, validationHasFailed); PHP_METHOD(Phalcon_Mvc_Model, caseInsensitiveColumnMap); +PHP_METHOD(Phalcon_Mvc_Model, __serialize); +PHP_METHOD(Phalcon_Mvc_Model, __unserialize); zend_object *zephir_init_properties_Phalcon_Mvc_Model(zend_class_entry *class_type); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_gettransaction, 0, 0, IS_NULL, 1) @@ -310,9 +312,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 0, 1) - ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setconnectionservice, 0, 1, IS_VOID, 0) @@ -461,7 +469,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_belongsto, 0, 3 ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getpreparedquery, 0, 1, Phalcon\\Mvc\\Model\\QueryInterface, 0) @@ -473,7 +485,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmany, 0, 3, ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, 0, 6, Phalcon\\Mvc\\Model\\Relation, 0) @@ -483,14 +499,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasone, 0, 3, Phalcon\\Mvc\\Model\\Relation, 0) ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasonethrough, 0, 6, Phalcon\\Mvc\\Model\\Relation, 0) @@ -500,7 +524,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasonethrough, ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_keepsnapshots, 0, 1, IS_VOID, 0) @@ -547,6 +575,14 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_caseinsensitiv ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_zephir_init_properties_phalcon_mvc_model, 0, 0, 0) ZEND_END_ARG_INFO() @@ -654,5 +690,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, validate, arginfo_phalcon_mvc_model_validate, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, validationHasFailed, arginfo_phalcon_mvc_model_validationhasfailed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, caseInsensitiveColumnMap, arginfo_phalcon_mvc_model_caseinsensitivecolumnmap, ZEND_ACC_PRIVATE|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Mvc_Model, __serialize, arginfo_phalcon_mvc_model___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, __unserialize, arginfo_phalcon_mvc_model___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/behavior/timestampable.zep.c b/ext/phalcon/mvc/model/behavior/timestampable.zep.c index f72d9c01690..c74740b4d60 100644 --- a/ext/phalcon/mvc/model/behavior/timestampable.zep.c +++ b/ext/phalcon/mvc/model/behavior/timestampable.zep.c @@ -101,7 +101,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'field' is required", "phalcon/Mvc/Model/Behavior/Timestampable.zep", 50); return; } - ZEPHIR_CALL_METHOD(×tamp, this_ptr, "gettimestamp", NULL, 0, &options); + ZEPHIR_CALL_METHOD(×tamp, this_ptr, "gettimestamp", NULL, 432, &options); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&field) == IS_ARRAY)) { zephir_is_iterable(&field, 0, "phalcon/Mvc/Model/Behavior/Timestampable.zep", 63); @@ -165,7 +165,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, getTimestamp) ZEPHIR_OBS_VAR(&format); if (zephir_array_isset_string_fetch(&format, &options, SL("format"), 0)) { - ZEPHIR_RETURN_CALL_FUNCTION("date", NULL, 0, &format); + ZEPHIR_RETURN_CALL_FUNCTION("date", NULL, 433, &format); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/binder.zep.c b/ext/phalcon/mvc/model/binder.zep.c index 2eb472711eb..b2fe1db7adb 100644 --- a/ext/phalcon/mvc/model/binder.zep.c +++ b/ext/phalcon/mvc/model/binder.zep.c @@ -431,16 +431,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) ZEPHIR_INIT_VAR(&reflection); if (!ZEPHIR_IS_NULL(&methodName)) { object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionmethod"))); - ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 0, handler, &methodName); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 434, handler, &methodName); zephir_check_call_status(); } else { object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 166, handler); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 145, handler); zephir_check_call_status(); } zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&cache, &_0); - ZEPHIR_CALL_METHOD(&methodParams, &reflection, "getparameters", NULL, 167); + ZEPHIR_CALL_METHOD(&methodParams, &reflection, "getparameters", NULL, 146); zephir_check_call_status(); ZEPHIR_INIT_VAR(¶msKeys); zephir_array_keys(¶msKeys, ¶ms); @@ -473,7 +473,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/Mvc/Model/Binder.zep", 179); ZEPHIR_INIT_NVAR(&_6$$5); ZVAL_STRING(&_6$$5, "Phalcon\\Mvc\\Model"); - ZEPHIR_CALL_FUNCTION(&_7$$5, "is_subclass_of", &_8, 0, &className, &_6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "is_subclass_of", &_8, 435, &className, &_6$$5); zephir_check_call_status(); if (ZEPHIR_IS_STRING(&className, "Phalcon\\Mvc\\Model")) { if (Z_TYPE_P(&realClasses) == IS_NULL) { @@ -498,7 +498,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) object_init_ex(&_10$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$14); ZEPHIR_CONCAT_SVS(&_11$$14, "You should provide model class name for ", ¶mKey, " parameter"); - ZEPHIR_CALL_METHOD(NULL, &_10$$14, "__construct", &_12, 31, &_11$$14); + ZEPHIR_CALL_METHOD(NULL, &_10$$14, "__construct", &_12, 29, &_11$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$14, "phalcon/Mvc/Model/Binder.zep", 199); ZEPHIR_MM_RESTORE(); @@ -555,7 +555,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/Mvc/Model/Binder.zep", 179); ZEPHIR_INIT_NVAR(&_15$$19); ZVAL_STRING(&_15$$19, "Phalcon\\Mvc\\Model"); - ZEPHIR_CALL_FUNCTION(&_16$$19, "is_subclass_of", &_8, 0, &className, &_15$$19); + ZEPHIR_CALL_FUNCTION(&_16$$19, "is_subclass_of", &_8, 435, &className, &_15$$19); zephir_check_call_status(); if (ZEPHIR_IS_STRING(&className, "Phalcon\\Mvc\\Model")) { if (Z_TYPE_P(&realClasses) == IS_NULL) { @@ -580,7 +580,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) object_init_ex(&_18$$28, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_19$$28); ZEPHIR_CONCAT_SVS(&_19$$28, "You should provide model class name for ", ¶mKey, " parameter"); - ZEPHIR_CALL_METHOD(NULL, &_18$$28, "__construct", &_12, 31, &_19$$28); + ZEPHIR_CALL_METHOD(NULL, &_18$$28, "__construct", &_12, 29, &_19$$28); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$28, "phalcon/Mvc/Model/Binder.zep", 199); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/criteria.zep.c b/ext/phalcon/mvc/model/criteria.zep.c index 4e3c6913904..f0004179716 100644 --- a/ext/phalcon/mvc/model/criteria.zep.c +++ b/ext/phalcon/mvc/model/criteria.zep.c @@ -783,19 +783,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput) zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 508, container); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 427, container); zephir_check_call_status(); if (zephir_fast_count_int(&conditions)) { ZEPHIR_INIT_VAR(&_16$$16); ZEPHIR_INIT_VAR(&_17$$16); ZEPHIR_CONCAT_SVS(&_17$$16, " ", &operator, " "); zephir_fast_join(&_16$$16, &_17$$16, &conditions); - ZEPHIR_CALL_METHOD(NULL, &criteria, "where", NULL, 0, &_16$$16); + ZEPHIR_CALL_METHOD(NULL, &criteria, "where", NULL, 436, &_16$$16); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &criteria, "bind", NULL, 0, &bind); + ZEPHIR_CALL_METHOD(NULL, &criteria, "bind", NULL, 437, &bind); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 509, &modelName); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 428, &modelName); zephir_check_call_status(); RETURN_CCTOR(&criteria); } @@ -1459,11 +1459,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, limit) ZVAL_LONG(&_0, limit); - ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 299, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 281, &_0); zephir_check_call_status(); limit = zephir_get_numberval(&_1); ZVAL_LONG(&_0, offset); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 299, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 281, &_0); zephir_check_call_status(); offset = zephir_get_numberval(&_2); if (UNEXPECTED(limit == 0)) { diff --git a/ext/phalcon/mvc/model/manager.zep.c b/ext/phalcon/mvc/model/manager.zep.c index c0ff52a54cc..e838dde5a54 100644 --- a/ext/phalcon/mvc/model/manager.zep.c +++ b/ext/phalcon/mvc/model/manager.zep.c @@ -493,7 +493,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, load) object_init_ex(&_0$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZEPHIR_CONCAT_SVS(&_1$$3, "Model '", &modelName, "' could not be loaded"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &_1$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/Model/Manager.zep", 349); ZEPHIR_MM_RESTORE(); @@ -675,10 +675,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, isVisibleModelProperty) array_init(&publicProperties); ZEPHIR_INIT_VAR(&classReflection); object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 172, &className); + ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 151, &className); zephir_check_call_status(); ZVAL_LONG(&_1$$3, 1); - ZEPHIR_CALL_METHOD(&reflectionProperties, &classReflection, "getproperties", NULL, 176, &_1$$3); + ZEPHIR_CALL_METHOD(&reflectionProperties, &classReflection, "getproperties", NULL, 157, &_1$$3); zephir_check_call_status(); zephir_is_iterable(&reflectionProperties, 0, "phalcon/Mvc/Model/Manager.zep", 434); if (Z_TYPE_P(&reflectionProperties) == IS_ARRAY) { @@ -1577,15 +1577,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&relation); @@ -1599,6 +1598,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) ZVAL_UNDEF(&_3); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -1607,13 +1607,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -1623,9 +1623,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -1651,10 +1653,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_2, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_2, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 813); return; @@ -1693,8 +1695,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasOneThrough, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasOneThrough, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); @@ -1702,8 +1705,6 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasOneThrough); @@ -1719,6 +1720,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(7, 8) @@ -1730,13 +1732,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -1755,9 +1757,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -1792,12 +1796,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOneThrough) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 3); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 0, intermediateFields, &intermediateModel, intermediateReferencedFields); + ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 439, intermediateFields, &intermediateModel, intermediateReferencedFields); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 926); return; @@ -1832,15 +1836,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2, _3; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&relation); @@ -1854,6 +1857,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) ZVAL_UNDEF(&_3); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -1862,13 +1866,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -1878,9 +1882,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -1906,10 +1912,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_2, 0); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_2, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_2, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1017); return; @@ -1945,15 +1951,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasMany, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasMany, relation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); ZVAL_UNDEF(&fields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasMany); @@ -1967,6 +1972,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) ZVAL_UNDEF(&_2); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 5) @@ -1975,13 +1981,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string")); RETURN_MM_NULL(); @@ -1991,9 +1997,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -2020,10 +2028,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (UNEXPECTED(Z_TYPE_P(&alias) != IS_STRING)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1104); return; @@ -2062,8 +2070,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval options; zval intermediateModel, referencedModel, keyRelation; - zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasManyToMany, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; + zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options_param = NULL, entityName, referencedEntity, hasManyToMany, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&model_sub); @@ -2071,8 +2080,6 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZVAL_UNDEF(&intermediateFields_sub); ZVAL_UNDEF(&intermediateReferencedFields_sub); ZVAL_UNDEF(&referencedFields_sub); - ZVAL_UNDEF(&options_sub); - ZVAL_NULL(&__$null); ZVAL_UNDEF(&entityName); ZVAL_UNDEF(&referencedEntity); ZVAL_UNDEF(&hasManyToMany); @@ -2088,6 +2095,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZVAL_UNDEF(&intermediateModel); ZVAL_UNDEF(&referencedModel); ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(7, 8) @@ -2099,13 +2107,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) Z_PARAM_STR(referencedModel) Z_PARAM_ZVAL(referencedFields) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(options) + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options); + zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options_param); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string")); RETURN_MM_NULL(); @@ -2124,9 +2132,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) } else { ZEPHIR_INIT_VAR(&referencedModel); } - if (!options) { - options = &options_sub; - options = &__$null; + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); } @@ -2161,12 +2171,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) ZEPHIR_INIT_VAR(&relation); object_init_ex(&relation, phalcon_mvc_model_relation_ce); ZVAL_LONG(&_1, 4); - ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 0, &_1, &referencedModel, fields, referencedFields, options); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 438, &_1, &referencedModel, fields, referencedFields, &options); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 0, intermediateFields, &intermediateModel, intermediateReferencedFields); + ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 439, intermediateFields, &intermediateModel, intermediateReferencedFields); zephir_check_call_status(); ZEPHIR_OBS_VAR(&alias); - if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (zephir_array_isset_string_fetch(&alias, &options, SL("alias"), 0)) { if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/Mvc/Model/Manager.zep", 1217); return; @@ -2874,7 +2884,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SVSVSVSVS(&_4$$3, "[", &intermediateModel, "].[", &intermediateFields, "] = [", &referencedModel, "].[", &_3$$3, "]"); zephir_array_append(&joinConditions, &_4$$3, PH_SEPARATE, "phalcon/Mvc/Model/Manager.zep", 1452); - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 0, &extraParameters, parameters); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 440, &extraParameters, parameters); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&builder, this_ptr, "createbuilder", NULL, 0, &_5$$3); zephir_check_call_status(); @@ -3005,10 +3015,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) ZEPHIR_CALL_METHOD(&_32, record, "getdi", NULL, 0); zephir_check_call_status(); zephir_array_update_string(&findParams, SL("di"), &_32, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 0, &findParams, parameters); + ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 440, &findParams, parameters); zephir_check_call_status(); if (Z_TYPE_P(&extraParameters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 0, &extraParameters, &findArguments); + ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 440, &extraParameters, &findArguments); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&findParams, &findArguments); @@ -3172,7 +3182,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, hasBelongsTo) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "belongsTo"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -3224,7 +3234,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasMany) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasMany"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -3276,7 +3286,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasOne) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasOne"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -3328,7 +3338,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasOneThrough) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasOneThrough"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } @@ -3380,7 +3390,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, hasHasManyToMany) ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hasManyToMany"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 0, &_0, &modelName, &modelRelation); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "checkhasrelationship", NULL, 441, &_0, &modelName, &modelRelation); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/manager.zep.h b/ext/phalcon/mvc/model/manager.zep.h index 511cccfaae2..e109101c910 100644 --- a/ext/phalcon/mvc/model/manager.zep.h +++ b/ext/phalcon/mvc/model/manager.zep.h @@ -236,7 +236,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhaso ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasonethrough, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -247,7 +251,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhaso ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelongsto, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -255,7 +263,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelo ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmany, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -263,7 +275,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasm ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmanytomany, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -274,7 +290,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasm ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existsbelongsto, 0, 2, _IS_BOOL, 0) diff --git a/ext/phalcon/mvc/model/managerinterface.zep.c b/ext/phalcon/mvc/model/managerinterface.zep.c index f65c3f14620..82303922814 100644 --- a/ext/phalcon/mvc/model/managerinterface.zep.c +++ b/ext/phalcon/mvc/model/managerinterface.zep.c @@ -107,8 +107,8 @@ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getBelongsTo); * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getBelongsToRecords); @@ -121,8 +121,8 @@ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getHasMany); * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getHasManyRecords); @@ -147,8 +147,8 @@ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getHasOneAndHasMany); * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ ZEPHIR_DOC_METHOD(Phalcon_Mvc_Model_ManagerInterface, getHasOneRecords); diff --git a/ext/phalcon/mvc/model/managerinterface.zep.h b/ext/phalcon/mvc/model/managerinterface.zep.h index a7af807d0e7..1a86b19457f 100644 --- a/ext/phalcon/mvc/model/managerinterface.zep.h +++ b/ext/phalcon/mvc/model/managerinterface.zep.h @@ -14,7 +14,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmany, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -22,7 +26,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasone, 0, 4, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -30,7 +38,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, fields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasonethrough, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -41,7 +53,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmanytomany, 0, 7, Phalcon\\Mvc\\Model\\RelationInterface, 0) @@ -52,7 +68,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterfac ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) ZEND_ARG_INFO(0, referencedFields) - ZEND_ARG_INFO(0, options) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_createbuilder, 0, 0, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) diff --git a/ext/phalcon/mvc/model/metadata.zep.c b/ext/phalcon/mvc/model/metadata.zep.c index bfb58b6978a..7402841f850 100644 --- a/ext/phalcon/mvc/model/metadata.zep.c +++ b/ext/phalcon/mvc/model/metadata.zep.c @@ -147,7 +147,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAttributes) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 102); @@ -190,7 +190,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticCreateAttributes) ZVAL_LONG(&_0, 10); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 129); @@ -233,7 +233,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticUpdateAttributes) ZVAL_LONG(&_0, 11); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 156); @@ -276,7 +276,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getBindTypes) ZVAL_LONG(&_0, 9); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 183); @@ -320,7 +320,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getColumnMap) ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 26, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 24, model, &_0); zephir_check_call_status(); _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { @@ -367,7 +367,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDefaultValues) ZVAL_LONG(&_0, 12); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 231); @@ -410,7 +410,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypes) ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 255); @@ -453,7 +453,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypesNumeric) ZVAL_LONG(&_0, 5); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 282); @@ -520,7 +520,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getEmptyStringAttributes) ZVAL_LONG(&_0, 13); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 327); @@ -562,7 +562,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getIdentityField) ZVAL_LONG(&_0, 8); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); RETURN_MM(); } @@ -601,7 +601,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNonPrimaryKeyAttributes) ZVAL_LONG(&_0, 2); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 367); @@ -644,7 +644,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNotNullAttributes) ZVAL_LONG(&_0, 3); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 391); @@ -687,7 +687,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getPrimaryKeyAttributes) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 25, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 23, model, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&data) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/Mvc/Model/MetaData.zep", 415); @@ -731,7 +731,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getReverseColumnMap) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 26, model, &_0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 24, model, &_0); zephir_check_call_status(); _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { @@ -818,7 +818,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, hasAttribute) if (Z_TYPE_P(&columnMap) == IS_ARRAY) { RETURN_MM_BOOL(zephir_array_isset(&columnMap, &attribute)); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "readmetadata", NULL, 27, model); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "readmetadata", NULL, 25, model); zephir_check_call_status(); zephir_array_fetch_long(&_1, &_0, 4, PH_READONLY, "phalcon/Mvc/Model/MetaData.zep", 482); RETURN_MM_BOOL(zephir_array_isset(&_1, &attribute)); @@ -934,7 +934,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMap) ZVAL_NULL(&_1$$4); ZVAL_NULL(&_2$$4); ZVAL_NULL(&_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &_1$$4, &_2$$4, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_NVAR(&data); @@ -995,7 +995,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex) ZVAL_NULL(&_1$$4); ZVAL_NULL(&_2$$4); ZVAL_NULL(&_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &_1$$4, &_2$$4, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_NVAR(&columnMapModel); @@ -1056,7 +1056,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaData) zephir_get_strval(&key, &_1); zephir_read_property(&_2, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_2, &key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_read_property(&_3, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); @@ -1121,7 +1121,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaDataIndex) zephir_read_property(&_2, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch(&_3, &_2, &key, PH_READONLY, "phalcon/Mvc/Model/MetaData.zep", 626); if (!(zephir_array_isset_long(&_3, index))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_read_property(&_4, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); @@ -1196,7 +1196,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticCreateAttributes) ZVAL_LONG(&_0, 10); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -1239,7 +1239,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticUpdateAttributes) ZVAL_LONG(&_0, 11); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -1282,7 +1282,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setEmptyStringAttributes) ZVAL_LONG(&_0, 13); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 29, model, &_0, &attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 27, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -1384,7 +1384,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, write) ZEPHIR_CALL_METHOD(&result, &_0$$3, "set", NULL, 0, &key, &data); zephir_check_call_status_or_jump(try_end_1); if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 30, &option); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 28, &option); zephir_check_call_status_or_jump(try_end_1); } @@ -1398,7 +1398,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, write) if (zephir_is_instance_of(&_1, SL("Exception"))) { zend_clear_exception(); ZEPHIR_CPY_WRT(&_2, &_1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 30, &option); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "throwwriteexception", NULL, 28, &option); zephir_check_call_status(); } } @@ -1475,7 +1475,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) zephir_get_strval(&key, &_3); zephir_read_property(&_4, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset(&_4, &key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 28, model, &key, &source, &schema); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 26, model, &key, &source, &schema); zephir_check_call_status(); } zephir_update_property_array_multi(this_ptr, SL("metaData"), data, SL("zl"), 2, &key, index); @@ -1551,7 +1551,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, initialize) object_init_ex(&_2$$8, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_3$$8); ZEPHIR_CONCAT_SV(&_3$$8, "Invalid meta-data for model ", &className); - ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", NULL, 31, &_3$$8); + ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", NULL, 29, &_3$$8); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$8, "phalcon/Mvc/Model/MetaData.zep", 817); ZEPHIR_MM_RESTORE(); @@ -1634,7 +1634,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, throwWriteException) if (zephir_is_true(option)) { ZEPHIR_INIT_VAR(&_0$$3); object_init_ex(&_0$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 31, &message); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 29, &message); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/Model/MetaData.zep", 901); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c index 6abbc84b021..d5a21d567a5 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c +++ b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c @@ -104,7 +104,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getColumnMaps) object_init_ex(&_1$$4, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SV(&_2$$4, "No annotations were found in class ", &className); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep", 43); ZEPHIR_MM_RESTORE(); @@ -117,7 +117,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getColumnMaps) object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_4$$5); ZEPHIR_CONCAT_SV(&_4$$5, "No properties with annotations were found in class ", &className); - ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 31, &_4$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 29, &_4$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$5, "phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep", 54); ZEPHIR_MM_RESTORE(); @@ -426,7 +426,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData) object_init_ex(&_1$$4, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SV(&_2$$4, "No annotations were found in class ", &className); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 31, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 29, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep", 124); ZEPHIR_MM_RESTORE(); @@ -439,7 +439,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData) object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_4$$5); ZEPHIR_CONCAT_SV(&_4$$5, "No properties with annotations were found in class ", &className); - ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 31, &_4$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 29, &_4$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$5, "phalcon/Mvc/Model/MetaData/Strategy/Annotations.zep", 135); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c index 410a6aa5f47..2c56a0c12d2 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c +++ b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c @@ -225,7 +225,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData) zephir_get_class(&_3$$3, model, 0); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SVSV(&_4$$3, "Table '", &completeTable, "' doesn't exist in database when dumping meta-data for ", &_3$$3); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 31, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 29, &_4$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$3, "phalcon/Mvc/Model/MetaData/Strategy/Introspection.zep", 92); ZEPHIR_MM_RESTORE(); @@ -247,7 +247,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData) zephir_get_class(&_7$$6, model, 0); ZEPHIR_INIT_VAR(&_8$$6); ZEPHIR_CONCAT_SVSV(&_8$$6, "Cannot obtain table columns for the mapped source '", &completeTable, "' used in model ", &_7$$6); - ZEPHIR_CALL_METHOD(NULL, &_6$$6, "__construct", NULL, 31, &_8$$6); + ZEPHIR_CALL_METHOD(NULL, &_6$$6, "__construct", NULL, 29, &_8$$6); zephir_check_call_status(); zephir_throw_exception_debug(&_6$$6, "phalcon/Mvc/Model/MetaData/Strategy/Introspection.zep", 112); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/metadata/stream.zep.c b/ext/phalcon/mvc/model/metadata/stream.zep.c index 9fe8a4fd8f9..44b603bf0bc 100644 --- a/ext/phalcon/mvc/model/metadata/stream.zep.c +++ b/ext/phalcon/mvc/model/metadata/stream.zep.c @@ -217,7 +217,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Stream, write) ZEPHIR_CONCAT_SVS(&_5$$3, "= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) @@ -417,12 +422,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, execute) ZEPHIR_CPY_WRT(&cacheOptions, &_0); if (Z_TYPE_P(&cacheOptions) != IS_NULL) { if (UNEXPECTED(Z_TYPE_P(&cacheOptions) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid caching options", "phalcon/Mvc/Model/Query.zep", 275); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid caching options", "phalcon/Mvc/Model/Query.zep", 274); return; } ZEPHIR_OBS_VAR(&key); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&key, &cacheOptions, SL("key"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A cache key must be provided to identify the cached resultset in the cache backend", "phalcon/Mvc/Model/Query.zep", 284); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A cache key must be provided to identify the cached resultset in the cache backend", "phalcon/Mvc/Model/Query.zep", 283); return; } ZEPHIR_OBS_VAR(&lifetime); @@ -438,19 +443,30 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, execute) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&cache, &_1$$3, "getshared", NULL, 0, &cacheService); zephir_check_call_status(); - if (UNEXPECTED(!((zephir_is_instance_of(&cache, SL("Psr\\SimpleCache\\CacheInterface")))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache service must be an object implementing Psr\\SimpleCache\\CacheInterface", "phalcon/Mvc/Model/Query.zep", 301); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$3, "is_a", NULL, 83, &cache, &_2$$3); + zephir_check_call_status(); + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3))) { + ZEPHIR_INIT_VAR(&_4$$8); + object_init_ex(&_4$$8, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_5$$8); + ZEPHIR_CONCAT_SS(&_5$$8, "Cache service must be an object implementing ", "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_METHOD(NULL, &_4$$8, "__construct", NULL, 29, &_5$$8); + zephir_check_call_status(); + zephir_throw_exception_debug(&_4$$8, "phalcon/Mvc/Model/Query.zep", 303); + ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_METHOD(&result, &cache, "get", NULL, 0, &key); zephir_check_call_status(); if (!(ZEPHIR_IS_EMPTY(&result))) { if (UNEXPECTED(Z_TYPE_P(&result) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache didn't return a valid resultset", "phalcon/Mvc/Model/Query.zep", 310); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache didn't return a valid resultset", "phalcon/Mvc/Model/Query.zep", 312); return; } - ZVAL_BOOL(&_2$$9, 0); - ZEPHIR_CALL_METHOD(NULL, &result, "setisfresh", NULL, 0, &_2$$9); + ZVAL_BOOL(&_6$$9, 0); + ZEPHIR_CALL_METHOD(NULL, &result, "setisfresh", NULL, 0, &_6$$9); zephir_check_call_status(); if (zephir_is_true(&uniqueRow)) { ZEPHIR_CALL_METHOD(&preparedResult, &result, "getfirst", NULL, 0); @@ -480,39 +496,39 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, execute) ZEPHIR_CPY_WRT(&type, &_0); do { if (ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeselect", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeselect", NULL, 443, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 306)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeinsert", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeinsert", NULL, 444, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 300)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executeupdate", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executeupdate", NULL, 445, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 303)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "executedelete", NULL, 0, &intermediate, &mergedParams, &mergedTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "executedelete", NULL, 446, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - ZEPHIR_INIT_VAR(&_3$$19); - object_init_ex(&_3$$19, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(&_4$$19); - ZEPHIR_CONCAT_SV(&_4$$19, "Unknown statement ", &type); - ZEPHIR_CALL_METHOD(NULL, &_3$$19, "__construct", NULL, 31, &_4$$19); + ZEPHIR_INIT_VAR(&_7$$19); + object_init_ex(&_7$$19, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_8$$19); + ZEPHIR_CONCAT_SV(&_8$$19, "Unknown statement ", &type); + ZEPHIR_CALL_METHOD(NULL, &_7$$19, "__construct", NULL, 29, &_8$$19); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$19, "phalcon/Mvc/Model/Query.zep", 393); + zephir_throw_exception_debug(&_7$$19, "phalcon/Mvc/Model/Query.zep", 395); ZEPHIR_MM_RESTORE(); return; } while(0); if (Z_TYPE_P(&cacheOptions) != IS_NULL) { if (!ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only PHQL statements that return resultsets can be cached", "phalcon/Mvc/Model/Query.zep", 406); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only PHQL statements that return resultsets can be cached", "phalcon/Mvc/Model/Query.zep", 408); return; } ZEPHIR_CALL_METHOD(NULL, &cache, "set", NULL, 0, &key, &result, &lifetime); @@ -680,11 +696,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSql) zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("bindParams"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("bindTypes"), PH_NOISY_CC | PH_READONLY); ZVAL_BOOL(&_3$$3, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "executeselect", NULL, 0, &intermediate, &_1$$3, &_2$$3, &_3$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "executeselect", NULL, 443, &intermediate, &_1$$3, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "This type of statement generates multiple SQL statements", "phalcon/Mvc/Model/Query.zep", 512); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "This type of statement generates multiple SQL statements", "phalcon/Mvc/Model/Query.zep", 514); return; } @@ -761,7 +777,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) zephir_read_static_property_ce(&_2$$5, phalcon_mvc_model_query_ce, SL("internalPhqlCache"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset_fetch(&irPhql, &_2$$5, &uniqueId, 0)) { if (Z_TYPE_P(&irPhql) == IS_ARRAY) { - zephir_array_fetch_string(&_3$$7, &ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 565); + zephir_array_fetch_string(&_3$$7, &ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 567); zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &_3$$7); RETURN_CCTOR(&irPhql); } @@ -773,22 +789,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) zephir_update_property_zval(this_ptr, ZEND_STRL("type"), &type); do { if (ZEPHIR_IS_LONG(&type, 309)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 447); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 306)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 448); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 300)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 449); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&type, 303)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 0); + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 450); zephir_check_call_status(); break; } @@ -796,9 +812,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) object_init_ex(&_4$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_5$$13); ZEPHIR_CONCAT_SVSV(&_5$$13, "Unknown statement ", &type, ", when preparing: ", &phql); - ZEPHIR_CALL_METHOD(NULL, &_4$$13, "__construct", NULL, 31, &_5$$13); + ZEPHIR_CALL_METHOD(NULL, &_4$$13, "__construct", NULL, 29, &_5$$13); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$13, "phalcon/Mvc/Model/Query.zep", 599); + zephir_throw_exception_debug(&_4$$13, "phalcon/Mvc/Model/Query.zep", 601); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -806,7 +822,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) } } if (UNEXPECTED(Z_TYPE_P(&irPhql) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted AST", "phalcon/Mvc/Model/Query.zep", 605); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted AST", "phalcon/Mvc/Model/Query.zep", 607); return; } if (Z_TYPE_P(&uniqueId) == IS_LONG) { @@ -941,7 +957,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) ZEPHIR_CALL_METHOD(&manager, container, "getshared", NULL, 0, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&manager) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsManager' is invalid", "phalcon/Mvc/Model/Query.zep", 669); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsManager' is invalid", "phalcon/Mvc/Model/Query.zep", 671); return; } ZEPHIR_INIT_NVAR(&_0); @@ -949,7 +965,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) ZEPHIR_CALL_METHOD(&metaData, container, "getshared", NULL, 0, &_0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&metaData) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsMetaData' is invalid", "phalcon/Mvc/Model/Query.zep", 675); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsMetaData' is invalid", "phalcon/Mvc/Model/Query.zep", 677); return; } zephir_update_property_zval(this_ptr, ZEND_STRL("manager"), &manager); @@ -1153,13 +1169,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 743); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 745); if (UNEXPECTED(zephir_array_isset_long(&models, 1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Delete from several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 748); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Delete from several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 750); return; } ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 751); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 753); ZEPHIR_OBS_VAR(&model); zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0))) { @@ -1167,12 +1183,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) ZEPHIR_CALL_METHOD(&model, &_1$$4, "load", NULL, 0, &modelName); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 0, &model, &intermediate, &bindParams, &bindTypes); + ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 451, &model, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (!(zephir_fast_count_int(&records))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_2$$5, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_2$$5); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_2$$5); zephir_check_call_status(); RETURN_MM(); } @@ -1197,7 +1213,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_7$$7, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_7$$7, &record); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_7$$7, &record); zephir_check_call_status(); RETURN_MM(); } @@ -1208,7 +1224,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeDelete) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_9, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_9); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_9); zephir_check_call_status(); RETURN_MM(); } @@ -1291,7 +1307,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &intermediate, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 832); + zephir_array_fetch_string(&modelName, &intermediate, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 834); zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&model); @@ -1320,16 +1336,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) } } ZEPHIR_OBS_VAR(&values); - zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 867); + zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 869); if (UNEXPECTED(zephir_fast_count_int(&fields) != zephir_fast_count_int(&values))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The column count does not match the values count", "phalcon/Mvc/Model/Query.zep", 876); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The column count does not match the values count", "phalcon/Mvc/Model/Query.zep", 878); return; } ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&insertValues); array_init(&insertValues); - zephir_is_iterable(&values, 0, "phalcon/Mvc/Model/Query.zep", 947); + zephir_is_iterable(&values, 0, "phalcon/Mvc/Model/Query.zep", 949); if (Z_TYPE_P(&values) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _4, _5, _2) { @@ -1342,8 +1358,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_INIT_NVAR(&value); ZVAL_COPY(&value, _2); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 886); - zephir_array_fetch_string(&_6$$8, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&_6$$8, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 890); do { if (ZEPHIR_IS_LONG(&_6$$8, 260) || ZEPHIR_IS_LONG(&_6$$8, 258) || ZEPHIR_IS_LONG(&_6$$8, 259)) { ZEPHIR_CALL_METHOD(&insertValue, &dialect, "getsqlexpression", &_7, 0, &exprValue); @@ -1370,9 +1386,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_12$$12, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$12); ZEPHIR_CONCAT_SVS(&_13$$12, "Bound parameter '", &wildcard, "' cannot be replaced because it isn't in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 31, &_13$$12); + ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 29, &_13$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$12, "phalcon/Mvc/Model/Query.zep", 912); + zephir_throw_exception_debug(&_12$$12, "phalcon/Mvc/Model/Query.zep", 914); ZEPHIR_MM_RESTORE(); return; } @@ -1382,13 +1398,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&insertValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_15$$13, &dialect, "getsqlexpression", &_16, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 34, &_15$$13); + ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 32, &_15$$13); zephir_check_call_status(); break; } while(0); ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 925); + zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 927); _18$$8 = automaticFields; if (_18$$8) { _18$$8 = Z_TYPE_P(&columnMap) == IS_ARRAY; @@ -1400,9 +1416,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_19$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_20$$15); ZEPHIR_CONCAT_SVS(&_20$$15, "Column '", &fieldName, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_19$$15, "__construct", &_14, 31, &_20$$15); + ZEPHIR_CALL_METHOD(NULL, &_19$$15, "__construct", &_14, 29, &_20$$15); zephir_check_call_status(); - zephir_throw_exception_debug(&_19$$15, "phalcon/Mvc/Model/Query.zep", 935); + zephir_throw_exception_debug(&_19$$15, "phalcon/Mvc/Model/Query.zep", 937); ZEPHIR_MM_RESTORE(); return; } @@ -1425,8 +1441,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) ZEPHIR_CALL_METHOD(&value, &values, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 886); - zephir_array_fetch_string(&_21$$17, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 888); + zephir_array_fetch_string(&_21$$17, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 890); do { if (ZEPHIR_IS_LONG(&_21$$17, 260) || ZEPHIR_IS_LONG(&_21$$17, 258) || ZEPHIR_IS_LONG(&_21$$17, 259)) { ZEPHIR_CALL_METHOD(&insertValue, &dialect, "getsqlexpression", &_22, 0, &exprValue); @@ -1453,9 +1469,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_27$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_28$$21); ZEPHIR_CONCAT_SVS(&_28$$21, "Bound parameter '", &wildcard, "' cannot be replaced because it isn't in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_27$$21, "__construct", &_14, 31, &_28$$21); + ZEPHIR_CALL_METHOD(NULL, &_27$$21, "__construct", &_14, 29, &_28$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_27$$21, "phalcon/Mvc/Model/Query.zep", 912); + zephir_throw_exception_debug(&_27$$21, "phalcon/Mvc/Model/Query.zep", 914); ZEPHIR_MM_RESTORE(); return; } @@ -1465,13 +1481,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&insertValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_29$$22, &dialect, "getsqlexpression", &_30, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 34, &_29$$22); + ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_17, 32, &_29$$22); zephir_check_call_status(); break; } while(0); ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 925); + zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 927); _31$$17 = automaticFields; if (_31$$17) { _31$$17 = Z_TYPE_P(&columnMap) == IS_ARRAY; @@ -1483,9 +1499,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(&_32$$24, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_33$$24); ZEPHIR_CONCAT_SVS(&_33$$24, "Column '", &fieldName, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_32$$24, "__construct", &_14, 31, &_33$$24); + ZEPHIR_CALL_METHOD(NULL, &_32$$24, "__construct", &_14, 29, &_33$$24); zephir_check_call_status(); - zephir_throw_exception_debug(&_32$$24, "phalcon/Mvc/Model/Query.zep", 935); + zephir_throw_exception_debug(&_32$$24, "phalcon/Mvc/Model/Query.zep", 937); ZEPHIR_MM_RESTORE(); return; } @@ -1506,7 +1522,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeInsert) object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZEPHIR_CALL_METHOD(&_34, &insertModel, "create", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_34, &insertModel); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_34, &insertModel); zephir_check_call_status(); RETURN_MM(); } @@ -1662,8 +1678,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_VAR(&connectionTypes); array_init(&connectionTypes); ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 984); - zephir_is_iterable(&models, 0, "phalcon/Mvc/Model/Query.zep", 1012); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 986); + zephir_is_iterable(&models, 0, "phalcon/Mvc/Model/Query.zep", 1014); if (Z_TYPE_P(&models) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&models), _1) { @@ -1683,7 +1699,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_check_call_status(); zephir_array_update_zval(&connectionTypes, &_6$$5, &__$true, PH_COPY | PH_SEPARATE); if (UNEXPECTED(zephir_fast_count_int(&connectionTypes) == 2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1007); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1009); return; } } @@ -1713,7 +1729,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_check_call_status(); zephir_array_update_zval(&connectionTypes, &_9$$9, &__$true, PH_COPY | PH_SEPARATE); if (UNEXPECTED(zephir_fast_count_int(&connectionTypes) == 2)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1007); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/Mvc/Model/Query.zep", 1009); return; } } @@ -1723,23 +1739,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) } ZEPHIR_INIT_NVAR(&modelName); ZEPHIR_OBS_VAR(&columns); - zephir_array_fetch_string(&columns, &intermediate, SL("columns"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1012); + zephir_array_fetch_string(&columns, &intermediate, SL("columns"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1014); haveObjects = 0; haveScalars = 0; isComplex = 0; numberObjects = 0; ZEPHIR_CPY_WRT(&columns1, &columns); - zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1040); + zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1042); if (Z_TYPE_P(&columns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _10) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _10); if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1024); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1026); return; } - zephir_array_fetch_string(&_12$$11, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1027); + zephir_array_fetch_string(&_12$$11, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1029); if (ZEPHIR_IS_STRING(&_12$$11, "scalar")) { if (!(zephir_array_isset_string(&column, SL("balias")))) { isComplex = 1; @@ -1762,10 +1778,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&column) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1024); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/Mvc/Model/Query.zep", 1026); return; } - zephir_array_fetch_string(&_13$$16, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1027); + zephir_array_fetch_string(&_13$$16, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1029); if (ZEPHIR_IS_STRING(&_13$$16, "scalar")) { if (!(zephir_array_isset_string(&column, SL("balias")))) { isComplex = 1; @@ -1803,7 +1819,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) array_init(&simpleColumnMap); zephir_read_property(&_0, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&metaData, &_0); - zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1146); + zephir_is_iterable(&columns, 0, "phalcon/Mvc/Model/Query.zep", 1148); if (Z_TYPE_P(&columns) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _16, _17, _14) { @@ -1816,11 +1832,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _14); ZEPHIR_OBS_NVAR(&sqlColumn); - zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1063); - zephir_array_fetch_string(&_18$$28, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1066); + zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1065); + zephir_array_fetch_string(&_18$$28, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1068); if (ZEPHIR_IS_STRING(&_18$$28, "object")) { ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1067); + zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1069); ZEPHIR_OBS_NVAR(&instance); zephir_read_property(&_19$$29, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&instance, &_19$$29, &modelName, 0))) { @@ -1838,7 +1854,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&columnMap); ZVAL_NULL(&columnMap); } - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1103); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1105); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _23$$31) { @@ -1851,7 +1867,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_26$$34); ZEPHIR_CONCAT_SVSV(&_26$$34, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_25$$34, &_26$$34); - zephir_array_append(&selectColumns, &_25$$34, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_25$$34, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -1871,7 +1887,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_28$$35); ZEPHIR_CONCAT_SVSV(&_28$$35, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_27$$35, &_28$$35); - zephir_array_append(&selectColumns, &_27$$35, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_27$$35, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -1889,7 +1905,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_update_multi(&columns1, &_31$$36, SL("zs"), 3, &aliasCopy, SL("keepSnapshots")); } } else { - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1120); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1122); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _32$$37) { @@ -1899,7 +1915,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_34$$38, 2, 0); zephir_array_fast_append(&_34$$38, &attribute); zephir_array_fast_append(&_34$$38, &sqlColumn); - zephir_array_append(&selectColumns, &_34$$38, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_34$$38, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -1916,7 +1932,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_35$$39, 2, 0); zephir_array_fast_append(&_35$$39, &attribute); zephir_array_fast_append(&_35$$39, &sqlColumn); - zephir_array_append(&selectColumns, &_35$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_35$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -1939,7 +1955,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_fast_append(&_37$$42, &aliasCopy); ZEPHIR_CPY_WRT(&columnAlias, &_37$$42); } - zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1131); + zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1133); } _38$$28 = !isComplex; if (_38$$28) { @@ -1968,11 +1984,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_CALL_METHOD(&column, &columns, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&sqlColumn); - zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1063); - zephir_array_fetch_string(&_39$$46, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1066); + zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1065); + zephir_array_fetch_string(&_39$$46, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1068); if (ZEPHIR_IS_STRING(&_39$$46, "object")) { ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1067); + zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1069); ZEPHIR_OBS_NVAR(&instance); zephir_read_property(&_40$$47, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&instance, &_40$$47, &modelName, 0))) { @@ -1990,7 +2006,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&columnMap); ZVAL_NULL(&columnMap); } - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1103); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1105); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _44$$49) { @@ -2003,7 +2019,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_47$$52); ZEPHIR_CONCAT_SVSV(&_47$$52, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_46$$52, &_47$$52); - zephir_array_append(&selectColumns, &_46$$52, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_46$$52, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -2023,7 +2039,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&_49$$53); ZEPHIR_CONCAT_SVSV(&_49$$53, "_", &sqlColumn, "_", &attribute); zephir_array_fast_append(&_48$$53, &_49$$53); - zephir_array_append(&selectColumns, &_48$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1096); + zephir_array_append(&selectColumns, &_48$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1098); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -2041,7 +2057,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_update_multi(&columns1, &_52$$54, SL("zs"), 3, &aliasCopy, SL("keepSnapshots")); } } else { - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1120); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Query.zep", 1122); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _53$$55) { @@ -2051,7 +2067,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_55$$56, 2, 0); zephir_array_fast_append(&_55$$56, &attribute); zephir_array_fast_append(&_55$$56, &sqlColumn); - zephir_array_append(&selectColumns, &_55$$56, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_55$$56, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &attributes, "rewind", NULL, 0); @@ -2068,7 +2084,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_56$$57, 2, 0); zephir_array_fast_append(&_56$$57, &attribute); zephir_array_fast_append(&_56$$57, &sqlColumn); - zephir_array_append(&selectColumns, &_56$$57, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1118); + zephir_array_append(&selectColumns, &_56$$57, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1120); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); } @@ -2090,7 +2106,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_array_fast_append(&_58$$60, &aliasCopy); ZEPHIR_CPY_WRT(&columnAlias, &_58$$60); } - zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1131); + zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1133); } _59$$46 = !isComplex; if (_59$$46) { @@ -2115,7 +2131,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_VAR(&bindCounts); array_init(&bindCounts); zephir_array_update_string(&intermediate, SL("columns"), &selectColumns, PH_COPY | PH_SEPARATE); - zephir_is_iterable(&bindParams, 0, "phalcon/Mvc/Model/Query.zep", 1167); + zephir_is_iterable(&bindParams, 0, "phalcon/Mvc/Model/Query.zep", 1169); if (Z_TYPE_P(&bindParams) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&bindParams), _62, _63, _60) { @@ -2173,7 +2189,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&wildcard); ZEPHIR_INIT_VAR(&processedTypes); array_init(&processedTypes); - zephir_is_iterable(&bindTypes, 0, "phalcon/Mvc/Model/Query.zep", 1180); + zephir_is_iterable(&bindTypes, 0, "phalcon/Mvc/Model/Query.zep", 1182); if (Z_TYPE_P(&bindTypes) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&bindTypes), _68, _69, _66) { @@ -2278,7 +2294,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) array_init(&simpleColumnMap); ZEPHIR_CALL_METHOD(&_74$$90, &metaData, "getattributes", NULL, 0, &resultObject); zephir_check_call_status(); - zephir_is_iterable(&_74$$90, 0, "phalcon/Mvc/Model/Query.zep", 1268); + zephir_is_iterable(&_74$$90, 0, "phalcon/Mvc/Model/Query.zep", 1270); if (Z_TYPE_P(&_74$$90) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_74$$90), _75$$90) { @@ -2288,7 +2304,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_77$$91, 2, 0); zephir_array_fast_append(&_77$$91, &attribute); ZEPHIR_OBS_NVAR(&_78$$91); - zephir_array_fetch(&_78$$91, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1266); + zephir_array_fetch(&_78$$91, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1268); zephir_array_fast_append(&_77$$91, &_78$$91); zephir_array_update_zval(&simpleColumnMap, &attribute, &_77$$91, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -2307,7 +2323,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_79$$92, 2, 0); zephir_array_fast_append(&_79$$92, &attribute); ZEPHIR_OBS_NVAR(&_80$$92); - zephir_array_fetch(&_80$$92, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1266); + zephir_array_fetch(&_80$$92, &typesColumnMap, &attribute, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1268); zephir_array_fast_append(&_79$$92, &_80$$92); zephir_array_update_zval(&simpleColumnMap, &attribute, &_79$$92, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &_74$$90, "next", NULL, 0); @@ -2317,7 +2333,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) ZEPHIR_INIT_NVAR(&attribute); } else { array_init(&simpleColumnMap); - zephir_is_iterable(&columnMap, 0, "phalcon/Mvc/Model/Query.zep", 1277); + zephir_is_iterable(&columnMap, 0, "phalcon/Mvc/Model/Query.zep", 1279); if (Z_TYPE_P(&columnMap) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columnMap), _83$$93, _84$$93, _81$$93) { @@ -2333,7 +2349,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_85$$94, 2, 0); zephir_array_fast_append(&_85$$94, &attribute); ZEPHIR_OBS_NVAR(&_86$$94); - zephir_array_fetch(&_86$$94, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1275); + zephir_array_fetch(&_86$$94, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1277); zephir_array_fast_append(&_85$$94, &_86$$94); zephir_array_update_zval(&simpleColumnMap, &column, &_85$$94, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -2354,7 +2370,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) zephir_create_array(&_87$$95, 2, 0); zephir_array_fast_append(&_87$$95, &attribute); ZEPHIR_OBS_NVAR(&_88$$95); - zephir_array_fetch(&_88$$95, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1275); + zephir_array_fetch(&_88$$95, &typesColumnMap, &column, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1277); zephir_array_fast_append(&_87$$95, &_88$$95); zephir_array_update_zval(&simpleColumnMap, &column, &_87$$95, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &columnMap, "next", NULL, 0); @@ -2382,24 +2398,24 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) object_init_ex(&_91$$98, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_92$$98); ZEPHIR_CONCAT_SVS(&_92$$98, "Resultset class \"", &resultsetClassName, "\" not found"); - ZEPHIR_CALL_METHOD(NULL, &_91$$98, "__construct", NULL, 31, &_92$$98); + ZEPHIR_CALL_METHOD(NULL, &_91$$98, "__construct", NULL, 29, &_92$$98); zephir_check_call_status(); - zephir_throw_exception_debug(&_91$$98, "phalcon/Mvc/Model/Query.zep", 1293); + zephir_throw_exception_debug(&_91$$98, "phalcon/Mvc/Model/Query.zep", 1295); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_INIT_VAR(&_93$$97); ZVAL_STRING(&_93$$97, "Phalcon\\Mvc\\Model\\ResultsetInterface"); - ZEPHIR_CALL_FUNCTION(&_94$$97, "is_subclass_of", NULL, 0, &resultsetClassName, &_93$$97); + ZEPHIR_CALL_FUNCTION(&_94$$97, "is_subclass_of", NULL, 435, &resultsetClassName, &_93$$97); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_94$$97))) { ZEPHIR_INIT_VAR(&_95$$99); object_init_ex(&_95$$99, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_96$$99); ZEPHIR_CONCAT_SVS(&_96$$99, "Resultset class \"", &resultsetClassName, "\" must be an implementation of Phalcon\\Mvc\\Model\\ResultsetInterface"); - ZEPHIR_CALL_METHOD(NULL, &_95$$99, "__construct", NULL, 31, &_96$$99); + ZEPHIR_CALL_METHOD(NULL, &_95$$99, "__construct", NULL, 29, &_96$$99); zephir_check_call_status(); - zephir_throw_exception_debug(&_95$$99, "phalcon/Mvc/Model/Query.zep", 1299); + zephir_throw_exception_debug(&_95$$99, "phalcon/Mvc/Model/Query.zep", 1301); ZEPHIR_MM_RESTORE(); return; } @@ -2423,12 +2439,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeSelect) } else { ZVAL_BOOL(&_98$$83, 0); } - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &simpleColumnMap, &resultObject, &resultData, &cache, &_98$$83); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 453, &simpleColumnMap, &resultObject, &resultData, &cache, &_98$$83); zephir_check_call_status(); RETURN_MM(); } object_init_ex(return_value, phalcon_mvc_model_resultset_complex_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &columns1, &resultData, &cache); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 454, &columns1, &resultData, &cache); zephir_check_call_status(); RETURN_MM(); } @@ -2510,13 +2526,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_OBS_VAR(&models); - zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1347); + zephir_array_fetch_string(&models, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1349); if (UNEXPECTED(zephir_array_isset_long(&models, 1))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Updating several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 1352); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Updating several models at the same time is still not supported", "phalcon/Mvc/Model/Query.zep", 1354); return; } ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1355); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1357); ZEPHIR_OBS_VAR(&model); zephir_read_property(&_0, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0))) { @@ -2529,14 +2545,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_VAR(&fields); - zephir_array_fetch_string(&fields, &intermediate, SL("fields"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1374); + zephir_array_fetch_string(&fields, &intermediate, SL("fields"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1376); ZEPHIR_OBS_VAR(&values); - zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1375); + zephir_array_fetch_string(&values, &intermediate, SL("values"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1377); ZEPHIR_INIT_VAR(&updateValues); array_init(&updateValues); ZEPHIR_CPY_WRT(&selectBindParams, &bindParams); ZEPHIR_CPY_WRT(&selectBindTypes, &bindTypes); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 1447); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 1449); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _4, _5, _2) { @@ -2549,17 +2565,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_INIT_NVAR(&field); ZVAL_COPY(&field, _2); ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1390); + zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1392); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1391); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1393); if (zephir_array_isset_string(&field, SL("balias"))) { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1394); + zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); } else { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); + zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1398); } - zephir_array_fetch_string(&_6$$5, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1399); + zephir_array_fetch_string(&_6$$5, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1401); do { if (ZEPHIR_IS_LONG(&_6$$5, 260) || ZEPHIR_IS_LONG(&_6$$5, 258) || ZEPHIR_IS_LONG(&_6$$5, 259)) { ZEPHIR_CALL_METHOD(&updateValue, &dialect, "getsqlexpression", &_7, 0, &exprValue); @@ -2586,9 +2602,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) object_init_ex(&_12$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_13$$11); ZEPHIR_CONCAT_SVS(&_13$$11, "Bound parameter '", &wildcard, "' cannot be replaced because it's not in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", &_14, 31, &_13$$11); + ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", &_14, 29, &_13$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 1422); + zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 1424); ZEPHIR_MM_RESTORE(); return; } @@ -2597,14 +2613,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) break; } if (ZEPHIR_IS_LONG(&_6$$5, 277)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1431); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1433); return; } ZEPHIR_INIT_NVAR(&updateValue); object_init_ex(&updateValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_15$$13, &dialect, "getsqlexpression", &_16, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 34, &_15$$13); + ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 32, &_15$$13); zephir_check_call_status(); break; } while(0); @@ -2625,17 +2641,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1390); + zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1392); ZEPHIR_OBS_NVAR(&exprValue); - zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1391); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1393); if (zephir_array_isset_string(&field, SL("balias"))) { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1394); + zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); } else { ZEPHIR_OBS_NVAR(&fieldName); - zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1396); + zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1398); } - zephir_array_fetch_string(&_18$$14, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1399); + zephir_array_fetch_string(&_18$$14, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1401); do { if (ZEPHIR_IS_LONG(&_18$$14, 260) || ZEPHIR_IS_LONG(&_18$$14, 258) || ZEPHIR_IS_LONG(&_18$$14, 259)) { ZEPHIR_CALL_METHOD(&updateValue, &dialect, "getsqlexpression", &_19, 0, &exprValue); @@ -2662,9 +2678,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) object_init_ex(&_24$$20, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_25$$20); ZEPHIR_CONCAT_SVS(&_25$$20, "Bound parameter '", &wildcard, "' cannot be replaced because it's not in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, &_24$$20, "__construct", &_14, 31, &_25$$20); + ZEPHIR_CALL_METHOD(NULL, &_24$$20, "__construct", &_14, 29, &_25$$20); zephir_check_call_status(); - zephir_throw_exception_debug(&_24$$20, "phalcon/Mvc/Model/Query.zep", 1422); + zephir_throw_exception_debug(&_24$$20, "phalcon/Mvc/Model/Query.zep", 1424); ZEPHIR_MM_RESTORE(); return; } @@ -2673,14 +2689,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) break; } if (ZEPHIR_IS_LONG(&_18$$14, 277)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1431); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/Mvc/Model/Query.zep", 1433); return; } ZEPHIR_INIT_NVAR(&updateValue); object_init_ex(&updateValue, phalcon_db_rawvalue_ce); ZEPHIR_CALL_METHOD(&_26$$22, &dialect, "getsqlexpression", &_27, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 34, &_26$$22); + ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_17, 32, &_26$$22); zephir_check_call_status(); break; } while(0); @@ -2692,12 +2708,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) } ZEPHIR_INIT_NVAR(&field); ZEPHIR_INIT_NVAR(&number); - ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 0, &model, &intermediate, &selectBindParams, &selectBindTypes); + ZEPHIR_CALL_METHOD(&records, this_ptr, "getrelatedrecords", NULL, 451, &model, &intermediate, &selectBindParams, &selectBindTypes); zephir_check_call_status(); if (!(zephir_fast_count_int(&records))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_28$$23, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_28$$23); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_28$$23); zephir_check_call_status(); RETURN_MM(); } @@ -2724,7 +2740,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_33$$25, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_33$$25, &record); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_33$$25, &record); zephir_check_call_status(); RETURN_MM(); } @@ -2735,7 +2751,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, executeUpdate) zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); ZVAL_BOOL(&_35, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_35); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, &_35); zephir_check_call_status(); RETURN_MM(); } @@ -2766,13 +2782,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCallArgument) ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); - zephir_array_fetch_string(&_0, &argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1509); + zephir_array_fetch_string(&_0, &argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1511); if (ZEPHIR_IS_LONG(&_0, 352)) { zephir_create_array(return_value, 1, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("all")); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getexpression", NULL, 0, &argument); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getexpression", NULL, 455, &argument); zephir_check_call_status(); RETURN_MM(); } @@ -2825,8 +2841,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_VAR(&whenClauses); array_init(&whenClauses); - zephir_array_fetch_string(&_0, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1527); - zephir_is_iterable(&_0, 0, "phalcon/Mvc/Model/Query.zep", 1542); + zephir_array_fetch_string(&_0, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1529); + zephir_is_iterable(&_0, 0, "phalcon/Mvc/Model/Query.zep", 1544); if (Z_TYPE_P(&_0) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) { @@ -2836,24 +2852,24 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&_3$$4); zephir_create_array(&_3$$4, 3, 0); add_assoc_stringl_ex(&_3$$4, SL("type"), SL("when")); - zephir_array_fetch_string(&_5$$4, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1531); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 0, &_5$$4); + zephir_array_fetch_string(&_5$$4, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1533); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 455, &_5$$4); zephir_check_call_status(); zephir_array_update_string(&_3$$4, SL("expr"), &_4$$4, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_7$$4, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1532); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 0, &_7$$4); + zephir_array_fetch_string(&_7$$4, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1534); + ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "getexpression", &_6, 455, &_7$$4); zephir_check_call_status(); zephir_array_update_string(&_3$$4, SL("then"), &_4$$4, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_3$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1533); + zephir_array_append(&whenClauses, &_3$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1535); } else { ZEPHIR_INIT_NVAR(&_8$$5); zephir_create_array(&_8$$5, 2, 0); add_assoc_stringl_ex(&_8$$5, SL("type"), SL("else")); - zephir_array_fetch_string(&_10$$5, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1537); - ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "getexpression", &_6, 0, &_10$$5); + zephir_array_fetch_string(&_10$$5, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1539); + ZEPHIR_CALL_METHOD(&_9$$5, this_ptr, "getexpression", &_6, 455, &_10$$5); zephir_check_call_status(); zephir_array_update_string(&_8$$5, SL("expr"), &_9$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_8$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1538); + zephir_array_append(&whenClauses, &_8$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1540); } } ZEND_HASH_FOREACH_END(); } else { @@ -2871,24 +2887,24 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&_11$$7); zephir_create_array(&_11$$7, 3, 0); add_assoc_stringl_ex(&_11$$7, SL("type"), SL("when")); - zephir_array_fetch_string(&_13$$7, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1531); - ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 0, &_13$$7); + zephir_array_fetch_string(&_13$$7, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1533); + ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 455, &_13$$7); zephir_check_call_status(); zephir_array_update_string(&_11$$7, SL("expr"), &_12$$7, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_14$$7, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1532); - ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 0, &_14$$7); + zephir_array_fetch_string(&_14$$7, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1534); + ZEPHIR_CALL_METHOD(&_12$$7, this_ptr, "getexpression", &_6, 455, &_14$$7); zephir_check_call_status(); zephir_array_update_string(&_11$$7, SL("then"), &_12$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_11$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1533); + zephir_array_append(&whenClauses, &_11$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1535); } else { ZEPHIR_INIT_NVAR(&_15$$8); zephir_create_array(&_15$$8, 2, 0); add_assoc_stringl_ex(&_15$$8, SL("type"), SL("else")); - zephir_array_fetch_string(&_17$$8, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1537); - ZEPHIR_CALL_METHOD(&_16$$8, this_ptr, "getexpression", &_6, 0, &_17$$8); + zephir_array_fetch_string(&_17$$8, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1539); + ZEPHIR_CALL_METHOD(&_16$$8, this_ptr, "getexpression", &_6, 455, &_17$$8); zephir_check_call_status(); zephir_array_update_string(&_15$$8, SL("expr"), &_16$$8, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, &_15$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1538); + zephir_array_append(&whenClauses, &_15$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 1540); } ZEPHIR_CALL_METHOD(NULL, &_0, "next", NULL, 0); zephir_check_call_status(); @@ -2897,8 +2913,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCaseExpression) ZEPHIR_INIT_NVAR(&whenExpr); zephir_create_array(return_value, 3, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("case")); - zephir_array_fetch_string(&_19, &expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1544); - ZEPHIR_CALL_METHOD(&_18, this_ptr, "getexpression", &_6, 0, &_19); + zephir_array_fetch_string(&_19, &expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1546); + ZEPHIR_CALL_METHOD(&_18, this_ptr, "getexpression", &_6, 455, &_19); zephir_check_call_status(); zephir_array_update_string(return_value, SL("expr"), &_18, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("when-clauses"), &whenClauses, PH_COPY | PH_SEPARATE); @@ -3057,7 +3073,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } else { ZVAL_BOOL(&_0$$5, 0); } - ZEPHIR_CALL_METHOD(&left, this_ptr, "getexpression", NULL, 0, &exprLeft, &_0$$5); + ZEPHIR_CALL_METHOD(&left, this_ptr, "getexpression", NULL, 455, &exprLeft, &_0$$5); zephir_check_call_status(); } ZEPHIR_OBS_VAR(&exprRight); @@ -3067,7 +3083,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } else { ZVAL_BOOL(&_1$$6, 0); } - ZEPHIR_CALL_METHOD(&right, this_ptr, "getexpression", NULL, 0, &exprRight, &_1$$6); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getexpression", NULL, 455, &exprRight, &_1$$6); zephir_check_call_status(); } } @@ -3152,7 +3168,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) break; } if (ZEPHIR_IS_LONG(&exprType, 355)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getqualified", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getqualified", NULL, 456, &expr); zephir_check_call_status(); break; } @@ -3248,7 +3264,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_18$$25, 2, 0); add_assoc_stringl_ex(&_18$$25, SL("type"), SL("literal")); ZEPHIR_OBS_VAR(&_19$$25); - zephir_array_fetch_string(&_19$$25, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1760); + zephir_array_fetch_string(&_19$$25, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1762); zephir_array_update_string(&_18$$25, SL("value"), &_19$$25, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_18$$25); break; @@ -3271,9 +3287,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } if (ZEPHIR_IS_LONG(&exprType, 260)) { ZEPHIR_OBS_VAR(&value); - zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1781); + zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1783); if (quoting) { - if (zephir_memnstr_str(&value, SL("'"), "phalcon/Mvc/Model/Query.zep", 1788)) { + if (zephir_memnstr_str(&value, SL("'"), "phalcon/Mvc/Model/Query.zep", 1790)) { ZEPHIR_INIT_VAR(&escapedValue); phalcon_orm_singlequotes(&escapedValue, &value); } else { @@ -3296,7 +3312,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_23$$33, 2, 0); add_assoc_stringl_ex(&_23$$33, SL("type"), SL("placeholder")); ZEPHIR_INIT_VAR(&_24$$33); - zephir_array_fetch_string(&_25$$33, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1809); + zephir_array_fetch_string(&_25$$33, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1811); ZEPHIR_INIT_VAR(&_26$$33); ZVAL_STRING(&_26$$33, "?"); ZEPHIR_INIT_VAR(&_27$$33); @@ -3310,7 +3326,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) ZEPHIR_INIT_VAR(&_28$$34); zephir_create_array(&_28$$34, 2, 0); add_assoc_stringl_ex(&_28$$34, SL("type"), SL("placeholder")); - zephir_array_fetch_string(&_29$$34, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1818); + zephir_array_fetch_string(&_29$$34, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 1820); ZEPHIR_INIT_VAR(&_30$$34); ZEPHIR_CONCAT_SV(&_30$$34, ":", &_29$$34); zephir_array_update_string(&_28$$34, SL("value"), &_30$$34, PH_COPY | PH_SEPARATE); @@ -3319,14 +3335,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } if (ZEPHIR_IS_LONG(&exprType, 277)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1823); - if (zephir_memnstr_str(&value, SL(":"), "phalcon/Mvc/Model/Query.zep", 1825)) { + zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1825); + if (zephir_memnstr_str(&value, SL(":"), "phalcon/Mvc/Model/Query.zep", 1827)) { ZEPHIR_INIT_VAR(&valueParts); zephir_fast_explode_str(&valueParts, SL(":"), &value, LONG_MAX); ZEPHIR_OBS_VAR(&name); - zephir_array_fetch_long(&name, &valueParts, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1827); + zephir_array_fetch_long(&name, &valueParts, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1829); ZEPHIR_OBS_VAR(&bindType); - zephir_array_fetch_long(&bindType, &valueParts, 1, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1828); + zephir_array_fetch_long(&bindType, &valueParts, 1, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 1830); do { if (ZEPHIR_IS_STRING(&bindType, "str")) { ZEPHIR_INIT_VAR(&_31$$37); @@ -3414,9 +3430,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_50$$44, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_51$$44); ZEPHIR_CONCAT_SV(&_51$$44, "Bind value is required for array type placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_50$$44, "__construct", NULL, 31, &_51$$44); + ZEPHIR_CALL_METHOD(NULL, &_50$$44, "__construct", NULL, 29, &_51$$44); zephir_check_call_status(); - zephir_throw_exception_debug(&_50$$44, "phalcon/Mvc/Model/Query.zep", 1898); + zephir_throw_exception_debug(&_50$$44, "phalcon/Mvc/Model/Query.zep", 1900); ZEPHIR_MM_RESTORE(); return; } @@ -3425,9 +3441,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_52$$45, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_53$$45); ZEPHIR_CONCAT_SV(&_53$$45, "Bind type requires an array in placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_52$$45, "__construct", NULL, 31, &_53$$45); + ZEPHIR_CALL_METHOD(NULL, &_52$$45, "__construct", NULL, 29, &_53$$45); zephir_check_call_status(); - zephir_throw_exception_debug(&_52$$45, "phalcon/Mvc/Model/Query.zep", 1904); + zephir_throw_exception_debug(&_52$$45, "phalcon/Mvc/Model/Query.zep", 1906); ZEPHIR_MM_RESTORE(); return; } @@ -3436,9 +3452,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_54$$46, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_55$$46); ZEPHIR_CONCAT_SV(&_55$$46, "At least one value must be bound in placeholder: ", &name); - ZEPHIR_CALL_METHOD(NULL, &_54$$46, "__construct", NULL, 31, &_55$$46); + ZEPHIR_CALL_METHOD(NULL, &_54$$46, "__construct", NULL, 29, &_55$$46); zephir_check_call_status(); - zephir_throw_exception_debug(&_54$$46, "phalcon/Mvc/Model/Query.zep", 1910); + zephir_throw_exception_debug(&_54$$46, "phalcon/Mvc/Model/Query.zep", 1912); ZEPHIR_MM_RESTORE(); return; } @@ -3457,9 +3473,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_58$$47, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_59$$47); ZEPHIR_CONCAT_SV(&_59$$47, "Unknown bind type: ", &bindType); - ZEPHIR_CALL_METHOD(NULL, &_58$$47, "__construct", NULL, 31, &_59$$47); + ZEPHIR_CALL_METHOD(NULL, &_58$$47, "__construct", NULL, 29, &_59$$47); zephir_check_call_status(); - zephir_throw_exception_debug(&_58$$47, "phalcon/Mvc/Model/Query.zep", 1925); + zephir_throw_exception_debug(&_58$$47, "phalcon/Mvc/Model/Query.zep", 1927); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -3641,18 +3657,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_79$$66, 2, 0); add_assoc_stringl_ex(&_79$$66, SL("type"), SL("literal")); ZEPHIR_OBS_VAR(&_80$$66); - zephir_array_fetch_string(&_80$$66, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2101); + zephir_array_fetch_string(&_80$$66, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2103); zephir_array_update_string(&_79$$66, SL("value"), &_80$$66, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_79$$66); break; } if (ZEPHIR_IS_LONG(&exprType, 350)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getfunctioncall", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getfunctioncall", NULL, 457, &expr); zephir_check_call_status(); break; } if (ZEPHIR_IS_LONG(&exprType, 409)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getcaseexpression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "getcaseexpression", NULL, 458, &expr); zephir_check_call_status(); break; } @@ -3661,7 +3677,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_create_array(&_81$$69, 2, 0); add_assoc_stringl_ex(&_81$$69, SL("type"), SL("select")); ZVAL_BOOL(&_83$$69, 1); - ZEPHIR_CALL_METHOD(&_82$$69, this_ptr, "_prepareselect", NULL, 0, &expr, &_83$$69); + ZEPHIR_CALL_METHOD(&_82$$69, this_ptr, "_prepareselect", NULL, 447, &expr, &_83$$69); zephir_check_call_status(); zephir_array_update_string(&_81$$69, SL("value"), &_82$$69, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&exprReturn, &_81$$69); @@ -3671,9 +3687,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) object_init_ex(&_84$$70, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_85$$70); ZEPHIR_CONCAT_SV(&_85$$70, "Unknown expression type ", &exprType); - ZEPHIR_CALL_METHOD(NULL, &_84$$70, "__construct", NULL, 31, &_85$$70); + ZEPHIR_CALL_METHOD(NULL, &_84$$70, "__construct", NULL, 29, &_85$$70); zephir_check_call_status(); - zephir_throw_exception_debug(&_84$$70, "phalcon/Mvc/Model/Query.zep", 2124); + zephir_throw_exception_debug(&_84$$70, "phalcon/Mvc/Model/Query.zep", 2126); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -3681,22 +3697,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) RETURN_CCTOR(&exprReturn); } if (zephir_array_isset_string(&expr, SL("domain"))) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualified", NULL, 0, &expr); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getqualified", NULL, 456, &expr); zephir_check_call_status(); RETURN_MM(); } if (zephir_array_isset_long(&expr, 0)) { ZEPHIR_INIT_VAR(&listItems); array_init(&listItems); - zephir_is_iterable(&expr, 0, "phalcon/Mvc/Model/Query.zep", 2147); + zephir_is_iterable(&expr, 0, "phalcon/Mvc/Model/Query.zep", 2149); if (Z_TYPE_P(&expr) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&expr), _86$$72) { ZEPHIR_INIT_NVAR(&exprListItem); ZVAL_COPY(&exprListItem, _86$$72); - ZEPHIR_CALL_METHOD(&_88$$73, this_ptr, "getexpression", NULL, 0, &exprListItem); + ZEPHIR_CALL_METHOD(&_88$$73, this_ptr, "getexpression", NULL, 455, &exprListItem); zephir_check_call_status(); - zephir_array_append(&listItems, &_88$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2144); + zephir_array_append(&listItems, &_88$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2146); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &expr, "rewind", NULL, 0); @@ -3709,9 +3725,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) } ZEPHIR_CALL_METHOD(&exprListItem, &expr, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_89$$74, this_ptr, "getexpression", NULL, 0, &exprListItem); + ZEPHIR_CALL_METHOD(&_89$$74, this_ptr, "getexpression", NULL, 455, &exprListItem); zephir_check_call_status(); - zephir_array_append(&listItems, &_89$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2144); + zephir_array_append(&listItems, &_89$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2146); ZEPHIR_CALL_METHOD(NULL, &expr, "next", NULL, 0); zephir_check_call_status(); } @@ -3722,7 +3738,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getExpression) zephir_array_fast_append(return_value, &listItems); RETURN_MM(); } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown expression", "phalcon/Mvc/Model/Query.zep", 2153); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown expression", "phalcon/Mvc/Model/Query.zep", 2155); return; } @@ -3774,15 +3790,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) if (zephir_array_isset_long(&arguments, 0)) { ZEPHIR_INIT_VAR(&functionArgs); array_init(&functionArgs); - zephir_is_iterable(&arguments, 0, "phalcon/Mvc/Model/Query.zep", 2179); + zephir_is_iterable(&arguments, 0, "phalcon/Mvc/Model/Query.zep", 2181); if (Z_TYPE_P(&arguments) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _0$$6) { ZEPHIR_INIT_NVAR(&argument); ZVAL_COPY(&argument, _0$$6); - ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcallargument", &_3, 0, &argument); + ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcallargument", &_3, 459, &argument); zephir_check_call_status(); - zephir_array_append(&functionArgs, &_2$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2177); + zephir_array_append(&functionArgs, &_2$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2179); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &arguments, "rewind", NULL, 0); @@ -3795,9 +3811,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) } ZEPHIR_CALL_METHOD(&argument, &arguments, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "getcallargument", &_3, 0, &argument); + ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "getcallargument", &_3, 459, &argument); zephir_check_call_status(); - zephir_array_append(&functionArgs, &_4$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2177); + zephir_array_append(&functionArgs, &_4$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2179); ZEPHIR_CALL_METHOD(NULL, &arguments, "next", NULL, 0); zephir_check_call_status(); } @@ -3806,7 +3822,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) } else { ZEPHIR_INIT_VAR(&_5$$9); zephir_create_array(&_5$$9, 1, 0); - ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "getcallargument", &_3, 0, &arguments); + ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "getcallargument", &_3, 459, &arguments); zephir_check_call_status(); zephir_array_fast_append(&_5$$9, &_6$$9); ZEPHIR_CPY_WRT(&functionArgs, &_5$$9); @@ -3815,7 +3831,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 4, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_7$$10); - zephir_array_fetch_string(&_7$$10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2189); + zephir_array_fetch_string(&_7$$10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2191); zephir_array_update_string(return_value, SL("name"), &_7$$10, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_8$$10); @@ -3826,7 +3842,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 3, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_9$$11); - zephir_array_fetch_string(&_9$$11, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2196); + zephir_array_fetch_string(&_9$$11, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2198); zephir_array_update_string(return_value, SL("name"), &_9$$11, PH_COPY | PH_SEPARATE); zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); RETURN_MM(); @@ -3835,7 +3851,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getFunctionCall) zephir_create_array(return_value, 2, 0); add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); ZEPHIR_OBS_VAR(&_10); - zephir_array_fetch_string(&_10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2205); + zephir_array_fetch_string(&_10, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2207); zephir_array_update_string(return_value, SL("name"), &_10, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -3876,15 +3892,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) if (zephir_array_isset_long(&group, 0)) { ZEPHIR_INIT_VAR(&groupParts); array_init(&groupParts); - zephir_is_iterable(&group, 0, "phalcon/Mvc/Model/Query.zep", 2225); + zephir_is_iterable(&group, 0, "phalcon/Mvc/Model/Query.zep", 2227); if (Z_TYPE_P(&group) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&group), _0$$3) { ZEPHIR_INIT_NVAR(&groupItem); ZVAL_COPY(&groupItem, _0$$3); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getexpression", &_3, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getexpression", &_3, 455, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupParts, &_2$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2223); + zephir_array_append(&groupParts, &_2$$4, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2225); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &group, "rewind", NULL, 0); @@ -3897,9 +3913,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) } ZEPHIR_CALL_METHOD(&groupItem, &group, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getexpression", &_3, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_4$$5, this_ptr, "getexpression", &_3, 455, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupParts, &_4$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2223); + zephir_array_append(&groupParts, &_4$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2225); ZEPHIR_CALL_METHOD(NULL, &group, "next", NULL, 0); zephir_check_call_status(); } @@ -3908,7 +3924,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getGroupClause) } else { ZEPHIR_INIT_VAR(&_5$$6); zephir_create_array(&_5$$6, 1, 0); - ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getexpression", &_3, 0, &group); + ZEPHIR_CALL_METHOD(&_6$$6, this_ptr, "getexpression", &_3, 455, &group); zephir_check_call_status(); zephir_array_fast_append(&_5$$6, &_6$$6); ZEPHIR_CPY_WRT(&groupParts, &_5$$6); @@ -3950,13 +3966,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getLimitClause) array_init(&limit); ZEPHIR_OBS_VAR(&number); if (zephir_array_isset_string_fetch(&number, &limitClause, SL("number"), 0)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getexpression", NULL, 0, &number); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getexpression", NULL, 455, &number); zephir_check_call_status(); zephir_array_update_string(&limit, SL("number"), &_0$$3, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&offset); if (zephir_array_isset_string_fetch(&offset, &limitClause, SL("offset"), 0)) { - ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getexpression", NULL, 0, &offset); + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getexpression", NULL, 455, &offset); zephir_check_call_status(); zephir_array_update_string(&limit, SL("offset"), &_1$$4, PH_COPY | PH_SEPARATE); } @@ -3998,10 +4014,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoin) ZEPHIR_OBS_VAR(&qualified); if (zephir_array_isset_string_fetch(&qualified, &join, SL("qualified"), 0)) { - zephir_array_fetch_string(&_0$$3, &qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2261); + zephir_array_fetch_string(&_0$$3, &qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2263); if (ZEPHIR_IS_LONG(&_0$$3, 355)) { ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &qualified, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2262); + zephir_array_fetch_string(&modelName, &qualified, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2264); ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -4016,7 +4032,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoin) RETURN_MM(); } } - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2277); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2279); return; } @@ -4051,7 +4067,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoinType) ZEPHIR_OBS_VAR(&type); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&type, &join, SL("type"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2288); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 2290); return; } do { @@ -4077,9 +4093,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoinType) zephir_read_property(&_1, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_SVSV(&_2, "Unknown join type ", &type, ", when preparing: ", &_1); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 31, &_2); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 29, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(&_0, "phalcon/Mvc/Model/Query.zep", 2310); + zephir_throw_exception_debug(&_0, "phalcon/Mvc/Model/Query.zep", 2312); ZEPHIR_MM_RESTORE(); return; } @@ -4253,7 +4269,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&tables); - zephir_array_fetch_string(&tables, &select, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2346); + zephir_array_fetch_string(&tables, &select, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2348); if (!(zephir_array_isset_long(&tables, 0))) { ZEPHIR_INIT_VAR(&selectTables); zephir_create_array(&selectTables, 1, 0); @@ -4262,7 +4278,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CPY_WRT(&selectTables, &tables); } ZEPHIR_OBS_VAR(&joins); - zephir_array_fetch_string(&joins, &select, SL("joins"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2354); + zephir_array_fetch_string(&joins, &select, SL("joins"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2356); if (!(zephir_array_isset_long(&joins, 0))) { ZEPHIR_INIT_VAR(&selectJoins); zephir_create_array(&selectJoins, 1, 0); @@ -4270,45 +4286,45 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } else { ZEPHIR_CPY_WRT(&selectJoins, &joins); } - zephir_is_iterable(&selectJoins, 0, "phalcon/Mvc/Model/Query.zep", 2505); + zephir_is_iterable(&selectJoins, 0, "phalcon/Mvc/Model/Query.zep", 2507); if (Z_TYPE_P(&selectJoins) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectJoins), _1) { ZEPHIR_INIT_NVAR(&joinItem); ZVAL_COPY(&joinItem, _1); - ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 0, &manager, &joinItem); + ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 460, &manager, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&source); - zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2368); + zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); ZEPHIR_OBS_NVAR(&schema); - zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2369); + zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); ZEPHIR_OBS_NVAR(&model); - zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); + zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2372); ZEPHIR_OBS_NVAR(&realModelName); - zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); + zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2373); ZEPHIR_INIT_NVAR(&completeSource); zephir_create_array(&completeSource, 2, 0); zephir_array_fast_append(&completeSource, &source); zephir_array_fast_append(&completeSource, &schema); - ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 0, &joinItem); + ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 461, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&aliasExpr); if (zephir_array_isset_string_fetch(&aliasExpr, &joinItem, SL("alias"), 0)) { ZEPHIR_OBS_NVAR(&alias); - zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2383); + zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2385); if (UNEXPECTED(zephir_array_isset(&joinModels, &alias))) { ZEPHIR_INIT_NVAR(&_5$$9); object_init_ex(&_5$$9, phalcon_mvc_model_exception_ce); zephir_read_property(&_6$$9, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$9); ZEPHIR_CONCAT_SVSV(&_7$$9, "Cannot use '", &alias, "' as join alias because it was already used, when preparing: ", &_6$$9); - ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_8, 31, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_5$$9, "__construct", &_8, 29, &_7$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model/Query.zep", 2391); + zephir_throw_exception_debug(&_5$$9, "phalcon/Mvc/Model/Query.zep", 2393); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2397); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2399); zephir_array_update_zval(&joinTypes, &alias, &joinType, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&joinModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); @@ -4325,9 +4341,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_10$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$11); ZEPHIR_CONCAT_SVSV(&_11$$11, "Cannot use '", &realModelName, "' as join alias because it was already used, when preparing: ", &_10$$11); - ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 31, &_11$$11); + ZEPHIR_CALL_METHOD(NULL, &_9$$11, "__construct", &_8, 29, &_11$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model/Query.zep", 2450); + zephir_throw_exception_debug(&_9$$11, "phalcon/Mvc/Model/Query.zep", 2452); ZEPHIR_MM_RESTORE(); return; } @@ -4354,40 +4370,40 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&joinItem, &selectJoins, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 0, &manager, &joinItem); + ZEPHIR_CALL_METHOD(&joinData, this_ptr, "getjoin", &_3, 460, &manager, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&source); - zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2368); + zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); ZEPHIR_OBS_NVAR(&schema); - zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2369); + zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); ZEPHIR_OBS_NVAR(&model); - zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2370); + zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2372); ZEPHIR_OBS_NVAR(&realModelName); - zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2371); + zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2373); ZEPHIR_INIT_NVAR(&_12$$12); zephir_create_array(&_12$$12, 2, 0); zephir_array_fast_append(&_12$$12, &source); zephir_array_fast_append(&_12$$12, &schema); ZEPHIR_CPY_WRT(&completeSource, &_12$$12); - ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 0, &joinItem); + ZEPHIR_CALL_METHOD(&joinType, this_ptr, "getjointype", &_4, 461, &joinItem); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&aliasExpr); if (zephir_array_isset_string_fetch(&aliasExpr, &joinItem, SL("alias"), 0)) { ZEPHIR_OBS_NVAR(&alias); - zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2383); + zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2385); if (UNEXPECTED(zephir_array_isset(&joinModels, &alias))) { ZEPHIR_INIT_NVAR(&_13$$14); object_init_ex(&_13$$14, phalcon_mvc_model_exception_ce); zephir_read_property(&_14$$14, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_15$$14); ZEPHIR_CONCAT_SVSV(&_15$$14, "Cannot use '", &alias, "' as join alias because it was already used, when preparing: ", &_14$$14); - ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 31, &_15$$14); + ZEPHIR_CALL_METHOD(NULL, &_13$$14, "__construct", &_8, 29, &_15$$14); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$14, "phalcon/Mvc/Model/Query.zep", 2391); + zephir_throw_exception_debug(&_13$$14, "phalcon/Mvc/Model/Query.zep", 2393); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2397); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2399); zephir_array_update_zval(&joinTypes, &alias, &joinType, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&joinModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); @@ -4404,9 +4420,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_17$$16, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_18$$16); ZEPHIR_CONCAT_SVSV(&_18$$16, "Cannot use '", &realModelName, "' as join alias because it was already used, when preparing: ", &_17$$16); - ZEPHIR_CALL_METHOD(NULL, &_16$$16, "__construct", &_8, 31, &_18$$16); + ZEPHIR_CALL_METHOD(NULL, &_16$$16, "__construct", &_8, 29, &_18$$16); zephir_check_call_status(); - zephir_throw_exception_debug(&_16$$16, "phalcon/Mvc/Model/Query.zep", 2450); + zephir_throw_exception_debug(&_16$$16, "phalcon/Mvc/Model/Query.zep", 2452); ZEPHIR_MM_RESTORE(); return; } @@ -4432,7 +4448,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_update_property_zval(this_ptr, ZEND_STRL("sqlModelsAliases"), &sqlModelsAliases); zephir_update_property_zval(this_ptr, ZEND_STRL("sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); zephir_update_property_zval(this_ptr, ZEND_STRL("modelsInstances"), &modelsInstances); - zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2525); + zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2527); if (Z_TYPE_P(&joinPrepared) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _21, _22, _19) { @@ -4446,7 +4462,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZVAL_COPY(&joinItem, _19); ZEPHIR_OBS_NVAR(&joinExpr); if (zephir_array_isset_string_fetch(&joinExpr, &joinItem, SL("conditions"), 0)) { - ZEPHIR_CALL_METHOD(&_23$$18, this_ptr, "getexpression", &_24, 0, &joinExpr); + ZEPHIR_CALL_METHOD(&_23$$18, this_ptr, "getexpression", &_24, 455, &joinExpr); zephir_check_call_status(); zephir_array_update_zval(&joinPreCondition, &joinAliasName, &_23$$18, PH_COPY | PH_SEPARATE); } @@ -4466,7 +4482,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinExpr); if (zephir_array_isset_string_fetch(&joinExpr, &joinItem, SL("conditions"), 0)) { - ZEPHIR_CALL_METHOD(&_25$$20, this_ptr, "getexpression", &_24, 0, &joinExpr); + ZEPHIR_CALL_METHOD(&_25$$20, this_ptr, "getexpression", &_24, 455, &joinExpr); zephir_check_call_status(); zephir_array_update_zval(&joinPreCondition, &joinAliasName, &_25$$20, PH_COPY | PH_SEPARATE); } @@ -4479,7 +4495,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_0, this_ptr, ZEND_STRL("enableImplicitJoins"), PH_NOISY_CC | PH_READONLY); if (!(zephir_is_true(&_0))) { ZEPHIR_INIT_VAR(&_26$$21); - zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2537); + zephir_is_iterable(&joinPrepared, 0, "phalcon/Mvc/Model/Query.zep", 2539); if (Z_TYPE_P(&joinPrepared) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _29$$21, _30$$21, _27$$21) { @@ -4492,11 +4508,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_26$$21); ZVAL_COPY(&_26$$21, _27$$21); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2527); + zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2528); + zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2530); ZEPHIR_OBS_NVAR(&preCondition); - zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); + zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2531); ZEPHIR_INIT_NVAR(&_31$$22); zephir_create_array(&_31$$22, 3, 0); zephir_array_update_string(&_31$$22, SL("type"), &joinType, PH_COPY | PH_SEPARATE); @@ -4505,7 +4521,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_32$$22, 1, 0); zephir_array_fast_append(&_32$$22, &preCondition); zephir_array_update_string(&_31$$22, SL("conditions"), &_32$$22, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_31$$22, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2534); + zephir_array_append(&sqlJoins, &_31$$22, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2536); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &joinPrepared, "rewind", NULL, 0); @@ -4521,11 +4537,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&_26$$21, &joinPrepared, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2527); + zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2528); + zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2530); ZEPHIR_OBS_NVAR(&preCondition); - zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2529); + zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2531); ZEPHIR_INIT_NVAR(&_33$$23); zephir_create_array(&_33$$23, 3, 0); zephir_array_update_string(&_33$$23, SL("type"), &joinType, PH_COPY | PH_SEPARATE); @@ -4534,7 +4550,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_34$$23, 1, 0); zephir_array_fast_append(&_34$$23, &preCondition); zephir_array_update_string(&_33$$23, SL("conditions"), &_34$$23, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_33$$23, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2534); + zephir_array_append(&sqlJoins, &_33$$23, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2536); ZEPHIR_CALL_METHOD(NULL, &joinPrepared, "next", NULL, 0); zephir_check_call_status(); } @@ -4545,15 +4561,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&fromModels); array_init(&fromModels); - zephir_is_iterable(&selectTables, 0, "phalcon/Mvc/Model/Query.zep", 2552); + zephir_is_iterable(&selectTables, 0, "phalcon/Mvc/Model/Query.zep", 2554); if (Z_TYPE_P(&selectTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectTables), _35) { ZEPHIR_INIT_NVAR(&tableItem); ZVAL_COPY(&tableItem, _35); - zephir_array_fetch_string(&_37$$24, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_37$$24, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2548); ZEPHIR_OBS_NVAR(&_38$$24); - zephir_array_fetch_string(&_38$$24, &_37$$24, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_38$$24, &_37$$24, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2548); zephir_array_update_zval(&fromModels, &_38$$24, &__$true, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -4567,9 +4583,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&tableItem, &selectTables, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_39$$25, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_39$$25, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2548); ZEPHIR_OBS_NVAR(&_40$$25); - zephir_array_fetch_string(&_40$$25, &_39$$25, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2546); + zephir_array_fetch_string(&_40$$25, &_39$$25, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2548); zephir_array_update_zval(&fromModels, &_40$$25, &__$true, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &selectTables, "next", NULL, 0); zephir_check_call_status(); @@ -4577,7 +4593,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&tableItem); ZEPHIR_INIT_VAR(&_41); - zephir_is_iterable(&fromModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); + zephir_is_iterable(&fromModels, 0, "phalcon/Mvc/Model/Query.zep", 2674); if (Z_TYPE_P(&fromModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fromModels), _44, _45, _42) { @@ -4589,7 +4605,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_INIT_NVAR(&_41); ZVAL_COPY(&_41, _42); - zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2670); + zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); if (Z_TYPE_P(&joinModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinModels), _48$$26, _49$$26, _46$$26) { @@ -4602,13 +4618,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&joinModel); ZVAL_COPY(&joinModel, _46$$26); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_50, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -4621,36 +4637,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_53$$31, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_54$$31); ZEPHIR_CONCAT_SVSVSV(&_54$$31, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_53$$31); - ZEPHIR_CALL_METHOD(NULL, &_52$$31, "__construct", &_8, 31, &_54$$31); + ZEPHIR_CALL_METHOD(NULL, &_52$$31, "__construct", &_8, 29, &_54$$31); zephir_check_call_status(); - zephir_throw_exception_debug(&_52$$31, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_52$$31, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_55$$32, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_55$$32))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _58$$35) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _58$$35); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -4663,14 +4679,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_60$$39); @@ -4680,7 +4696,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_61$$39); array_init(&_61$$39); zephir_array_update_string(&_60$$39, SL("conditions"), &_61$$39, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_60$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_60$$39, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_62$$40); @@ -4691,7 +4707,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_63$$40, 1, 0); zephir_array_fast_append(&_63$$40, &preCondition); zephir_array_update_string(&_62$$40, SL("conditions"), &_63$$40, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_62$$40, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_62$$40, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } } ZEND_HASH_FOREACH_END(); } else { @@ -4708,13 +4724,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&joinModel, &joinModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_64, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -4727,36 +4743,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_67$$45, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_68$$45); ZEPHIR_CONCAT_SVSVSV(&_68$$45, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_67$$45); - ZEPHIR_CALL_METHOD(NULL, &_66$$45, "__construct", &_8, 31, &_68$$45); + ZEPHIR_CALL_METHOD(NULL, &_66$$45, "__construct", &_8, 29, &_68$$45); zephir_check_call_status(); - zephir_throw_exception_debug(&_66$$45, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_66$$45, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_69$$46, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_69$$46))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _70$$49) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _70$$49); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -4769,14 +4785,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_72$$53); @@ -4786,7 +4802,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_73$$53); array_init(&_73$$53); zephir_array_update_string(&_72$$53, SL("conditions"), &_73$$53, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_72$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_72$$53, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_74$$54); @@ -4797,7 +4813,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_75$$54, 1, 0); zephir_array_fast_append(&_75$$54, &preCondition); zephir_array_update_string(&_74$$54, SL("conditions"), &_75$$54, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_74$$54, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_74$$54, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } ZEPHIR_CALL_METHOD(NULL, &joinModels, "next", NULL, 0); zephir_check_call_status(); @@ -4819,7 +4835,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_41, &fromModels, "current", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2670); + zephir_is_iterable(&joinModels, 0, "phalcon/Mvc/Model/Query.zep", 2672); if (Z_TYPE_P(&joinModels) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinModels), _78$$55, _79$$55, _76$$55) { @@ -4832,13 +4848,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&joinModel); ZVAL_COPY(&joinModel, _76$$55); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_80, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -4851,36 +4867,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_83$$60, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_84$$60); ZEPHIR_CONCAT_SVSVSV(&_84$$60, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_83$$60); - ZEPHIR_CALL_METHOD(NULL, &_82$$60, "__construct", &_8, 31, &_84$$60); + ZEPHIR_CALL_METHOD(NULL, &_82$$60, "__construct", &_8, 29, &_84$$60); zephir_check_call_status(); - zephir_throw_exception_debug(&_82$$60, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_82$$60, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_85$$61, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_85$$61))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _86$$64) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _86$$64); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -4893,14 +4909,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_88$$68); @@ -4910,7 +4926,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_89$$68); array_init(&_89$$68); zephir_array_update_string(&_88$$68, SL("conditions"), &_89$$68, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_88$$68, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_88$$68, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_90$$69); @@ -4921,7 +4937,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_91$$69, 1, 0); zephir_array_fast_append(&_91$$69, &preCondition); zephir_array_update_string(&_90$$69, SL("conditions"), &_91$$69, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_90$$69, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_90$$69, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } } ZEND_HASH_FOREACH_END(); } else { @@ -4938,13 +4954,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_CALL_METHOD(&joinModel, &joinModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&joinSource); - zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2557); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2559); ZEPHIR_OBS_NVAR(&joinType); - zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2562); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2564); ZEPHIR_OBS_NVAR(&preCondition); if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0))) { ZEPHIR_OBS_NVAR(&modelNameAlias); - zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2571); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2573); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_92, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { @@ -4957,36 +4973,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_read_property(&_95$$74, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_96$$74); ZEPHIR_CONCAT_SVSVSV(&_96$$74, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_95$$74); - ZEPHIR_CALL_METHOD(NULL, &_94$$74, "__construct", &_8, 31, &_96$$74); + ZEPHIR_CALL_METHOD(NULL, &_94$$74, "__construct", &_8, 29, &_96$$74); zephir_check_call_status(); - zephir_throw_exception_debug(&_94$$74, "phalcon/Mvc/Model/Query.zep", 2597); + zephir_throw_exception_debug(&_94$$74, "phalcon/Mvc/Model/Query.zep", 2599); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&relation); - zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2603); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2605); } } if (Z_TYPE_P(&relation) == IS_OBJECT) { ZEPHIR_OBS_NVAR(&modelAlias); - zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2614); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2616); ZEPHIR_CALL_METHOD(&_97$$75, &relation, "isthrough", NULL, 0); zephir_check_call_status(); if (!(zephir_is_true(&_97$$75))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getsinglejoin", &_56, 462, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "getmultijoin", &_57, 463, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } if (zephir_array_isset_long(&sqlJoin, 0)) { - zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2644); + zephir_is_iterable(&sqlJoin, 0, "phalcon/Mvc/Model/Query.zep", 2646); if (Z_TYPE_P(&sqlJoin) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _98$$78) { ZEPHIR_INIT_NVAR(&sqlJoinItem); ZVAL_COPY(&sqlJoinItem, _98$$78); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "rewind", NULL, 0); @@ -4999,14 +5015,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) } ZEPHIR_CALL_METHOD(&sqlJoinItem, &sqlJoin, "current", NULL, 0); zephir_check_call_status(); - zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2642); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2644); ZEPHIR_CALL_METHOD(NULL, &sqlJoin, "next", NULL, 0); zephir_check_call_status(); } } ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2645); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2647); } } else { ZEPHIR_INIT_NVAR(&_100$$82); @@ -5016,7 +5032,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) ZEPHIR_INIT_NVAR(&_101$$82); array_init(&_101$$82); zephir_array_update_string(&_100$$82, SL("conditions"), &_101$$82, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_100$$82, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2656); + zephir_array_append(&sqlJoins, &_100$$82, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2658); } } else { ZEPHIR_INIT_NVAR(&_102$$83); @@ -5027,7 +5043,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getJoins) zephir_create_array(&_103$$83, 1, 0); zephir_array_fast_append(&_103$$83, &preCondition); zephir_array_update_string(&_102$$83, SL("conditions"), &_103$$83, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, &_102$$83, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2667); + zephir_array_append(&sqlJoins, &_102$$83, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2669); } ZEPHIR_CALL_METHOD(NULL, &joinModels, "next", NULL, 0); zephir_check_call_status(); @@ -5157,7 +5173,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) ZEPHIR_CALL_METHOD(&referencedModelName, relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&fields) == IS_ARRAY) { - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 2789); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 2791); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _3$$3, _4$$3, _1$$3) { @@ -5175,14 +5191,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) zephir_read_property(&_6$$5, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$5); ZEPHIR_CONCAT_SVSVSV(&_7$$5, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_6$$5); - ZEPHIR_CALL_METHOD(NULL, &_5$$5, "__construct", &_8, 31, &_7$$5); + ZEPHIR_CALL_METHOD(NULL, &_5$$5, "__construct", &_8, 29, &_7$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$5, "phalcon/Mvc/Model/Query.zep", 2756); + zephir_throw_exception_debug(&_5$$5, "phalcon/Mvc/Model/Query.zep", 2758); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&intermediateField); - zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2762); + zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2764); ZEPHIR_INIT_NVAR(&sqlEqualsJoinCondition); zephir_create_array(&sqlEqualsJoinCondition, 4, 0); add_assoc_stringl_ex(&sqlEqualsJoinCondition, SL("type"), SL("binary-op")); @@ -5192,7 +5208,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_10$$4, SL("type"), 355); zephir_array_update_string(&_10$$4, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$4, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 0, &_10$$4); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 456, &_10$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("left"), &_9$$4, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_12$$4); @@ -5200,7 +5216,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_12$$4, SL("type"), SL("qualified")); zephir_array_update_string(&_12$$4, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_12$$4, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 0, &_12$$4); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getqualified", &_11, 456, &_12$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("right"), &_9$$4, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); @@ -5223,14 +5239,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) zephir_read_property(&_14$$7, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_15$$7); ZEPHIR_CONCAT_SVSVSV(&_15$$7, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_14$$7); - ZEPHIR_CALL_METHOD(NULL, &_13$$7, "__construct", &_8, 31, &_15$$7); + ZEPHIR_CALL_METHOD(NULL, &_13$$7, "__construct", &_8, 29, &_15$$7); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$7, "phalcon/Mvc/Model/Query.zep", 2756); + zephir_throw_exception_debug(&_13$$7, "phalcon/Mvc/Model/Query.zep", 2758); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_OBS_NVAR(&intermediateField); - zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2762); + zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2764); ZEPHIR_INIT_NVAR(&_16$$6); zephir_create_array(&_16$$6, 4, 0); add_assoc_stringl_ex(&_16$$6, SL("type"), SL("binary-op")); @@ -5240,7 +5256,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_18$$6, SL("type"), 355); zephir_array_update_string(&_18$$6, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_18$$6, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 0, &_18$$6); + ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 456, &_18$$6); zephir_check_call_status(); zephir_array_update_string(&_16$$6, SL("left"), &_17$$6, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_19$$6); @@ -5248,7 +5264,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_19$$6, SL("type"), SL("qualified")); zephir_array_update_string(&_19$$6, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_19$$6, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 0, &_19$$6); + ZEPHIR_CALL_METHOD(&_17$$6, this_ptr, "getqualified", &_11, 456, &_19$$6); zephir_check_call_status(); zephir_array_update_string(&_16$$6, SL("right"), &_17$$6, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&sqlEqualsJoinCondition, &_16$$6); @@ -5280,7 +5296,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_25$$8, SL("type"), 355); zephir_array_update_string(&_25$$8, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_25$$8, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_25$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_25$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("left"), &_24$$8, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_26$$8); @@ -5288,7 +5304,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_26$$8, SL("type"), SL("qualified")); zephir_array_update_string(&_26$$8, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_26$$8, SL("name"), &intermediateFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_26$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_26$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("right"), &_24$$8, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_22$$8, &_23$$8); @@ -5309,7 +5325,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_long_ex(&_27$$8, SL("type"), 355); zephir_array_update_string(&_27$$8, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_27$$8, SL("name"), &intermediateReferencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_27$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_27$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("left"), &_24$$8, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_28$$8); @@ -5317,7 +5333,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getMultiJoin) add_assoc_stringl_ex(&_28$$8, SL("type"), SL("qualified")); zephir_array_update_string(&_28$$8, SL("domain"), &referencedModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_28$$8, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 0, &_28$$8); + ZEPHIR_CALL_METHOD(&_24$$8, this_ptr, "getqualified", &_11, 456, &_28$$8); zephir_check_call_status(); zephir_array_update_string(&_23$$8, SL("right"), &_24$$8, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_22$$8, &_23$$8); @@ -5382,14 +5398,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) } ZEPHIR_INIT_VAR(&orderParts); array_init(&orderParts); - zephir_is_iterable(&orderColumns, 0, "phalcon/Mvc/Model/Query.zep", 2898); + zephir_is_iterable(&orderColumns, 0, "phalcon/Mvc/Model/Query.zep", 2900); if (Z_TYPE_P(&orderColumns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&orderColumns), _0) { ZEPHIR_INIT_NVAR(&orderItem); ZVAL_COPY(&orderItem, _0); - zephir_array_fetch_string(&_2$$5, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2880); - ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 0, &_2$$5); + zephir_array_fetch_string(&_2$$5, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2882); + ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 455, &_2$$5); zephir_check_call_status(); if (zephir_array_isset_string_fetch(&orderSort, &orderItem, SL("sort"), 1)) { if (ZEPHIR_IS_LONG(&orderSort, 327)) { @@ -5414,7 +5430,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) zephir_array_fast_append(&_7$$9, &orderPartExpr); ZEPHIR_CPY_WRT(&orderPartSort, &_7$$9); } - zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2895); + zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2897); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &orderColumns, "rewind", NULL, 0); @@ -5427,8 +5443,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) } ZEPHIR_CALL_METHOD(&orderItem, &orderColumns, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_8$$10, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2880); - ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 0, &_8$$10); + zephir_array_fetch_string(&_8$$10, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2882); + ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "getexpression", &_3, 455, &_8$$10); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&orderSort); if (zephir_array_isset_string_fetch(&orderSort, &orderItem, SL("sort"), 0)) { @@ -5455,7 +5471,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getOrderClause) zephir_array_fast_append(&_13$$14, &orderPartExpr); ZEPHIR_CPY_WRT(&orderPartSort, &_13$$14); } - zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2895); + zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 2897); ZEPHIR_CALL_METHOD(NULL, &orderColumns, "next", NULL, 0); zephir_check_call_status(); } @@ -5543,13 +5559,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) ZEPHIR_OBS_VAR(&columnName); - zephir_array_fetch_string(&columnName, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2912); + zephir_array_fetch_string(&columnName, &expr, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 2914); zephir_read_property(&_0, this_ptr, ZEND_STRL("nestingLevel"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&nestingLevel, &_0); zephir_read_property(&_0, this_ptr, ZEND_STRL("sqlColumnAliases"), PH_NOISY_CC | PH_READONLY); if (zephir_array_isset(&_0, &nestingLevel)) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("sqlColumnAliases"), PH_NOISY_CC | PH_READONLY); - zephir_array_fetch(&_2$$3, &_1$$3, &nestingLevel, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2920); + zephir_array_fetch(&_2$$3, &_1$$3, &nestingLevel, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2922); ZEPHIR_CPY_WRT(&sqlColumnAliases, &_2$$3); } else { ZEPHIR_INIT_NVAR(&sqlColumnAliases); @@ -5559,7 +5575,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) if (_3) { _4 = !(zephir_array_isset_string(&expr, SL("domain"))); if (!(_4)) { - zephir_array_fetch_string(&_5, &expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2925); + zephir_array_fetch_string(&_5, &expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 2927); _4 = ZEPHIR_IS_EMPTY(&_5); } _3 = _4; @@ -5583,9 +5599,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_9$$7, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_10$$7); ZEPHIR_CONCAT_SVSV(&_10$$7, "Unknown model or alias '", &columnDomain, "' (11), when preparing: ", &_9$$7); - ZEPHIR_CALL_METHOD(NULL, &_8$$7, "__construct", NULL, 31, &_10$$7); + ZEPHIR_CALL_METHOD(NULL, &_8$$7, "__construct", NULL, 29, &_10$$7); zephir_check_call_status(); - zephir_throw_exception_debug(&_8$$7, "phalcon/Mvc/Model/Query.zep", 2946); + zephir_throw_exception_debug(&_8$$7, "phalcon/Mvc/Model/Query.zep", 2948); ZEPHIR_MM_RESTORE(); return; } @@ -5599,9 +5615,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_13$$9, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$9); ZEPHIR_CONCAT_SVSV(&_14$$9, "There is no model related to model or alias '", &columnDomain, "', when executing: ", &_13$$9); - ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", NULL, 31, &_14$$9); + ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", NULL, 29, &_14$$9); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$9, "phalcon/Mvc/Model/Query.zep", 2965); + zephir_throw_exception_debug(&_12$$9, "phalcon/Mvc/Model/Query.zep", 2967); ZEPHIR_MM_RESTORE(); return; } @@ -5619,9 +5635,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_16$$12, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_17$$12); ZEPHIR_CONCAT_SVSVSV(&_17$$12, "Column '", &columnName, "' doesn't belong to the model or alias '", &columnDomain, "', when executing: ", &_16$$12); - ZEPHIR_CALL_METHOD(NULL, &_15$$12, "__construct", NULL, 31, &_17$$12); + ZEPHIR_CALL_METHOD(NULL, &_15$$12, "__construct", NULL, 29, &_17$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_15$$12, "phalcon/Mvc/Model/Query.zep", 2977); + zephir_throw_exception_debug(&_15$$12, "phalcon/Mvc/Model/Query.zep", 2979); ZEPHIR_MM_RESTORE(); return; } @@ -5633,7 +5649,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) ZEPHIR_INIT_VAR(&hasModel); ZVAL_BOOL(&hasModel, 0); zephir_read_property(&_18$$14, this_ptr, ZEND_STRL("modelsInstances"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_18$$14, 0, "phalcon/Mvc/Model/Query.zep", 3011); + zephir_is_iterable(&_18$$14, 0, "phalcon/Mvc/Model/Query.zep", 3013); if (Z_TYPE_P(&_18$$14) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_18$$14), _19$$14) { @@ -5649,9 +5665,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_24$$17, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_25$$17); ZEPHIR_CONCAT_SVSV(&_25$$17, "The column '", &columnName, "' is ambiguous, when preparing: ", &_24$$17); - ZEPHIR_CALL_METHOD(NULL, &_23$$17, "__construct", NULL, 31, &_25$$17); + ZEPHIR_CALL_METHOD(NULL, &_23$$17, "__construct", NULL, 29, &_25$$17); zephir_check_call_status(); - zephir_throw_exception_debug(&_23$$17, "phalcon/Mvc/Model/Query.zep", 3000); + zephir_throw_exception_debug(&_23$$17, "phalcon/Mvc/Model/Query.zep", 3002); ZEPHIR_MM_RESTORE(); return; } @@ -5679,9 +5695,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_29$$20, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_30$$20); ZEPHIR_CONCAT_SVSV(&_30$$20, "The column '", &columnName, "' is ambiguous, when preparing: ", &_29$$20); - ZEPHIR_CALL_METHOD(NULL, &_28$$20, "__construct", NULL, 31, &_30$$20); + ZEPHIR_CALL_METHOD(NULL, &_28$$20, "__construct", NULL, 29, &_30$$20); zephir_check_call_status(); - zephir_throw_exception_debug(&_28$$20, "phalcon/Mvc/Model/Query.zep", 3000); + zephir_throw_exception_debug(&_28$$20, "phalcon/Mvc/Model/Query.zep", 3002); ZEPHIR_MM_RESTORE(); return; } @@ -5698,16 +5714,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_32$$21, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_33$$21); ZEPHIR_CONCAT_SVSV(&_33$$21, "Column '", &columnName, "' doesn't belong to any of the selected models (1), when preparing: ", &_32$$21); - ZEPHIR_CALL_METHOD(NULL, &_31$$21, "__construct", NULL, 31, &_33$$21); + ZEPHIR_CALL_METHOD(NULL, &_31$$21, "__construct", NULL, 29, &_33$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_31$$21, "phalcon/Mvc/Model/Query.zep", 3014); + zephir_throw_exception_debug(&_31$$21, "phalcon/Mvc/Model/Query.zep", 3016); ZEPHIR_MM_RESTORE(); return; } zephir_read_property(&_34$$14, this_ptr, ZEND_STRL("models"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&models, &_34$$14); if (UNEXPECTED(Z_TYPE_P(&models) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The models list was not loaded correctly", "phalcon/Mvc/Model/Query.zep", 3025); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The models list was not loaded correctly", "phalcon/Mvc/Model/Query.zep", 3027); return; } ZEPHIR_INIT_VAR(&className); @@ -5719,9 +5735,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_36$$23, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_37$$23); ZEPHIR_CONCAT_SVSV(&_37$$23, "Can't obtain model's source from models list: '", &className, "', when preparing: ", &_36$$23); - ZEPHIR_CALL_METHOD(NULL, &_35$$23, "__construct", NULL, 31, &_37$$23); + ZEPHIR_CALL_METHOD(NULL, &_35$$23, "__construct", NULL, 29, &_37$$23); zephir_check_call_status(); - zephir_throw_exception_debug(&_35$$23, "phalcon/Mvc/Model/Query.zep", 3036); + zephir_throw_exception_debug(&_35$$23, "phalcon/Mvc/Model/Query.zep", 3038); ZEPHIR_MM_RESTORE(); return; } @@ -5740,9 +5756,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getQualified) zephir_read_property(&_39$$27, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_40$$27); ZEPHIR_CONCAT_SVSV(&_40$$27, "Column '", &columnName, "' doesn't belong to any of the selected models (3), when preparing: ", &_39$$27); - ZEPHIR_CALL_METHOD(NULL, &_38$$27, "__construct", NULL, 31, &_40$$27); + ZEPHIR_CALL_METHOD(NULL, &_38$$27, "__construct", NULL, 29, &_40$$27); zephir_check_call_status(); - zephir_throw_exception_debug(&_38$$27, "phalcon/Mvc/Model/Query.zep", 3055); + zephir_throw_exception_debug(&_38$$27, "phalcon/Mvc/Model/Query.zep", 3057); ZEPHIR_MM_RESTORE(); return; } @@ -5828,7 +5844,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getReadConnection) ZEPHIR_CALL_METHOD(&connection, model, "selectreadconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&connection) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectReadConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3099); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectReadConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3101); return; } RETURN_CCTOR(&connection); @@ -5900,10 +5916,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getRelatedRecords) zephir_array_fast_append(&_0, &_1); zephir_array_update_string(&selectIr, SL("columns"), &_0, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_VAR(&_4); - zephir_array_fetch_string(&_4, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3129); + zephir_array_fetch_string(&_4, &intermediate, SL("models"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3131); zephir_array_update_string(&selectIr, SL("models"), &_4, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_NVAR(&_4); - zephir_array_fetch_string(&_4, &intermediate, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3131); + zephir_array_fetch_string(&_4, &intermediate, SL("tables"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3133); zephir_array_update_string(&selectIr, SL("tables"), &_4, PH_COPY | PH_SEPARATE); ZEPHIR_OBS_VAR(&whereConditions); if (zephir_array_isset_string_fetch(&whereConditions, &intermediate, SL("where"), 0)) { @@ -5915,17 +5931,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getRelatedRecords) } ZEPHIR_INIT_VAR(&query); object_init_ex(&query, phalcon_mvc_model_query_ce); - ZEPHIR_CALL_METHOD(NULL, &query, "__construct", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &query, "__construct", NULL, 464); zephir_check_call_status(); zephir_read_property(&_5, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &query, "setdi", NULL, 0, &_5); + ZEPHIR_CALL_METHOD(NULL, &query, "setdi", NULL, 465, &_5); zephir_check_call_status(); ZVAL_LONG(&_6, 309); - ZEPHIR_CALL_METHOD(NULL, &query, "settype", NULL, 0, &_6); + ZEPHIR_CALL_METHOD(NULL, &query, "settype", NULL, 466, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &query, "setintermediate", NULL, 0, &selectIr); + ZEPHIR_CALL_METHOD(NULL, &query, "setintermediate", NULL, 467, &selectIr); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 0, &bindParams, &bindTypes); + ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 468, &bindParams, &bindTypes); zephir_check_call_status(); RETURN_MM(); } @@ -5992,7 +6008,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) ZEPHIR_OBS_VAR(&columnType); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columnType, &column, SL("type"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3171); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3173); return; } ZEPHIR_INIT_VAR(&sqlColumns); @@ -6001,7 +6017,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 0); if (ZEPHIR_IS_LONG(&columnType, 352)) { zephir_read_property(&_0$$4, this_ptr, ZEND_STRL("models"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_0$$4, 0, "phalcon/Mvc/Model/Query.zep", 3201); + zephir_is_iterable(&_0$$4, 0, "phalcon/Mvc/Model/Query.zep", 3203); if (Z_TYPE_P(&_0$$4) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0$$4), _3$$4, _4$$4, _1$$4) { @@ -6018,15 +6034,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&sqlColumn, SL("type"), SL("object")); zephir_array_update_string(&sqlColumn, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("column"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_5$$5, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&_5$$5, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); zephir_array_update_string(&sqlColumn, SL("balias"), &_5$$5, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_7$$6, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3195); + zephir_array_fetch_string(&_7$$6, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3197); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_7$$6, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3198); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3200); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &_0$$4, "rewind", NULL, 0); @@ -6046,16 +6062,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&_8$$7, SL("type"), SL("object")); zephir_array_update_string(&_8$$7, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$7, SL("column"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_9$$7, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&_9$$7, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); zephir_array_update_string(&_8$$7, SL("balias"), &_9$$7, PH_COPY | PH_SEPARATE); ZEPHIR_CPY_WRT(&sqlColumn, &_8$$7); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_10$$8, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3195); + zephir_array_fetch_string(&_10$$8, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3197); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_10$$8, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3198); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3200); ZEPHIR_CALL_METHOD(NULL, &_0$$4, "next", NULL, 0); zephir_check_call_status(); } @@ -6065,14 +6081,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) RETURN_CTOR(&sqlColumns); } if (UNEXPECTED(!(zephir_array_isset_string(&column, SL("column"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3205); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3207); return; } if (ZEPHIR_IS_LONG(&columnType, 353)) { zephir_read_property(&_11$$10, this_ptr, ZEND_STRL("sqlAliases"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&sqlAliases, &_11$$10); ZEPHIR_OBS_VAR(&columnDomain); - zephir_array_fetch_string(&columnDomain, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3217); + zephir_array_fetch_string(&columnDomain, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3219); ZEPHIR_OBS_NVAR(&source); if (UNEXPECTED(!(zephir_array_isset_fetch(&source, &sqlAliases, &columnDomain, 0)))) { ZEPHIR_INIT_VAR(&_12$$11); @@ -6080,9 +6096,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_read_property(&_13$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_14$$11); ZEPHIR_CONCAT_SVSV(&_14$$11, "Unknown model or alias '", &columnDomain, "' (2), when preparing: ", &_13$$11); - ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", NULL, 31, &_14$$11); + ZEPHIR_CALL_METHOD(NULL, &_12$$11, "__construct", NULL, 29, &_14$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 3222); + zephir_throw_exception_debug(&_12$$11, "phalcon/Mvc/Model/Query.zep", 3224); ZEPHIR_MM_RESTORE(); return; } @@ -6092,10 +6108,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) zephir_read_property(&_11$$10, this_ptr, ZEND_STRL("sqlAliasesModels"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&sqlAliasesModels, &_11$$10); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch(&modelName, &sqlAliasesModels, &columnDomain, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3236); + zephir_array_fetch(&modelName, &sqlAliasesModels, &columnDomain, PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3238); if (Z_TYPE_P(&preparedAlias) != IS_STRING) { if (ZEPHIR_IS_EQUAL(&columnDomain, &modelName)) { - ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_6, 104, &modelName); + ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_6, 73, &modelName); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&preparedAlias, &columnDomain); @@ -6110,10 +6126,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) ZEPHIR_CPY_WRT(&sqlColumn, &_15$$10); if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_16$$15, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3263); + zephir_array_fetch_string(&_16$$15, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3265); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_16$$15, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3266); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3268); RETURN_CTOR(&sqlColumns); } if (ZEPHIR_IS_LONG(&columnType, 354)) { @@ -6122,8 +6138,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) add_assoc_stringl_ex(&_17$$16, SL("type"), SL("scalar")); ZEPHIR_CPY_WRT(&sqlColumn, &_17$$16); ZEPHIR_OBS_VAR(&columnData); - zephir_array_fetch_string(&columnData, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3280); - ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "getexpression", NULL, 0, &columnData); + zephir_array_fetch_string(&columnData, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3282); + ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "getexpression", NULL, 455, &columnData); zephir_check_call_status(); ZEPHIR_OBS_VAR(&balias); if (zephir_array_isset_string_fetch(&balias, &sqlExprColumn, SL("balias"), 0)) { @@ -6132,20 +6148,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSelectColumn) } if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_18$$18, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3293); + zephir_array_fetch_string(&_18$$18, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3295); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_18$$18, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&sqlColumn, SL("column"), &sqlExprColumn, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3297); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3299); RETURN_CTOR(&sqlColumns); } ZEPHIR_INIT_VAR(&_19); object_init_ex(&_19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_20); ZEPHIR_CONCAT_SV(&_20, "Unknown type of column ", &columnType); - ZEPHIR_CALL_METHOD(NULL, &_19, "__construct", NULL, 31, &_20); + ZEPHIR_CALL_METHOD(NULL, &_19, "__construct", NULL, 29, &_20); zephir_check_call_status(); - zephir_throw_exception_debug(&_19, "phalcon/Mvc/Model/Query.zep", 3302); + zephir_throw_exception_debug(&_19, "phalcon/Mvc/Model/Query.zep", 3304); ZEPHIR_MM_RESTORE(); return; } @@ -6244,7 +6260,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_3$$3, SL("type"), 355); zephir_array_update_string(&_3$$3, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_3$$3, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 0, &_3$$3); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 456, &_3$$3); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("left"), &_2$$3, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_VAR(&_4$$3); @@ -6252,7 +6268,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_4$$3, SL("type"), SL("qualified")); zephir_array_update_string(&_4$$3, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$3, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 0, &_4$$3); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getqualified", NULL, 456, &_4$$3); zephir_check_call_status(); zephir_array_update_string(&_1$$3, SL("right"), &_2$$3, PH_COPY | PH_SEPARATE); zephir_array_fast_append(&_0$$3, &_1$$3); @@ -6260,7 +6276,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) } else { ZEPHIR_INIT_VAR(&sqlJoinPartialConditions); array_init(&sqlJoinPartialConditions); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3392); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3394); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _7$$4, _8$$4, _5$$4) { @@ -6279,9 +6295,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) zephir_read_property(&_10$$6, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_11$$6); ZEPHIR_CONCAT_SVSVSV(&_11$$6, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_10$$6); - ZEPHIR_CALL_METHOD(NULL, &_9$$6, "__construct", &_12, 31, &_11$$6); + ZEPHIR_CALL_METHOD(NULL, &_9$$6, "__construct", &_12, 29, &_11$$6); zephir_check_call_status(); - zephir_throw_exception_debug(&_9$$6, "phalcon/Mvc/Model/Query.zep", 3364); + zephir_throw_exception_debug(&_9$$6, "phalcon/Mvc/Model/Query.zep", 3366); ZEPHIR_MM_RESTORE(); return; } @@ -6294,7 +6310,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_15$$5, SL("type"), 355); zephir_array_update_string(&_15$$5, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$5, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 0, &_15$$5); + ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 456, &_15$$5); zephir_check_call_status(); zephir_array_update_string(&_13$$5, SL("left"), &_14$$5, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_16$$5); @@ -6302,10 +6318,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_16$$5, SL("type"), SL("qualified")); zephir_array_update_string(&_16$$5, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$5, SL("name"), &referencedField, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 0, &_16$$5); + ZEPHIR_CALL_METHOD(&_14$$5, this_ptr, "getqualified", NULL, 456, &_16$$5); zephir_check_call_status(); zephir_array_update_string(&_13$$5, SL("right"), &_14$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoinPartialConditions, &_13$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3389); + zephir_array_append(&sqlJoinPartialConditions, &_13$$5, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3391); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0); @@ -6327,9 +6343,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) zephir_read_property(&_18$$8, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_19$$8); ZEPHIR_CONCAT_SVSVSV(&_19$$8, "The number of fields must be equal to the number of referenced fields in join ", &modelAlias, "-", &joinAlias, ", when preparing: ", &_18$$8); - ZEPHIR_CALL_METHOD(NULL, &_17$$8, "__construct", &_12, 31, &_19$$8); + ZEPHIR_CALL_METHOD(NULL, &_17$$8, "__construct", &_12, 29, &_19$$8); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$8, "phalcon/Mvc/Model/Query.zep", 3364); + zephir_throw_exception_debug(&_17$$8, "phalcon/Mvc/Model/Query.zep", 3366); ZEPHIR_MM_RESTORE(); return; } @@ -6342,7 +6358,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_long_ex(&_22$$7, SL("type"), 355); zephir_array_update_string(&_22$$7, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$7, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 0, &_22$$7); + ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 456, &_22$$7); zephir_check_call_status(); zephir_array_update_string(&_20$$7, SL("left"), &_21$$7, PH_COPY | PH_SEPARATE); ZEPHIR_INIT_NVAR(&_23$$7); @@ -6350,10 +6366,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleJoin) add_assoc_stringl_ex(&_23$$7, SL("type"), SL("qualified")); zephir_array_update_string(&_23$$7, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_23$$7, SL("name"), &referencedField, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 0, &_23$$7); + ZEPHIR_CALL_METHOD(&_21$$7, this_ptr, "getqualified", NULL, 456, &_23$$7); zephir_check_call_status(); zephir_array_update_string(&_20$$7, SL("right"), &_21$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoinPartialConditions, &_20$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3389); + zephir_array_append(&sqlJoinPartialConditions, &_20$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3391); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); } @@ -6403,7 +6419,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getTable) ZEPHIR_OBS_VAR(&modelName); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&modelName, &qualifiedName, SL("name"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3414); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3416); return; } ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &modelName); @@ -6491,7 +6507,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getWriteConnection) ZEPHIR_CALL_METHOD(&connection, model, "selectwriteconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); if (UNEXPECTED(Z_TYPE_P(&connection) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectWriteConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3452); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectWriteConnection did not return a connection", "phalcon/Mvc/Model/Query.zep", 3454); return; } RETURN_CCTOR(&connection); @@ -6553,12 +6569,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_CPY_WRT(&ast, &_0); ZEPHIR_OBS_VAR(&delete); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&delete, &ast, SL("delete"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3474); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3476); return; } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &delete, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3478); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/Mvc/Model/Query.zep", 3480); return; } ZEPHIR_INIT_VAR(&models); @@ -6582,16 +6598,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); - zephir_is_iterable(&deleteTables, 0, "phalcon/Mvc/Model/Query.zep", 3538); + zephir_is_iterable(&deleteTables, 0, "phalcon/Mvc/Model/Query.zep", 3540); if (Z_TYPE_P(&deleteTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&deleteTables), _1) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _1); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3502); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3504); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3503); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3505); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_3, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -6615,17 +6631,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3520); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3521); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3522); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3523); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3527); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3529); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3531); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3533); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -6640,9 +6656,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_CALL_METHOD(&table, &deleteTables, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3502); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3504); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3503); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3505); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -6665,17 +6681,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3520); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3521); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3522); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3523); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3527); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3529); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3531); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3533); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &deleteTables, "next", NULL, 0); zephir_check_call_status(); @@ -6693,13 +6709,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { ZVAL_BOOL(&_10$$17, 1); - ZEPHIR_CALL_METHOD(&_9$$17, this_ptr, "getexpression", NULL, 0, &where, &_10$$17); + ZEPHIR_CALL_METHOD(&_9$$17, this_ptr, "getexpression", NULL, 455, &where, &_10$$17); zephir_check_call_status(); zephir_array_update_string(&sqlDelete, SL("where"), &_9$$17, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_11$$18, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_11$$18, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlDelete, SL("limit"), &_11$$18, PH_COPY | PH_SEPARATE); } @@ -6763,23 +6779,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_0, this_ptr, ZEND_STRL("ast"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&ast, &_0); if (UNEXPECTED(!(zephir_array_isset_string(&ast, SL("qualifiedName"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3572); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3574); return; } if (UNEXPECTED(!(zephir_array_isset_string(&ast, SL("values"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3576); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3578); return; } ZEPHIR_OBS_VAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &ast, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3579); + zephir_array_fetch_string(&qualifiedName, &ast, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3581); if (UNEXPECTED(!(zephir_array_isset_string(&qualifiedName, SL("name"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3583); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/Mvc/Model/Query.zep", 3585); return; } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); ZEPHIR_OBS_VAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3587); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3589); ZEPHIR_CALL_METHOD(&model, &manager, "load", NULL, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -6796,8 +6812,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) notQuoting = 0; ZEPHIR_INIT_VAR(&exprValues); array_init(&exprValues); - zephir_array_fetch_string(&_2, &ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3600); - zephir_is_iterable(&_2, 0, "phalcon/Mvc/Model/Query.zep", 3608); + zephir_array_fetch_string(&_2, &ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3602); + zephir_is_iterable(&_2, 0, "phalcon/Mvc/Model/Query.zep", 3610); if (Z_TYPE_P(&_2) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_2), _3) { @@ -6806,17 +6822,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_INIT_NVAR(&_5$$7); zephir_create_array(&_5$$7, 2, 0); ZEPHIR_OBS_NVAR(&_6$$7); - zephir_array_fetch_string(&_6$$7, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3603); + zephir_array_fetch_string(&_6$$7, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3605); zephir_array_update_string(&_5$$7, SL("type"), &_6$$7, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_8$$7, 1); } else { ZVAL_BOOL(&_8$$7, 0); } - ZEPHIR_CALL_METHOD(&_7$$7, this_ptr, "getexpression", &_9, 0, &exprValue, &_8$$7); + ZEPHIR_CALL_METHOD(&_7$$7, this_ptr, "getexpression", &_9, 455, &exprValue, &_8$$7); zephir_check_call_status(); zephir_array_update_string(&_5$$7, SL("value"), &_7$$7, PH_COPY | PH_SEPARATE); - zephir_array_append(&exprValues, &_5$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3605); + zephir_array_append(&exprValues, &_5$$7, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3607); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &_2, "rewind", NULL, 0); @@ -6832,17 +6848,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_INIT_NVAR(&_10$$8); zephir_create_array(&_10$$8, 2, 0); ZEPHIR_OBS_NVAR(&_11$$8); - zephir_array_fetch_string(&_11$$8, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3603); + zephir_array_fetch_string(&_11$$8, &exprValue, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3605); zephir_array_update_string(&_10$$8, SL("type"), &_11$$8, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_13$$8, 1); } else { ZVAL_BOOL(&_13$$8, 0); } - ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "getexpression", &_9, 0, &exprValue, &_13$$8); + ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "getexpression", &_9, 455, &exprValue, &_13$$8); zephir_check_call_status(); zephir_array_update_string(&_10$$8, SL("value"), &_12$$8, PH_COPY | PH_SEPARATE); - zephir_array_append(&exprValues, &_10$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3605); + zephir_array_append(&exprValues, &_10$$8, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3607); ZEPHIR_CALL_METHOD(NULL, &_2, "next", NULL, 0); zephir_check_call_status(); } @@ -6858,14 +6874,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) if (zephir_array_isset_string_fetch(&fields, &ast, SL("fields"), 0)) { ZEPHIR_INIT_VAR(&sqlFields); array_init(&sqlFields); - zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3632); + zephir_is_iterable(&fields, 0, "phalcon/Mvc/Model/Query.zep", 3634); if (Z_TYPE_P(&fields) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _14$$9) { ZEPHIR_INIT_NVAR(&field); ZVAL_COPY(&field, _14$$9); ZEPHIR_OBS_NVAR(&name); - zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3619); + zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3621); ZEPHIR_CALL_METHOD(&_16$$10, &metaData, "hasattribute", &_17, 0, &model, &name); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_16$$10))) { @@ -6874,13 +6890,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_19$$11, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_20$$11); ZEPHIR_CONCAT_SVSVSV(&_20$$11, "The model '", &modelName, "' doesn't have the attribute '", &name, "', when preparing: ", &_19$$11); - ZEPHIR_CALL_METHOD(NULL, &_18$$11, "__construct", &_21, 31, &_20$$11); + ZEPHIR_CALL_METHOD(NULL, &_18$$11, "__construct", &_21, 29, &_20$$11); zephir_check_call_status(); - zephir_throw_exception_debug(&_18$$11, "phalcon/Mvc/Model/Query.zep", 3625); + zephir_throw_exception_debug(&_18$$11, "phalcon/Mvc/Model/Query.zep", 3627); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3629); + zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3631); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &fields, "rewind", NULL, 0); @@ -6894,7 +6910,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) ZEPHIR_CALL_METHOD(&field, &fields, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); - zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3619); + zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3621); ZEPHIR_CALL_METHOD(&_22$$12, &metaData, "hasattribute", &_23, 0, &model, &name); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_22$$12))) { @@ -6903,13 +6919,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) zephir_read_property(&_25$$13, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_26$$13); ZEPHIR_CONCAT_SVSVSV(&_26$$13, "The model '", &modelName, "' doesn't have the attribute '", &name, "', when preparing: ", &_25$$13); - ZEPHIR_CALL_METHOD(NULL, &_24$$13, "__construct", &_21, 31, &_26$$13); + ZEPHIR_CALL_METHOD(NULL, &_24$$13, "__construct", &_21, 29, &_26$$13); zephir_check_call_status(); - zephir_throw_exception_debug(&_24$$13, "phalcon/Mvc/Model/Query.zep", 3625); + zephir_throw_exception_debug(&_24$$13, "phalcon/Mvc/Model/Query.zep", 3627); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3629); + zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3631); ZEPHIR_CALL_METHOD(NULL, &fields, "next", NULL, 0); zephir_check_call_status(); } @@ -7115,12 +7131,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &select, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3668); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3670); return; } ZEPHIR_OBS_VAR(&columns); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&columns, &select, SL("columns"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3672); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/Mvc/Model/Query.zep", 3674); return; } RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("nestingLevel"))); @@ -7161,26 +7177,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_1, this_ptr, ZEND_STRL("metaData"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&metaData, &_1); if (UNEXPECTED(Z_TYPE_P(&manager) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A models-manager is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3739); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A models-manager is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3741); return; } if (UNEXPECTED(Z_TYPE_P(&metaData) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A meta-data is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3745); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A meta-data is required to execute the query", "phalcon/Mvc/Model/Query.zep", 3747); return; } number = 0; ZEPHIR_INIT_VAR(&automaticJoins); array_init(&automaticJoins); - zephir_is_iterable(&selectedModels, 0, "phalcon/Mvc/Model/Query.zep", 3875); + zephir_is_iterable(&selectedModels, 0, "phalcon/Mvc/Model/Query.zep", 3877); if (Z_TYPE_P(&selectedModels) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectedModels), _2) { ZEPHIR_INIT_NVAR(&selectedModel); ZVAL_COPY(&selectedModel, _2); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3753); + zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3755); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3754); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3756); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_4, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); @@ -7203,9 +7219,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_6$$17, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_7$$17); ZEPHIR_CONCAT_SVSV(&_7$$17, "Alias '", &alias, "' is used more than once, when preparing: ", &_6$$17); - ZEPHIR_CALL_METHOD(NULL, &_5$$17, "__construct", &_8, 31, &_7$$17); + ZEPHIR_CALL_METHOD(NULL, &_5$$17, "__construct", &_8, 29, &_7$$17); zephir_check_call_status(); - zephir_throw_exception_debug(&_5$$17, "phalcon/Mvc/Model/Query.zep", 3779); + zephir_throw_exception_debug(&_5$$17, "phalcon/Mvc/Model/Query.zep", 3781); ZEPHIR_MM_RESTORE(); return; } @@ -7214,7 +7230,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_zval(&sqlModelsAliases, &modelName, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&completeSource) == IS_ARRAY) { - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3791); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3793); } else { ZEPHIR_INIT_NVAR(&_9$$19); zephir_create_array(&_9$$19, 3, 0); @@ -7241,7 +7257,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } else { ZEPHIR_CPY_WRT(&withs, &with); } - zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3867); + zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3869); if (Z_TYPE_P(&withs) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&withs), _10$$21) { @@ -7253,7 +7269,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_13$$24, "AA", &_12$$24); ZEPHIR_CPY_WRT(&joinAlias, &_13$$24); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_14, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -7274,9 +7290,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_18$$27, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_19$$27); ZEPHIR_CONCAT_SVSVSV(&_19$$27, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_18$$27); - ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 31, &_19$$27); + ZEPHIR_CALL_METHOD(NULL, &_17$$27, "__construct", &_8, 29, &_19$$27); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_17$$27, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -7296,7 +7312,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_21$$24, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_21$$24, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_21$$24, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_21$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_21$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_22$$24); zephir_create_array(&_22$$24, 3, 0); add_assoc_long_ex(&_22$$24, SL("type"), 360); @@ -7310,7 +7326,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_23$$24, SL("type"), 355); zephir_array_update_string(&_23$$24, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_22$$24, SL("alias"), &_23$$24, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_22$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_22$$24, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; } ZEND_HASH_FOREACH_END(); } else { @@ -7330,7 +7346,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_25$$28, "AA", &_24$$28); ZEPHIR_CPY_WRT(&joinAlias, &_25$$28); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_26, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -7351,9 +7367,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_30$$31, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_31$$31); ZEPHIR_CONCAT_SVSVSV(&_31$$31, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_30$$31); - ZEPHIR_CALL_METHOD(NULL, &_29$$31, "__construct", &_8, 31, &_31$$31); + ZEPHIR_CALL_METHOD(NULL, &_29$$31, "__construct", &_8, 29, &_31$$31); zephir_check_call_status(); - zephir_throw_exception_debug(&_29$$31, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_29$$31, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -7373,7 +7389,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_33$$28, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_33$$28, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_33$$28, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_33$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_33$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_34$$28); zephir_create_array(&_34$$28, 3, 0); add_assoc_long_ex(&_34$$28, SL("type"), 360); @@ -7387,7 +7403,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_35$$28, SL("type"), 355); zephir_array_update_string(&_35$$28, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_34$$28, SL("alias"), &_35$$28, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_34$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_34$$28, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; ZEPHIR_CALL_METHOD(NULL, &withs, "next", NULL, 0); zephir_check_call_status(); @@ -7395,8 +7411,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_INIT_NVAR(&withItem); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3869); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3870); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3871); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3872); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -7411,9 +7427,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CALL_METHOD(&selectedModel, &selectedModels, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3753); + zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3755); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3754); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3756); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_36, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); @@ -7437,9 +7453,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_39$$36, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_40$$36); ZEPHIR_CONCAT_SVSV(&_40$$36, "Alias '", &alias, "' is used more than once, when preparing: ", &_39$$36); - ZEPHIR_CALL_METHOD(NULL, &_38$$36, "__construct", &_8, 31, &_40$$36); + ZEPHIR_CALL_METHOD(NULL, &_38$$36, "__construct", &_8, 29, &_40$$36); zephir_check_call_status(); - zephir_throw_exception_debug(&_38$$36, "phalcon/Mvc/Model/Query.zep", 3779); + zephir_throw_exception_debug(&_38$$36, "phalcon/Mvc/Model/Query.zep", 3781); ZEPHIR_MM_RESTORE(); return; } @@ -7448,7 +7464,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_zval(&sqlModelsAliases, &modelName, &alias, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(&completeSource) == IS_ARRAY) { - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3791); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3793); } else { ZEPHIR_INIT_NVAR(&_41$$38); zephir_create_array(&_41$$38, 3, 0); @@ -7476,7 +7492,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } else { ZEPHIR_CPY_WRT(&withs, &with); } - zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3867); + zephir_is_iterable(&withs, 0, "phalcon/Mvc/Model/Query.zep", 3869); if (Z_TYPE_P(&withs) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&withs), _43$$40) { @@ -7488,7 +7504,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_46$$43, "AA", &_45$$43); ZEPHIR_CPY_WRT(&joinAlias, &_46$$43); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_47, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -7509,9 +7525,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_51$$46, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_52$$46); ZEPHIR_CONCAT_SVSVSV(&_52$$46, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_51$$46); - ZEPHIR_CALL_METHOD(NULL, &_50$$46, "__construct", &_8, 31, &_52$$46); + ZEPHIR_CALL_METHOD(NULL, &_50$$46, "__construct", &_8, 29, &_52$$46); zephir_check_call_status(); - zephir_throw_exception_debug(&_50$$46, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_50$$46, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -7531,7 +7547,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_54$$43, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_54$$43, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_54$$43, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_54$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_54$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_55$$43); zephir_create_array(&_55$$43, 3, 0); add_assoc_long_ex(&_55$$43, SL("type"), 360); @@ -7545,7 +7561,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_56$$43, SL("type"), 355); zephir_array_update_string(&_56$$43, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_55$$43, SL("alias"), &_56$$43, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_55$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_55$$43, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; } ZEND_HASH_FOREACH_END(); } else { @@ -7565,7 +7581,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_58$$47, "AA", &_57$$47); ZEPHIR_CPY_WRT(&joinAlias, &_58$$47); ZEPHIR_OBS_NVAR(&relationModel); - zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3817); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 3819); ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_59, 0, &modelName, &relationModel); zephir_check_call_status(); if (Z_TYPE_P(&relation) == IS_OBJECT) { @@ -7586,9 +7602,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_read_property(&_63$$50, this_ptr, ZEND_STRL("phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&_64$$50); ZEPHIR_CONCAT_SVSVSV(&_64$$50, "Can't find a relationship between '", &modelName, "' and '", &relationModel, "' when preparing: ", &_63$$50); - ZEPHIR_CALL_METHOD(NULL, &_62$$50, "__construct", &_8, 31, &_64$$50); + ZEPHIR_CALL_METHOD(NULL, &_62$$50, "__construct", &_8, 29, &_64$$50); zephir_check_call_status(); - zephir_throw_exception_debug(&_62$$50, "phalcon/Mvc/Model/Query.zep", 3837); + zephir_throw_exception_debug(&_62$$50, "phalcon/Mvc/Model/Query.zep", 3839); ZEPHIR_MM_RESTORE(); return; } @@ -7608,7 +7624,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_array_update_string(&_66$$47, SL("eager"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_66$$47, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_66$$47, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, &_66$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3851); + zephir_array_append(&selectColumns, &_66$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3853); ZEPHIR_INIT_NVAR(&_67$$47); zephir_create_array(&_67$$47, 3, 0); add_assoc_long_ex(&_67$$47, SL("type"), 360); @@ -7622,7 +7638,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) add_assoc_long_ex(&_68$$47, SL("type"), 355); zephir_array_update_string(&_68$$47, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_67$$47, SL("alias"), &_68$$47, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, &_67$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3863); + zephir_array_append(&automaticJoins, &_67$$47, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3865); number++; ZEPHIR_CALL_METHOD(NULL, &withs, "next", NULL, 0); zephir_check_call_status(); @@ -7630,8 +7646,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_INIT_NVAR(&withItem); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3869); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3870); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3871); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3872); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &selectedModels, "next", NULL, 0); zephir_check_call_status(); @@ -7692,16 +7708,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) zephir_fast_array_merge(&_81$$55, &joins, &automaticJoins); zephir_array_update_string(&select, SL("joins"), &_81$$55, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&automaticJoins, &joins, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3906); + zephir_array_append(&automaticJoins, &joins, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3908); zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 0, &select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 470, &select); zephir_check_call_status(); } else { if (zephir_fast_count_int(&automaticJoins)) { zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 0, &select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "getjoins", NULL, 470, &select); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&sqlJoins); @@ -7711,15 +7727,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) position = 0; ZEPHIR_INIT_VAR(&sqlColumnAliases); array_init(&sqlColumnAliases); - zephir_is_iterable(&selectColumns, 0, "phalcon/Mvc/Model/Query.zep", 3957); + zephir_is_iterable(&selectColumns, 0, "phalcon/Mvc/Model/Query.zep", 3959); if (Z_TYPE_P(&selectColumns) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectColumns), _82) { ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _82); - ZEPHIR_CALL_METHOD(&_84$$60, this_ptr, "getselectcolumn", &_85, 0, &column); + ZEPHIR_CALL_METHOD(&_84$$60, this_ptr, "getselectcolumn", &_85, 471, &column); zephir_check_call_status(); - zephir_is_iterable(&_84$$60, 0, "phalcon/Mvc/Model/Query.zep", 3955); + zephir_is_iterable(&_84$$60, 0, "phalcon/Mvc/Model/Query.zep", 3957); if (Z_TYPE_P(&_84$$60) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_84$$60), _86$$60) { @@ -7736,7 +7752,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_88$$65, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_88$$65, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_88$$65, "scalar")) { ZEPHIR_INIT_NVAR(&_89$$66); ZVAL_LONG(&_89$$66, position); @@ -7744,7 +7760,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_90$$66, "_", &_89$$66); zephir_array_update_zval(&sqlColumns, &_90$$66, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -7772,7 +7788,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_91$$72, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_91$$72, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_91$$72, "scalar")) { ZEPHIR_INIT_NVAR(&_92$$73); ZVAL_LONG(&_92$$73, position); @@ -7780,7 +7796,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_93$$73, "_", &_92$$73); zephir_array_update_zval(&sqlColumns, &_93$$73, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -7802,9 +7818,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_CALL_METHOD(&column, &selectColumns, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_94$$75, this_ptr, "getselectcolumn", &_85, 0, &column); + ZEPHIR_CALL_METHOD(&_94$$75, this_ptr, "getselectcolumn", &_85, 471, &column); zephir_check_call_status(); - zephir_is_iterable(&_94$$75, 0, "phalcon/Mvc/Model/Query.zep", 3955); + zephir_is_iterable(&_94$$75, 0, "phalcon/Mvc/Model/Query.zep", 3957); if (Z_TYPE_P(&_94$$75) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_94$$75), _95$$75) { @@ -7821,7 +7837,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_97$$80, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_97$$80, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_97$$80, "scalar")) { ZEPHIR_INIT_NVAR(&_98$$81); ZVAL_LONG(&_98$$81, position); @@ -7829,7 +7845,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_99$$81, "_", &_98$$81); zephir_array_update_zval(&sqlColumns, &_99$$81, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -7857,7 +7873,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_100$$87, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3945); + zephir_array_fetch_string(&_100$$87, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 3947); if (ZEPHIR_IS_STRING(&_100$$87, "scalar")) { ZEPHIR_INIT_NVAR(&_101$$88); ZVAL_LONG(&_101$$88, position); @@ -7865,7 +7881,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) ZEPHIR_CONCAT_SV(&_102$$88, "_", &_101$$88); zephir_array_update_zval(&sqlColumns, &_102$$88, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3948); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 3950); } } } @@ -7897,31 +7913,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) } ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, ast, SL("where"), 0)) { - ZEPHIR_CALL_METHOD(&_104$$92, this_ptr, "getexpression", NULL, 0, &where); + ZEPHIR_CALL_METHOD(&_104$$92, this_ptr, "getexpression", NULL, 455, &where); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("where"), &_104$$92, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&groupBy); if (zephir_array_isset_string_fetch(&groupBy, ast, SL("groupBy"), 0)) { - ZEPHIR_CALL_METHOD(&_105$$93, this_ptr, "getgroupclause", NULL, 0, &groupBy); + ZEPHIR_CALL_METHOD(&_105$$93, this_ptr, "getgroupclause", NULL, 472, &groupBy); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("group"), &_105$$93, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&having); if (zephir_array_isset_string_fetch(&having, ast, SL("having"), 0)) { - ZEPHIR_CALL_METHOD(&_106$$94, this_ptr, "getexpression", NULL, 0, &having); + ZEPHIR_CALL_METHOD(&_106$$94, this_ptr, "getexpression", NULL, 455, &having); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("having"), &_106$$94, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&order); if (zephir_array_isset_string_fetch(&order, ast, SL("orderBy"), 0)) { - ZEPHIR_CALL_METHOD(&_107$$95, this_ptr, "getorderclause", NULL, 0, &order); + ZEPHIR_CALL_METHOD(&_107$$95, this_ptr, "getorderclause", NULL, 473, &order); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("order"), &_107$$95, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_108$$96, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_108$$96, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlSelect, SL("limit"), &_108$$96, PH_COPY | PH_SEPARATE); } @@ -8015,17 +8031,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CPY_WRT(&ast, &_0); ZEPHIR_OBS_VAR(&update); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&update, &ast, SL("update"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4034); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4036); return; } ZEPHIR_OBS_VAR(&tables); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&tables, &update, SL("tables"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4038); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4040); return; } ZEPHIR_OBS_VAR(&values); if (UNEXPECTED(!(zephir_array_isset_string_fetch(&values, &update, SL("values"), 0)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4042); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/Mvc/Model/Query.zep", 4044); return; } ZEPHIR_INIT_VAR(&models); @@ -8049,16 +8065,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) } zephir_read_property(&_0, this_ptr, ZEND_STRL("manager"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&manager, &_0); - zephir_is_iterable(&updateTables, 0, "phalcon/Mvc/Model/Query.zep", 4108); + zephir_is_iterable(&updateTables, 0, "phalcon/Mvc/Model/Query.zep", 4110); if (Z_TYPE_P(&updateTables) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateTables), _1) { ZEPHIR_INIT_NVAR(&table); ZVAL_COPY(&table, _1); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4066); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4068); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4067); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4069); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_3, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -8082,17 +8098,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4090); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4091); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4092); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4093); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4097); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4099); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4101); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4103); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -8107,9 +8123,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CALL_METHOD(&table, &updateTables, "current", NULL, 0); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&qualifiedName); - zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4066); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4068); ZEPHIR_OBS_NVAR(&modelName); - zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4067); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4069); ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &modelName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); @@ -8132,17 +8148,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_NVAR(&alias); if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4090); - zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4091); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4092); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4093); zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&models, &alias, &modelName, PH_COPY | PH_SEPARATE); } else { zephir_array_update_zval(&sqlAliases, &modelName, &source, PH_COPY | PH_SEPARATE); zephir_array_update_zval(&sqlAliasesModelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4097); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4099); zephir_array_update_zval(&models, &modelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4101); + zephir_array_append(&sqlModels, &modelName, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4103); zephir_array_update_zval(&modelsInstances, &modelName, &model, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &updateTables, "next", NULL, 0); zephir_check_call_status(); @@ -8165,37 +8181,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_CPY_WRT(&updateValues, &values); } notQuoting = 0; - zephir_is_iterable(&updateValues, 0, "phalcon/Mvc/Model/Query.zep", 4132); + zephir_is_iterable(&updateValues, 0, "phalcon/Mvc/Model/Query.zep", 4134); if (Z_TYPE_P(&updateValues) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateValues), _9) { ZEPHIR_INIT_NVAR(&updateValue); ZVAL_COPY(&updateValue, _9); - zephir_array_fetch_string(&_12$$20, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_fetch_string(&_12$$20, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4126); if (notQuoting) { ZVAL_BOOL(&_13$$20, 1); } else { ZVAL_BOOL(&_13$$20, 0); } - ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "getexpression", &_14, 0, &_12$$20, &_13$$20); + ZEPHIR_CALL_METHOD(&_11$$20, this_ptr, "getexpression", &_14, 455, &_12$$20, &_13$$20); zephir_check_call_status(); - zephir_array_append(&sqlFields, &_11$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_append(&sqlFields, &_11$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4126); ZEPHIR_OBS_NVAR(&exprColumn); - zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4125); + zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); ZEPHIR_INIT_NVAR(&_15$$20); zephir_create_array(&_15$$20, 2, 0); ZEPHIR_OBS_NVAR(&_16$$20); - zephir_array_fetch_string(&_16$$20, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); + zephir_array_fetch_string(&_16$$20, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4129); zephir_array_update_string(&_15$$20, SL("type"), &_16$$20, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_18$$20, 1); } else { ZVAL_BOOL(&_18$$20, 0); } - ZEPHIR_CALL_METHOD(&_17$$20, this_ptr, "getexpression", &_14, 0, &exprColumn, &_18$$20); + ZEPHIR_CALL_METHOD(&_17$$20, this_ptr, "getexpression", &_14, 455, &exprColumn, &_18$$20); zephir_check_call_status(); zephir_array_update_string(&_15$$20, SL("value"), &_17$$20, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlValues, &_15$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4129); + zephir_array_append(&sqlValues, &_15$$20, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4131); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &updateValues, "rewind", NULL, 0); @@ -8208,31 +8224,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) } ZEPHIR_CALL_METHOD(&updateValue, &updateValues, "current", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_20$$21, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_fetch_string(&_20$$21, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query.zep", 4126); if (notQuoting) { ZVAL_BOOL(&_21$$21, 1); } else { ZVAL_BOOL(&_21$$21, 0); } - ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "getexpression", &_14, 0, &_20$$21, &_21$$21); + ZEPHIR_CALL_METHOD(&_19$$21, this_ptr, "getexpression", &_14, 455, &_20$$21, &_21$$21); zephir_check_call_status(); - zephir_array_append(&sqlFields, &_19$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4124); + zephir_array_append(&sqlFields, &_19$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4126); ZEPHIR_OBS_NVAR(&exprColumn); - zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4125); + zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); ZEPHIR_INIT_NVAR(&_22$$21); zephir_create_array(&_22$$21, 2, 0); ZEPHIR_OBS_NVAR(&_23$$21); - zephir_array_fetch_string(&_23$$21, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4127); + zephir_array_fetch_string(&_23$$21, &exprColumn, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Query.zep", 4129); zephir_array_update_string(&_22$$21, SL("type"), &_23$$21, PH_COPY | PH_SEPARATE); if (notQuoting) { ZVAL_BOOL(&_25$$21, 1); } else { ZVAL_BOOL(&_25$$21, 0); } - ZEPHIR_CALL_METHOD(&_24$$21, this_ptr, "getexpression", &_14, 0, &exprColumn, &_25$$21); + ZEPHIR_CALL_METHOD(&_24$$21, this_ptr, "getexpression", &_14, 455, &exprColumn, &_25$$21); zephir_check_call_status(); zephir_array_update_string(&_22$$21, SL("value"), &_24$$21, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlValues, &_22$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4129); + zephir_array_append(&sqlValues, &_22$$21, PH_SEPARATE, "phalcon/Mvc/Model/Query.zep", 4131); ZEPHIR_CALL_METHOD(NULL, &updateValues, "next", NULL, 0); zephir_check_call_status(); } @@ -8247,13 +8263,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) ZEPHIR_OBS_VAR(&where); if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { ZVAL_BOOL(&_27$$22, 1); - ZEPHIR_CALL_METHOD(&_26$$22, this_ptr, "getexpression", &_14, 0, &where, &_27$$22); + ZEPHIR_CALL_METHOD(&_26$$22, this_ptr, "getexpression", &_14, 455, &where, &_27$$22); zephir_check_call_status(); zephir_array_update_string(&sqlUpdate, SL("where"), &_26$$22, PH_COPY | PH_SEPARATE); } ZEPHIR_OBS_VAR(&limit); if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { - ZEPHIR_CALL_METHOD(&_28$$23, this_ptr, "getlimitclause", NULL, 0, &limit); + ZEPHIR_CALL_METHOD(&_28$$23, this_ptr, "getlimitclause", NULL, 469, &limit); zephir_check_call_status(); zephir_array_update_string(&sqlUpdate, SL("limit"), &_28$$23, PH_COPY | PH_SEPARATE); } diff --git a/ext/phalcon/mvc/model/query/builder.zep.c b/ext/phalcon/mvc/model/query/builder.zep.c index 9249b0d2545..ae7c2e30b52 100644 --- a/ext/phalcon/mvc/model/query/builder.zep.c +++ b/ext/phalcon/mvc/model/query/builder.zep.c @@ -1082,7 +1082,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getModels) } if (_1) { ZEPHIR_MAKE_REF(&models); - ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 0, &models); + ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 474, &models); ZEPHIR_UNREF(&models); zephir_check_call_status(); RETURN_MM(); @@ -1319,7 +1319,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) object_init_ex(&_4$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_5$$17); ZEPHIR_CONCAT_SVS(&_5$$17, "Column '", &firstPrimaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_4$$17, "__construct", NULL, 31, &_5$$17); + ZEPHIR_CALL_METHOD(NULL, &_4$$17, "__construct", NULL, 29, &_5$$17); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$17, "phalcon/Mvc/Model/Query/Builder.zep", 739); ZEPHIR_MM_RESTORE(); @@ -1333,9 +1333,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CONCAT_SVS(&_6$$19, "'", &conditions, "'"); ZEPHIR_CPY_WRT(&conditions, &_6$$19); } - ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$13, this_ptr, "autoescape", NULL, 0, &attributeField); + ZEPHIR_CALL_METHOD(&_8$$13, this_ptr, "autoescape", NULL, 475, &attributeField); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$13); ZEPHIR_CONCAT_VSVSV(&_9$$13, &_7$$13, ".", &_8$$13, " = ", &conditions); @@ -1382,7 +1382,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (Z_TYPE_P(&columnAlias) == IS_LONG) { zephir_array_append(&selectedColumns, &column, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 793); } else { - ZEPHIR_CALL_METHOD(&_14$$29, this_ptr, "autoescape", NULL, 0, &columnAlias); + ZEPHIR_CALL_METHOD(&_14$$29, this_ptr, "autoescape", NULL, 475, &columnAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_15$$29); ZEPHIR_CONCAT_VSV(&_15$$29, &column, " AS ", &_14$$29); @@ -1405,7 +1405,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (Z_TYPE_P(&columnAlias) == IS_LONG) { zephir_array_append(&selectedColumns, &column, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 793); } else { - ZEPHIR_CALL_METHOD(&_16$$32, this_ptr, "autoescape", NULL, 0, &columnAlias); + ZEPHIR_CALL_METHOD(&_16$$32, this_ptr, "autoescape", NULL, 475, &columnAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_17$$32); ZEPHIR_CONCAT_VSV(&_17$$32, &column, " AS ", &_16$$32); @@ -1441,11 +1441,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZVAL_COPY(&model, _19$$35); ZEPHIR_INIT_NVAR(&selectedColumn); if (Z_TYPE_P(&modelColumnAlias) == IS_LONG) { - ZEPHIR_CALL_METHOD(&_23$$37, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_23$$37, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_23$$37, ".*"); } else { - ZEPHIR_CALL_METHOD(&_24$$38, this_ptr, "autoescape", NULL, 0, &modelColumnAlias); + ZEPHIR_CALL_METHOD(&_24$$38, this_ptr, "autoescape", NULL, 475, &modelColumnAlias); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_24$$38, ".*"); } @@ -1466,11 +1466,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedColumn); if (Z_TYPE_P(&modelColumnAlias) == IS_LONG) { - ZEPHIR_CALL_METHOD(&_25$$40, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_25$$40, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_25$$40, ".*"); } else { - ZEPHIR_CALL_METHOD(&_26$$41, this_ptr, "autoescape", NULL, 0, &modelColumnAlias); + ZEPHIR_CALL_METHOD(&_26$$41, this_ptr, "autoescape", NULL, 475, &modelColumnAlias); zephir_check_call_status(); ZEPHIR_CONCAT_VS(&selectedColumn, &_26$$41, ".*"); } @@ -1485,7 +1485,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_fast_join_str(&_27$$35, SL(", "), &selectedColumns); zephir_concat_self(&phql, &_27$$35); } else { - ZEPHIR_CALL_METHOD(&_28$$42, this_ptr, "autoescape", NULL, 0, &models); + ZEPHIR_CALL_METHOD(&_28$$42, this_ptr, "autoescape", NULL, 475, &models); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_29$$42); ZEPHIR_CONCAT_VS(&_29$$42, &_28$$42, ".*"); @@ -1508,14 +1508,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&model); ZVAL_COPY(&model, _30$$43); if (Z_TYPE_P(&modelAlias) == IS_STRING) { - ZEPHIR_CALL_METHOD(&_34$$45, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_34$$45, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$45, this_ptr, "autoescape", NULL, 0, &modelAlias); + ZEPHIR_CALL_METHOD(&_35$$45, this_ptr, "autoescape", NULL, 475, &modelAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedModel); ZEPHIR_CONCAT_VSV(&selectedModel, &_34$$45, " AS ", &_35$$45); } else { - ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); } zephir_array_append(&selectedModels, &selectedModel, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 839); @@ -1534,14 +1534,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CALL_METHOD(&model, &models, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&modelAlias) == IS_STRING) { - ZEPHIR_CALL_METHOD(&_36$$48, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&_36$$48, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_37$$48, this_ptr, "autoescape", NULL, 0, &modelAlias); + ZEPHIR_CALL_METHOD(&_37$$48, this_ptr, "autoescape", NULL, 475, &modelAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&selectedModel); ZEPHIR_CONCAT_VSV(&selectedModel, &_36$$48, " AS ", &_37$$48); } else { - ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 0, &model); + ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 475, &model); zephir_check_call_status(); } zephir_array_append(&selectedModels, &selectedModel, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 839); @@ -1557,7 +1557,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_CONCAT_SV(&_39$$43, " FROM ", &_38$$43); zephir_concat_self(&phql, &_39$$43); } else { - ZEPHIR_CALL_METHOD(&_40$$50, this_ptr, "autoescape", NULL, 0, &models); + ZEPHIR_CALL_METHOD(&_40$$50, this_ptr, "autoescape", NULL, 475, &models); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_41$$50); ZEPHIR_CONCAT_SV(&_41$$50, " FROM ", &_40$$50); @@ -1581,20 +1581,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_OBS_NVAR(&joinType); zephir_array_fetch_long(&joinType, &join, 3, PH_NOISY, "phalcon/Mvc/Model/Query/Builder.zep", 872); if (zephir_is_true(&joinType)) { - ZEPHIR_CALL_METHOD(&_44$$53, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_44$$53, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_45$$53); ZEPHIR_CONCAT_SVSV(&_45$$53, " ", &joinType, " JOIN ", &_44$$53); zephir_concat_self(&phql, &_45$$53); } else { - ZEPHIR_CALL_METHOD(&_46$$54, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_46$$54, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_47$$54); ZEPHIR_CONCAT_SV(&_47$$54, " JOIN ", &_46$$54); zephir_concat_self(&phql, &_47$$54); } if (zephir_is_true(&joinAlias)) { - ZEPHIR_CALL_METHOD(&_48$$55, this_ptr, "autoescape", NULL, 0, &joinAlias); + ZEPHIR_CALL_METHOD(&_48$$55, this_ptr, "autoescape", NULL, 475, &joinAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_49$$55); ZEPHIR_CONCAT_SV(&_49$$55, " AS ", &_48$$55); @@ -1626,20 +1626,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_OBS_NVAR(&joinType); zephir_array_fetch_long(&joinType, &join, 3, PH_NOISY, "phalcon/Mvc/Model/Query/Builder.zep", 872); if (zephir_is_true(&joinType)) { - ZEPHIR_CALL_METHOD(&_51$$58, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_51$$58, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_52$$58); ZEPHIR_CONCAT_SVSV(&_52$$58, " ", &joinType, " JOIN ", &_51$$58); zephir_concat_self(&phql, &_52$$58); } else { - ZEPHIR_CALL_METHOD(&_53$$59, this_ptr, "autoescape", NULL, 0, &joinModel); + ZEPHIR_CALL_METHOD(&_53$$59, this_ptr, "autoescape", NULL, 475, &joinModel); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_54$$59); ZEPHIR_CONCAT_SV(&_54$$59, " JOIN ", &_53$$59); zephir_concat_self(&phql, &_54$$59); } if (zephir_is_true(&joinAlias)) { - ZEPHIR_CALL_METHOD(&_55$$60, this_ptr, "autoescape", NULL, 0, &joinAlias); + ZEPHIR_CALL_METHOD(&_55$$60, this_ptr, "autoescape", NULL, 475, &joinAlias); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_56$$60); ZEPHIR_CONCAT_SV(&_56$$60, " AS ", &_55$$60); @@ -1674,7 +1674,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) { ZEPHIR_INIT_NVAR(&groupItem); ZVAL_COPY(&groupItem, _59$$64); - ZEPHIR_CALL_METHOD(&_61$$65, this_ptr, "autoescape", NULL, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_61$$65, this_ptr, "autoescape", NULL, 475, &groupItem); zephir_check_call_status(); zephir_array_append(&groupItems, &_61$$65, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 914); } ZEND_HASH_FOREACH_END(); @@ -1689,7 +1689,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) } ZEPHIR_CALL_METHOD(&groupItem, &group, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_62$$66, this_ptr, "autoescape", NULL, 0, &groupItem); + ZEPHIR_CALL_METHOD(&_62$$66, this_ptr, "autoescape", NULL, 475, &groupItem); zephir_check_call_status(); zephir_array_append(&groupItems, &_62$$66, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 914); ZEPHIR_CALL_METHOD(NULL, &group, "next", NULL, 0); @@ -1732,7 +1732,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&itemExplode$$73); zephir_fast_explode_str(&itemExplode$$73, SL(" "), &orderItem, LONG_MAX); zephir_array_fetch_long(&_69$$73, &itemExplode$$73, 0, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); - ZEPHIR_CALL_METHOD(&_68$$73, this_ptr, "autoescape", NULL, 0, &_69$$73); + ZEPHIR_CALL_METHOD(&_68$$73, this_ptr, "autoescape", NULL, 475, &_69$$73); zephir_check_call_status(); zephir_array_fetch_long(&_70$$73, &itemExplode$$73, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); ZEPHIR_INIT_NVAR(&_71$$73); @@ -1740,7 +1740,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_array_append(&orderItems, &_71$$73, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 953); continue; } - ZEPHIR_CALL_METHOD(&_72$$71, this_ptr, "autoescape", NULL, 0, &orderItem); + ZEPHIR_CALL_METHOD(&_72$$71, this_ptr, "autoescape", NULL, 475, &orderItem); zephir_check_call_status(); zephir_array_append(&orderItems, &_72$$71, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 958); } ZEND_HASH_FOREACH_END(); @@ -1763,7 +1763,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) ZEPHIR_INIT_NVAR(&itemExplode$$76); zephir_fast_explode_str(&itemExplode$$76, SL(" "), &orderItem, LONG_MAX); zephir_array_fetch_long(&_74$$76, &itemExplode$$76, 0, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); - ZEPHIR_CALL_METHOD(&_73$$76, this_ptr, "autoescape", NULL, 0, &_74$$76); + ZEPHIR_CALL_METHOD(&_73$$76, this_ptr, "autoescape", NULL, 475, &_74$$76); zephir_check_call_status(); zephir_array_fetch_long(&_75$$76, &itemExplode$$76, 1, PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Query/Builder.zep", 953); ZEPHIR_INIT_NVAR(&_76$$76); @@ -1771,7 +1771,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) zephir_array_append(&orderItems, &_76$$76, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 953); continue; } - ZEPHIR_CALL_METHOD(&_77$$74, this_ptr, "autoescape", NULL, 0, &orderItem); + ZEPHIR_CALL_METHOD(&_77$$74, this_ptr, "autoescape", NULL, 475, &orderItem); zephir_check_call_status(); zephir_array_append(&orderItems, &_77$$74, PH_SEPARATE, "phalcon/Mvc/Model/Query/Builder.zep", 958); ZEPHIR_CALL_METHOD(NULL, &order, "next", NULL, 0); @@ -1821,7 +1821,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (zephir_is_numeric(&number)) { zephir_concat_self_str(&phql, SL(" LIMIT :APL0:")); ZVAL_LONG(&_82$$86, 10); - ZEPHIR_CALL_FUNCTION(&_83$$86, "intval", NULL, 51, &number, &_82$$86); + ZEPHIR_CALL_FUNCTION(&_83$$86, "intval", NULL, 38, &number, &_82$$86); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_84$$86); ZVAL_STRING(&_84$$86, "APL0"); @@ -1838,7 +1838,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) if (_87$$86) { zephir_concat_self_str(&phql, SL(" OFFSET :APL1:")); ZVAL_LONG(&_88$$87, 10); - ZEPHIR_CALL_FUNCTION(&_89$$87, "intval", NULL, 51, &offset, &_88$$87); + ZEPHIR_CALL_FUNCTION(&_89$$87, "intval", NULL, 38, &offset, &_88$$87); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_90$$87); ZVAL_STRING(&_90$$87, "APL1"); @@ -1887,7 +1887,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getQuery) ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 0); + ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 476); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("container"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&container, &_0); @@ -2495,7 +2495,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) ZVAL_LONG(&_0, limit); - ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 299, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 281, &_0); zephir_check_call_status(); limit = zephir_get_numberval(&_1); if (UNEXPECTED(limit == 0)) { @@ -2506,7 +2506,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) zephir_update_property_zval(this_ptr, ZEND_STRL("limit"), &_0); if (zephir_is_numeric(offset)) { ZVAL_LONG(&_2$$4, zephir_get_intval(offset)); - ZEPHIR_CALL_FUNCTION(&_3$$4, "abs", NULL, 299, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "abs", NULL, 281, &_2$$4); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("offset"), &_3$$4); } @@ -3351,9 +3351,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionBetween) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1571); ZEPHIR_MM_RESTORE(); @@ -3473,9 +3473,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionIn) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1619); ZEPHIR_MM_RESTORE(); @@ -3634,9 +3634,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionNotBetween) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1673); ZEPHIR_MM_RESTORE(); @@ -3756,9 +3756,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, conditionNotIn) object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "Operator % is not available."); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 140, &_2$$3, &operator); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 112, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_3$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Mvc/Model/Query/Builder.zep", 1720); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/resultset.zep.c b/ext/phalcon/mvc/model/resultset.zep.c index 1fa1c514719..c1bf9445778 100644 --- a/ext/phalcon/mvc/model/resultset.zep.c +++ b/ext/phalcon/mvc/model/resultset.zep.c @@ -19,6 +19,7 @@ #include "kernel/operators.h" #include "kernel/fcall.h" #include "kernel/exception.h" +#include "kernel/concat.h" #include "kernel/array.h" #include "Zend/zend_closures.h" @@ -142,16 +143,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset) /** * Phalcon\Mvc\Model\Resultset constructor * - * @param ResultInterface|false result - * @param CacheInterface|null cache + * @param ResultInterface|false $result + * @param mixed|null $cache */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) { - zend_bool _5; - zval _4; + zend_bool _11, _4$$4; + zval _10, _7$$5; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, prefetchRecords = 0; - zval *result, result_sub, *cache = NULL, cache_sub, __$null, rowCount, rows, _2, _0$$3, _1$$3, _3$$5, _6$$8; + zval *result, result_sub, *cache = NULL, cache_sub, __$null, rowCount, rows, _8, _0$$3, _1$$3, _2$$4, _3$$4, _5$$4, _6$$5, _9$$6, _12$$9; zval *this_ptr = getThis(); ZVAL_UNDEF(&result_sub); @@ -159,18 +160,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) ZVAL_NULL(&__$null); ZVAL_UNDEF(&rowCount); ZVAL_UNDEF(&rows); - ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_8); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$5); - ZVAL_UNDEF(&_6$$8); - ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_7$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(result) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) ZEND_PARSE_PARAMETERS_END(); #endif @@ -194,37 +200,60 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) } zephir_update_property_zval(this_ptr, ZEND_STRL("result"), result); if (Z_TYPE_P(cache) != IS_NULL) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Phalcon\\Cache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_3$$4, "is_a", NULL, 83, cache, &_2$$4); + zephir_check_call_status(); + _4$$4 = !ZEPHIR_IS_TRUE_IDENTICAL(&_3$$4); + if (_4$$4) { + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Psr\\SimpleCache\\CacheInterface"); + ZEPHIR_CALL_FUNCTION(&_5$$4, "is_a", NULL, 83, cache, &_2$$4); + zephir_check_call_status(); + _4$$4 = !ZEPHIR_IS_TRUE_IDENTICAL(&_5$$4); + } + if (UNEXPECTED(_4$$4)) { + ZEPHIR_INIT_VAR(&_6$$5); + object_init_ex(&_6$$5, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_7$$5); + ZEPHIR_CONCAT_SS(&_7$$5, "Cache service must be an object implementing ", "Phalcon\\Cache\\CacheInterface or Psr\\SimpleCache\\CacheInterface"); + ZEPHIR_CALL_METHOD(NULL, &_6$$5, "__construct", NULL, 29, &_7$$5); + zephir_check_call_status(); + zephir_throw_exception_debug(&_6$$5, "phalcon/Mvc/Model/Resultset.zep", 165); + ZEPHIR_MM_RESTORE(); + return; + } zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), cache); } - ZVAL_LONG(&_2, 2); - ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, &_2); + ZVAL_LONG(&_8, 2); + ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, &_8); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&rowCount, result, "numrows", NULL, 0); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &rowCount); if (ZEPHIR_IS_LONG(&rowCount, 0)) { - ZEPHIR_INIT_VAR(&_3$$5); - array_init(&_3$$5); - zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_3$$5); + ZEPHIR_INIT_VAR(&_9$$6); + array_init(&_9$$6); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_9$$6); RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(&_4); - ZEPHIR_INIT_NVAR(&_4); - ZVAL_STRING(&_4, "ZEPHIR_GLOBAL(orm).resultset_prefetch_records"); - prefetchRecords = zephir_get_intval_ex(&_4); - _5 = prefetchRecords > 0; - if (_5) { - _5 = ZEPHIR_LE_LONG(&rowCount, prefetchRecords); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_INIT_NVAR(&_10); + ZVAL_STRING(&_10, "ZEPHIR_GLOBAL(orm).resultset_prefetch_records"); + prefetchRecords = zephir_get_intval_ex(&_10); + _11 = prefetchRecords > 0; + if (_11) { + _11 = ZEPHIR_LE_LONG(&rowCount, prefetchRecords); } - if (_5) { + if (_11) { ZEPHIR_CALL_METHOD(&rows, result, "fetchall", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&rows) == IS_ARRAY) { zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &rows); } else { - ZEPHIR_INIT_VAR(&_6$$8); - array_init(&_6$$8); - zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_6$$8); + ZEPHIR_INIT_VAR(&_12$$9); + array_init(&_12$$9); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_12$$9); } } ZEPHIR_MM_RESTORE(); @@ -285,7 +314,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) ZVAL_NULL(&connection); result = 1; transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -297,7 +326,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) zephir_check_call_status(); if (transaction == 0) { if (UNEXPECTED(!((zephir_method_exists_ex(&record, ZEND_STRL("getwriteconnection")) == SUCCESS)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 228); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 239); return; } ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); @@ -384,7 +413,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -409,7 +438,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) zephir_check_call_status(); continue; } - zephir_array_append(&records, &processedRecord, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 322); + zephir_array_append(&records, &processedRecord, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 333); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); } @@ -471,7 +500,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) RETURN_MM_NULL(); } ZVAL_LONG(&_1, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_1); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -512,7 +541,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) RETURN_MM_NULL(); } ZVAL_LONG(&_0, (zephir_get_numberval(&count) - 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -599,7 +628,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, jsonSerialize) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -616,9 +645,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, jsonSerialize) if (_3$$3) { ZEPHIR_CALL_METHOD(&_4$$4, ¤t, "jsonserialize", NULL, 0); zephir_check_call_status(); - zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 447); + zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 458); } else { - zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 449); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset.zep", 460); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); @@ -667,7 +696,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, next) zephir_read_property(&_0, this_ptr, ZEND_STRL("pointer"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1, (zephir_get_numberval(&_0) + 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -679,7 +708,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index, index_sub, _0; + zval index_sub, _0; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -698,10 +728,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) zephir_read_property(&_0, this_ptr, ZEND_STRL("count"), PH_NOISY_CC | PH_READONLY); if (UNEXPECTED(ZEPHIR_GE(index, &_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the cursor", "phalcon/Mvc/Model/Resultset.zep", 487); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the cursor", "phalcon/Mvc/Model/Resultset.zep", 498); return; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, index); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, index); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -758,7 +788,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetSet) zephir_fetch_params_without_memory_grow(2, 0, &index, &value); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 514); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 525); return; } @@ -782,7 +812,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetUnset) zephir_fetch_params_without_memory_grow(1, 0, &offset); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 522); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Cursor is an immutable ArrayAccess object", "phalcon/Mvc/Model/Resultset.zep", 533); return; } @@ -802,7 +832,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, rewind) ZEPHIR_MM_GROW(); ZVAL_LONG(&_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 119, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 88, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } @@ -1009,7 +1039,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) ZEPHIR_INIT_VAR(&connection); ZVAL_NULL(&connection); transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -1021,7 +1051,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) zephir_check_call_status(); if (transaction == 0) { if (UNEXPECTED(!((zephir_method_exists_ex(&record, ZEND_STRL("getwriteconnection")) == SUCCESS)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 639); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/Mvc/Model/Resultset.zep", 650); return; } ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); diff --git a/ext/phalcon/mvc/model/resultset.zep.h b/ext/phalcon/mvc/model/resultset.zep.h index a470ea84a3b..25e514c9c8e 100644 --- a/ext/phalcon/mvc/model/resultset.zep.h +++ b/ext/phalcon/mvc/model/resultset.zep.h @@ -31,7 +31,7 @@ zend_object *zephir_init_properties_Phalcon_Mvc_Model_Resultset(zend_class_entry ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset___construct, 0, 0, 1) ZEND_ARG_INFO(0, result) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_count, 0, 0, IS_LONG, 0) @@ -45,7 +45,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_filt ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, Psr\\SimpleCache\\CacheInterface, 1) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, Phalcon\\Cache\\CacheInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_getfirst, 0, 0, 0) @@ -75,7 +75,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_next, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/resultset/complex.zep.c b/ext/phalcon/mvc/model/resultset/complex.zep.c index e3945721a8c..ce32a1dcf36 100644 --- a/ext/phalcon/mvc/model/resultset/complex.zep.c +++ b/ext/phalcon/mvc/model/resultset/complex.zep.c @@ -58,9 +58,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset_Complex) /** * Phalcon\Mvc\Model\Resultset\Complex constructor * - * @param array columnTypes - * @param ResultInterface|null result - * @param CacheInterface|null cache + * @param array $columnTypes + * @param ResultInterface|null $result + * @param mixed|null $cache */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct) { @@ -80,7 +80,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct) Z_PARAM_ZVAL(columnTypes) Z_PARAM_OPTIONAL Z_PARAM_OBJECT_OF_CLASS_OR_NULL(result, phalcon_db_resultinterface_ce) - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) ZEND_PARSE_PARAMETERS_END(); #endif @@ -210,7 +210,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) dirtyState = 0; zephir_read_property(&_1, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY); - zephir_is_iterable(&_1, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 267); + zephir_is_iterable(&_1, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 259); if (Z_TYPE_P(&_1) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1), _4, _5, _2) { @@ -223,21 +223,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_INIT_NVAR(&column); ZVAL_COPY(&column, _2); if (UNEXPECTED(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", 139); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 138); return; } ZEPHIR_OBS_NVAR(&type); - zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142); + zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 141); 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", 148); + zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 147); ZEPHIR_OBS_NVAR(&attributes); - zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); + zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148); ZEPHIR_OBS_NVAR(&columnMap); - zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150); + zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); ZEPHIR_INIT_NVAR(&rowModel); array_init(&rowModel); - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 167); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _6$$11) { @@ -246,7 +246,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_8$$12); ZEPHIR_CONCAT_SVSV(&_8$$12, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_8$$12, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_8$$12, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -263,7 +263,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_9$$13); ZEPHIR_CONCAT_SVSV(&_9$$13, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_9$$13, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_9$$13, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); @@ -279,22 +279,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } if (ZEPHIR_GLOBAL(orm).late_state_binding) { ZEPHIR_OBS_NVAR(&_10$$16); - zephir_array_fetch_string(&_10$$16, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178); + zephir_array_fetch_string(&_10$$16, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 175); if (zephir_instance_of_ev(&_10$$16, phalcon_mvc_model_ce)) { - zephir_array_fetch_string(&_11$$17, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179); + zephir_array_fetch_string(&_11$$17, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 176); ZEPHIR_INIT_NVAR(&modelName); zephir_get_class(&modelName, &_11$$17, 0); } else { ZEPHIR_INIT_NVAR(&modelName); ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - zephir_array_fetch_string(&_12$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185); + zephir_array_fetch_string(&_12$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 182); ZVAL_LONG(&_13$$16, dirtyState); _14$$16 = zephir_fetch_class(&modelName); ZEPHIR_CALL_CE_STATIC(&value, _14$$16, "cloneresultmap", NULL, 0, &_12$$16, &rowModel, &columnMap, &_13$$16, &keepSnapshots); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_16$$19, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199); + zephir_array_fetch_string(&_16$$19, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 194); ZVAL_LONG(&_17$$19, dirtyState); ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_16$$19, &rowModel, &columnMap, &_17$$19, &keepSnapshots); zephir_check_call_status(); @@ -307,12 +307,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } while(0); ZEPHIR_OBS_NVAR(&attribute); - zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223); + zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 218); } else { ZEPHIR_OBS_NVAR(&sqlAlias); if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231); + zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 224); } else { ZEPHIR_OBS_NVAR(&value); zephir_array_isset_fetch(&value, &row, &alias, 0); @@ -354,21 +354,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_CALL_METHOD(&column, &_1, "current", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(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", 139); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/Mvc/Model/Resultset/Complex.zep", 138); return; } ZEPHIR_OBS_NVAR(&type); - zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 142); + zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 141); 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", 148); + zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 147); ZEPHIR_OBS_NVAR(&attributes); - zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); + zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 148); ZEPHIR_OBS_NVAR(&columnMap); - zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 150); + zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 149); ZEPHIR_INIT_NVAR(&rowModel); array_init(&rowModel); - zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 168); + zephir_is_iterable(&attributes, 0, "phalcon/Mvc/Model/Resultset/Complex.zep", 167); if (Z_TYPE_P(&attributes) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _21$$31) { @@ -377,7 +377,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_23$$32); ZEPHIR_CONCAT_SVSV(&_23$$32, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_23$$32, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_23$$32, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); } ZEND_HASH_FOREACH_END(); } else { @@ -394,7 +394,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) ZEPHIR_OBS_NVAR(&columnValue); ZEPHIR_INIT_NVAR(&_24$$33); ZEPHIR_CONCAT_SVSV(&_24$$33, "_", &source, "_", &attribute); - zephir_array_fetch(&columnValue, &row, &_24$$33, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 161); + zephir_array_fetch(&columnValue, &row, &_24$$33, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 160); zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(NULL, &attributes, "next", NULL, 0); zephir_check_call_status(); @@ -410,22 +410,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } if (ZEPHIR_GLOBAL(orm).late_state_binding) { ZEPHIR_OBS_NVAR(&_25$$36); - zephir_array_fetch_string(&_25$$36, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 178); + zephir_array_fetch_string(&_25$$36, &column, SL("instance"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 175); if (zephir_instance_of_ev(&_25$$36, phalcon_mvc_model_ce)) { - zephir_array_fetch_string(&_26$$37, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 179); + zephir_array_fetch_string(&_26$$37, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 176); ZEPHIR_INIT_NVAR(&modelName); zephir_get_class(&modelName, &_26$$37, 0); } else { ZEPHIR_INIT_NVAR(&modelName); ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - zephir_array_fetch_string(&_27$$36, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 185); + zephir_array_fetch_string(&_27$$36, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 182); ZVAL_LONG(&_28$$36, dirtyState); _29$$36 = zephir_fetch_class(&modelName); ZEPHIR_CALL_CE_STATIC(&value, _29$$36, "cloneresultmap", NULL, 0, &_27$$36, &rowModel, &columnMap, &_28$$36, &keepSnapshots); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_30$$39, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 199); + zephir_array_fetch_string(&_30$$39, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 194); ZVAL_LONG(&_31$$39, dirtyState); ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_15, 0, &_30$$39, &rowModel, &columnMap, &_31$$39, &keepSnapshots); zephir_check_call_status(); @@ -438,12 +438,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) } while(0); ZEPHIR_OBS_NVAR(&attribute); - zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 223); + zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 218); } else { ZEPHIR_OBS_NVAR(&sqlAlias); if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { ZEPHIR_OBS_NVAR(&value); - zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 231); + zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/Mvc/Model/Resultset/Complex.zep", 224); } else { ZEPHIR_OBS_NVAR(&value); zephir_array_isset_fetch(&value, &row, &alias, 0); @@ -503,7 +503,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) ZEPHIR_INIT_VAR(&records); array_init(&records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 118); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 87); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); @@ -511,9 +511,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) if (!(zephir_is_true(&_0))) { break; } - ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 0); + ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 477); zephir_check_call_status(); - zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Complex.zep", 287); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Complex.zep", 279); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_3, 0); zephir_check_call_status(); } @@ -559,8 +559,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize) ZEPHIR_CPY_WRT(&hydrateMode, &_0); ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_1, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 316); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 307); return; } ZEPHIR_INIT_VAR(&_3); @@ -642,8 +642,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) } ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 361); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 351); return; } ZEPHIR_INIT_VAR(&_2); @@ -665,20 +665,138 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) zephir_check_call_status(); } if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 374); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 364); return; } - zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 377); + zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 367); zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_5); - zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 378); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 368); ZEPHIR_INIT_ZVAL_NREF(_7); ZVAL_LONG(&_7, zephir_fast_count_int(&_6)); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_7); - zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 379); + zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 369); zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_8); - zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 380); + zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 370); zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), &_9); - zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 381); + zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 371); + zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_10); + ZEPHIR_MM_RESTORE(); +} + +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __serialize) +{ + zval records, cache, columnTypes, hydrateMode, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&columnTypes); + ZVAL_UNDEF(&hydrateMode); + ZVAL_UNDEF(&_0); + + + ZEPHIR_MM_GROW(); + + ZEPHIR_CALL_METHOD(&records, this_ptr, "toarray", NULL, 0); + zephir_check_call_status(); + zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("columnTypes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&columnTypes, &_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&hydrateMode, &_0); + zephir_create_array(return_value, 4, 0); + zephir_array_update_string(return_value, SL("cache"), &cache, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("rows"), &records, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("columnTypes"), &columnTypes, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("hydrateMode"), &hydrateMode, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zephir_fcall_cache_entry *_0 = NULL; + zval *data_param = NULL, __$true, __$false, resultset, container, serializer, _1, _2, _5, _6, _7, _8, _9, _10, _3$$4, _4$$4; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&container); + ZVAL_UNDEF(&serializer); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + if (1) { + zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("disableHydration"), &__$false); + } + ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); + zephir_check_call_status(); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Complex.zep", 408); + return; + } + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "serializer"); + ZEPHIR_CALL_METHOD(&_1, &container, "has", NULL, 0, &_2); + zephir_check_call_status(); + if (zephir_is_true(&_1)) { + ZEPHIR_INIT_VAR(&_4$$4); + ZVAL_STRING(&_4$$4, "serializer"); + ZEPHIR_CALL_METHOD(&_3$$4, &container, "getshared", NULL, 0, &_4$$4); + zephir_check_call_status(); + ZEPHIR_CPY_WRT(&serializer, &_3$$4); + ZEPHIR_CALL_METHOD(NULL, &serializer, "unserialize", NULL, 0, &data); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&resultset, &serializer, "getdata", NULL, 0); + zephir_check_call_status(); + } else { + ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 16, &data); + zephir_check_call_status(); + } + if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Complex.zep", 421); + return; + } + zephir_array_fetch_string(&_5, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 424); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_5); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 425); + ZEPHIR_INIT_ZVAL_NREF(_7); + ZVAL_LONG(&_7, zephir_fast_count_int(&_6)); + zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_7); + zephir_array_fetch_string(&_8, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 426); + zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_8); + zephir_array_fetch_string(&_9, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 427); + zephir_update_property_zval(this_ptr, ZEND_STRL("columnTypes"), &_9); + zephir_array_fetch_string(&_10, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Complex.zep", 428); zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_10); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/mvc/model/resultset/complex.zep.h b/ext/phalcon/mvc/model/resultset/complex.zep.h index 1eaa8a13efb..6954f9507e5 100644 --- a/ext/phalcon/mvc/model/resultset/complex.zep.h +++ b/ext/phalcon/mvc/model/resultset/complex.zep.h @@ -8,14 +8,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize); +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __serialize); +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___construct, 0, 0, 1) ZEND_ARG_INFO(0, columnTypes) ZEND_ARG_OBJ_INFO(0, result, Phalcon\\Db\\ResultInterface, 1) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_current, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_toarray, 0, 0, IS_ARRAY, 0) @@ -29,15 +35,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_comp ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_complex_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __construct, arginfo_phalcon_mvc_model_resultset_complex___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) -#if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, current, arginfo_phalcon_mvc_model_resultset_complex_current, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) -#else - PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, current, NULL, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) -#endif PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, toArray, arginfo_phalcon_mvc_model_resultset_complex_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, serialize, arginfo_phalcon_mvc_model_resultset_complex_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, unserialize, arginfo_phalcon_mvc_model_resultset_complex_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __serialize, arginfo_phalcon_mvc_model_resultset_complex___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __unserialize, arginfo_phalcon_mvc_model_resultset_complex___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultset/simple.zep.c b/ext/phalcon/mvc/model/resultset/simple.zep.c index d816a38635e..c1c7ac50129 100644 --- a/ext/phalcon/mvc/model/resultset/simple.zep.c +++ b/ext/phalcon/mvc/model/resultset/simple.zep.c @@ -60,7 +60,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset_Simple) * @param array columnMap * @param ModelInterface|Row model * @param \Phalcon\Db\ResultInterface|false result - * @param CacheInterface|null cache + * @param mixed|null cache * @param bool keepSnapshots false */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) @@ -86,7 +86,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) Z_PARAM_ZVAL(model) Z_PARAM_ZVAL(result) Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(cache, zephir_get_internal_ce(SL("psr\\simplecache\\cacheinterface"))) + Z_PARAM_ZVAL_OR_NULL(cache) Z_PARAM_BOOL(keepSnapshots) ZEND_PARSE_PARAMETERS_END(); #endif @@ -303,7 +303,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) ZEPHIR_INIT_VAR(&renamedRecords); array_init(&renamedRecords); if (Z_TYPE_P(&records) == IS_ARRAY) { - zephir_is_iterable(&records, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 241); + zephir_is_iterable(&records, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 240); if (Z_TYPE_P(&records) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&records), _4$$7) { @@ -311,7 +311,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) ZVAL_COPY(&record, _4$$7); ZEPHIR_INIT_NVAR(&renamed); array_init(&renamed); - zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); if (Z_TYPE_P(&record) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _8$$8, _9$$8, _6$$8) { @@ -329,9 +329,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_10$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_11$$10); ZEPHIR_CONCAT_SVS(&_11$$10, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_10$$10, "__construct", &_12, 31, &_11$$10); + ZEPHIR_CALL_METHOD(NULL, &_10$$10, "__construct", &_12, 29, &_11$$10); zephir_check_call_status(); - zephir_throw_exception_debug(&_10$$10, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_10$$10, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -342,9 +342,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_13$$12, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_14$$12); ZEPHIR_CONCAT_SVS(&_14$$12, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_12, 31, &_14$$12); + ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_12, 29, &_14$$12); zephir_check_call_status(); - zephir_throw_exception_debug(&_13$$12, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_13$$12, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -370,9 +370,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_15$$14, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_16$$14); ZEPHIR_CONCAT_SVS(&_16$$14, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_15$$14, "__construct", &_12, 31, &_16$$14); + ZEPHIR_CALL_METHOD(NULL, &_15$$14, "__construct", &_12, 29, &_16$$14); zephir_check_call_status(); - zephir_throw_exception_debug(&_15$$14, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_15$$14, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -383,9 +383,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_17$$16, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_18$$16); ZEPHIR_CONCAT_SVS(&_18$$16, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_17$$16, "__construct", &_12, 31, &_18$$16); + ZEPHIR_CALL_METHOD(NULL, &_17$$16, "__construct", &_12, 29, &_18$$16); zephir_check_call_status(); - zephir_throw_exception_debug(&_17$$16, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_17$$16, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -397,7 +397,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &records, "rewind", NULL, 0); @@ -412,7 +412,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) zephir_check_call_status(); ZEPHIR_INIT_NVAR(&renamed); array_init(&renamed); - zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_is_iterable(&record, 0, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); if (Z_TYPE_P(&record) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _21$$17, _22$$17, _19$$17) { @@ -430,9 +430,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_23$$19, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_24$$19); ZEPHIR_CONCAT_SVS(&_24$$19, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_23$$19, "__construct", &_12, 31, &_24$$19); + ZEPHIR_CALL_METHOD(NULL, &_23$$19, "__construct", &_12, 29, &_24$$19); zephir_check_call_status(); - zephir_throw_exception_debug(&_23$$19, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_23$$19, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -443,9 +443,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_25$$21, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_26$$21); ZEPHIR_CONCAT_SVS(&_26$$21, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_25$$21, "__construct", &_12, 31, &_26$$21); + ZEPHIR_CALL_METHOD(NULL, &_25$$21, "__construct", &_12, 29, &_26$$21); zephir_check_call_status(); - zephir_throw_exception_debug(&_25$$21, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_25$$21, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -471,9 +471,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_27$$23, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_28$$23); ZEPHIR_CONCAT_SVS(&_28$$23, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_27$$23, "__construct", &_12, 31, &_28$$23); + ZEPHIR_CALL_METHOD(NULL, &_27$$23, "__construct", &_12, 29, &_28$$23); zephir_check_call_status(); - zephir_throw_exception_debug(&_27$$23, "phalcon/Mvc/Model/Resultset/Simple.zep", 222); + zephir_throw_exception_debug(&_27$$23, "phalcon/Mvc/Model/Resultset/Simple.zep", 221); ZEPHIR_MM_RESTORE(); return; } @@ -484,9 +484,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) object_init_ex(&_29$$25, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_NVAR(&_30$$25); ZEPHIR_CONCAT_SVS(&_30$$25, "Column '", &key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, &_29$$25, "__construct", &_12, 31, &_30$$25); + ZEPHIR_CALL_METHOD(NULL, &_29$$25, "__construct", &_12, 29, &_30$$25); zephir_check_call_status(); - zephir_throw_exception_debug(&_29$$25, "phalcon/Mvc/Model/Resultset/Simple.zep", 229); + zephir_throw_exception_debug(&_29$$25, "phalcon/Mvc/Model/Resultset/Simple.zep", 228); ZEPHIR_MM_RESTORE(); return; } @@ -498,7 +498,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) } ZEPHIR_INIT_NVAR(&value); ZEPHIR_INIT_NVAR(&key); - zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 239); + zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/Mvc/Model/Resultset/Simple.zep", 238); ZEPHIR_CALL_METHOD(NULL, &records, "next", NULL, 0); zephir_check_call_status(); } @@ -537,8 +537,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize) ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 262); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 260); return; } ZEPHIR_INIT_VAR(&data); @@ -625,8 +625,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) ZEPHIR_CALL_CE_STATIC(&container, phalcon_di_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(&container) != IS_OBJECT)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 300); + if (Z_TYPE_P(&container) == IS_NULL) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector container is not valid", "phalcon/Mvc/Model/Resultset/Simple.zep", 297); return; } ZEPHIR_INIT_VAR(&_2); @@ -648,22 +648,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) zephir_check_call_status(); } if (UNEXPECTED(Z_TYPE_P(&resultset) != IS_ARRAY)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Simple.zep", 313); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/Mvc/Model/Resultset/Simple.zep", 310); return; } - zephir_array_fetch_string(&_5, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 316); + zephir_array_fetch_string(&_5, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 313); zephir_update_property_zval(this_ptr, ZEND_STRL("model"), &_5); - zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 317); + zephir_array_fetch_string(&_6, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 314); zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_6); - zephir_array_fetch_string(&_7, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 318); + zephir_array_fetch_string(&_7, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 315); ZEPHIR_INIT_ZVAL_NREF(_8); ZVAL_LONG(&_8, zephir_fast_count_int(&_7)); zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_8); - zephir_array_fetch_string(&_9, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 319); + zephir_array_fetch_string(&_9, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 316); zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_9); - zephir_array_fetch_string(&_10, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 320); + zephir_array_fetch_string(&_10, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 317); zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_10); - zephir_array_fetch_string(&_11, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 321); + zephir_array_fetch_string(&_11, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 318); zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_11); if (zephir_array_isset_string_fetch(&keepSnapshots, &resultset, SL("keepSnapshots"), 1)) { zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &keepSnapshots); @@ -671,3 +671,89 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) ZEPHIR_MM_RESTORE(); } +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __serialize) +{ + zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + + + ZEPHIR_MM_GROW(); + + zephir_create_array(return_value, 6, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("model"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("model"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("cache"), &_0, PH_COPY | PH_SEPARATE); + ZVAL_BOOL(&_2, 0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "toarray", NULL, 0, &_2); + zephir_check_call_status(); + zephir_array_update_string(return_value, SL("rows"), &_1, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("columnMap"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("columnMap"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("hydrateMode"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("hydrateMode"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("keepSnapshots"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("keepSnapshots"), &_0, PH_COPY | PH_SEPARATE); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *data_param = NULL, keepSnapshots, _0, _1, _2, _3, _4, _5, _6; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&keepSnapshots); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + zephir_array_fetch_string(&_0, &data, SL("model"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 341); + zephir_update_property_zval(this_ptr, ZEND_STRL("model"), &_0); + zephir_array_fetch_string(&_1, &data, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 342); + zephir_update_property_zval(this_ptr, ZEND_STRL("rows"), &_1); + zephir_array_fetch_string(&_2, &data, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 343); + ZEPHIR_INIT_ZVAL_NREF(_3); + ZVAL_LONG(&_3, zephir_fast_count_int(&_2)); + zephir_update_property_zval(this_ptr, ZEND_STRL("count"), &_3); + zephir_array_fetch_string(&_4, &data, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 344); + zephir_update_property_zval(this_ptr, ZEND_STRL("cache"), &_4); + zephir_array_fetch_string(&_5, &data, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 345); + zephir_update_property_zval(this_ptr, ZEND_STRL("columnMap"), &_5); + zephir_array_fetch_string(&_6, &data, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/Mvc/Model/Resultset/Simple.zep", 346); + zephir_update_property_zval(this_ptr, ZEND_STRL("hydrateMode"), &_6); + if (zephir_array_isset_string_fetch(&keepSnapshots, &data, SL("keepSnapshots"), 1)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("keepSnapshots"), &keepSnapshots); + } + ZEPHIR_MM_RESTORE(); +} + diff --git a/ext/phalcon/mvc/model/resultset/simple.zep.h b/ext/phalcon/mvc/model/resultset/simple.zep.h index 023b2e294ce..e9c102de26e 100644 --- a/ext/phalcon/mvc/model/resultset/simple.zep.h +++ b/ext/phalcon/mvc/model/resultset/simple.zep.h @@ -8,12 +8,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, current); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize); PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize); +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __serialize); +PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___construct, 0, 0, 3) ZEND_ARG_INFO(0, columnMap) ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, result) - ZEND_ARG_OBJ_INFO(0, cache, Psr\\SimpleCache\\CacheInterface, 1) + ZEND_ARG_INFO(0, cache) ZEND_ARG_TYPE_INFO(0, keepSnapshots, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -32,11 +34,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simp ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_simple_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __construct, arginfo_phalcon_mvc_model_resultset_simple___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, current, arginfo_phalcon_mvc_model_resultset_simple_current, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, toArray, arginfo_phalcon_mvc_model_resultset_simple_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, serialize, arginfo_phalcon_mvc_model_resultset_simple_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, unserialize, arginfo_phalcon_mvc_model_resultset_simple_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __serialize, arginfo_phalcon_mvc_model_resultset_simple___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __unserialize, arginfo_phalcon_mvc_model_resultset_simple___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultsetinterface.zep.h b/ext/phalcon/mvc/model/resultsetinterface.zep.h index 399cb4117d2..f756de09e06 100644 --- a/ext/phalcon/mvc/model/resultsetinterface.zep.h +++ b/ext/phalcon/mvc/model/resultsetinterface.zep.h @@ -11,7 +11,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinter ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getcache, 0, 0, Psr\\SimpleCache\\CacheInterface, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getcache, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_getfirst, 0, 0, 0) diff --git a/ext/phalcon/mvc/model/row.zep.c b/ext/phalcon/mvc/model/row.zep.c index ab25da20d81..3396db8d32e 100644 --- a/ext/phalcon/mvc/model/row.zep.c +++ b/ext/phalcon/mvc/model/row.zep.c @@ -16,10 +16,10 @@ #include "kernel/fcall.h" #include "kernel/object.h" #include "kernel/memory.h" -#include "kernel/array.h" +#include "kernel/operators.h" #include "kernel/exception.h" +#include "kernel/array.h" #include "ext/spl/spl_exceptions.h" -#include "kernel/operators.h" /** @@ -31,8 +31,6 @@ * file that was distributed with this source code. */ /** - * Phalcon\Mvc\Model\Row - * * This component allows Phalcon\Mvc\Model to return rows without an associated entity. * This objects implements the ArrayAccess interface to allow access the object as object->x or array[x]. */ @@ -75,11 +73,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, jsonSerialize) PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *index, index_sub, value; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval index_sub, _0, _1; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); - ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -92,12 +93,15 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) zephir_fetch_params(1, 1, 0, &index); - ZEPHIR_OBS_VAR(&value); - if (UNEXPECTED(!(zephir_fetch_property_zval(&value, this_ptr, index, PH_SILENT_CC)))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/Mvc/Model/Row.zep", 46); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "offsetexists", NULL, 0, index); + zephir_check_call_status(); + if (!(zephir_is_true(&_0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/Mvc/Model/Row.zep", 42); return; } - RETURN_CCTOR(&value); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property_zval(&_1, this_ptr, index, PH_NOISY_CC); + RETURN_CCTOR(&_1); } /** @@ -107,7 +111,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) { - zval *index, index_sub; + zval index_sub; + zval *index; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -133,7 +138,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) { - zval *index, index_sub, *value, value_sub; + zval index_sub, value_sub; + zval *index, *value; zval *this_ptr = getThis(); ZVAL_UNDEF(&index_sub); @@ -150,7 +156,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) zephir_fetch_params_without_memory_grow(2, 0, &index, &value); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 70); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 66); return; } @@ -161,7 +167,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) { - zval *offset, offset_sub; + zval offset_sub; + zval *offset; zval *this_ptr = getThis(); ZVAL_UNDEF(&offset_sub); @@ -176,7 +183,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) zephir_fetch_params_without_memory_grow(1, 0, &offset); - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 80); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 76); return; } @@ -263,7 +270,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, toArray) ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 505, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 424, this_ptr); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/row.zep.h b/ext/phalcon/mvc/model/row.zep.h index 7f5528140a3..226a0668038 100644 --- a/ext/phalcon/mvc/model/row.zep.h +++ b/ext/phalcon/mvc/model/row.zep.h @@ -16,7 +16,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_jsonserialize, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/transaction.zep.c b/ext/phalcon/mvc/model/transaction.zep.c index 39af665a484..ccb8fe92c51 100644 --- a/ext/phalcon/mvc/model/transaction.zep.c +++ b/ext/phalcon/mvc/model/transaction.zep.c @@ -240,7 +240,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, getConnection) zephir_read_property(&_0, this_ptr, ZEND_STRL("rollbackOnAbort"), PH_NOISY_CC | PH_READONLY); if (zephir_is_true(&_0)) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 0); + ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 478); zephir_check_call_status(); if (zephir_is_true(&_1$$3)) { ZEPHIR_INIT_VAR(&_2$$4); @@ -371,7 +371,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, rollback) ZEPHIR_INIT_VAR(&_3$$7); object_init_ex(&_3$$7, phalcon_mvc_model_transaction_failed_ce); zephir_read_property(&_4$$7, this_ptr, ZEND_STRL("rollbackRecord"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 0, &rollbackMessage, &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 479, &rollbackMessage, &_4$$7); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$7, "phalcon/Mvc/Model/Transaction.zep", 215); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/transaction/manager.zep.c b/ext/phalcon/mvc/model/transaction/manager.zep.c index 133cf795e3c..5804c176a0f 100644 --- a/ext/phalcon/mvc/model/transaction/manager.zep.c +++ b/ext/phalcon/mvc/model/transaction/manager.zep.c @@ -327,7 +327,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get) ZEPHIR_INIT_VAR(&_3$$4); ZVAL_STRING(&_3$$4, "rollbackPendent"); zephir_array_fast_append(&_2$$4, &_3$$4); - ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 0, &_2$$4); + ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 480, &_2$$4); zephir_check_call_status(); } if (1) { @@ -467,9 +467,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) } else { ZVAL_BOOL(&_7, 0); } - ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 0, &container, &_7, &_6); + ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 481, &container, &_7, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 482, this_ptr); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("transactions"), &transaction); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("number"))); diff --git a/ext/phalcon/mvc/router.zep.c b/ext/phalcon/mvc/router.zep.c index cd1cedf5e2c..40e1751540e 100644 --- a/ext/phalcon/mvc/router.zep.c +++ b/ext/phalcon/mvc/router.zep.c @@ -64,29 +64,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router) ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc, Router, phalcon, mvc_router, phalcon_di_abstractinjectionaware_ce, phalcon_mvc_router_method_entry, 0); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("action"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("action"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("controller"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("controller"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultAction"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultAction"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultController"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultController"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultModule"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultModule"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("defaultNamespace"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("defaultNamespace"), "", ZEND_ACC_PROTECTED); /** * @var array */ @@ -112,13 +112,13 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router) */ zend_declare_property_null(phalcon_mvc_router_ce, SL("matches"), ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("module"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("module"), "", ZEND_ACC_PROTECTED); /** - * @var string|null + * @var string */ - zend_declare_property_null(phalcon_mvc_router_ce, SL("namespaceName"), ZEND_ACC_PROTECTED); + zend_declare_property_string(phalcon_mvc_router_ce, SL("namespaceName"), "", ZEND_ACC_PROTECTED); /** * @var array|string|null */ @@ -277,7 +277,7 @@ PHP_METHOD(Phalcon_Mvc_Router, __construct) add_assoc_long_ex(&_1$$3, SL("controller"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^/([\\w0-9\\_\\-]+)[/]{0,1}$#u"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 124, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 96, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/Mvc/Router.zep", 171); ZEPHIR_INIT_NVAR(&_2$$3); @@ -289,7 +289,7 @@ PHP_METHOD(Phalcon_Mvc_Router, __construct) add_assoc_long_ex(&_3$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_4$$3); ZVAL_STRING(&_4$$3, "#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 124, &_4$$3, &_3$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 96, &_4$$3, &_3$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/Mvc/Router.zep", 180); } @@ -385,7 +385,7 @@ PHP_METHOD(Phalcon_Mvc_Router, add) ZEPHIR_INIT_VAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 124, &pattern, paths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 96, &pattern, paths, httpMethods); zephir_check_call_status(); ZVAL_LONG(&_0, position); ZEPHIR_CALL_METHOD(NULL, this_ptr, "attach", NULL, 0, &route, &_0); @@ -1626,7 +1626,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) ZVAL_LONG(&_0, 5); - ZEPHIR_CALL_FUNCTION(&_1, "parse_url", NULL, 125, &uri, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "parse_url", NULL, 97, &uri, &_0); zephir_check_call_status(); zephir_get_strval(&uri, &_1); zephir_read_property(&_0, this_ptr, ZEND_STRL("removeExtraSlashes"), PH_NOISY_CC | PH_READONLY); @@ -1821,7 +1821,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_28$$35, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_29$$35); ZEPHIR_CONCAT_SV(&_29$$35, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_28$$35, "__construct", &_30, 31, &_29$$35); + ZEPHIR_CALL_METHOD(NULL, &_28$$35, "__construct", &_30, 29, &_29$$35); zephir_check_call_status(); zephir_throw_exception_debug(&_28$$35, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -1887,7 +1887,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_36$$46, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_37$$46); ZEPHIR_CONCAT_SV(&_37$$46, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_36$$46, "__construct", &_30, 31, &_37$$46); + ZEPHIR_CALL_METHOD(NULL, &_36$$46, "__construct", &_30, 29, &_37$$46); zephir_check_call_status(); zephir_throw_exception_debug(&_36$$46, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -2099,7 +2099,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_63$$84, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_64$$84); ZEPHIR_CONCAT_SV(&_64$$84, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_63$$84, "__construct", &_30, 31, &_64$$84); + ZEPHIR_CALL_METHOD(NULL, &_63$$84, "__construct", &_30, 29, &_64$$84); zephir_check_call_status(); zephir_throw_exception_debug(&_63$$84, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -2165,7 +2165,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) object_init_ex(&_70$$95, phalcon_mvc_router_exception_ce); ZEPHIR_INIT_NVAR(&_71$$95); ZEPHIR_CONCAT_SV(&_71$$95, "Wrong key in paths: ", &part); - ZEPHIR_CALL_METHOD(NULL, &_70$$95, "__construct", &_30, 31, &_71$$95); + ZEPHIR_CALL_METHOD(NULL, &_70$$95, "__construct", &_30, 29, &_71$$95); zephir_check_call_status(); zephir_throw_exception_debug(&_70$$95, "phalcon/Mvc/Router.zep", 824); ZEPHIR_MM_RESTORE(); @@ -2704,6 +2704,7 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaultNamespace) */ PHP_METHOD(Phalcon_Mvc_Router, setDefaults) { + zval _0$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *defaults_param = NULL, namespaceName, module, controller, action, params; zval defaults; @@ -2715,6 +2716,7 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaults) ZVAL_UNDEF(&controller); ZVAL_UNDEF(&action); ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -2729,7 +2731,8 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaults) if (zephir_array_isset_string_fetch(&namespaceName, &defaults, SL("namespace"), 1)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("defaultNamespace"), &namespaceName); + zephir_cast_to_string(&_0$$3, &namespaceName); + zephir_update_property_zval(this_ptr, ZEND_STRL("defaultNamespace"), &_0$$3); } if (zephir_array_isset_string_fetch(&module, &defaults, SL("module"), 1)) { zephir_update_property_zval(this_ptr, ZEND_STRL("defaultModule"), &module); diff --git a/ext/phalcon/mvc/router/annotations.zep.c b/ext/phalcon/mvc/router/annotations.zep.c index d0dc92d681d..d2d8789e68f 100644 --- a/ext/phalcon/mvc/router/annotations.zep.c +++ b/ext/phalcon/mvc/router/annotations.zep.c @@ -326,7 +326,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZVAL_STRING(&_1, "annotations"); ZEPHIR_CALL_METHOD(&annotationsService, &container, "getshared", NULL, 0, &_1); zephir_check_call_status(); - zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Router/Annotations.zep", 249); + zephir_is_iterable(&handlers, 0, "phalcon/Mvc/Router/Annotations.zep", 250); if (Z_TYPE_P(&handlers) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _2) { @@ -340,9 +340,9 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (!(ZEPHIR_IS_EMPTY(&prefix))) { ZEPHIR_INIT_NVAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 124, &prefix); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 96, &prefix); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5$$6, &route, "getcompiledpattern", &_6, 0); + ZEPHIR_CALL_METHOD(&_5$$6, &route, "getcompiledpattern", &_6, 483); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_7$$6); ZVAL_STRING(&_7$$6, "$#"); @@ -377,6 +377,14 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_OBS_NVAR(&moduleName); zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0); ZEPHIR_INIT_NVAR(&_11$$4); + if (Z_TYPE_P(&moduleName) != IS_NULL) { + ZEPHIR_CPY_WRT(&_11$$4, &moduleName); + } else { + ZEPHIR_INIT_NVAR(&_11$$4); + ZVAL_STRING(&_11$$4, ""); + } + ZEPHIR_CPY_WRT(&moduleName, &_11$$4); + ZEPHIR_INIT_NVAR(&_11$$4); ZEPHIR_CONCAT_VV(&_11$$4, &controllerName, &controllerSuffix); zephir_get_strval(&sufixed, &_11$$4); if (Z_TYPE_P(&namespaceName) != IS_NULL) { @@ -395,7 +403,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&annotations) == IS_ARRAY) { - zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217); + zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 218); if (Z_TYPE_P(&annotations) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _14$$15) { @@ -429,7 +437,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&lowerControllerName); zephir_uncamelize(&lowerControllerName, &controllerName, NULL ); - zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243); + zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 244); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _19$$18, _20$$18, _17$$18) { @@ -446,7 +454,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_21$$19, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_21$$19, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_21$$19, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_21$$19) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_21$$19), _22$$19) { @@ -492,7 +500,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_25$$23, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_25$$23, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_25$$23, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_25$$23) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_25$$23), _26$$23) { @@ -546,9 +554,9 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (!(ZEPHIR_IS_EMPTY(&prefix))) { ZEPHIR_INIT_NVAR(&route); object_init_ex(&route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 124, &prefix); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", &_4, 96, &prefix); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_28$$29, &route, "getcompiledpattern", &_6, 0); + ZEPHIR_CALL_METHOD(&_28$$29, &route, "getcompiledpattern", &_6, 483); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_29$$29); ZVAL_STRING(&_29$$29, "$#"); @@ -583,6 +591,14 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_OBS_NVAR(&moduleName); zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0); ZEPHIR_INIT_NVAR(&_33$$27); + if (Z_TYPE_P(&moduleName) != IS_NULL) { + ZEPHIR_CPY_WRT(&_33$$27, &moduleName); + } else { + ZEPHIR_INIT_NVAR(&_33$$27); + ZVAL_STRING(&_33$$27, ""); + } + ZEPHIR_CPY_WRT(&moduleName, &_33$$27); + ZEPHIR_INIT_NVAR(&_33$$27); ZEPHIR_CONCAT_VV(&_33$$27, &controllerName, &controllerSuffix); zephir_get_strval(&sufixed, &_33$$27); if (Z_TYPE_P(&namespaceName) != IS_NULL) { @@ -601,7 +617,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&annotations) == IS_ARRAY) { - zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 217); + zephir_is_iterable(&annotations, 0, "phalcon/Mvc/Router/Annotations.zep", 218); if (Z_TYPE_P(&annotations) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _36$$38) { @@ -635,7 +651,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&lowerControllerName); zephir_uncamelize(&lowerControllerName, &controllerName, NULL ); - zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 243); + zephir_is_iterable(&methodAnnotations, 0, "phalcon/Mvc/Router/Annotations.zep", 244); if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _40$$41, _41$$41, _38$$41) { @@ -652,7 +668,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_42$$42, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_42$$42, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_42$$42, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_42$$42) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_42$$42), _43$$42) { @@ -698,7 +714,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) } ZEPHIR_CALL_METHOD(&_45$$46, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(&_45$$46, 0, "phalcon/Mvc/Router/Annotations.zep", 242); + zephir_is_iterable(&_45$$46, 0, "phalcon/Mvc/Router/Annotations.zep", 243); if (Z_TYPE_P(&_45$$46) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_45$$46), _46$$46) { @@ -870,7 +886,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) zephir_read_property(&_2, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY); if (Z_TYPE_P(&_2) != IS_NULL) { zephir_read_property(&_3$$6, this_ptr, ZEND_STRL("actionPreformatCallback"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_4$$6, "call_user_func", NULL, 199, &_3$$6, &proxyActionName); + ZEPHIR_CALL_FUNCTION(&_4$$6, "call_user_func", NULL, 180, &_3$$6, &proxyActionName); zephir_check_call_status(); ZEPHIR_CPY_WRT(&proxyActionName, &_4$$6); } @@ -931,7 +947,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5); zephir_check_call_status(); if (Z_TYPE_P(&converts) == IS_ARRAY) { - zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 372); + zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 373); if (Z_TYPE_P(&converts) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _11$$18, _12$$18, _9$$18) { @@ -973,7 +989,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_5); zephir_check_call_status(); if (Z_TYPE_P(&converts) == IS_ARRAY) { - zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 383); + zephir_is_iterable(&converts, 0, "phalcon/Mvc/Router/Annotations.zep", 384); if (Z_TYPE_P(&converts) == IS_ARRAY) { ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _17$$21, _18$$21, _15$$21) { @@ -1181,7 +1197,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionPreformatCallback) zephir_create_closure_ex(&_0$$4, NULL, phalcon_10__closure_ce, SL("__invoke")); zephir_update_property_zval(this_ptr, ZEND_STRL("actionPreformatCallback"), &_0$$4); } else { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/Mvc/Router/Annotations.zep", 462); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/Mvc/Router/Annotations.zep", 463); return; } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/router/group.zep.c b/ext/phalcon/mvc/router/group.zep.c index 0b44c753397..3f4ff3a4417 100644 --- a/ext/phalcon/mvc/router/group.zep.c +++ b/ext/phalcon/mvc/router/group.zep.c @@ -1101,10 +1101,10 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addRoute) zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_VV(&_2, &_1, &pattern); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 124, &_2, &mergedPaths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 96, &_2, &mergedPaths, httpMethods); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("routes"), &route); - ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 484, this_ptr); zephir_check_call_status(); RETURN_CCTOR(&route); } diff --git a/ext/phalcon/mvc/router/route.zep.c b/ext/phalcon/mvc/router/route.zep.c index 6e48d28687e..6ed2b57e430 100644 --- a/ext/phalcon/mvc/router/route.zep.c +++ b/ext/phalcon/mvc/router/route.zep.c @@ -758,7 +758,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getReversedPaths) ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, ZEND_STRL("paths"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 203, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_flip", NULL, 95, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/url.zep.c b/ext/phalcon/mvc/url.zep.c index bdda86ea1d5..3ffcf2fbcaa 100644 --- a/ext/phalcon/mvc/url.zep.c +++ b/ext/phalcon/mvc/url.zep.c @@ -282,7 +282,7 @@ PHP_METHOD(Phalcon_Mvc_Url, get) object_init_ex(&_12$$14, phalcon_mvc_url_exception_ce); ZEPHIR_INIT_VAR(&_13$$14); ZEPHIR_CONCAT_SVS(&_13$$14, "Cannot obtain a route using the name '", &routeName, "'"); - ZEPHIR_CALL_METHOD(NULL, &_12$$14, "__construct", NULL, 31, &_13$$14); + ZEPHIR_CALL_METHOD(NULL, &_12$$14, "__construct", NULL, 29, &_13$$14); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$14, "phalcon/Mvc/Url.zep", 161); ZEPHIR_MM_RESTORE(); @@ -305,11 +305,11 @@ PHP_METHOD(Phalcon_Mvc_Url, get) ZVAL_STRING(&_18$$15, "#(?"); RETURN_MM(); @@ -889,7 +889,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileDo) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 591); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); @@ -939,13 +939,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileEcho) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 615); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); zephir_array_fetch_string(&_2, &expr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 623); if (ZEPHIR_IS_LONG(&_2, 350)) { @@ -1006,13 +1006,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileElseIf) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 662); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); @@ -1102,7 +1102,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$4); ZEPHIR_CONCAT_SVS(&_1$$4, "Template file ", &path, " does not exist"); - ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 0, &_1$$4); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 501, &_1$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 702); ZEPHIR_MM_RESTORE(); @@ -1115,7 +1115,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) object_init_ex(&_2$$5, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVS(&_3$$5, "Template file ", &path, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 0, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 501, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_2$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 714); ZEPHIR_MM_RESTORE(); @@ -1240,7 +1240,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) ZEPHIR_CONCAT_VV(&prefixLevel, &prefix, &level); ZEPHIR_OBS_VAR(&expr); zephir_array_fetch_string(&expr, &statement, SL("expr"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 780); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_OBS_VAR(&blockStatements); zephir_array_fetch_string(&blockStatements, &statement, SL("block_statements"), PH_NOISY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 787); @@ -1300,7 +1300,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) } else { ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlist", NULL, 0, &blockStatements, &_4); + ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlist", NULL, 502, &blockStatements, &_4); zephir_check_call_status(); ZEPHIR_OBS_VAR(&loopContext); zephir_read_property(&loopContext, this_ptr, ZEND_STRL("loopPointers"), PH_NOISY_CC); @@ -1351,7 +1351,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) } ZEPHIR_OBS_VAR(&ifExpr); if (zephir_array_isset_string_fetch(&ifExpr, &statement, SL("if_expr"), 0)) { - ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "expression", NULL, 0, &ifExpr); + ZEPHIR_CALL_METHOD(&_16$$15, this_ptr, "expression", NULL, 500, &ifExpr); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_17$$15); ZEPHIR_CONCAT_SVS(&_17$$15, "if (", &_16$$15, ") { ?>"); @@ -1493,13 +1493,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 942); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); zephir_array_fetch_string(&_4, &statement, SL("true_statements"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 948); if (extendsMode) { @@ -1507,7 +1507,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) } else { ZVAL_BOOL(&_5, 0); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "statementlist", NULL, 0, &_4, &_5); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "statementlist", NULL, 502, &_4, &_5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_SVSV(&_6, "", &_3); @@ -1519,7 +1519,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) } else { ZVAL_BOOL(&_8$$4, 0); } - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "statementlist", NULL, 0, &blockStatements, &_8$$4); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "statementlist", NULL, 502, &blockStatements, &_8$$4); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9$$4); ZEPHIR_CONCAT_SV(&_9$$4, "", &_7$$4); @@ -1597,14 +1597,14 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileInclude) RETURN_CCTOR(&compilation); } } - ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 0, &pathExpr); + ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 500, &pathExpr); zephir_check_call_status(); ZEPHIR_OBS_VAR(¶ms); if (!(zephir_array_isset_string_fetch(¶ms, &statement, SL("params"), 0))) { ZEPHIR_CONCAT_SVS(return_value, "partial(", &path, "); ?>"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 0, ¶ms); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 500, ¶ms); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "partial(", &path, ", ", &_3, "); ?>"); RETURN_MM(); @@ -1692,7 +1692,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) object_init_ex(&_1$$4, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_2$$4); ZEPHIR_CONCAT_SVS(&_2$$4, "Macro '", &name, "' is already defined"); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 0, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 501, &_2$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$4, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1064); ZEPHIR_MM_RESTORE(); @@ -1743,7 +1743,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1); ZEPHIR_OBS_NVAR(&defaultValue); if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) { - ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "expression", &_15, 0, &defaultValue); + ZEPHIR_CALL_METHOD(&_14$$8, this_ptr, "expression", &_15, 500, &defaultValue); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_16$$8); ZEPHIR_CONCAT_SVSVS(&_16$$8, "$", &variableName, " = ", &_14$$8, ";"); @@ -1786,7 +1786,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) zephir_concat_self_str(&code, " } else { ", sizeof(" } else { ") - 1); ZEPHIR_OBS_NVAR(&defaultValue); if (EXPECTED(zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0))) { - ZEPHIR_CALL_METHOD(&_22$$11, this_ptr, "expression", &_15, 0, &defaultValue); + ZEPHIR_CALL_METHOD(&_22$$11, this_ptr, "expression", &_15, 500, &defaultValue); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_23$$11); ZEPHIR_CONCAT_SVSVS(&_23$$11, "$", &variableName, " = ", &_22$$11, ";"); @@ -1812,7 +1812,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) } else { ZVAL_BOOL(&_26$$13, 0); } - ZEPHIR_CALL_METHOD(&_25$$13, this_ptr, "statementlist", NULL, 0, &blockStatements, &_26$$13); + ZEPHIR_CALL_METHOD(&_25$$13, this_ptr, "statementlist", NULL, 502, &blockStatements, &_26$$13); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_27$$13); ZEPHIR_CONCAT_VS(&_27$$13, &_25$$13, ""); RETURN_MM(); @@ -1935,10 +1935,10 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) ZEPHIR_INIT_NVAR(&assignment); ZVAL_COPY(&assignment, _0); zephir_array_fetch_string(&_2$$4, &assignment, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1177); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 0, &_2$$4); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 500, &_2$$4); zephir_check_call_status(); zephir_array_fetch_string(&_4$$4, &assignment, SL("variable"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1184); - ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 0, &_4$$4); + ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 500, &_4$$4); zephir_check_call_status(); zephir_array_fetch_string(&_5$$4, &assignment, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1190); do { @@ -1985,10 +1985,10 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) ZEPHIR_CALL_METHOD(&assignment, &assignments, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_11$$10, &assignment, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1177); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 0, &_11$$10); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", &_3, 500, &_11$$10); zephir_check_call_status(); zephir_array_fetch_string(&_12$$10, &assignment, SL("variable"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1184); - ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 0, &_12$$10); + ZEPHIR_CALL_METHOD(&target, this_ptr, "expression", &_3, 500, &_12$$10); zephir_check_call_status(); zephir_array_fetch_string(&_13$$10, &assignment, SL("op"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1190); do { @@ -2153,13 +2153,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); ZEPHIR_INIT_VAR(&_1$$3); ZVAL_STRING(&_1$$3, "Corrupt statement"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3, &statement); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 501, &_1$$3, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$3, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1256); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 0, &expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 500, &expr); zephir_check_call_status(); ZEPHIR_INIT_VAR(&compilation); ZEPHIR_CONCAT_SVS(&compilation, ""); @@ -2170,14 +2170,14 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) } else { ZVAL_BOOL(&_3$$4, 0); } - ZEPHIR_CALL_METHOD(&lines, this_ptr, "statementlist", NULL, 0, &caseClauses, &_3$$4); + ZEPHIR_CALL_METHOD(&lines, this_ptr, "statementlist", NULL, 502, &caseClauses, &_3$$4); zephir_check_call_status(); if (zephir_fast_strlen_ev(&lines) != 0) { ZEPHIR_INIT_VAR(&_4$$5); ZVAL_STRING(&_4$$5, "/(*ANYCRLF)^\\h+|\\h+$|(\\h){2,}/mu"); ZEPHIR_INIT_VAR(&_5$$5); ZVAL_STRING(&_5$$5, ""); - ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 50, &_4$$5, &_5$$5, &lines); + ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 37, &_4$$5, &_5$$5, &lines); zephir_check_call_status(); ZEPHIR_CPY_WRT(&lines, &_6$$5); } @@ -2265,7 +2265,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) zephir_array_fast_append(&_1$$4, &expr); ZEPHIR_INIT_NVAR(&_2$$4); ZVAL_STRING(&_2$$4, "resolveExpression"); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_3, 0, &_2$$4, &_1$$4); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_3, 503, &_2$$4, &_1$$4); zephir_check_call_status(); if (Z_TYPE_P(&exprCode) == IS_STRING) { break; @@ -2282,7 +2282,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) ZEPHIR_INIT_NVAR(&singleExpr); ZVAL_COPY(&singleExpr, _4$$6); zephir_array_fetch_string(&_6$$7, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344); - ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 0, &_6$$7); + ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 500, &_6$$7); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) { @@ -2305,7 +2305,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) ZEPHIR_CALL_METHOD(&singleExpr, &expr, "current", NULL, 0); zephir_check_call_status(); zephir_array_fetch_string(&_9$$10, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1344); - ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 0, &_9$$10); + ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 500, &_9$$10); zephir_check_call_status(); ZEPHIR_OBS_NVAR(&name); if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) { @@ -2331,7 +2331,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } ZEPHIR_OBS_NVAR(&left); if (zephir_array_isset_string_fetch(&left, &expr, SL("left"), 0)) { - ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 0, &left); + ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 500, &left); zephir_check_call_status(); } if (ZEPHIR_IS_LONG(&type, 311)) { @@ -2342,13 +2342,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } if (ZEPHIR_IS_LONG(&type, 124)) { zephir_array_fetch_string(&_14$$16, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1391); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_15, 0, &_14$$16, &leftCode); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_15, 504, &_14$$16, &leftCode); zephir_check_call_status(); break; } ZEPHIR_OBS_NVAR(&right); if (zephir_array_isset_string_fetch(&right, &expr, SL("right"), 0)) { - ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 0, &right); + ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 500, &right); zephir_check_call_status(); } ZEPHIR_INIT_NVAR(&exprCode); @@ -2524,7 +2524,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) if (ZEPHIR_IS_LONG(&type, 365)) { ZEPHIR_OBS_NVAR(&start); if (zephir_array_isset_string_fetch(&start, &expr, SL("start"), 0)) { - ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 0, &start); + ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 500, &start); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&startCode); @@ -2532,7 +2532,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } ZEPHIR_OBS_NVAR(&end); if (zephir_array_isset_string_fetch(&end, &expr, SL("end"), 0)) { - ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 0, &end); + ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 500, &end); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&endCode); @@ -2624,7 +2624,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) } if (ZEPHIR_IS_LONG(&type, 366)) { zephir_array_fetch_string(&_23$$72, &expr, SL("ternary"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1625); - ZEPHIR_CALL_METHOD(&_22$$72, this_ptr, "expression", &_7, 0, &_23$$72); + ZEPHIR_CALL_METHOD(&_22$$72, this_ptr, "expression", &_7, 500, &_23$$72); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&exprCode); ZEPHIR_CONCAT_SVSVSVS(&exprCode, "(", &_22$$72, " ? ", &leftCode, " : ", &rightCode, ")"); @@ -2651,7 +2651,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) zephir_array_fetch_string(&_26$$76, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643); ZEPHIR_INIT_NVAR(&_27$$76); ZEPHIR_CONCAT_SVSVSV(&_27$$76, "Unknown expression ", &type, " in ", &_25$$76, " on line ", &_26$$76); - ZEPHIR_CALL_METHOD(NULL, &_24$$76, "__construct", &_28, 0, &_27$$76); + ZEPHIR_CALL_METHOD(NULL, &_24$$76, "__construct", &_28, 501, &_27$$76); zephir_check_call_status(); zephir_throw_exception_debug(&_24$$76, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1643); ZEPHIR_MM_RESTORE(); @@ -2868,7 +2868,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) ZVAL_NULL(&funcArguments); ZEPHIR_OBS_NVAR(&funcArguments); if (zephir_array_isset_string_fetch(&funcArguments, &expr, SL("arguments"), 0)) { - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 0, &funcArguments); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 500, &funcArguments); zephir_check_call_status(); } else { ZEPHIR_INIT_NVAR(&arguments); @@ -2891,7 +2891,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_array_fast_append(&_1$$6, &funcArguments); ZEPHIR_INIT_VAR(&_2$$6); ZVAL_STRING(&_2$$6, "compileFunction"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 0, &_2$$6, &_1$$6); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 503, &_2$$6, &_1$$6); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_STRING) { RETURN_CCTOR(&code); @@ -2923,7 +2923,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_array_fetch_string(&_6$$9, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1775); ZEPHIR_INIT_VAR(&_7$$9); ZEPHIR_CONCAT_SVSVSV(&_7$$9, "Invalid definition for user function '", &name, "' in ", &_5$$9, " on line ", &_6$$9); - ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 0, &_7$$9); + ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 501, &_7$$9); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$9, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 1775); ZEPHIR_MM_RESTORE(); @@ -2952,7 +2952,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) zephir_read_property(&_11$$17, this_ptr, ZEND_STRL("exprLevel"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&exprLevel, &_11$$17); if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlistorextends", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&code, this_ptr, "statementlistorextends", NULL, 505, &block); zephir_check_call_status(); if (ZEPHIR_IS_LONG(&exprLevel, 1)) { ZEPHIR_CPY_WRT(&escapedCode, &code); @@ -2979,7 +2979,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) } ZEPHIR_INIT_VAR(&_12$$5); zephir_camelize(&_12$$5, &name, NULL ); - ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 104, &_12$$5); + ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 73, &_12$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&arrayHelpers); zephir_create_array(&arrayHelpers, 16, 0); @@ -3072,7 +3072,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) ZEPHIR_CONCAT_SVSVS(return_value, "$this->callMacro('", &name, "', [", &arguments, "])"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_21, this_ptr, "expression", NULL, 0, &nameExpr); + ZEPHIR_CALL_METHOD(&_21, this_ptr, "expression", NULL, 500, &nameExpr); zephir_check_call_status(); ZEPHIR_CONCAT_VSVS(return_value, &_21, "(", &arguments, ")"); RETURN_MM(); @@ -3407,28 +3407,28 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveTest) if (zephir_array_isset_string_fetch(&name, &testName, SL("value"), 0)) { if (ZEPHIR_IS_STRING(&name, "divisibleby")) { zephir_array_fetch_string(&_1$$12, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2155); - ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 0, &_1$$12); + ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 500, &_1$$12); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "(((", &left, ") % (", &_0$$12, ")) == 0)"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&name, "sameas")) { zephir_array_fetch_string(&_3$$13, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2162); - ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 0, &_3$$13); + ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 500, &_3$$13); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "(", &left, ") === (", &_2$$13, ")"); RETURN_MM(); } if (ZEPHIR_IS_STRING(&name, "type")) { zephir_array_fetch_string(&_5$$14, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2169); - ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 0, &_5$$14); + ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 500, &_5$$14); zephir_check_call_status(); ZEPHIR_CONCAT_SVSVS(return_value, "gettype(", &left, ") === (", &_4$$14, ")"); RETURN_MM(); } } } - ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 0, &test); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 500, &test); zephir_check_call_status(); ZEPHIR_CONCAT_VSV(return_value, &left, " == ", &_6); RETURN_MM(); @@ -3647,7 +3647,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) } else { ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 0, &intermediate, &_0); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "statementlist", NULL, 502, &intermediate, &_0); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("extended"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&extended, &_1); @@ -3683,11 +3683,11 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) ZEPHIR_INIT_NVAR(&localBlock); array_init(&localBlock); } - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &localBlock); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &localBlock); zephir_check_call_status(); } else { if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &block); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&blockCompilation, &block); @@ -3728,11 +3728,11 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSource) ZEPHIR_INIT_NVAR(&localBlock); array_init(&localBlock); } - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &localBlock); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &localBlock); zephir_check_call_status(); } else { if (Z_TYPE_P(&block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 0, &block); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "statementlist", NULL, 502, &block); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&blockCompilation, &block); @@ -3927,7 +3927,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_2$$5, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2389); ZEPHIR_INIT_VAR(&_3$$5); ZEPHIR_CONCAT_SVSV(&_3$$5, "Unknown filter type in ", &_1$$5, " on line ", &_2$$5); - ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 0, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 501, &_3$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$5, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2389); ZEPHIR_MM_RESTORE(); @@ -3961,11 +3961,11 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_update_string(&_4$$7, SL("file"), &file, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$7, SL("line"), &line, PH_COPY | PH_SEPARATE); ZEPHIR_MAKE_REF(&funcArguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &funcArguments, &_4$$7); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &funcArguments, &_4$$7); ZEPHIR_UNREF(&funcArguments); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 0, &funcArguments); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 500, &funcArguments); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&arguments, &left); @@ -3980,7 +3980,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fast_append(&_7$$9, &funcArguments); ZEPHIR_INIT_VAR(&_8$$9); ZVAL_STRING(&_8$$9, "compileFilter"); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 0, &_8$$9, &_7$$9); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 503, &_8$$9, &_7$$9); zephir_check_call_status(); if (Z_TYPE_P(&code) == IS_STRING) { RETURN_CCTOR(&code); @@ -4011,7 +4011,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_12$$11, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2483); ZEPHIR_INIT_VAR(&_13$$11); ZEPHIR_CONCAT_SVSVSV(&_13$$11, "Invalid definition for user filter '", &name, "' in ", &_11$$11, " on line ", &_12$$11); - ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", NULL, 0, &_13$$11); + ZEPHIR_CALL_METHOD(NULL, &_10$$11, "__construct", NULL, 501, &_13$$11); zephir_check_call_status(); zephir_throw_exception_debug(&_10$$11, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2483); ZEPHIR_MM_RESTORE(); @@ -4145,7 +4145,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) zephir_array_fetch_string(&_25, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2677); ZEPHIR_INIT_VAR(&_26); ZEPHIR_CONCAT_SVSVSV(&_26, "Unknown filter \"", &name, "\" in ", &_24, " on line ", &_25); - ZEPHIR_CALL_METHOD(NULL, &_23, "__construct", NULL, 0, &_26); + ZEPHIR_CALL_METHOD(NULL, &_23, "__construct", NULL, 501, &_26); zephir_check_call_status(); zephir_throw_exception_debug(&_23, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2677); ZEPHIR_MM_RESTORE(); @@ -4316,7 +4316,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_6$$7, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2725); ZEPHIR_INIT_NVAR(&_7$$7); ZEPHIR_CONCAT_SVSV(&_7$$7, "Invalid statement in ", &_5$$7, " on line ", &_6$$7); - ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_8, 0, &_7$$7, &statement); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_8, 501, &_7$$7, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$7, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2727); ZEPHIR_MM_RESTORE(); @@ -4328,7 +4328,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fast_append(&_9$$8, &statement); ZEPHIR_INIT_NVAR(&_10$$8); ZVAL_STRING(&_10$$8, "compileStatement"); - ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 0, &_10$$8, &_9$$8); + ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 503, &_10$$8, &_9$$8); zephir_check_call_status(); if (Z_TYPE_P(&tempCompilation) == IS_STRING) { zephir_concat_self(&compilation, &tempCompilation); @@ -4433,7 +4433,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) } else { ZVAL_BOOL(&_34$$24, 0); } - ZEPHIR_CALL_METHOD(&_33$$24, this_ptr, "statementlist", &_35, 0, &blockStatements, &_34$$24); + ZEPHIR_CALL_METHOD(&_33$$24, this_ptr, "statementlist", &_35, 502, &blockStatements, &_34$$24); zephir_check_call_status(); zephir_concat_self(&compilation, &_33$$24); } @@ -4543,7 +4543,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_58$$37, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_INIT_NVAR(&_59$$37); ZEPHIR_CONCAT_SVSVSV(&_59$$37, "Unknown statement ", &type, " in ", &_57$$37, " on line ", &_58$$37); - ZEPHIR_CALL_METHOD(NULL, &_56$$37, "__construct", &_8, 0, &_59$$37); + ZEPHIR_CALL_METHOD(NULL, &_56$$37, "__construct", &_8, 501, &_59$$37); zephir_check_call_status(); zephir_throw_exception_debug(&_56$$37, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_MM_RESTORE(); @@ -4573,7 +4573,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_62$$40, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2725); ZEPHIR_INIT_NVAR(&_63$$40); ZEPHIR_CONCAT_SVSV(&_63$$40, "Invalid statement in ", &_61$$40, " on line ", &_62$$40); - ZEPHIR_CALL_METHOD(NULL, &_60$$40, "__construct", &_8, 0, &_63$$40, &statement); + ZEPHIR_CALL_METHOD(NULL, &_60$$40, "__construct", &_8, 501, &_63$$40, &statement); zephir_check_call_status(); zephir_throw_exception_debug(&_60$$40, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2727); ZEPHIR_MM_RESTORE(); @@ -4585,7 +4585,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fast_append(&_64$$41, &statement); ZEPHIR_INIT_NVAR(&_65$$41); ZVAL_STRING(&_65$$41, "compileStatement"); - ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 0, &_65$$41, &_64$$41); + ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 503, &_65$$41, &_64$$41); zephir_check_call_status(); if (Z_TYPE_P(&tempCompilation) == IS_STRING) { zephir_concat_self(&compilation, &tempCompilation); @@ -4690,7 +4690,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) } else { ZVAL_BOOL(&_81$$57, 0); } - ZEPHIR_CALL_METHOD(&_80$$57, this_ptr, "statementlist", &_35, 0, &blockStatements, &_81$$57); + ZEPHIR_CALL_METHOD(&_80$$57, this_ptr, "statementlist", &_35, 502, &blockStatements, &_81$$57); zephir_check_call_status(); zephir_concat_self(&compilation, &_80$$57); } @@ -4800,7 +4800,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementList) zephir_array_fetch_string(&_96$$70, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_INIT_NVAR(&_97$$70); ZEPHIR_CONCAT_SVSVSV(&_97$$70, "Unknown statement ", &type, " in ", &_95$$70, " on line ", &_96$$70); - ZEPHIR_CALL_METHOD(NULL, &_94$$70, "__construct", &_8, 0, &_97$$70); + ZEPHIR_CALL_METHOD(NULL, &_94$$70, "__construct", &_8, 501, &_97$$70); zephir_check_call_status(); zephir_throw_exception_debug(&_94$$70, "phalcon/Mvc/View/Engine/Volt/Compiler.zep", 2957); ZEPHIR_MM_RESTORE(); @@ -4893,7 +4893,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, statementListOrExtends) ZEPHIR_INIT_NVAR(&statement); } if (isStatementList) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "statementlist", NULL, 0, statements); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "statementlist", NULL, 502, statements); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/mvc/view/simple.zep.c b/ext/phalcon/mvc/view/simple.zep.c index 66ad6250746..d2070237cfb 100644 --- a/ext/phalcon/mvc/view/simple.zep.c +++ b/ext/phalcon/mvc/view/simple.zep.c @@ -417,7 +417,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, partial) } - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 459); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 383); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { zephir_read_property(&_0$$3, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY); @@ -430,12 +430,12 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, partial) } else { ZEPHIR_CPY_WRT(&mergedParams, params); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 0, &partialPath, &mergedParams); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 506, &partialPath, &mergedParams); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { zephir_update_property_zval(this_ptr, ZEND_STRL("viewParams"), &viewParams); } - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 0); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 486); zephir_check_call_status(); zephir_read_property(&_2, this_ptr, ZEND_STRL("content"), PH_NOISY_CC | PH_READONLY); zend_print_zval(&_2, 0); @@ -534,15 +534,15 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, render) ZEPHIR_INIT_VAR(&_0); ZEPHIR_CREATE_SYMBOL_TABLE(); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 459); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 383); zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("viewParams"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&viewParams, &_1); ZEPHIR_INIT_VAR(&mergedParams); zephir_fast_array_merge(&mergedParams, &viewParams, ¶ms); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 0, &path, &mergedParams); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "internalrender", NULL, 506, &path, &mergedParams); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 0); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 486); zephir_check_call_status(); RETURN_MM_MEMBER(getThis(), "content"); } @@ -794,7 +794,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setViewsDir) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdirseparator", NULL, 0, &viewsDir); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdirseparator", NULL, 507, &viewsDir); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("viewsDir"), &_0); ZEPHIR_MM_RESTORE(); @@ -853,7 +853,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines) if (Z_TYPE_P(®isteredEngines) != IS_ARRAY) { ZEPHIR_INIT_VAR(&_2$$4); object_init_ex(&_2$$4, phalcon_mvc_view_engine_php_ce); - ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 0, this_ptr, &di); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 489, this_ptr, &di); zephir_check_call_status(); zephir_array_update_string(&engines, SL(".phtml"), &_2$$4, PH_COPY | PH_SEPARATE); } else { @@ -879,7 +879,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines) ZEPHIR_CALL_CE_STATIC(&_7$$9, _8$$9, "bind", &_9, 0, &engineService, &di); zephir_check_call_status(); ZEPHIR_CPY_WRT(&engineService, &_7$$9); - ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_10, 199, &engineService, this_ptr); + ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_10, 180, &engineService, this_ptr); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&engineObject, &engineService); @@ -895,7 +895,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines) object_init_ex(&_12$$12, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_NVAR(&_13$$12); ZEPHIR_CONCAT_SV(&_13$$12, "Invalid template engine registration for extension: ", &extension); - ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 31, &_13$$12); + ZEPHIR_CALL_METHOD(NULL, &_12$$12, "__construct", &_14, 29, &_13$$12); zephir_check_call_status(); zephir_throw_exception_debug(&_12$$12, "phalcon/Mvc/View/Simple.zep", 477); ZEPHIR_MM_RESTORE(); @@ -922,7 +922,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines) ZEPHIR_CALL_CE_STATIC(&_15$$15, _16$$15, "bind", &_9, 0, &engineService, &di); zephir_check_call_status(); ZEPHIR_CPY_WRT(&engineService, &_15$$15); - ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_10, 199, &engineService, this_ptr); + ZEPHIR_CALL_FUNCTION(&engineObject, "call_user_func", &_10, 180, &engineService, this_ptr); zephir_check_call_status(); } else { ZEPHIR_CPY_WRT(&engineObject, &engineService); @@ -938,7 +938,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, loadTemplateEngines) object_init_ex(&_18$$18, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_NVAR(&_19$$18); ZEPHIR_CONCAT_SV(&_19$$18, "Invalid template engine registration for extension: ", &extension); - ZEPHIR_CALL_METHOD(NULL, &_18$$18, "__construct", &_14, 31, &_19$$18); + ZEPHIR_CALL_METHOD(NULL, &_18$$18, "__construct", &_14, 29, &_19$$18); zephir_check_call_status(); zephir_throw_exception_debug(&_18$$18, "phalcon/Mvc/View/Simple.zep", 477); ZEPHIR_MM_RESTORE(); @@ -1177,7 +1177,7 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, internalRender) object_init_ex(&_30$$20, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_VAR(&_31$$20); ZEPHIR_CONCAT_SVS(&_31$$20, "View '", &viewsDirPath, "' was not found in the views directory"); - ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", NULL, 31, &_31$$20); + ZEPHIR_CALL_METHOD(NULL, &_30$$20, "__construct", NULL, 29, &_31$$20); zephir_check_call_status(); zephir_throw_exception_debug(&_30$$20, "phalcon/Mvc/View/Simple.zep", 576); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/paginator/adapter/model.zep.c b/ext/phalcon/paginator/adapter/model.zep.c index d7cd9e08bbd..603e42a4581 100644 --- a/ext/phalcon/paginator/adapter/model.zep.c +++ b/ext/phalcon/paginator/adapter/model.zep.c @@ -165,7 +165,7 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) ZEPHIR_INIT_VAR(&_6); ZVAL_STRING(&_6, "count"); zephir_array_fast_append(&_5, &_6); - ZEPHIR_CALL_FUNCTION(&_7, "call_user_func", NULL, 199, &_5, ¶meters); + ZEPHIR_CALL_FUNCTION(&_7, "call_user_func", NULL, 180, &_5, ¶meters); zephir_check_call_status(); rowcount = zephir_get_intval(&_7); if (zephir_safe_mod_long_long(rowcount, limit) != 0) { @@ -186,7 +186,7 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) ZEPHIR_INIT_VAR(&_11$$8); ZVAL_STRING(&_11$$8, "find"); zephir_array_fast_append(&_10$$8, &_11$$8); - ZEPHIR_CALL_FUNCTION(&_12$$8, "call_user_func", NULL, 199, &_10$$8, ¶meters); + ZEPHIR_CALL_FUNCTION(&_12$$8, "call_user_func", NULL, 180, &_10$$8, ¶meters); zephir_check_call_status(); ZEPHIR_CPY_WRT(&pageItems, &_12$$8); } diff --git a/ext/phalcon/paginator/adapter/nativearray.zep.c b/ext/phalcon/paginator/adapter/nativearray.zep.c index 561d0d64a41..a1f05a18cb9 100644 --- a/ext/phalcon/paginator/adapter/nativearray.zep.c +++ b/ext/phalcon/paginator/adapter/nativearray.zep.c @@ -113,7 +113,7 @@ PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, paginate) } ZVAL_LONG(&_0, (show * ((pageNumber - 1)))); ZVAL_LONG(&_4, show); - ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 0, &items, &_0, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 498, &items, &_0, &_4); zephir_check_call_status(); ZEPHIR_CPY_WRT(&items, &_5); if (pageNumber < totalPages) { diff --git a/ext/phalcon/paginator/adapter/querybuilder.zep.c b/ext/phalcon/paginator/adapter/querybuilder.zep.c index 4e95444ad42..7259d47c2a8 100644 --- a/ext/phalcon/paginator/adapter/querybuilder.zep.c +++ b/ext/phalcon/paginator/adapter/querybuilder.zep.c @@ -123,7 +123,7 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct) object_init_ex(&_0$$5, phalcon_paginator_exception_ce); ZEPHIR_INIT_VAR(&_1$$5); ZEPHIR_CONCAT_SS(&_1$$5, "Parameter 'builder' must be an instance ", "of Phalcon\\Mvc\\Model\\Query\\Builder"); - ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 31, &_1$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 29, &_1$$5); zephir_check_call_status(); zephir_throw_exception_debug(&_0$$5, "phalcon/Paginator/Adapter/QueryBuilder.zep", 80); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/paginator/paginatorfactory.zep.c b/ext/phalcon/paginator/paginatorfactory.zep.c index 404f43e240e..eff963bf93f 100644 --- a/ext/phalcon/paginator/paginatorfactory.zep.c +++ b/ext/phalcon/paginator/paginatorfactory.zep.c @@ -95,7 +95,7 @@ PHP_METHOD(Phalcon_Paginator_PaginatorFactory, __construct) * $paginator = (new PaginatorFactory())->load($options); *``` * - * @param array|\Phalcon\Config = [ + * @param array|\Phalcon\Config\Config config = [ * 'adapter' => 'queryBuilder', * 'limit' => 20, * 'page' => 1, diff --git a/ext/phalcon/session/adapter/abstractadapter.zep.c b/ext/phalcon/session/adapter/abstractadapter.zep.c index 68943d1b17a..adb81b13f79 100644 --- a/ext/phalcon/session/adapter/abstractadapter.zep.c +++ b/ext/phalcon/session/adapter/abstractadapter.zep.c @@ -23,9 +23,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -62,35 +62,35 @@ PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy) zend_bool _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, _1, _2, _3$$3; + zval *sessionId, sessionId_sub, _1, _2, _3$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); - _0 = !(ZEPHIR_IS_EMPTY(id)); + _0 = !(ZEPHIR_IS_EMPTY(sessionId)); if (_0) { zephir_read_property(&_1, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_2, &_1, "has", NULL, 0, sessionId); zephir_check_call_status(); _0 = zephir_is_true(&_2); } if (_0) { zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_3$$3, "delete", NULL, 0, id); + ZEPHIR_RETURN_CALL_METHOD(&_3$$3, "delete", NULL, 0, sessionId); zephir_check_call_status(); RETURN_MM(); } @@ -99,22 +99,26 @@ PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, destroy) /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, gc) { - zval *maxlifetime, maxlifetime_sub; + zval *maxlifetime_param = NULL; + zend_long maxlifetime; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime); + zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); RETURN_BOOL(1); @@ -127,27 +131,27 @@ PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, read) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, data, _0, _1; + zval *sessionId, sessionId_sub, data, _0, _1; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, id); + ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); if (Z_TYPE_P(&data) == IS_NULL) { @@ -190,27 +194,27 @@ PHP_METHOD(Phalcon_Session_Adapter_AbstractAdapter, write) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, *data, data_sub, _0; + zval *sessionId, sessionId_sub, *data, data_sub, _0; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &id, &data); + zephir_fetch_params(1, 2, 0, &sessionId, &data); zephir_read_property(&_0, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, id, data); + ZEPHIR_RETURN_CALL_METHOD(&_0, "set", NULL, 0, sessionId, data); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/session/adapter/abstractadapter.zep.h b/ext/phalcon/session/adapter/abstractadapter.zep.h index 5601ca65654..45be8c40575 100644 --- a/ext/phalcon/session/adapter/abstractadapter.zep.h +++ b/ext/phalcon/session/adapter/abstractadapter.zep.h @@ -15,15 +15,25 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstract ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_INFO(0, maxlifetime) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_open, 0, 2, _IS_BOOL, 0) @@ -32,7 +42,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstract ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_abstractadapter_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/session/adapter/libmemcached.zep.c b/ext/phalcon/session/adapter/libmemcached.zep.c index b12a7773c05..afcd49cae5f 100644 --- a/ext/phalcon/session/adapter/libmemcached.zep.c +++ b/ext/phalcon/session/adapter/libmemcached.zep.c @@ -21,9 +21,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -39,9 +39,10 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Libmemcached) } /** - * Constructor + * Libmemcached constructor. * - * @param array options = [ + * @param AdapterFactory $factory + * @param array $options = [ * 'servers' => [ * [ * 'host' => 'localhost', diff --git a/ext/phalcon/session/adapter/noop.zep.c b/ext/phalcon/session/adapter/noop.zep.c index a33df4feda4..d3caec7c274 100644 --- a/ext/phalcon/session/adapter/noop.zep.c +++ b/ext/phalcon/session/adapter/noop.zep.c @@ -23,9 +23,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -142,19 +142,19 @@ PHP_METHOD(Phalcon_Session_Adapter_Noop, close) */ PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy) { - zval *id, id_sub; + zval *sessionId, sessionId_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &id); + zephir_fetch_params_without_memory_grow(1, 0, &sessionId); RETURN_BOOL(1); @@ -162,22 +162,26 @@ PHP_METHOD(Phalcon_Session_Adapter_Noop, destroy) /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ PHP_METHOD(Phalcon_Session_Adapter_Noop, gc) { - zval *maxlifetime, maxlifetime_sub; + zval *maxlifetime_param = NULL; + zend_long maxlifetime; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime); + zephir_fetch_params_without_memory_grow(1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); RETURN_BOOL(1); @@ -188,19 +192,19 @@ PHP_METHOD(Phalcon_Session_Adapter_Noop, gc) */ PHP_METHOD(Phalcon_Session_Adapter_Noop, read) { - zval *id, id_sub; + zval *sessionId, sessionId_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &id); + zephir_fetch_params_without_memory_grow(1, 0, &sessionId); RETURN_STRING(""); @@ -236,21 +240,21 @@ PHP_METHOD(Phalcon_Session_Adapter_Noop, open) */ PHP_METHOD(Phalcon_Session_Adapter_Noop, write) { - zval *id, id_sub, *data, data_sub; + zval *sessionId, sessionId_sub, *data, data_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(2, 0, &id, &data); + zephir_fetch_params_without_memory_grow(2, 0, &sessionId, &data); RETURN_BOOL(1); diff --git a/ext/phalcon/session/adapter/noop.zep.h b/ext/phalcon/session/adapter/noop.zep.h index daedf7d1a82..6b9adde87c8 100644 --- a/ext/phalcon/session/adapter/noop.zep.h +++ b/ext/phalcon/session/adapter/noop.zep.h @@ -25,15 +25,25 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_clo ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_noop_gc, 0, 0, 1) + ZEND_ARG_INFO(0, maxlifetime) +ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_open, 0, 2, _IS_BOOL, 0) @@ -42,7 +52,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_ope ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_noop_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/session/adapter/redis.zep.c b/ext/phalcon/session/adapter/redis.zep.c index c1f393c0d82..1fc10ead7b3 100644 --- a/ext/phalcon/session/adapter/redis.zep.c +++ b/ext/phalcon/session/adapter/redis.zep.c @@ -21,9 +21,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -41,14 +41,15 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Redis) /** * Constructor * - * @param array options = [ - * 'prefix' => 'sess-reds-', - * 'host' => '127.0.0.1', - * 'port' => 6379, - * 'index' => 0, - * 'persistent' => false, - * 'auth' => '', - * 'socket' => '' + * @param AdapterFactory $factory + * @param array $options = [ + * 'prefix' => 'sess-reds-', + * 'host' => '127.0.0.1', + * 'port' => 6379, + * 'index' => 0, + * 'persistent' => false, + * 'auth' => '', + * 'socket' => '', * ] */ PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct) diff --git a/ext/phalcon/session/adapter/stream.zep.c b/ext/phalcon/session/adapter/stream.zep.c index 16875a655c2..f1bf1258dba 100644 --- a/ext/phalcon/session/adapter/stream.zep.c +++ b/ext/phalcon/session/adapter/stream.zep.c @@ -13,22 +13,22 @@ #include "kernel/main.h" #include "kernel/fcall.h" -#include "kernel/object.h" -#include "kernel/array.h" #include "kernel/memory.h" #include "kernel/operators.h" #include "kernel/exception.h" #include "kernel/concat.h" +#include "kernel/object.h" #include "ext/spl/spl_exceptions.h" #include "kernel/file.h" #include "kernel/time.h" +#include "kernel/array.h" #include "kernel/string.h" /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -52,6 +52,10 @@ * ); * $session->setAdapter($files); * ``` + * + * @property array $options + * @property string $prefix + * @property string $path */ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Stream) { @@ -67,7 +71,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Stream) /** * Constructor * - * @param array options = [ + * @param array $options = [ * 'prefix' => '', * 'savePath' => '' * ] @@ -77,15 +81,16 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval options, *options_param = NULL, path, _1, _3, _6, _2$$3, _4$$4, _5$$4; + zval *options_param = NULL, path, _1, _2, _3, _6, _4$$4, _5$$4; + zval options; zval *this_ptr = getThis(); ZVAL_UNDEF(&options); ZVAL_UNDEF(&path); ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_6); - ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_5$$4); #if PHP_VERSION_ID >= 80000 @@ -109,29 +114,32 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, __construct) ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_stream_ce, getThis(), "__construct", &_0, 0, &options); zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&options, &_1); - ZEPHIR_OBS_VAR(&path); - if (!(zephir_array_isset_string_fetch(&path, &options, SL("savePath"), 0))) { - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, "session.save_path"); - ZEPHIR_CALL_FUNCTION(&path, "ini_get", NULL, 0, &_2$$3); - zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "session.save_path"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "phpiniget", NULL, 0, &_2); + zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "savePath"); + ZEPHIR_CALL_METHOD(&path, this_ptr, "getarrval", NULL, 0, &options, &_2, &_1); + zephir_check_call_status(); + if (UNEXPECTED(1 == ZEPHIR_IS_EMPTY(&path))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session save path cannot be empty", "phalcon/Session/Adapter/Stream.zep", 67); + return; } - ZEPHIR_CALL_FUNCTION(&_3, "is_writable", NULL, 395, &path); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "phpiswritable", NULL, 0, &path); zephir_check_call_status(); - if (UNEXPECTED(!zephir_is_true(&_3))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3))) { ZEPHIR_INIT_VAR(&_4$$4); object_init_ex(&_4$$4, phalcon_session_exception_ce); ZEPHIR_INIT_VAR(&_5$$4); ZEPHIR_CONCAT_SVS(&_5$$4, "The session save path [", &path, "] is not writable"); - ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 31, &_5$$4); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 29, &_5$$4); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$4, "phalcon/Session/Adapter/Stream.zep", 67); + zephir_throw_exception_debug(&_4$$4, "phalcon/Session/Adapter/Stream.zep", 71); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_6, this_ptr, "getdirseparator", NULL, 0, &path); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "getdirseparator", NULL, 508, &path); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("path"), &_6); ZEPHIR_MM_RESTORE(); @@ -142,10 +150,10 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy) zend_bool _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, file, _0, _1, _3; + zval *sessionId, sessionId_sub, file, _0, _1, _3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&file); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); @@ -153,28 +161,28 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&file); ZEPHIR_CONCAT_VV(&file, &_0, &_1); _2 = (zephir_file_exists(&file) == SUCCESS); if (_2) { - ZEPHIR_CALL_FUNCTION(&_3, "is_file", NULL, 0, &file); + ZEPHIR_CALL_FUNCTION(&_3, "is_file", NULL, 509, &file); zephir_check_call_status(); _2 = zephir_is_true(&_3); } if (_2) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", NULL, 118, &file); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -182,17 +190,19 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, destroy) /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) { zend_bool _6$$3, _9$$3, _12$$5, _14$$5; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *maxlifetime, maxlifetime_sub, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5; + zval *maxlifetime_param = NULL, file, pattern, time, _0, _1, _2, _3, *_4, _5, _7$$3, _10$$3, _13$$5, _15$$5; + zend_long maxlifetime, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); - ZVAL_UNDEF(&maxlifetime_sub); ZVAL_UNDEF(&file); ZVAL_UNDEF(&pattern); ZVAL_UNDEF(&time); @@ -208,13 +218,14 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(maxlifetime) + Z_PARAM_LONG(maxlifetime) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &maxlifetime); + zephir_fetch_params(1, 1, 0, &maxlifetime_param); + maxlifetime = zephir_get_intval(maxlifetime_param); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); @@ -224,20 +235,20 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) ZEPHIR_INIT_VAR(&_2); zephir_time(&_2); ZEPHIR_INIT_VAR(&time); - zephir_sub_function(&time, &_2, maxlifetime); - ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 0, &pattern); + ZVAL_LONG(&time, (zephir_get_numberval(&_2) - maxlifetime)); + ZEPHIR_CALL_FUNCTION(&_3, "glob", NULL, 510, &pattern); zephir_check_call_status(); - zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 104); + zephir_is_iterable(&_3, 0, "phalcon/Session/Adapter/Stream.zep", 111); if (Z_TYPE_P(&_3) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4) { ZEPHIR_INIT_NVAR(&file); ZVAL_COPY(&file, _4); - _6$$3 = (zephir_file_exists(&file) == SUCCESS); + _6$$3 = 1 == (zephir_file_exists(&file) == SUCCESS); if (_6$$3) { - ZEPHIR_CALL_FUNCTION(&_7$$3, "is_file", &_8, 0, &file); + ZEPHIR_CALL_FUNCTION(&_7$$3, "is_file", &_8, 509, &file); zephir_check_call_status(); - _6$$3 = zephir_is_true(&_7$$3); + _6$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_7$$3); } _9$$3 = _6$$3; if (_9$$3) { @@ -246,7 +257,7 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) _9$$3 = ZEPHIR_LT(&_10$$3, &time); } if (_9$$3) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 118, &file); zephir_check_call_status(); } } ZEND_HASH_FOREACH_END(); @@ -261,11 +272,11 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) } ZEPHIR_CALL_METHOD(&file, &_3, "current", NULL, 0); zephir_check_call_status(); - _12$$5 = (zephir_file_exists(&file) == SUCCESS); + _12$$5 = 1 == (zephir_file_exists(&file) == SUCCESS); if (_12$$5) { - ZEPHIR_CALL_FUNCTION(&_13$$5, "is_file", &_8, 0, &file); + ZEPHIR_CALL_FUNCTION(&_13$$5, "is_file", &_8, 509, &file); zephir_check_call_status(); - _12$$5 = zephir_is_true(&_13$$5); + _12$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_13$$5); } _14$$5 = _12$$5; if (_14$$5) { @@ -274,7 +285,7 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc) _14$$5 = ZEPHIR_LT(&_15$$5, &time); } if (_14$$5) { - ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 145, &file); + ZEPHIR_CALL_FUNCTION(NULL, "unlink", &_11, 118, &file); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(NULL, &_3, "next", NULL, 0); @@ -312,52 +323,58 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, open) RETURN_BOOL(1); } +/** + * Reads data from the adapter + */ PHP_METHOD(Phalcon_Session_Adapter_Stream, read) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, data, name, pointer, _0, _1, _2$$3, _3$$3, _4$$3; + zval *sessionId, sessionId_sub, data, name, pointer, _0, _1, _2, _3$$3, _4$$3, _5$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data); ZVAL_UNDEF(&name); ZVAL_UNDEF(&pointer); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3$$3); ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id); + zephir_fetch_params(1, 1, 0, &sessionId); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); ZEPHIR_CONCAT_VV(&name, &_0, &_1); ZEPHIR_INIT_VAR(&data); ZVAL_STRING(&data, ""); - if ((zephir_file_exists(&name) == SUCCESS)) { - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, "r"); - ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 90, &name, &_2$$3); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileexists", NULL, 0, &name); + zephir_check_call_status(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_2)) { + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "r"); + ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &name, &_3$$3); zephir_check_call_status(); - ZVAL_LONG(&_3$$3, 1); - ZEPHIR_CALL_FUNCTION(&_4$$3, "flock", NULL, 154, &pointer, &_3$$3); + ZVAL_LONG(&_4$$3, 1); + ZEPHIR_CALL_FUNCTION(&_5$$3, "flock", NULL, 126, &pointer, &_4$$3); zephir_check_call_status(); - if (zephir_is_true(&_4$$3)) { - ZEPHIR_INIT_NVAR(&data); - zephir_file_get_contents(&data, &name); + if (zephir_is_true(&_5$$3)) { + ZEPHIR_CALL_METHOD(&data, this_ptr, "phpfilegetcontents", NULL, 0, &name); + zephir_check_call_status(); } zephir_fclose(&pointer); if (ZEPHIR_IS_FALSE_IDENTICAL(&data)) { @@ -371,10 +388,10 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, write) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, id_sub, *data, data_sub, name, _0, _1, _2, _3; + zval *sessionId, sessionId_sub, *data, data_sub, name, _0, _1, _2, _3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&sessionId_sub); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&name); ZVAL_UNDEF(&_0); @@ -384,30 +401,93 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, write) #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) - Z_PARAM_ZVAL(id) + Z_PARAM_ZVAL(sessionId) Z_PARAM_ZVAL(data) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 2, 0, &id, &data); + zephir_fetch_params(1, 2, 0, &sessionId, &data); zephir_read_property(&_0, this_ptr, ZEND_STRL("path"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, id); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedname", NULL, 0, sessionId); zephir_check_call_status(); ZEPHIR_INIT_VAR(&name); ZEPHIR_CONCAT_VV(&name, &_0, &_1); - ZVAL_LONG(&_2, 2); - ZEPHIR_CALL_FUNCTION(&_3, "file_put_contents", NULL, 157, &name, data, &_2); + ZVAL_LONG(&_3, 2); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &name, data, &_3); zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_3)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2)); } /** * @todo Remove this when we get traits */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, getArrVal) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval cast; + zval *collection_param = NULL, *index, index_sub, *defaultValue = NULL, defaultValue_sub, *cast_param = NULL, __$null, value; + zval collection; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&cast); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_ARRAY(collection) + Z_PARAM_ZVAL(index) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + Z_PARAM_STR_OR_NULL(cast) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &collection_param, &index, &defaultValue, &cast_param); + ZEPHIR_OBS_COPY_OR_DUP(&collection, collection_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + if (!cast_param) { + ZEPHIR_INIT_VAR(&cast); + } else { + if (UNEXPECTED(Z_TYPE_P(cast_param) != IS_STRING && Z_TYPE_P(cast_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cast' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(cast_param) == IS_STRING)) { + zephir_get_strval(&cast, cast_param); + } else { + ZEPHIR_INIT_VAR(&cast); + } + } + + + ZEPHIR_OBS_VAR(&value); + if (UNEXPECTED(!(zephir_array_isset_fetch(&value, &collection, index, 0)))) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + if (UNEXPECTED(zephir_is_true(&cast))) { + ZEPHIR_MAKE_REF(&value); + ZEPHIR_CALL_FUNCTION(NULL, "settype", NULL, 12, &value, &cast); + ZEPHIR_UNREF(&value); + zephir_check_call_status(); + } + RETURN_CCTOR(&value); +} + PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -447,3 +527,232 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator) RETURN_MM(); } +/** + * @param string $filename + * + * @return bool + * + * @link https://php.net/manual/en/function.file-exists.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS)); +} + +/** + * @param string $filename + * + * @return string|false + * + * @link https://php.net/manual/en/function.file-get-contents.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileGetContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + zephir_file_get_contents(return_value, &filename); + RETURN_MM(); +} + +/** + * @param string $filename + * @param mixed $data + * @param int $flags + * @param resource $context + * + * @return int|false + * + * @link https://php.net/manual/en/function.file-put-contents.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFilePutContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long flags, ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_STR(filename) + Z_PARAM_ZVAL(data) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(flags) + Z_PARAM_ZVAL_OR_NULL(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context); + zephir_get_strval(&filename, filename_param); + if (!flags_param) { + flags = 0; + } else { + flags = zephir_get_intval(flags_param); + } + if (!context) { + context = &context_sub; + context = &__$null; + } + + + ZVAL_LONG(&_0, flags); + ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 133, &filename, data, &_0, context); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * @param string $filename + * @param string $mode + * + * @return resource|false + * + * @link https://php.net/manual/en/function.fopen.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFopen) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *mode_param = NULL; + zval filename, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&mode); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(filename) + Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &filename_param, &mode_param); + zephir_get_strval(&filename, filename_param); + zephir_get_strval(&mode, mode_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Gets the value of a configuration option + * + * @param string $varname + * + * @return string + * + * @link https://php.net/manual/en/function.ini-get.php + * @link https://php.net/manual/en/ini.list.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIniGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *varname_param = NULL; + zval varname; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&varname); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(varname) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &varname_param); + zephir_get_strval(&varname, varname_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("ini_get", NULL, 511, &varname); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * Tells whether the filename is writable + * + * @param string $filename + * + * @return bool + * + * @link https://php.net/manual/en/function.is-writable.php + */ +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("is_writable", NULL, 0, &filename); + zephir_check_call_status(); + RETURN_MM(); +} + diff --git a/ext/phalcon/session/adapter/stream.zep.h b/ext/phalcon/session/adapter/stream.zep.h index 9107713e209..134fca2c9b0 100644 --- a/ext/phalcon/session/adapter/stream.zep.h +++ b/ext/phalcon/session/adapter/stream.zep.h @@ -9,7 +9,14 @@ PHP_METHOD(Phalcon_Session_Adapter_Stream, gc); PHP_METHOD(Phalcon_Session_Adapter_Stream, open); PHP_METHOD(Phalcon_Session_Adapter_Stream, read); PHP_METHOD(Phalcon_Session_Adapter_Stream, write); +PHP_METHOD(Phalcon_Session_Adapter_Stream, getArrVal); PHP_METHOD(Phalcon_Session_Adapter_Stream, getDirSeparator); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileExists); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFileGetContents); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFilePutContents); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpFopen); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIniGet); +PHP_METHOD(Phalcon_Session_Adapter_Stream, phpIsWritable); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream___construct, 0, 0, 0) #if PHP_VERSION_ID >= 80000 @@ -20,12 +27,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream___construct, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_destroy, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) +ZEND_END_ARG_INFO() +#elif PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 0, 1) - ZEND_ARG_INFO(0, maxlifetime) + ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0) ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_gc, 0, 0, 1) + ZEND_ARG_INFO(0, maxlifetime) +ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_open, 0, 2, _IS_BOOL, 0) ZEND_ARG_INFO(0, savePath) @@ -33,18 +50,53 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_o ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_read, 0, 1, IS_STRING, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_write, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, id) + ZEND_ARG_INFO(0, sessionId) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_getarrval, 0, 0, 2) + ZEND_ARG_ARRAY_INFO(0, collection, 0) + ZEND_ARG_INFO(0, index) + ZEND_ARG_INFO(0, defaultValue) + ZEND_ARG_TYPE_INFO(0, cast, IS_STRING, 1) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_getdirseparator, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfileexists, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfilegetcontents, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfileputcontents, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_stream_phpfopen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_phpiniget, 0, 1, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, varname, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_stream_phpiswritable, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_session_adapter_stream_method_entry) { PHP_ME(Phalcon_Session_Adapter_Stream, __construct, arginfo_phalcon_session_adapter_stream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Session_Adapter_Stream, destroy, arginfo_phalcon_session_adapter_stream_destroy, ZEND_ACC_PUBLIC) @@ -52,6 +104,13 @@ ZEPHIR_INIT_FUNCS(phalcon_session_adapter_stream_method_entry) { PHP_ME(Phalcon_Session_Adapter_Stream, open, arginfo_phalcon_session_adapter_stream_open, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Stream, read, arginfo_phalcon_session_adapter_stream_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Stream, write, arginfo_phalcon_session_adapter_stream_write, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Stream, getArrVal, arginfo_phalcon_session_adapter_stream_getarrval, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Session_Adapter_Stream, getDirSeparator, arginfo_phalcon_session_adapter_stream_getdirseparator, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFileExists, arginfo_phalcon_session_adapter_stream_phpfileexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFileGetContents, arginfo_phalcon_session_adapter_stream_phpfilegetcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFilePutContents, arginfo_phalcon_session_adapter_stream_phpfileputcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpFopen, arginfo_phalcon_session_adapter_stream_phpfopen, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpIniGet, arginfo_phalcon_session_adapter_stream_phpiniget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Session_Adapter_Stream, phpIsWritable, arginfo_phalcon_session_adapter_stream_phpiswritable, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/session/bag.zep.c b/ext/phalcon/session/bag.zep.c index 296f96e36eb..d9a672759f7 100644 --- a/ext/phalcon/session/bag.zep.c +++ b/ext/phalcon/session/bag.zep.c @@ -13,17 +13,17 @@ #include "kernel/main.h" #include "kernel/object.h" -#include "kernel/operators.h" -#include "kernel/exception.h" #include "kernel/memory.h" #include "kernel/fcall.h" +#include "kernel/operators.h" #include "ext/spl/spl_exceptions.h" +#include "kernel/exception.h" /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -41,6 +41,10 @@ * $user->name = "Kimbra Johnson"; * $user->age = 22; * ``` + * + * @property DiInterface|null $container + * @property string $name + * @property ManagerInterface $session; */ ZEPHIR_INIT_CLASS(Phalcon_Session_Bag) { @@ -57,80 +61,52 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Bag) */ zend_declare_property_null(phalcon_session_bag_ce, SL("name"), ZEND_ACC_PRIVATE); /** - * @var \Phalcon\Session\ManagerInterface + * @var ManagerInterface */ zend_declare_property_null(phalcon_session_bag_ce, SL("session"), ZEND_ACC_PRIVATE); + zend_class_implements(phalcon_session_bag_ce, 1, phalcon_session_baginterface_ce); zend_class_implements(phalcon_session_bag_ce, 1, phalcon_di_injectionawareinterface_ce); return SUCCESS; } /** - * Phalcon\Session\Bag constructor + * @param ManagerInterface $session + * @param string $name */ PHP_METHOD(Phalcon_Session_Bag, __construct) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *container = NULL, container_sub, __$null, data, session, _0, _1, _2; zval name; + zval *session, session_sub, *name_param = NULL, data, _0, _1; zval *this_ptr = getThis(); - ZVAL_UNDEF(&name); - ZVAL_UNDEF(&container_sub); - ZVAL_NULL(&__$null); + ZVAL_UNDEF(&session_sub); ZVAL_UNDEF(&data); - ZVAL_UNDEF(&session); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&name); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_OBJECT_OF_CLASS(session, phalcon_session_managerinterface_ce) Z_PARAM_STR(name) - Z_PARAM_OPTIONAL - Z_PARAM_OBJECT_OF_CLASS_OR_NULL(container, phalcon_di_diinterface_ce) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &name_param, &container); - if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(&name, name_param); - } else { - ZEPHIR_INIT_VAR(&name); - } - if (!container) { - container = &container_sub; - container = &__$null; - } + zephir_fetch_params(1, 2, 0, &session, &name_param); + zephir_get_strval(&name, name_param); + zephir_update_property_zval(this_ptr, ZEND_STRL("session"), session); zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); - if (UNEXPECTED(Z_TYPE_P(container) == IS_NULL)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/Session/Bag.zep", 62); - return; - } - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, "session"); - ZEPHIR_CALL_METHOD(&_0, container, "has", NULL, 0, &_1); - zephir_check_call_status(); - if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/Session/Bag.zep", 68); - return; - } - ZEPHIR_INIT_NVAR(&_1); - ZVAL_STRING(&_1, "session"); - ZEPHIR_CALL_METHOD(&session, container, "getshared", NULL, 0, &_1); + ZEPHIR_CALL_METHOD(&_0, session, "getdi", NULL, 0); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("container"), container); - zephir_update_property_zval(this_ptr, ZEND_STRL("session"), &session); - zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&data, &session, "get", NULL, 0, &_2); + zephir_update_property_zval(this_ptr, ZEND_STRL("container"), &_0); + zephir_read_property(&_1, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, session, "get", NULL, 0, &_1); zephir_check_call_status(); if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_INIT_NVAR(&data); @@ -187,14 +163,13 @@ PHP_METHOD(Phalcon_Session_Bag, init) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *data_param = NULL, _1, _2, _3; + zval *data_param = NULL, _1, _2; zval data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) @@ -218,8 +193,7 @@ PHP_METHOD(Phalcon_Session_Bag, init) zephir_check_call_status(); zephir_read_property(&_1, this_ptr, ZEND_STRL("session"), PH_NOISY_CC | PH_READONLY); zephir_read_property(&_2, this_ptr, ZEND_STRL("name"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &_3); + ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/session/bag.zep.h b/ext/phalcon/session/bag.zep.h index e0ae4193ba2..f00d7202b18 100644 --- a/ext/phalcon/session/bag.zep.h +++ b/ext/phalcon/session/bag.zep.h @@ -11,9 +11,9 @@ PHP_METHOD(Phalcon_Session_Bag, remove); PHP_METHOD(Phalcon_Session_Bag, set); PHP_METHOD(Phalcon_Session_Bag, setDI); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___construct, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___construct, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, session, Phalcon\\Session\\ManagerInterface, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) - ZEND_ARG_OBJ_INFO(0, container, Phalcon\\Di\\DiInterface, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_clear, 0, 0, IS_VOID, 0) diff --git a/ext/phalcon/session/baginterface.zep.c b/ext/phalcon/session/baginterface.zep.c new file mode 100644 index 00000000000..3961d4e737b --- /dev/null +++ b/ext/phalcon/session/baginterface.zep.c @@ -0,0 +1,44 @@ + +#ifdef HAVE_CONFIG_H +#include "../../ext_config.h" +#endif + +#include +#include "../../php_ext.h" +#include "../../ext.h" + +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +/** + * Phalcon\Session\BagInterface + * + * Interface for Phalcon\Session\Bag + */ +ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface) +{ + ZEPHIR_REGISTER_INTERFACE(Phalcon\\Session, BagInterface, phalcon, session_baginterface, phalcon_session_baginterface_method_entry); + + return SUCCESS; +} + +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __get); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __isset); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __set); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, __unset); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, init); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, get); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, set); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, has); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, remove); +ZEPHIR_DOC_METHOD(Phalcon_Session_BagInterface, clear); diff --git a/ext/phalcon/session/baginterface.zep.h b/ext/phalcon/session/baginterface.zep.h new file mode 100644 index 00000000000..89229dd5fba --- /dev/null +++ b/ext/phalcon/session/baginterface.zep.h @@ -0,0 +1,70 @@ + +extern zend_class_entry *phalcon_session_baginterface_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface); + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface___get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___isset, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___set, 0, 2, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___unset, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_init, 0, 0, IS_VOID, 0) + +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, data, 0) +#endif +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface_get, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, defaultValue) + ZEND_ARG_TYPE_INFO(0, cast, IS_STRING, 1) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_set, 0, 2, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_has, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_remove, 0, 1, IS_VOID, 0) + + ZEND_ARG_TYPE_INFO(0, element, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_clear, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEPHIR_INIT_FUNCS(phalcon_session_baginterface_method_entry) { + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __get, arginfo_phalcon_session_baginterface___get) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __isset, arginfo_phalcon_session_baginterface___isset) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __set, arginfo_phalcon_session_baginterface___set) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, __unset, arginfo_phalcon_session_baginterface___unset) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, init, arginfo_phalcon_session_baginterface_init) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, get, arginfo_phalcon_session_baginterface_get) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, set, arginfo_phalcon_session_baginterface_set) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, has, arginfo_phalcon_session_baginterface_has) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, remove, arginfo_phalcon_session_baginterface_remove) + PHP_ABSTRACT_ME(Phalcon_Session_BagInterface, clear, arginfo_phalcon_session_baginterface_clear) + PHP_FE_END +}; diff --git a/ext/phalcon/session/exception.zep.c b/ext/phalcon/session/exception.zep.c index 13d219620fb..84effc7f3cc 100644 --- a/ext/phalcon/session/exception.zep.c +++ b/ext/phalcon/session/exception.zep.c @@ -15,9 +15,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/session/manager.zep.c b/ext/phalcon/session/manager.zep.c index 77cc78380d1..9aced4dc458 100644 --- a/ext/phalcon/session/manager.zep.c +++ b/ext/phalcon/session/manager.zep.c @@ -19,23 +19,24 @@ #include "kernel/array.h" #include "ext/session/php_session.h" #include "kernel/exception.h" -#include "ext/spl/spl_exceptions.h" #include "kernel/concat.h" #include "kernel/string.h" +#include "ext/spl/spl_exceptions.h" /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ /** - * Phalcon\Session\Manager - * - * Session manager class + * @property SessionHandlerInterface|null $adapter + * @property string $name + * @property array $options + * @property string $uniqueId */ ZEPHIR_INIT_CLASS(Phalcon_Session_Manager) { @@ -66,7 +67,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Manager) /** * Manager constructor. * - * @param array options = [ + * @param array $options = [ * 'uniqueId' => null * ] */ @@ -105,6 +106,10 @@ PHP_METHOD(Phalcon_Session_Manager, __construct) /** * Alias: Gets a session variable from an application context + * + * @param string $key + * + * @return mixed */ PHP_METHOD(Phalcon_Session_Manager, __get) { @@ -135,6 +140,10 @@ PHP_METHOD(Phalcon_Session_Manager, __get) /** * Alias: Check whether a session variable is set in an application context + * + * @param string $key + * + * @return bool */ PHP_METHOD(Phalcon_Session_Manager, __isset) { @@ -165,6 +174,9 @@ PHP_METHOD(Phalcon_Session_Manager, __isset) /** * Alias: Sets a session variable in an application context + * + * @param string $key + * @param mixed $value */ PHP_METHOD(Phalcon_Session_Manager, __set) { @@ -197,6 +209,8 @@ PHP_METHOD(Phalcon_Session_Manager, __set) /** * Alias: Removes a session variable from an application context + * + * @param string $key */ PHP_METHOD(Phalcon_Session_Manager, __unset) { @@ -255,6 +269,8 @@ PHP_METHOD(Phalcon_Session_Manager, destroy) /** * Check whether the session has been started + * + * @return bool */ PHP_METHOD(Phalcon_Session_Manager, exists) { @@ -275,13 +291,19 @@ PHP_METHOD(Phalcon_Session_Manager, exists) /** * Gets a session variable from an application context + * + * @param string $key + * @param mixed|null $defaultValue + * @param bool $remove + * + * @return mixed|null */ PHP_METHOD(Phalcon_Session_Manager, get) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool remove; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, uniqueKey, value, _0; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, _SESSION, __$null, value, uniqueKey, _0; zval key; zval *this_ptr = getThis(); @@ -289,8 +311,8 @@ PHP_METHOD(Phalcon_Session_Manager, get) ZVAL_UNDEF(&defaultValue_sub); ZVAL_UNDEF(&_SESSION); ZVAL_NULL(&__$null); - ZVAL_UNDEF(&uniqueKey); ZVAL_UNDEF(&value); + ZVAL_UNDEF(&uniqueKey); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -449,38 +471,36 @@ PHP_METHOD(Phalcon_Session_Manager, getOptions) */ PHP_METHOD(Phalcon_Session_Manager, regenerateId) { - zend_bool delete = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *deleteOldSession = NULL, deleteOldSession_sub, __$true, _0, _1$$3; + zval *deleteOldSession_param = NULL, _0, _1$$3; + zend_bool deleteOldSession; zval *this_ptr = getThis(); - ZVAL_UNDEF(&deleteOldSession_sub); - ZVAL_BOOL(&__$true, 1); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_ZVAL(deleteOldSession) + Z_PARAM_BOOL(deleteOldSession) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 0, 1, &deleteOldSession); - if (!deleteOldSession) { - deleteOldSession = &deleteOldSession_sub; - deleteOldSession = &__$true; + zephir_fetch_params(1, 0, 1, &deleteOldSession_param); + if (!deleteOldSession_param) { + deleteOldSession = 1; + } else { + deleteOldSession = zephir_get_boolval(deleteOldSession_param); } - delete = zephir_get_boolval(deleteOldSession); ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZVAL_BOOL(&_1$$3, (delete ? 1 : 0)); + ZVAL_BOOL(&_1$$3, (deleteOldSession ? 1 : 0)); ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 0, &_1$$3); zephir_check_call_status(); } @@ -494,14 +514,14 @@ PHP_METHOD(Phalcon_Session_Manager, remove) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, _SESSION, _0, uniqueKey; + zval *key_param = NULL, _SESSION, uniqueKey, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&_SESSION); - ZVAL_UNDEF(&_0); ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -518,12 +538,11 @@ PHP_METHOD(Phalcon_Session_Manager, remove) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { - RETURN_MM_NULL(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); - zephir_check_call_status(); - zephir_array_unset(&_SESSION, &uniqueKey, PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -560,12 +579,11 @@ PHP_METHOD(Phalcon_Session_Manager, set) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { - RETURN_MM_NULL(); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_update_zval(&_SESSION, &uniqueKey, value, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&uniqueKey, this_ptr, "getuniquekey", NULL, 0, &key); - zephir_check_call_status(); - zephir_array_update_zval(&_SESSION, &uniqueKey, value, PH_COPY | PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -600,41 +618,41 @@ PHP_METHOD(Phalcon_Session_Manager, setId) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id_param = NULL, _0, _1$$3; - zval id, _2$$3; + zval *sessionId_param = NULL, _0, _1$$3; + zval sessionId, _2$$3; zval *this_ptr = getThis(); - ZVAL_UNDEF(&id); + ZVAL_UNDEF(&sessionId); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_STR(id) + Z_PARAM_STR(sessionId) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &id_param); - zephir_get_strval(&id, id_param); + zephir_fetch_params(1, 1, 0, &sessionId_param); + zephir_get_strval(&sessionId, sessionId_param); ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { ZEPHIR_INIT_VAR(&_1$$3); - object_init_ex(&_1$$3, spl_ce_RuntimeException); + object_init_ex(&_1$$3, phalcon_session_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SS(&_2$$3, "The session has already been started. ", "To change the id, use regenerateId()"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 254); + zephir_throw_exception_debug(&_1$$3, "phalcon/Session/Manager.zep", 271); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &id); + ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 0, &sessionId); zephir_check_call_status(); RETURN_THIS(); } @@ -643,7 +661,7 @@ PHP_METHOD(Phalcon_Session_Manager, setId) * Set the session name. Throw exception if the session has started * and do not allow poop names * - * @param string name + * @param string $name * * @throws InvalidArgumentException * @@ -678,8 +696,8 @@ PHP_METHOD(Phalcon_Session_Manager, setName) ZEPHIR_CALL_METHOD(&_0, this_ptr, "exists", NULL, 0); zephir_check_call_status(); - if (UNEXPECTED(zephir_is_true(&_0))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 277); + if (UNEXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "Cannot set session name after a session has started", "phalcon/Session/Manager.zep", 294); return; } ZEPHIR_INIT_VAR(&_1); @@ -690,7 +708,7 @@ PHP_METHOD(Phalcon_Session_Manager, setName) ZVAL_STRING(&_4, "/^[\\p{L}\\p{N}_-]+$/u"); zephir_preg_match(&_3, &_4, &name, &_1, 0, 0 , 0 ); if (UNEXPECTED(!zephir_is_true(&_3))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "The name contains non alphanum characters", "phalcon/Session/Manager.zep", 283); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The name contains non alphanum characters", "phalcon/Session/Manager.zep", 300); return; } zephir_update_property_zval(this_ptr, ZEND_STRL("name"), &name); @@ -772,7 +790,7 @@ PHP_METHOD(Phalcon_Session_Manager, start) if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_CALL_FUNCTION(&_1, "headers_sent", NULL, 433); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "phpheaderssent", NULL, 0); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { RETURN_MM_BOOL(0); @@ -780,7 +798,7 @@ PHP_METHOD(Phalcon_Session_Manager, start) ZEPHIR_OBS_VAR(&_2); zephir_read_property(&_2, this_ptr, ZEND_STRL("adapter"), PH_NOISY_CC); if (UNEXPECTED(!(zephir_is_instance_of(&_2, SL("SessionHandlerInterface"))))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session adapter is not valid", "phalcon/Session/Manager.zep", 327); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "The session adapter is not valid", "phalcon/Session/Manager.zep", 344); return; } ZEPHIR_OBS_VAR(&value); @@ -833,20 +851,46 @@ PHP_METHOD(Phalcon_Session_Manager, status) RETURN_MM_LONG(1); } +/** + * Checks if or where headers have been sent + * + * @return bool + * + * @link https://php.net/manual/en/function.headers-sent.php + */ +PHP_METHOD(Phalcon_Session_Manager, phpHeadersSent) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_FUNCTION("headers_sent", NULL, 357); + zephir_check_call_status(); + RETURN_MM(); +} + /** * Returns the key prefixed + * + * @param string $key + * + * @return string */ PHP_METHOD(Phalcon_Session_Manager, getUniqueKey) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *key_param = NULL, uniqueId, _0, _1$$3; + zval *key_param = NULL, prefix, _0, _1; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); - ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&prefix); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -860,15 +904,18 @@ PHP_METHOD(Phalcon_Session_Manager, getUniqueKey) zephir_get_strval(&key, key_param); - zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CPY_WRT(&uniqueId, &_0); - if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { - zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CONCAT_VSV(return_value, &_1$$3, "#", &key); - RETURN_MM(); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC); + if (1 != ZEPHIR_IS_EMPTY(&_0)) { + zephir_read_property(&_1, this_ptr, ZEND_STRL("uniqueId"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefix); + ZEPHIR_CONCAT_VS(&prefix, &_1, "#"); } else { - RETURN_CTOR(&key); + ZEPHIR_INIT_NVAR(&prefix); + ZVAL_STRING(&prefix, ""); } + ZEPHIR_CONCAT_VV(return_value, &prefix, &key); + RETURN_MM(); } /** diff --git a/ext/phalcon/session/manager.zep.h b/ext/phalcon/session/manager.zep.h index be8fdd18eb2..d783be67fd0 100644 --- a/ext/phalcon/session/manager.zep.h +++ b/ext/phalcon/session/manager.zep.h @@ -25,6 +25,7 @@ PHP_METHOD(Phalcon_Session_Manager, setName); PHP_METHOD(Phalcon_Session_Manager, setOptions); PHP_METHOD(Phalcon_Session_Manager, start); PHP_METHOD(Phalcon_Session_Manager, status); +PHP_METHOD(Phalcon_Session_Manager, phpHeadersSent); PHP_METHOD(Phalcon_Session_Manager, getUniqueKey); PHP_METHOD(Phalcon_Session_Manager, getArrVal); zend_object *zephir_init_properties_Phalcon_Session_Manager(zend_class_entry *class_type); @@ -85,7 +86,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_getoptio ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_regenerateid, 0, 0, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_INFO(0, deleteOldSession) + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_remove, 0, 1, IS_VOID, 0) @@ -104,7 +105,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setadapte ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setid, 0, 1, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_manager_setname, 0, 1, Phalcon\\Session\\ManagerInterface, 0) @@ -122,6 +123,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_status, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_phpheaderssent, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_manager_getuniquekey, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -158,6 +162,7 @@ ZEPHIR_INIT_FUNCS(phalcon_session_manager_method_entry) { PHP_ME(Phalcon_Session_Manager, setOptions, arginfo_phalcon_session_manager_setoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Manager, start, arginfo_phalcon_session_manager_start, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Manager, status, arginfo_phalcon_session_manager_status, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Manager, phpHeadersSent, arginfo_phalcon_session_manager_phpheaderssent, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Session_Manager, getUniqueKey, arginfo_phalcon_session_manager_getuniquekey, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Session_Manager, getArrVal, arginfo_phalcon_session_manager_getarrval, ZEND_ACC_PRIVATE) PHP_FE_END diff --git a/ext/phalcon/session/managerinterface.zep.c b/ext/phalcon/session/managerinterface.zep.c index a986f628170..989e1cafa67 100644 --- a/ext/phalcon/session/managerinterface.zep.c +++ b/ext/phalcon/session/managerinterface.zep.c @@ -13,9 +13,9 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/ext/phalcon/session/managerinterface.zep.h b/ext/phalcon/session/managerinterface.zep.h index 75f649089fc..39bb8353890 100644 --- a/ext/phalcon/session/managerinterface.zep.h +++ b/ext/phalcon/session/managerinterface.zep.h @@ -66,7 +66,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_setid, 0, 1, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_setname, 0, 1, Phalcon\\Session\\ManagerInterface, 0) @@ -85,7 +85,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_managerinterface ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_managerinterface_regenerateid, 0, 0, Phalcon\\Session\\ManagerInterface, 0) - ZEND_ARG_INFO(0, deleteOldSession) + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_managerinterface_method_entry) { diff --git a/ext/phalcon/storage/adapter/abstractadapter.zep.c b/ext/phalcon/storage/adapter/abstractadapter.zep.c index 869a1ea4b0b..440f06b800e 100644 --- a/ext/phalcon/storage/adapter/abstractadapter.zep.c +++ b/ext/phalcon/storage/adapter/abstractadapter.zep.c @@ -223,6 +223,47 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, delete) */ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, get) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(defaultValue) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); + zephir_get_strval(&key, key_param); + if (!defaultValue) { + defaultValue = &defaultValue_sub; + defaultValue = &__$null; + } + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + ZEPHIR_CALL_METHOD(&content, this_ptr, "doget", NULL, 0, &key); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); + zephir_check_call_status(); + RETURN_MM(); } /** @@ -332,6 +373,41 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer) ZEPHIR_MM_RESTORE(); } +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(&_0, "get", NULL, 0, &key); + zephir_check_call_status(); + RETURN_MM(); +} + /** * Filters the keys array based on global and passed prefix * @@ -393,14 +469,14 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys) ZEPHIR_CPY_WRT(&_1, keys); } ZEPHIR_CPY_WRT(keys, &_1); - zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 236); + zephir_is_iterable(keys, 0, "phalcon/Storage/Adapter/AbstractAdapter.zep", 257); if (Z_TYPE_P(keys) == IS_ARRAY) { ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(keys), _2) { ZEPHIR_INIT_NVAR(&key); ZVAL_COPY(&key, _2); if (zephir_start_with(&key, &pattern, NULL)) { - zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 232); + zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 253); } } ZEND_HASH_FOREACH_END(); } else { @@ -415,7 +491,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys) ZEPHIR_CALL_METHOD(&key, keys, "current", NULL, 0); zephir_check_call_status(); if (zephir_start_with(&key, &pattern, NULL)) { - zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 232); + zephir_array_append(&results, &key, PH_SEPARATE, "phalcon/Storage/Adapter/AbstractAdapter.zep", 253); } ZEPHIR_CALL_METHOD(NULL, keys, "next", NULL, 0); zephir_check_call_status(); @@ -493,9 +569,8 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData) ZEPHIR_SEPARATE_PARAM(content); - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC); - if (1 != ZEPHIR_IS_EMPTY(&_0)) { + zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) != IS_NULL) { zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(NULL, &_1$$3, "setdata", NULL, 0, content); zephir_check_call_status(); @@ -574,15 +649,17 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content = NULL, content_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$4, _2$$4; + zval *content = NULL, content_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$3, _2$$3, _3$$3, _4$$3; zval *this_ptr = getThis(); ZVAL_UNDEF(&content_sub); ZVAL_UNDEF(&defaultValue_sub); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$4); - ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -602,18 +679,20 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getUnserializedData) } - if (!(zephir_is_true(content))) { - RETVAL_ZVAL(defaultValue, 1, 0); - RETURN_MM(); - } - ZEPHIR_OBS_VAR(&_0); - zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC); - if (1 != ZEPHIR_IS_EMPTY(&_0)) { - zephir_read_property(&_1$$4, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(NULL, &_1$$4, "unserialize", NULL, 0, content); + zephir_read_property(&_0, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) != IS_NULL) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "unserialize", NULL, 0, content); + zephir_check_call_status(); + zephir_read_property(&_2$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3$$3, &_2$$3, "issuccess", NULL, 0); zephir_check_call_status(); - zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(content, &_2$$4, "getdata", NULL, 0); + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3))) { + RETVAL_ZVAL(defaultValue, 1, 0); + RETURN_MM(); + } + zephir_read_property(&_4$$3, this_ptr, ZEND_STRL("serializer"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(content, &_4$$3, "getdata", NULL, 0); zephir_check_call_status(); } RETVAL_ZVAL(content, 1, 0); diff --git a/ext/phalcon/storage/adapter/abstractadapter.zep.h b/ext/phalcon/storage/adapter/abstractadapter.zep.h index a7b39fb388f..a4c81fb9a0a 100644 --- a/ext/phalcon/storage/adapter/abstractadapter.zep.h +++ b/ext/phalcon/storage/adapter/abstractadapter.zep.h @@ -16,6 +16,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, has); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, increment); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, set); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer); +PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, doGet); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey); PHP_METHOD(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData); @@ -84,6 +85,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_abstract ZEND_ARG_TYPE_INFO(0, serializer, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_abstractadapter_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_abstractadapter_getfilteredkeys, 0, 2, IS_ARRAY, 0) ZEND_ARG_INFO(0, keys) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) @@ -125,7 +130,7 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, clear, arginfo_phalcon_storage_adapter_abstractadapter_clear, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, decrement, arginfo_phalcon_storage_adapter_abstractadapter_decrement, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, delete, arginfo_phalcon_storage_adapter_abstractadapter_delete, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, get, arginfo_phalcon_storage_adapter_abstractadapter_get, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, get, arginfo_phalcon_storage_adapter_abstractadapter_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getAdapter, arginfo_phalcon_storage_adapter_abstractadapter_getadapter, ZEND_ACC_PUBLIC) #else @@ -137,6 +142,7 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_abstractadapter_method_entry) { PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, increment, arginfo_phalcon_storage_adapter_abstractadapter_increment, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, set, arginfo_phalcon_storage_adapter_abstractadapter_set, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, setDefaultSerializer, arginfo_phalcon_storage_adapter_abstractadapter_setdefaultserializer, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, doGet, arginfo_phalcon_storage_adapter_abstractadapter_doget, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getFilteredKeys, arginfo_phalcon_storage_adapter_abstractadapter_getfilteredkeys, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getPrefixedKey, arginfo_phalcon_storage_adapter_abstractadapter_getprefixedkey, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_AbstractAdapter, getSerializedData, arginfo_phalcon_storage_adapter_abstractadapter_getserializeddata, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/storage/adapter/apcu.zep.c b/ext/phalcon/storage/adapter/apcu.zep.c index a7a6b6180de..cb8e73aeb63 100644 --- a/ext/phalcon/storage/adapter/apcu.zep.c +++ b/ext/phalcon/storage/adapter/apcu.zep.c @@ -121,9 +121,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear) zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&pattern); ZEPHIR_CONCAT_SVS(&pattern, "/^", &_0, "/"); - ZEPHIR_INIT_NVAR(&apc); - object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator"))); - ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern); + ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern); zephir_check_call_status(); result = 1; if (Z_TYPE_P(&apc) != IS_OBJECT) { @@ -135,10 +133,10 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear) { ZEPHIR_ITERATOR_COPY(&item, _1); } - zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 63); - ZEPHIR_CALL_FUNCTION(&_3$$4, "apcu_delete", &_4, 126, &_2$$4); + zephir_array_fetch_string(&_3$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 63); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "phpapcudelete", &_4, 0, &_3$$4); zephir_check_call_status(); - if (!(zephir_is_true(&_3$$4))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_2$$4)) { result = 0; } } @@ -196,7 +194,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 127, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcudec", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -212,12 +210,13 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, _0; + zval *key_param = NULL, _0, _1; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -239,68 +238,11 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 126, &_0); - zephir_check_call_status(); - RETURN_MM(); -} - -/** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed - */ -PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&content, "apcu_fetch", NULL, 128, &_0); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpapcudelete", NULL, 0, &_1); zephir_check_call_status(); - RETURN_MM(); + RETURN_MM_BOOL(zephir_get_boolval(&_0)); } /** @@ -359,9 +301,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys) zephir_read_property(&_0, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&pattern); ZEPHIR_CONCAT_SVVS(&pattern, "/^", &_0, &prefix, "/"); - ZEPHIR_INIT_NVAR(&apc); - object_init_ex(&apc, zephir_get_internal_ce(SL("apcuiterator"))); - ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &pattern); + ZEPHIR_CALL_METHOD(&apc, this_ptr, "phpapcuiterator", NULL, 0, &pattern); zephir_check_call_status(); ZEPHIR_INIT_VAR(&results); array_init(&results); @@ -374,8 +314,8 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys) { ZEPHIR_ITERATOR_COPY(&item, _1); } - zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 134); - zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 134); + zephir_array_fetch_string(&_2$$4, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Apcu.zep", 117); + zephir_array_append(&results, &_2$$4, PH_SEPARATE, "phalcon/Storage/Adapter/Apcu.zep", 117); } zend_iterator_dtor(_1); RETURN_CTOR(&results); @@ -423,7 +363,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_exists", NULL, 129, &_0); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcuexists", NULL, 0, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { @@ -484,17 +424,21 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment) ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 130, &_0, &_1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcuinc", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws Exception @@ -560,7 +504,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3, this_ptr, "getttl", NULL, 0, ttl); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_store", NULL, 131, &_1, &_2, &_3); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_1, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { @@ -620,10 +564,10 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&result, "apcu_store", NULL, 131, &_0, &_1); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpapcustore", NULL, 0, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); - if (((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE) == 1)) { + if ((Z_TYPE_P(&result) == IS_TRUE || Z_TYPE_P(&result) == IS_FALSE)) { ZEPHIR_CPY_WRT(&_2, &result); } else { ZVAL_BOOL(&_2, 0); @@ -631,3 +575,292 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever) RETURN_CCTOR(&_2); } +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpapcufetch", NULL, 0, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + +/** + * @todo Remove the below once we get traits + */ +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDec) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long step, ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *step_param = NULL, *success = NULL, success_sub, *ttl_param = NULL, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(step) + Z_PARAM_ZVAL_OR_NULL(success) + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 3, &key, &step_param, &success, &ttl_param); + if (!step_param) { + step = 1; + } else { + step = zephir_get_intval(step_param); + } + if (!success) { + success = &success_sub; + success = &__$null; + } + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, step); + ZVAL_LONG(&_1, ttl); + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 98, key, &_0, success, &_1); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDelete) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key); + + + ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 99, key); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key); + + + ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 100, key); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuInc) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long step, ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *step_param = NULL, *success = NULL, success_sub, *ttl_param = NULL, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(step) + Z_PARAM_ZVAL_OR_NULL(success) + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 3, &key, &step_param, &success, &ttl_param); + if (!step_param) { + step = 1; + } else { + step = zephir_get_intval(step_param); + } + if (!success) { + success = &success_sub; + success = &__$null; + } + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, step); + ZVAL_LONG(&_1, ttl); + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 101, key, &_0, success, &_1); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuFetch) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *success = NULL, success_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&success_sub); + ZVAL_NULL(&__$null); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(key) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(success) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &key, &success); + if (!success) { + success = &success_sub; + success = &__$null; + } + + + ZEPHIR_MAKE_REF(success); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 102, key, success); + ZEPHIR_UNREF(success); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuIterator) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *pattern_param = NULL; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(pattern) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &pattern_param); + zephir_get_strval(&pattern, pattern_param); + + + object_init_ex(return_value, zephir_get_internal_ce(SL("apcuiterator"))); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &pattern); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuStore) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ttl, ZEPHIR_LAST_CALL_STATUS; + zval *key, key_sub, *payload, payload_sub, *ttl_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&payload_sub); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_ZVAL(key) + Z_PARAM_ZVAL(payload) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(ttl) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 1, &key, &payload, &ttl_param); + if (!ttl_param) { + ttl = 0; + } else { + ttl = zephir_get_intval(ttl_param); + } + + + ZVAL_LONG(&_0, ttl); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 103, key, payload, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + diff --git a/ext/phalcon/storage/adapter/apcu.zep.h b/ext/phalcon/storage/adapter/apcu.zep.h index 9d70c7057d3..b15288154d7 100644 --- a/ext/phalcon/storage/adapter/apcu.zep.h +++ b/ext/phalcon/storage/adapter/apcu.zep.h @@ -7,12 +7,19 @@ PHP_METHOD(Phalcon_Storage_Adapter_Apcu, __construct); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, clear); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, decrement); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, delete); -PHP_METHOD(Phalcon_Storage_Adapter_Apcu, get); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, getKeys); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, has); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, increment); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, set); PHP_METHOD(Phalcon_Storage_Adapter_Apcu, setForever); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, doGet); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDec); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuDelete); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuExists); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuInc); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuFetch); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuIterator); +PHP_METHOD(Phalcon_Storage_Adapter_Apcu, phpApcuStore); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, factory, Phalcon\\Storage\\SerializerFactory, 0) @@ -35,11 +42,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_del ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_getkeys, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -64,16 +66,64 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_apcu_set ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcudec, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, step, IS_LONG, 0) + ZEND_ARG_INFO(0, success) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcudelete, 0, 0, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuexists, 0, 0, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuinc, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_TYPE_INFO(0, step, IS_LONG, 0) + ZEND_ARG_INFO(0, success) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcufetch, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, success) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcuiterator, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_apcu_phpapcustore, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, payload) + ZEND_ARG_TYPE_INFO(0, ttl, IS_LONG, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_apcu_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Apcu, __construct, arginfo_phalcon_storage_adapter_apcu___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Storage_Adapter_Apcu, clear, arginfo_phalcon_storage_adapter_apcu_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, decrement, arginfo_phalcon_storage_adapter_apcu_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, delete, arginfo_phalcon_storage_adapter_apcu_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Apcu, get, arginfo_phalcon_storage_adapter_apcu_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, getKeys, arginfo_phalcon_storage_adapter_apcu_getkeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, has, arginfo_phalcon_storage_adapter_apcu_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, increment, arginfo_phalcon_storage_adapter_apcu_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, set, arginfo_phalcon_storage_adapter_apcu_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Apcu, setForever, arginfo_phalcon_storage_adapter_apcu_setforever, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_Apcu, doGet, arginfo_phalcon_storage_adapter_apcu_doget, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuDec, arginfo_phalcon_storage_adapter_apcu_phpapcudec, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuDelete, arginfo_phalcon_storage_adapter_apcu_phpapcudelete, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuExists, arginfo_phalcon_storage_adapter_apcu_phpapcuexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuInc, arginfo_phalcon_storage_adapter_apcu_phpapcuinc, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuFetch, arginfo_phalcon_storage_adapter_apcu_phpapcufetch, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuIterator, arginfo_phalcon_storage_adapter_apcu_phpapcuiterator, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Apcu, phpApcuStore, arginfo_phalcon_storage_adapter_apcu_phpapcustore, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/storage/adapter/libmemcached.zep.c b/ext/phalcon/storage/adapter/libmemcached.zep.c index 0b2edb26c9a..017ae7218c0 100644 --- a/ext/phalcon/storage/adapter/libmemcached.zep.c +++ b/ext/phalcon/storage/adapter/libmemcached.zep.c @@ -230,64 +230,6 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete) RETURN_MM(); } -/** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed|null - * @throws StorageException - */ -PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_1, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - /** * Returns the already connected adapter or connects to the Memcached * server(s) @@ -389,14 +331,14 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter) ZEPHIR_INIT_NVAR(&_7$$4); zephir_fast_array_merge(&_7$$4, &failover, &client); ZEPHIR_CPY_WRT(&client, &_7$$4); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "setoptions", NULL, 132, &connection, &client); + ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "setoptions", NULL, 104, &connection, &client); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10$$4, &_9$$4, "setservers", NULL, 133, &connection, &servers); + ZEPHIR_CALL_METHOD(&_10$$4, &_9$$4, "setservers", NULL, 105, &connection, &servers); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_10$$4, "setsasl", NULL, 134, &connection, &saslUser, &saslPass); + ZEPHIR_CALL_METHOD(NULL, &_10$$4, "setsasl", NULL, 106, &connection, &saslUser, &saslPass); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 135, &connection); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 107, &connection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection); } @@ -565,11 +507,15 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, increment) } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -728,7 +674,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setOptions) ZEPHIR_CALL_METHOD(&_0, connection, "setoptions", NULL, 0, &client); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 266); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot set Memcached client options", "phalcon/Storage/Adapter/Libmemcached.zep", 253); return; } RETURN_THIS(); @@ -810,9 +756,9 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer) ZEPHIR_INIT_VAR(&map); zephir_create_array(&map, 3, 0); - add_assoc_long_ex(&map, SL("php"), 1); - add_assoc_long_ex(&map, SL("json"), 3); - add_assoc_long_ex(&map, SL("igbinary"), 2); + add_assoc_long_ex(&map, SL("memcached_igbinary"), 2); + add_assoc_long_ex(&map, SL("memcached_json"), 3); + add_assoc_long_ex(&map, SL("memcached_php"), 1); zephir_read_property(&_0, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&serializer); zephir_fast_strtolower(&serializer, &_0); @@ -821,7 +767,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setSerializer) ZEPHIR_INIT_NVAR(&_1$$3); ZVAL_STRING(&_1$$3, ""); zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_1$$3); - zephir_array_fetch(&_2$$3, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Libmemcached.zep", 312); + zephir_array_fetch(&_2$$3, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Libmemcached.zep", 299); ZVAL_LONG(&_3$$3, -1003); ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_3$$3, &_2$$3); zephir_check_call_status(); @@ -866,7 +812,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, setServers) ZEPHIR_CALL_METHOD(&_0, connection, "addservers", NULL, 0, &servers); zephir_check_call_status(); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 330); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Cannot connect to the Memcached server(s)", "phalcon/Storage/Adapter/Libmemcached.zep", 317); return; } RETURN_THIS(); diff --git a/ext/phalcon/storage/adapter/libmemcached.zep.h b/ext/phalcon/storage/adapter/libmemcached.zep.h index 8ad71afc1d3..b0369833bde 100644 --- a/ext/phalcon/storage/adapter/libmemcached.zep.h +++ b/ext/phalcon/storage/adapter/libmemcached.zep.h @@ -7,7 +7,6 @@ PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, __construct); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, clear); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, decrement); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, delete); -PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, get); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getAdapter); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, getKeys); PHP_METHOD(Phalcon_Storage_Adapter_Libmemcached, has); @@ -40,11 +39,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_libmemca ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_libmemcached_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_libmemcached_getadapter, 0, 0, 0) ZEND_END_ARG_INFO() @@ -98,7 +92,6 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_libmemcached_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Libmemcached, clear, arginfo_phalcon_storage_adapter_libmemcached_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Libmemcached, decrement, arginfo_phalcon_storage_adapter_libmemcached_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Libmemcached, delete, arginfo_phalcon_storage_adapter_libmemcached_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Libmemcached, get, arginfo_phalcon_storage_adapter_libmemcached_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_Libmemcached, getAdapter, arginfo_phalcon_storage_adapter_libmemcached_getadapter, ZEND_ACC_PUBLIC) #else diff --git a/ext/phalcon/storage/adapter/memory.zep.c b/ext/phalcon/storage/adapter/memory.zep.c index f8e3f2e2d52..1c7ebffbfd7 100644 --- a/ext/phalcon/storage/adapter/memory.zep.c +++ b/ext/phalcon/storage/adapter/memory.zep.c @@ -126,15 +126,17 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *value_param = NULL, current, prefixedKey, result, _0; + zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&newValue); ZVAL_UNDEF(&prefixedKey); ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -166,12 +168,16 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement) ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!(zephir_array_isset_fetch(¤t, &_0, &prefixedKey, 1)))) { - RETURN_MM_BOOL(0); - } ZEPHIR_INIT_VAR(&result); - ZVAL_LONG(&result, (zephir_get_intval(¤t) - value)); - zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &result); + ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey)); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 72); + ZEPHIR_INIT_VAR(&newValue); + ZVAL_LONG(&newValue, (zephir_get_intval(¤t) - value)); + ZEPHIR_CPY_WRT(&result, &newValue); + zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue); + } RETURN_CCTOR(&result); } @@ -184,14 +190,14 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement) */ PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete) { - zend_bool exists = 0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, prefixedKey, _0, _1; + zval *key_param = NULL, exists, prefixedKey, _0, _1; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); + ZVAL_UNDEF(&exists); ZVAL_UNDEF(&prefixedKey); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); @@ -219,62 +225,12 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete) ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - exists = zephir_array_isset(&_0, &prefixedKey); + ZEPHIR_INIT_VAR(&exists); + ZVAL_BOOL(&exists, zephir_array_key_exists(&_0, &prefixedKey)); zephir_unset_property_array(this_ptr, ZEND_STRL("data"), &prefixedKey); zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); zephir_array_unset(&_1, &prefixedKey, PH_SEPARATE); - RETURN_MM_BOOL(exists); -} - -/** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed - */ -PHP_METHOD(Phalcon_Storage_Adapter_Memory, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, content, prefixedKey, _0; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&content); - ZVAL_UNDEF(&prefixedKey); - ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - zephir_get_strval(&key, key_param); - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); - zephir_check_call_status(); - zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_OBS_VAR(&content); - zephir_array_fetch(&content, &_0, &prefixedKey, PH_NOISY, "phalcon/Storage/Adapter/Memory.zep", 112); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &content, defaultValue); - zephir_check_call_status(); - RETURN_MM(); + RETURN_CCTOR(&exists); } /** @@ -364,7 +320,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, has) ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - RETURN_MM_BOOL(zephir_array_isset(&_0, &prefixedKey)); + RETURN_MM_BOOL(zephir_array_key_exists(&_0, &prefixedKey)); } /** @@ -379,15 +335,17 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *value_param = NULL, current, prefixedKey, result, _0; + zval *key_param = NULL, *value_param = NULL, current, newValue, prefixedKey, result, _0, _1$$3; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&newValue); ZVAL_UNDEF(&prefixedKey); ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) @@ -419,21 +377,29 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment) ZEPHIR_CALL_METHOD(&prefixedKey, this_ptr, "getprefixedkey", NULL, 0, &key); zephir_check_call_status(); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - if (UNEXPECTED(!(zephir_array_isset_fetch(¤t, &_0, &prefixedKey, 1)))) { - RETURN_MM_BOOL(0); - } ZEPHIR_INIT_VAR(&result); - ZVAL_LONG(&result, (zephir_get_intval(¤t) + value)); - zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &result); + ZVAL_BOOL(&result, zephir_array_key_exists(&_0, &prefixedKey)); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&result))) { + zephir_read_property(&_1$$3, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(¤t, &_1$$3, &prefixedKey, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 145); + ZEPHIR_INIT_VAR(&newValue); + ZVAL_LONG(&newValue, (zephir_get_intval(¤t) + value)); + ZEPHIR_CPY_WRT(&result, &newValue); + zephir_update_property_array(this_ptr, SL("data"), &prefixedKey, &newValue); + } RETURN_CCTOR(&result); } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -544,6 +510,43 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, setForever) RETURN_MM(); } +/** + * @param string $key + * + * @return mixed + */ +PHP_METHOD(Phalcon_Storage_Adapter_Memory, doGet) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *key_param = NULL, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(key) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &key_param); + zephir_get_strval(&key, key_param); + + + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getprefixedkey", NULL, 0, &key); + zephir_check_call_status(); + zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Memory.zep", 206); + RETURN_CTOR(&_1); +} + zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type) { zval _0, _2, _1$$3, _3$$4; diff --git a/ext/phalcon/storage/adapter/memory.zep.h b/ext/phalcon/storage/adapter/memory.zep.h index 79b08705d8f..57f0131cfe3 100644 --- a/ext/phalcon/storage/adapter/memory.zep.h +++ b/ext/phalcon/storage/adapter/memory.zep.h @@ -7,12 +7,12 @@ PHP_METHOD(Phalcon_Storage_Adapter_Memory, __construct); PHP_METHOD(Phalcon_Storage_Adapter_Memory, clear); PHP_METHOD(Phalcon_Storage_Adapter_Memory, decrement); PHP_METHOD(Phalcon_Storage_Adapter_Memory, delete); -PHP_METHOD(Phalcon_Storage_Adapter_Memory, get); PHP_METHOD(Phalcon_Storage_Adapter_Memory, getKeys); PHP_METHOD(Phalcon_Storage_Adapter_Memory, has); PHP_METHOD(Phalcon_Storage_Adapter_Memory, increment); PHP_METHOD(Phalcon_Storage_Adapter_Memory, set); PHP_METHOD(Phalcon_Storage_Adapter_Memory, setForever); +PHP_METHOD(Phalcon_Storage_Adapter_Memory, doGet); zend_object *zephir_init_properties_Phalcon_Storage_Adapter_Memory(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory___construct, 0, 0, 1) @@ -36,11 +36,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_d ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_getkeys, 0, 0, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -65,6 +60,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_memory_s ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_doget, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_memory_zephir_init_properties_phalcon_storage_adapter_memory, 0, 0, 0) ZEND_END_ARG_INFO() @@ -73,11 +72,11 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_memory_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Memory, clear, arginfo_phalcon_storage_adapter_memory_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, decrement, arginfo_phalcon_storage_adapter_memory_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, delete, arginfo_phalcon_storage_adapter_memory_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Memory, get, arginfo_phalcon_storage_adapter_memory_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, getKeys, arginfo_phalcon_storage_adapter_memory_getkeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, has, arginfo_phalcon_storage_adapter_memory_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, increment, arginfo_phalcon_storage_adapter_memory_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, set, arginfo_phalcon_storage_adapter_memory_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Memory, setForever, arginfo_phalcon_storage_adapter_memory_setforever, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Adapter_Memory, doGet, arginfo_phalcon_storage_adapter_memory_doget, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/storage/adapter/redis.zep.c b/ext/phalcon/storage/adapter/redis.zep.c index 5752f987cd0..7c02395fd2a 100644 --- a/ext/phalcon/storage/adapter/redis.zep.c +++ b/ext/phalcon/storage/adapter/redis.zep.c @@ -310,64 +310,6 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete) RETURN_MM_BOOL(zephir_get_boolval(&_1)); } -/** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed|null - * @throws StorageException - */ -PHP_METHOD(Phalcon_Storage_Adapter_Redis, get) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1; - zval key; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&defaultValue_sub); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STR(key) - Z_PARAM_OPTIONAL - Z_PARAM_ZVAL_OR_NULL(defaultValue) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 1, &key_param, &defaultValue); - if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string")); - RETURN_MM_NULL(); - } - if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(&key, key_param); - } else { - ZEPHIR_INIT_VAR(&key); - } - if (!defaultValue) { - defaultValue = &defaultValue_sub; - defaultValue = &__$null; - } - - - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getadapter", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &key); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getunserializeddata", NULL, 0, &_1, defaultValue); - zephir_check_call_status(); - RETURN_MM(); -} - /** * Returns the already connected adapter or connects to the Redis * server(s) @@ -398,17 +340,17 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter) object_init_ex(&connection, zephir_get_internal_ce(SL("redis"))); ZEPHIR_CALL_METHOD(NULL, &connection, "__construct", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkconnect", NULL, 136, &connection); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "checkconnect", NULL, 108, &connection); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "checkauth", NULL, 137, &connection); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "checkauth", NULL, 109, &connection); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "checkindex", NULL, 138, &connection); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "checkindex", NULL, 110, &connection); zephir_check_call_status(); zephir_read_property(&_3$$3, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_4$$3, 2); ZEPHIR_CALL_METHOD(NULL, &connection, "setoption", NULL, 0, &_4$$3, &_3$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 139, &connection); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setserializer", NULL, 111, &connection); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("adapter"), &connection); } @@ -577,11 +519,15 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, increment) } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -752,7 +698,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkAuth) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&auth); - zephir_array_fetch_string(&auth, &_0, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 244); + zephir_array_fetch_string(&auth, &_0, SL("auth"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 231); /* try_start_1: */ @@ -778,7 +724,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkAuth) } } if (error) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 255); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Failed to authenticate with the Redis server", "phalcon/Storage/Adapter/Redis.zep", 242); return; } RETURN_THIS(); @@ -830,16 +776,16 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&options, &_0); ZEPHIR_OBS_VAR(&host); - zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 273); + zephir_array_fetch_string(&host, &options, SL("host"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 260); ZEPHIR_OBS_VAR(&port); - zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 274); + zephir_array_fetch_string(&port, &options, SL("port"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 261); ZEPHIR_OBS_VAR(&timeout); - zephir_array_fetch_string(&timeout, &options, SL("timeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 275); + zephir_array_fetch_string(&timeout, &options, SL("timeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 262); ZEPHIR_OBS_VAR(&retryInterval); - zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 276); + zephir_array_fetch_string(&retryInterval, &options, SL("retryInterval"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 263); ZEPHIR_OBS_VAR(&readTimeout); - zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 277); - zephir_array_fetch_string(&_1, &options, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 279); + zephir_array_fetch_string(&readTimeout, &options, SL("readTimeout"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 264); + zephir_array_fetch_string(&_1, &options, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 266); ZEPHIR_INIT_VAR(&method); ZEPHIR_INIT_VAR(¶meter); if (!ZEPHIR_IS_TRUE_IDENTICAL(&_1)) { @@ -849,11 +795,11 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) ZVAL_STRING(&method, "pconnect"); zephir_read_property(&_2$$4, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&persistentId); - zephir_array_fetch_string(&persistentId, &_2$$4, SL("persistentId"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 284); + zephir_array_fetch_string(&persistentId, &_2$$4, SL("persistentId"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 271); if (!(ZEPHIR_IS_EMPTY(&persistentId))) { ZEPHIR_CPY_WRT(¶meter, &persistentId); } else { - zephir_array_fetch_string(&_3$$4, &options, SL("index"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 285); + zephir_array_fetch_string(&_3$$4, &options, SL("index"), PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 272); ZEPHIR_CONCAT_SV(¶meter, "persistentId", &_3$$4); } } @@ -864,11 +810,11 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkConnect) object_init_ex(&_4$$5, phalcon_storage_exception_ce); ZEPHIR_INIT_VAR(&_5$$5); ZVAL_STRING(&_5$$5, "Could not connect to the Redisd server [%s:%s]"); - ZEPHIR_CALL_FUNCTION(&_6$$5, "sprintf", NULL, 140, &_5$$5, &host, &port); + ZEPHIR_CALL_FUNCTION(&_6$$5, "sprintf", NULL, 112, &_5$$5, &host, &port); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 31, &_6$$5); + ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", NULL, 29, &_6$$5); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$5, "phalcon/Storage/Adapter/Redis.zep", 304); + zephir_throw_exception_debug(&_4$$5, "phalcon/Storage/Adapter/Redis.zep", 291); ZEPHIR_MM_RESTORE(); return; } @@ -907,7 +853,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkIndex) zephir_read_property(&_0, this_ptr, ZEND_STRL("options"), PH_NOISY_CC | PH_READONLY); ZEPHIR_OBS_VAR(&index); - zephir_array_fetch_string(&index, &_0, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 320); + zephir_array_fetch_string(&index, &_0, SL("index"), PH_NOISY, "phalcon/Storage/Adapter/Redis.zep", 307); _1 = ZEPHIR_GT_LONG(&index, 0); if (_1) { ZEPHIR_CALL_METHOD(&_2, connection, "select", NULL, 0, &index); @@ -915,7 +861,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, checkIndex) _1 = !ZEPHIR_IS_TRUE_IDENTICAL(&_2); } if (_1) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 325); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "Redis server selected database failed", "phalcon/Storage/Adapter/Redis.zep", 312); return; } RETURN_THIS(); @@ -966,40 +912,40 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer) ZEPHIR_INIT_VAR(&map); zephir_create_array(&map, 2, 0); - add_assoc_long_ex(&map, SL("none"), 0); - add_assoc_long_ex(&map, SL("php"), 1); + add_assoc_long_ex(&map, SL("redis_none"), 0); + add_assoc_long_ex(&map, SL("redis_php"), 1); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_IGBINARY"); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_1)) { ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "\\Redis::SERIALIZER_IGBINARY"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "constant", NULL, 142, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "constant", NULL, 114, &_2$$3); zephir_check_call_status(); - zephir_array_update_string(&map, SL("igbinary"), &_3$$3, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_igbinary"), &_3$$3, PH_COPY | PH_SEPARATE); } ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_MSGPACK"); - ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_VAR(&_5$$4); ZVAL_STRING(&_5$$4, "\\Redis::SERIALIZER_MSGPACK"); - ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 142, &_5$$4); + ZEPHIR_CALL_FUNCTION(&_6$$4, "constant", NULL, 114, &_5$$4); zephir_check_call_status(); - zephir_array_update_string(&map, SL("msgpack"), &_6$$4, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_msgpack"), &_6$$4, PH_COPY | PH_SEPARATE); } ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "\\Redis::SERIALIZER_JSON"); - ZEPHIR_CALL_FUNCTION(&_7, "defined", NULL, 141, &_0); + ZEPHIR_CALL_FUNCTION(&_7, "defined", NULL, 113, &_0); zephir_check_call_status(); if (zephir_is_true(&_7)) { ZEPHIR_INIT_VAR(&_8$$5); ZVAL_STRING(&_8$$5, "\\Redis::SERIALIZER_JSON"); - ZEPHIR_CALL_FUNCTION(&_9$$5, "constant", NULL, 142, &_8$$5); + ZEPHIR_CALL_FUNCTION(&_9$$5, "constant", NULL, 114, &_8$$5); zephir_check_call_status(); - zephir_array_update_string(&map, SL("json"), &_9$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&map, SL("redis_json"), &_9$$5, PH_COPY | PH_SEPARATE); } zephir_read_property(&_10, this_ptr, ZEND_STRL("defaultSerializer"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&serializer); @@ -1009,7 +955,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, setSerializer) ZEPHIR_INIT_NVAR(&_11$$6); ZVAL_STRING(&_11$$6, ""); zephir_update_property_zval(this_ptr, ZEND_STRL("defaultSerializer"), &_11$$6); - zephir_array_fetch(&_12$$6, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 367); + zephir_array_fetch(&_12$$6, &map, &serializer, PH_NOISY | PH_READONLY, "phalcon/Storage/Adapter/Redis.zep", 354); ZVAL_LONG(&_13$$6, 1); ZEPHIR_CALL_METHOD(NULL, connection, "setoption", NULL, 0, &_13$$6, &_12$$6); zephir_check_call_status(); diff --git a/ext/phalcon/storage/adapter/redis.zep.h b/ext/phalcon/storage/adapter/redis.zep.h index eb1354e802a..8ff62e98e9e 100644 --- a/ext/phalcon/storage/adapter/redis.zep.h +++ b/ext/phalcon/storage/adapter/redis.zep.h @@ -7,7 +7,6 @@ PHP_METHOD(Phalcon_Storage_Adapter_Redis, __construct); PHP_METHOD(Phalcon_Storage_Adapter_Redis, clear); PHP_METHOD(Phalcon_Storage_Adapter_Redis, decrement); PHP_METHOD(Phalcon_Storage_Adapter_Redis, delete); -PHP_METHOD(Phalcon_Storage_Adapter_Redis, get); PHP_METHOD(Phalcon_Storage_Adapter_Redis, getAdapter); PHP_METHOD(Phalcon_Storage_Adapter_Redis, getKeys); PHP_METHOD(Phalcon_Storage_Adapter_Redis, has); @@ -40,11 +39,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_redis_de ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_redis_get, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_INFO(0, defaultValue) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_redis_getadapter, 0, 0, 0) ZEND_END_ARG_INFO() @@ -94,7 +88,6 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_redis_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Redis, clear, arginfo_phalcon_storage_adapter_redis_clear, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Redis, decrement, arginfo_phalcon_storage_adapter_redis_decrement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Adapter_Redis, delete, arginfo_phalcon_storage_adapter_redis_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Adapter_Redis, get, arginfo_phalcon_storage_adapter_redis_get, ZEND_ACC_PUBLIC) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Adapter_Redis, getAdapter, arginfo_phalcon_storage_adapter_redis_getadapter, ZEND_ACC_PUBLIC) #else diff --git a/ext/phalcon/storage/adapter/stream.zep.c b/ext/phalcon/storage/adapter/stream.zep.c index c83eed079d5..441808abe24 100644 --- a/ext/phalcon/storage/adapter/stream.zep.c +++ b/ext/phalcon/storage/adapter/stream.zep.c @@ -114,7 +114,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, __construct) ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_storage_exception_ce, "The 'storageDir' must be specified in the options", "phalcon/Storage/Adapter/Stream.zep", 63); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getdirseparator", NULL, 143, &storageDir); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getdirseparator", NULL, 115, &storageDir); zephir_check_call_status(); zephir_update_property_zval(this_ptr, ZEND_STRL("storageDir"), &_2); ZEPHIR_CALL_PARENT(NULL, phalcon_storage_adapter_stream_ce, getThis(), "__construct", &_3, 0, factory, &options); @@ -153,9 +153,9 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) result = 1; zephir_read_property(&_0, this_ptr, ZEND_STRL("storageDir"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdirseparator", NULL, 143, &_0); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdirseparator", NULL, 115, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 144, &directory); + ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 116, &directory); zephir_check_call_status(); zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 94); if (Z_TYPE_P(&iterator) == IS_ARRAY) { @@ -165,15 +165,15 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) ZVAL_COPY(&file, _1); ZEPHIR_CALL_METHOD(&_3$$3, &file, "isfile", NULL, 0); zephir_check_call_status(); - _4$$3 = zephir_is_true(&_3$$3); + _4$$3 = ZEPHIR_IS_TRUE_IDENTICAL(&_3$$3); if (_4$$3) { - ZEPHIR_CALL_METHOD(&_5$$3, &file, "getpathname", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$3, &file, "getpathname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6$$3, "unlink", &_7, 145, &_5$$3); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "phpunlink", &_7, 0, &_6$$3); zephir_check_call_status(); - _4$$3 = !zephir_is_true(&_6$$3); + _4$$3 = !ZEPHIR_IS_TRUE_IDENTICAL(&_5$$3); } - if (_4$$3) { + if (UNEXPECTED(_4$$3)) { result = 0; } } ZEND_HASH_FOREACH_END(); @@ -190,15 +190,15 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, clear) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$5, &file, "isfile", NULL, 0); zephir_check_call_status(); - _9$$5 = zephir_is_true(&_8$$5); + _9$$5 = ZEPHIR_IS_TRUE_IDENTICAL(&_8$$5); if (_9$$5) { - ZEPHIR_CALL_METHOD(&_10$$5, &file, "getpathname", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$5, &file, "getpathname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_11$$5, "unlink", &_7, 145, &_10$$5); + ZEPHIR_CALL_METHOD(&_10$$5, this_ptr, "phpunlink", &_7, 0, &_11$$5); zephir_check_call_status(); - _9$$5 = !zephir_is_true(&_11$$5); + _9$$5 = !ZEPHIR_IS_TRUE_IDENTICAL(&_10$$5); } - if (_9$$5) { + if (UNEXPECTED(_9$$5)) { result = 0; } ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0); @@ -221,12 +221,13 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS, _1; - zval *key_param = NULL, *value_param = NULL, data, _0; + zval *key_param = NULL, *value_param = NULL, data, result, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&data); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -258,7 +259,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key); @@ -266,9 +267,12 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, decrement) _1 = (zephir_get_intval(&data) - value); ZEPHIR_INIT_NVAR(&data); ZVAL_LONG(&data, _1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data); + ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data); zephir_check_call_status(); - RETURN_MM(); + if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + ZEPHIR_CPY_WRT(&result, &data); + } + RETURN_CCTOR(&result); } /** @@ -312,12 +316,12 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, delete) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 145, &filepath); + ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 118, &filepath); zephir_check_call_status(); RETURN_MM(); } @@ -374,17 +378,17 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, get) } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); zephir_check_call_status(); if (1 != (zephir_file_exists(&filepath) == SUCCESS)) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 147, &filepath); + ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 119, &filepath); zephir_check_call_status(); _0 = ZEPHIR_IS_EMPTY(&payload); if (!(_0)) { - ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 148, &payload); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 120, &payload); zephir_check_call_status(); _0 = zephir_is_true(&_1); } @@ -413,7 +417,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) zval files; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, directory, file, iterator, *_0, _1, _2$$4, _3$$5, _4$$5, _5$$5, _6$$6, _7$$7, _8$$7, _9$$7; + zval *prefix_param = NULL, directory, file, iterator, _0, *_1, _2, _3$$4, _4$$5, _5$$5, _6$$5, _7$$6, _8$$7, _9$$7, _10$$7; zval prefix; zval *this_ptr = getThis(); @@ -421,15 +425,16 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) ZVAL_UNDEF(&directory); ZVAL_UNDEF(&file); ZVAL_UNDEF(&iterator); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$5); ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$6); - ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$6); ZVAL_UNDEF(&_8$$7); ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$7); ZVAL_UNDEF(&files); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -460,51 +465,53 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getKeys) ZEPHIR_INIT_VAR(&files); array_init(&files); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 149); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 121); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &directory); zephir_check_call_status(); - if (!((zephir_file_exists(&directory) == SUCCESS))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { array_init(return_value); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 144, &directory); + ZEPHIR_CALL_METHOD(&iterator, this_ptr, "getiterator", NULL, 116, &directory); zephir_check_call_status(); - zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 195); + zephir_is_iterable(&iterator, 0, "phalcon/Storage/Adapter/Stream.zep", 200); if (Z_TYPE_P(&iterator) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _0) + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&iterator), _1) { ZEPHIR_INIT_NVAR(&file); - ZVAL_COPY(&file, _0); - ZEPHIR_CALL_METHOD(&_2$$4, &file, "isfile", NULL, 0); + ZVAL_COPY(&file, _1); + ZEPHIR_CALL_METHOD(&_3$$4, &file, "isfile", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(&_2$$4)) { - zephir_read_property(&_3$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_4$$5, &file, "getfilename", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_3$$4)) { + zephir_read_property(&_4$$5, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$5, &file, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_5$$5); - ZEPHIR_CONCAT_VV(&_5$$5, &_3$$5, &_4$$5); - zephir_array_append(&files, &_5$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 191); + ZEPHIR_INIT_NVAR(&_6$$5); + ZEPHIR_CONCAT_VV(&_6$$5, &_4$$5, &_5$$5); + zephir_array_append(&files, &_6$$5, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 196); } } ZEND_HASH_FOREACH_END(); } else { ZEPHIR_CALL_METHOD(NULL, &iterator, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_1, &iterator, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &iterator, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_1)) { + if (!zend_is_true(&_2)) { break; } ZEPHIR_CALL_METHOD(&file, &iterator, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$6, &file, "isfile", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$6, &file, "isfile", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(&_6$$6)) { - zephir_read_property(&_7$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_8$$7, &file, "getfilename", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_7$$6)) { + zephir_read_property(&_8$$7, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_9$$7, &file, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_9$$7); - ZEPHIR_CONCAT_VV(&_9$$7, &_7$$7, &_8$$7); - zephir_array_append(&files, &_9$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 191); + ZEPHIR_INIT_NVAR(&_10$$7); + ZEPHIR_CONCAT_VV(&_10$$7, &_8$$7, &_9$$7); + zephir_array_append(&files, &_10$$7, PH_SEPARATE, "phalcon/Storage/Adapter/Stream.zep", 196); } ZEPHIR_CALL_METHOD(NULL, &iterator, "next", NULL, 0); zephir_check_call_status(); @@ -527,7 +534,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, payload, filepath, _0; + zval *key_param = NULL, payload, filepath, _0, _1; zval key; zval *this_ptr = getThis(); @@ -535,6 +542,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) ZVAL_UNDEF(&payload); ZVAL_UNDEF(&filepath); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -556,19 +564,21 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, has) } - ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 146, &key); + ZEPHIR_CALL_METHOD(&filepath, this_ptr, "getfilepath", NULL, 117, &key); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "phpfileexists", NULL, 0, &filepath); zephir_check_call_status(); - if (!((zephir_file_exists(&filepath) == SUCCESS))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 147, &filepath); + ZEPHIR_CALL_METHOD(&payload, this_ptr, "getpayload", NULL, 119, &filepath); zephir_check_call_status(); if (UNEXPECTED(ZEPHIR_IS_EMPTY(&payload))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isexpired", NULL, 148, &payload); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "isexpired", NULL, 120, &payload); zephir_check_call_status(); - RETURN_MM_BOOL(!zephir_is_true(&_0)); + RETURN_MM_BOOL(!zephir_is_true(&_1)); } /** @@ -583,12 +593,13 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long value, ZEPHIR_LAST_CALL_STATUS, _1; - zval *key_param = NULL, *value_param = NULL, data, _0; + zval *key_param = NULL, *value_param = NULL, data, result, _0; zval key; zval *this_ptr = getThis(); ZVAL_UNDEF(&key); ZVAL_UNDEF(&data); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; @@ -620,7 +631,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (UNEXPECTED(!ZEPHIR_IS_TRUE_IDENTICAL(&_0))) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "get", NULL, 0, &key); @@ -628,17 +639,24 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, increment) _1 = (zephir_get_intval(&data) + value); ZEPHIR_INIT_NVAR(&data); ZVAL_LONG(&data, _1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &key, &data); + ZEPHIR_CALL_METHOD(&result, this_ptr, "set", NULL, 0, &key, &data); zephir_check_call_status(); - RETURN_MM(); + if (EXPECTED(!ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + ZEPHIR_CPY_WRT(&result, &data); + } + RETURN_CCTOR(&result); } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool */ @@ -707,7 +725,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, set) ZEPHIR_CALL_METHOD(&_2, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); zephir_array_update_string(&payload, SL("content"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 150, &payload, &key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 122, &payload, &key); zephir_check_call_status(); RETURN_MM(); } @@ -766,7 +784,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, setForever) ZEPHIR_CALL_METHOD(&_1, this_ptr, "getserializeddata", NULL, 0, value); zephir_check_call_status(); zephir_array_update_string(&payload, SL("content"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 150, &payload, &key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "storepayload", NULL, 122, &payload, &key); zephir_check_call_status(); RETURN_MM(); } @@ -827,18 +845,18 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDir) zephir_read_property(&_1, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_2); ZEPHIR_CONCAT_VV(&_2, &_0, &_1); - ZEPHIR_CALL_METHOD(&dirPrefix, this_ptr, "getdirseparator", NULL, 143, &_2); + ZEPHIR_CALL_METHOD(&dirPrefix, this_ptr, "getdirseparator", NULL, 115, &_2); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_3); zephir_read_property(&_4, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ""); zephir_fast_str_replace(&_3, &_4, &_5, &key); - ZEPHIR_CALL_METHOD(&dirFromFile, this_ptr, "getdirfromfile", NULL, 151, &_3); + ZEPHIR_CALL_METHOD(&dirFromFile, this_ptr, "getdirfromfile", NULL, 123, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6); ZEPHIR_CONCAT_VV(&_6, &dirPrefix, &dirFromFile); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getdirseparator", NULL, 143, &_6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getdirseparator", NULL, 115, &_6); zephir_check_call_status(); RETURN_MM(); } @@ -884,7 +902,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getFilepath) } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 149, &key); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdir", NULL, 121, &key); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_1); zephir_read_property(&_2, this_ptr, ZEND_STRL("prefix"), PH_NOISY_CC | PH_READONLY); @@ -938,10 +956,10 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator) ZEPHIR_INIT_VAR(&_0); object_init_ex(&_0, spl_ce_RecursiveDirectoryIterator); ZVAL_LONG(&_1, 4096); - ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 152, &dir, &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 124, &dir, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 2); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 153, &_0, &_1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 125, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -995,52 +1013,52 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload) ZVAL_BOOL(&payload, 0); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "r"); - ZEPHIR_CALL_FUNCTION(&pointer, "fopen", NULL, 90, &filepath, &_0); + ZEPHIR_CALL_METHOD(&pointer, this_ptr, "phpfopen", NULL, 0, &filepath, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(&pointer)) { + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&pointer))) { array_init(return_value); RETURN_MM(); } ZVAL_LONG(&_1, 1); - ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 154, &pointer, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "flock", NULL, 126, &pointer, &_1); zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_NVAR(&payload); - zephir_file_get_contents(&payload, &filepath); + if (EXPECTED(ZEPHIR_IS_TRUE_IDENTICAL(&_2))) { + ZEPHIR_CALL_METHOD(&payload, this_ptr, "phpfilegetcontents", NULL, 0, &filepath); + zephir_check_call_status(); } zephir_fclose(&pointer); - if (ZEPHIR_IS_FALSE_IDENTICAL(&payload)) { + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&payload))) { array_init(return_value); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); zephir_check_call_status(); ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "8.0"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, ">="); - ZEPHIR_CALL_FUNCTION(&_4, "version_compare", NULL, 88, &version, &_0, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "version_compare", NULL, 128, &version, &_0, &_3); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_VAR(&_5$$6); ZEPHIR_INIT_NVAR(&_5$$6); - zephir_create_closure_ex(&_5$$6, NULL, phalcon_3__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_5$$6, NULL, phalcon_1__closure_ce, SL("__invoke")); ZVAL_LONG(&_6$$6, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$6, &_6$$6); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_5$$6, &_6$$6); zephir_check_call_status(); } else { ZEPHIR_INIT_VAR(&_7$$7); ZEPHIR_INIT_NVAR(&_7$$7); - zephir_create_closure_ex(&_7$$7, NULL, phalcon_4__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_7$$7, NULL, phalcon_2__closure_ce, SL("__invoke")); ZVAL_LONG(&_8$$7, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_7$$7, &_8$$7); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_7$$7, &_8$$7); zephir_check_call_status(); } ZEPHIR_CALL_FUNCTION(&_9, "unserialize", NULL, 16, &payload); zephir_check_call_status(); ZEPHIR_CPY_WRT(&payload, &_9); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); zephir_check_call_status(); _10 = ZEPHIR_GLOBAL(warning).enable; if (!(_10)) { @@ -1155,26 +1173,177 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, storePayload) ZEPHIR_CALL_FUNCTION(&_0, "serialize", NULL, 15, &payload); zephir_check_call_status(); ZEPHIR_CPY_WRT(&payload, &_0); - ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 149, &key); + ZEPHIR_CALL_METHOD(&directory, this_ptr, "getdir", NULL, 121, &key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_0, "is_dir", NULL, 155, &directory); + ZEPHIR_CALL_FUNCTION(&_0, "is_dir", NULL, 131, &directory); zephir_check_call_status(); if (!(zephir_is_true(&_0))) { ZVAL_LONG(&_1$$3, 0777); - ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 156, &directory, &_1$$3, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "mkdir", NULL, 132, &directory, &_1$$3, &__$true); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(&_2); - ZEPHIR_CONCAT_VV(&_2, &directory, &key); - ZVAL_LONG(&_3, 2); - ZEPHIR_CALL_FUNCTION(&_4, "file_put_contents", NULL, 157, &_2, &payload, &_3); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VV(&_3, &directory, &key); + ZVAL_LONG(&_4, 2); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "phpfileputcontents", NULL, 0, &_3, &payload, &_4); zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_4)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_2)); } /** - * @todo Remove this when we get traits + * @todo Remove the methods below when we get traits */ +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileExists) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + RETURN_MM_BOOL((zephir_file_exists(&filename) == SUCCESS)); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileGetContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + zephir_file_get_contents(return_value, &filename); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFilePutContents) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long flags, ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *data, data_sub, *flags_param = NULL, *context = NULL, context_sub, __$null, _0; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 4) + Z_PARAM_STR(filename) + Z_PARAM_ZVAL(data) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(flags) + Z_PARAM_ZVAL_OR_NULL(context) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 2, &filename_param, &data, &flags_param, &context); + zephir_get_strval(&filename, filename_param); + if (!flags_param) { + flags = 0; + } else { + flags = zephir_get_intval(flags_param); + } + if (!context) { + context = &context_sub; + context = &__$null; + } + + + ZVAL_LONG(&_0, flags); + ZEPHIR_RETURN_CALL_FUNCTION("file_put_contents", NULL, 133, &filename, data, &_0, context); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFopen) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL, *mode_param = NULL; + zval filename, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); + ZVAL_UNDEF(&mode); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STR(filename) + Z_PARAM_STR(mode) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &filename_param, &mode_param); + zephir_get_strval(&filename, filename_param); + zephir_get_strval(&mode, mode_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpUnlink) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *filename_param = NULL; + zval filename; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filename); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(filename) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filename_param); + zephir_get_strval(&filename, filename_param); + + + ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 118, &filename); + zephir_check_call_status(); + RETURN_MM(); +} + PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -1218,7 +1387,7 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) ZVAL_LONG(&_0, 8); - ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, -2); @@ -1241,16 +1410,13 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile) } ZEPHIR_INIT_VAR(&_7); ZVAL_LONG(&_8, 2); - ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 115, &start, &_8); + ZEPHIR_CALL_FUNCTION(&_9, "str_split", NULL, 84, &start, &_8); zephir_check_call_status(); zephir_fast_join_str(&_7, SL("/"), &_9); ZEPHIR_CONCAT_VS(return_value, &_7, "/"); RETURN_MM(); } -/** - * @todo Remove this when we get traits - */ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirSeparator) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; diff --git a/ext/phalcon/storage/adapter/stream.zep.h b/ext/phalcon/storage/adapter/stream.zep.h index 00ac60f97c3..55807fe2463 100644 --- a/ext/phalcon/storage/adapter/stream.zep.h +++ b/ext/phalcon/storage/adapter/stream.zep.h @@ -19,6 +19,11 @@ PHP_METHOD(Phalcon_Storage_Adapter_Stream, getIterator); PHP_METHOD(Phalcon_Storage_Adapter_Stream, getPayload); PHP_METHOD(Phalcon_Storage_Adapter_Stream, isExpired); PHP_METHOD(Phalcon_Storage_Adapter_Stream, storePayload); +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileExists); +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFileGetContents); +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFilePutContents); +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpFopen); +PHP_METHOD(Phalcon_Storage_Adapter_Stream, phpUnlink); PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirFromFile); PHP_METHOD(Phalcon_Storage_Adapter_Stream, getDirSeparator); @@ -97,6 +102,30 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_s ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfileexists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfilegetcontents, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfileputcontents, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpfopen, 0, 0, 2) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_phpunlink, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_adapter_stream_getdirfromfile, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -122,6 +151,11 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_adapter_stream_method_entry) { PHP_ME(Phalcon_Storage_Adapter_Stream, getPayload, arginfo_phalcon_storage_adapter_stream_getpayload, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, isExpired, arginfo_phalcon_storage_adapter_stream_isexpired, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, storePayload, arginfo_phalcon_storage_adapter_stream_storepayload, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFileExists, arginfo_phalcon_storage_adapter_stream_phpfileexists, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFileGetContents, arginfo_phalcon_storage_adapter_stream_phpfilegetcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFilePutContents, arginfo_phalcon_storage_adapter_stream_phpfileputcontents, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpFopen, arginfo_phalcon_storage_adapter_stream_phpfopen, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Adapter_Stream, phpUnlink, arginfo_phalcon_storage_adapter_stream_phpunlink, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Storage_Adapter_Stream, getDirFromFile, arginfo_phalcon_storage_adapter_stream_getdirfromfile, ZEND_ACC_PRIVATE) PHP_ME(Phalcon_Storage_Adapter_Stream, getDirSeparator, arginfo_phalcon_storage_adapter_stream_getdirseparator, ZEND_ACC_PRIVATE) PHP_FE_END diff --git a/ext/phalcon/storage/serializer/abstractserializer.zep.c b/ext/phalcon/storage/serializer/abstractserializer.zep.c index e0d83398e1c..816ddee272d 100644 --- a/ext/phalcon/storage/serializer/abstractserializer.zep.c +++ b/ext/phalcon/storage/serializer/abstractserializer.zep.c @@ -27,11 +27,8 @@ * file that was distributed with this source code. */ /** - * Class AbstractSerializer - * - * @package Phalcon\Storage\Serializer - * * @property mixed $data + * @property bool $isSuccess */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer) { @@ -41,12 +38,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer) * @var mixed */ zend_declare_property_null(phalcon_storage_serializer_abstractserializer_ce, SL("data"), ZEND_ACC_PROTECTED); + /** + * @var bool + */ + zend_declare_property_bool(phalcon_storage_serializer_abstractserializer_ce, SL("isSuccess"), 1, ZEND_ACC_PROTECTED); zend_class_implements(phalcon_storage_serializer_abstractserializer_ce, 1, phalcon_storage_serializer_serializerinterface_ce); return SUCCESS; } /** - * Constructor. + * AbstractSerializer constructor. * * @param mixed|null $data */ @@ -82,7 +83,57 @@ PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct) } /** - * If this returns true, then the data returns back as is + * @return mixed + */ +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "data"); +} + +/** + * Returns `true` if the serialize/unserialize operation was successful; + * `false` otherwise + * + * @return bool + */ +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "isSuccess"); +} + +/** + * @param mixed $data + */ +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData) +{ + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + zephir_fetch_params_without_memory_grow(1, 0, &data); + + + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); +} + +/** + * If this returns true, then the data is returned as is * * @param mixed $data * @@ -106,49 +157,59 @@ PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable) zephir_fetch_params_without_memory_grow(1, 0, &data); - _0 = ZEPHIR_IS_EMPTY(data); + _0 = Z_TYPE_P(data) == IS_NULL; if (!(_0)) { - _0 = ((Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE) == 1); + _0 = 1 == (Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE); } _1 = _0; if (!(_1)) { - _1 = zephir_is_numeric(data); + _1 = 1 == zephir_is_numeric(data); } RETURN_BOOL(!(_1)); } -/** - * @return mixed - */ -PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData) +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __serialize) { + zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - RETURN_MEMBER(getThis(), "data"); + ZEPHIR_MM_GROW(); + + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_ARRAY) { + RETURN_MM_MEMBER(getThis(), "data"); + } + array_init(return_value); + RETURN_MM(); } -/** - * @param mixed $data - */ -PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData) +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize) { - zval *data, data_sub; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *data_param = NULL; + zval data; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&data); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + Z_PARAM_ARRAY(data) ZEND_PARSE_PARAMETERS_END(); #endif - zephir_fetch_params_without_memory_grow(1, 0, &data); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &data); + ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/storage/serializer/abstractserializer.zep.h b/ext/phalcon/storage/serializer/abstractserializer.zep.h index bd00ba0fb37..85fc59b50bb 100644 --- a/ext/phalcon/storage/serializer/abstractserializer.zep.h +++ b/ext/phalcon/storage/serializer/abstractserializer.zep.h @@ -4,19 +4,21 @@ extern zend_class_entry *phalcon_storage_serializer_abstractserializer_ce; ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_AbstractSerializer); PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __construct); -PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable); PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, getData); +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess); PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, setData); +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable); +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __serialize); +PHP_METHOD(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___construct, 0, 0, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_isserializable, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_getdata, 0, 0, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_getdata, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_issuccess, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_setdata, 0, 1, IS_VOID, 0) @@ -24,14 +26,29 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstr ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer_isserializable, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_abstractserializer___unserialize, 0, 1, IS_VOID, 0) + + ZEND_ARG_ARRAY_INFO(0, data, 0) +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_abstractserializer_method_entry) { PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __construct, arginfo_phalcon_storage_serializer_abstractserializer___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable, arginfo_phalcon_storage_serializer_abstractserializer_isserializable, ZEND_ACC_PROTECTED) #if PHP_VERSION_ID >= 80000 PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, arginfo_phalcon_storage_serializer_abstractserializer_getdata, ZEND_ACC_PUBLIC) #else PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, getData, NULL, ZEND_ACC_PUBLIC) #endif + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSuccess, arginfo_phalcon_storage_serializer_abstractserializer_issuccess, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, setData, arginfo_phalcon_storage_serializer_abstractserializer_setdata, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, isSerializable, arginfo_phalcon_storage_serializer_abstractserializer_isserializable, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __serialize, arginfo_phalcon_storage_serializer_abstractserializer___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_AbstractSerializer, __unserialize, arginfo_phalcon_storage_serializer_abstractserializer___unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/storage/serializer/base64.zep.c b/ext/phalcon/storage/serializer/base64.zep.c index 476c2cdf57d..10338e64b91 100644 --- a/ext/phalcon/storage/serializer/base64.zep.c +++ b/ext/phalcon/storage/serializer/base64.zep.c @@ -17,6 +17,7 @@ #include "kernel/exception.h" #include "ext/spl/spl_exceptions.h" #include "kernel/fcall.h" +#include "kernel/operators.h" /** @@ -27,11 +28,6 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -/** - * Class Base64 - * - * @package Phalcon\Storage\Serializer - */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Base64) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Base64, phalcon, storage_serializer_base64, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_base64_method_entry, 0); @@ -60,11 +56,11 @@ PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize) ZEPHIR_OBS_VAR(&_0); zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC); if (Z_TYPE_P(&_0) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the serializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 32); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the serializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 27); return; } zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 245, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 226, &_1); zephir_check_call_status(); RETURN_MM(); } @@ -72,7 +68,7 @@ PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize) /** * Unserializes data * - * @param string $data + * @param mixed $data * * @retrun void */ @@ -80,11 +76,16 @@ PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; + zval data_sub, __$true, __$false, result, _0, _1; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -97,13 +98,70 @@ PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize) zephir_fetch_params(1, 1, 0, &data); - if (Z_TYPE_P(data) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 50); + ZEPHIR_INIT_VAR(&_0); + zephir_gettype(&_0, data); + if (!ZEPHIR_IS_STRING_IDENTICAL(&_0, "string")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Base64.zep", 47); return; } - ZEPHIR_CALL_FUNCTION(&_0, "base64_decode", NULL, 244, data); + ZVAL_BOOL(&_1, 1); + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpbase64decode", NULL, 0, data, &_1); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0); + if (UNEXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&result))) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); ZEPHIR_MM_RESTORE(); } +/** + * Wrapper for base64_decode + * + * @param string $input + * @param bool $strict + * + * @return string|false + */ +PHP_METHOD(Phalcon_Storage_Serializer_Base64, phpBase64Decode) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zend_bool strict; + zval *input_param = NULL, *strict_param = NULL, _0; + zval input; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&input); + ZVAL_UNDEF(&_0); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(input) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(strict) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 1, &input_param, &strict_param); + zephir_get_strval(&input, input_param); + if (!strict_param) { + strict = 0; + } else { + strict = zephir_get_boolval(strict_param); + } + + + ZVAL_BOOL(&_0, (strict ? 1 : 0)); + ZEPHIR_RETURN_CALL_FUNCTION("base64_decode", NULL, 225, &input, &_0); + zephir_check_call_status(); + RETURN_MM(); +} + diff --git a/ext/phalcon/storage/serializer/base64.zep.h b/ext/phalcon/storage/serializer/base64.zep.h index dd42a484781..fc6c36350a3 100644 --- a/ext/phalcon/storage/serializer/base64.zep.h +++ b/ext/phalcon/storage/serializer/base64.zep.h @@ -5,17 +5,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Base64); PHP_METHOD(Phalcon_Storage_Serializer_Base64, serialize); PHP_METHOD(Phalcon_Storage_Serializer_Base64, unserialize); +PHP_METHOD(Phalcon_Storage_Serializer_Base64, phpBase64Decode); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_base64_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_base64_phpbase64decode, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_base64_method_entry) { PHP_ME(Phalcon_Storage_Serializer_Base64, serialize, arginfo_phalcon_storage_serializer_base64_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Serializer_Base64, unserialize, arginfo_phalcon_storage_serializer_base64_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_Base64, phpBase64Decode, arginfo_phalcon_storage_serializer_base64_phpbase64decode, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/storage/serializer/igbinary.zep.c b/ext/phalcon/storage/serializer/igbinary.zep.c index 84ae72bd040..abfab6b9074 100644 --- a/ext/phalcon/storage/serializer/igbinary.zep.c +++ b/ext/phalcon/storage/serializer/igbinary.zep.c @@ -40,11 +40,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary) */ PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize) { - zval _0, _1, _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval __$true, __$false, result, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); @@ -59,37 +62,49 @@ PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize) RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 0, &_2); + ZEPHIR_CALL_METHOD(&result, this_ptr, "doserialize", NULL, 0, &_2); zephir_check_call_status(); - RETURN_MM(); + if (UNEXPECTED(Z_TYPE_P(&result) == IS_NULL)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + RETURN_CCTOR(&result); } /** * Unserializes data * - * @param string $data + * @param mixed $data * * @return void */ PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize) { + zend_bool _8$$4; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4; + zval data_sub, __$false, __$true, result, version, _0, _1$$4, _2$$4, _3$$4, _4$$5, _5$$5, _6$$6, _7$$6; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&version); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$6); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -102,38 +117,150 @@ PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize) zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); - zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "8.0"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ">="); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 88, &version, &_0, &_1); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_create_closure_ex(&_3$$3, NULL, phalcon_11__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$3, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$3, &_4$$3); - zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); } else { - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_NVAR(&_5$$4); - zephir_create_closure_ex(&_5$$4, NULL, phalcon_12__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$4, &_6$$4); + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); + zephir_check_call_status(); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "8.0"); + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, ">="); + ZEPHIR_CALL_FUNCTION(&_3$$4, "version_compare", NULL, 128, &version, &_1$$4, &_2$$4); + zephir_check_call_status(); + if (zephir_is_true(&_3$$4)) { + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_INIT_NVAR(&_4$$5); + zephir_create_closure_ex(&_4$$5, NULL, phalcon_3__closure_ce, SL("__invoke")); + ZVAL_LONG(&_5$$5, 2); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_4$$5, &_5$$5); + zephir_check_call_status(); + } else { + ZEPHIR_INIT_VAR(&_6$$6); + ZEPHIR_INIT_NVAR(&_6$$6); + zephir_create_closure_ex(&_6$$6, NULL, phalcon_4__closure_ce, SL("__invoke")); + ZVAL_LONG(&_7$$6, 2); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_6$$6, &_7$$6); + zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(&result, this_ptr, "dounserialize", NULL, 0, data); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); zephir_check_call_status(); + _8$$4 = ZEPHIR_GLOBAL(warning).enable; + if (!(_8$$4)) { + _8$$4 = ZEPHIR_IS_FALSE_IDENTICAL(&result); + } + if (UNEXPECTED(_8$$4)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); + } else { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); + } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); + } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); } - ZEPHIR_CALL_FUNCTION(&_7, "igbinary_unserialize", NULL, 0, data); + ZEPHIR_MM_RESTORE(); +} + +/** + * Wrapper for `igbinary_serialize` + * + * @param mixed $value + * + * @return string|null + */ +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 135, value); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); + RETURN_MM(); +} + +/** + * Serialize + * + * @param mixed $value + * + * @return string|null + */ +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doSerialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "phpigbinaryserialize", NULL, 0, value); zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); +} + +/** + * Unserialize + * + * @param string $value + * + * @return mixed|false + */ +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); + + + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_unserialize", NULL, 136, value); + zephir_check_call_status(); + RETURN_MM(); } diff --git a/ext/phalcon/storage/serializer/igbinary.zep.h b/ext/phalcon/storage/serializer/igbinary.zep.h index b35f47b31ef..4f388c5afc0 100644 --- a/ext/phalcon/storage/serializer/igbinary.zep.h +++ b/ext/phalcon/storage/serializer/igbinary.zep.h @@ -5,13 +5,33 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Igbinary); PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, serialize); PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, unserialize); +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize); +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doSerialize); +PHP_METHOD(Phalcon_Storage_Serializer_Igbinary, doUnserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_serialize, 0, 0, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_phpigbinaryserialize, 0, 1, IS_STRING, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_doserialize, 0, 1, IS_STRING, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_igbinary_dounserialize, 0, 0, 1) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_igbinary_method_entry) { @@ -21,5 +41,8 @@ ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_igbinary_method_entry) { PHP_ME(Phalcon_Storage_Serializer_Igbinary, serialize, NULL, ZEND_ACC_PUBLIC) #endif PHP_ME(Phalcon_Storage_Serializer_Igbinary, unserialize, arginfo_phalcon_storage_serializer_igbinary_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, phpIgbinarySerialize, arginfo_phalcon_storage_serializer_igbinary_phpigbinaryserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, doSerialize, arginfo_phalcon_storage_serializer_igbinary_doserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Igbinary, doUnserialize, arginfo_phalcon_storage_serializer_igbinary_dounserialize, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/storage/serializer/json.zep.c b/ext/phalcon/storage/serializer/json.zep.c index 5334377e107..7f1882c8c26 100644 --- a/ext/phalcon/storage/serializer/json.zep.c +++ b/ext/phalcon/storage/serializer/json.zep.c @@ -30,11 +30,6 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -/** - * Class Json - * - * @package Phalcon\Storage\Serializer - */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Json) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Json, phalcon, storage_serializer_json, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_json_method_entry, 0); @@ -80,16 +75,16 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize) object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CONCAT_SS(&_4$$3, "Data for the JSON serializer cannot be of type 'object' ", "without implementing 'JsonSerializable'"); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_4$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 34); + zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 29); ZEPHIR_MM_RESTORE(); return; } zephir_read_property(&_6, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_5, this_ptr, "isserializable", NULL, 0, &_6); zephir_check_call_status(); - if (!(zephir_is_true(&_5))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_5)) { RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_7, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); @@ -101,7 +96,7 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, serialize) /** * Unserializes data * - * @param string $data + * @param mixed $data * * @return void */ @@ -109,11 +104,13 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; + zval data_sub, _0, _1$$4; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -126,9 +123,15 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, unserialize) zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdecode", NULL, 0, data); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_0); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + } else { + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getdecode", NULL, 0, data); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_1$$4); + } ZEPHIR_MM_RESTORE(); } @@ -198,18 +201,18 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, getDecode) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0))) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_4$$3, "phalcon/Storage/Serializer/Json.zep", 73); + zephir_throw_exception_debug(&_4$$3, "phalcon/Storage/Serializer/Json.zep", 71); ZEPHIR_MM_RESTORE(); return; } @@ -263,18 +266,18 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, getEncode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); - zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 95); + zephir_throw_exception_debug(&_3$$3, "phalcon/Storage/Serializer/Json.zep", 92); ZEPHIR_MM_RESTORE(); return; } diff --git a/ext/phalcon/storage/serializer/json.zep.h b/ext/phalcon/storage/serializer/json.zep.h index 5ebf3f20e59..732da81681a 100644 --- a/ext/phalcon/storage/serializer/json.zep.h +++ b/ext/phalcon/storage/serializer/json.zep.h @@ -11,10 +11,15 @@ PHP_METHOD(Phalcon_Storage_Serializer_Json, getEncode); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_json_serialize, 0, 0, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_json_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_json_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_json_getdecode, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) diff --git a/ext/phalcon/storage/serializer/memcachedigbinary.zep.c b/ext/phalcon/storage/serializer/memcachedigbinary.zep.c new file mode 100644 index 00000000000..1b769cc7ae1 --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedigbinary.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Memcached 'igbinary' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedIgbinary) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedIgbinary, phalcon, storage_serializer_memcachedigbinary, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/memcachedigbinary.zep.h b/ext/phalcon/storage/serializer/memcachedigbinary.zep.h new file mode 100644 index 00000000000..0d0dd59c69d --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedigbinary.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_memcachedigbinary_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedIgbinary); + diff --git a/ext/phalcon/storage/serializer/memcachedjson.zep.c b/ext/phalcon/storage/serializer/memcachedjson.zep.c new file mode 100644 index 00000000000..dea36fce11f --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedjson.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Memcached 'json' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedJson) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedJson, phalcon, storage_serializer_memcachedjson, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/memcachedjson.zep.h b/ext/phalcon/storage/serializer/memcachedjson.zep.h new file mode 100644 index 00000000000..45b295f6c6d --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedjson.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_memcachedjson_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedJson); + diff --git a/ext/phalcon/storage/serializer/memcachedphp.zep.c b/ext/phalcon/storage/serializer/memcachedphp.zep.c new file mode 100644 index 00000000000..12e041a7a39 --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedphp.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Memcached 'php' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedPhp) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, MemcachedPhp, phalcon, storage_serializer_memcachedphp, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/memcachedphp.zep.h b/ext/phalcon/storage/serializer/memcachedphp.zep.h new file mode 100644 index 00000000000..4b3411105cf --- /dev/null +++ b/ext/phalcon/storage/serializer/memcachedphp.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_memcachedphp_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_MemcachedPhp); + diff --git a/ext/phalcon/storage/serializer/msgpack.zep.c b/ext/phalcon/storage/serializer/msgpack.zep.c index d52fb4f884e..b459111035e 100644 --- a/ext/phalcon/storage/serializer/msgpack.zep.c +++ b/ext/phalcon/storage/serializer/msgpack.zep.c @@ -12,10 +12,9 @@ #include #include "kernel/main.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" #include "kernel/object.h" -#include "kernel/operators.h" +#include "kernel/fcall.h" +#include "kernel/memory.h" /** @@ -28,7 +27,7 @@ */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_msgpack_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, Msgpack, phalcon, storage_serializer_msgpack, phalcon_storage_serializer_igbinary_ce, phalcon_storage_serializer_msgpack_method_entry, 0); return SUCCESS; } @@ -36,104 +35,62 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack) /** * Serializes data * - * @return string|null + * @return string */ -PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize) +PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doSerialize) { - zval _0, _1, _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *value, value_sub, _0; zval *this_ptr = getThis(); + ZVAL_UNDEF(&value_sub); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ZVAL(value) + ZEND_PARSE_PARAMETERS_END(); +#endif ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &value); - zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1); - zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { - RETURN_MM_MEMBER(getThis(), "data"); - } - zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_2); + + zephir_read_property(&_0, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); } /** - * Unserializes data + * @param mixed $value * - * @param string $data - * - * @return void + * @return mixed */ -PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize) +PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doUnserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1, _2, _7, _3$$3, _4$$3, _5$$4, _6$$4; + zval *value, value_sub; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); - ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); - ZVAL_UNDEF(&version); - ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_4$$3); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&value_sub); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); + zephir_fetch_params(1, 1, 0, &value); - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_unpack", NULL, 0, value); zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_0); - ZVAL_STRING(&_0, "8.0"); - ZEPHIR_INIT_VAR(&_1); - ZVAL_STRING(&_1, ">="); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 88, &version, &_0, &_1); - zephir_check_call_status(); - if (zephir_is_true(&_2)) { - ZEPHIR_INIT_VAR(&_3$$3); - ZEPHIR_INIT_NVAR(&_3$$3); - zephir_create_closure_ex(&_3$$3, NULL, phalcon_13__closure_ce, SL("__invoke")); - ZVAL_LONG(&_4$$3, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_3$$3, &_4$$3); - zephir_check_call_status(); - } else { - ZEPHIR_INIT_VAR(&_5$$4); - ZEPHIR_INIT_NVAR(&_5$$4); - zephir_create_closure_ex(&_5$$4, NULL, phalcon_14__closure_ce, SL("__invoke")); - ZVAL_LONG(&_6$$4, 2); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_5$$4, &_6$$4); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_7, "msgpack_unpack", NULL, 0, data); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_7); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } diff --git a/ext/phalcon/storage/serializer/msgpack.zep.h b/ext/phalcon/storage/serializer/msgpack.zep.h index 96925560890..a98de40b1ea 100644 --- a/ext/phalcon/storage/serializer/msgpack.zep.h +++ b/ext/phalcon/storage/serializer/msgpack.zep.h @@ -3,19 +3,19 @@ extern zend_class_entry *phalcon_storage_serializer_msgpack_ce; ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Msgpack); -PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, serialize); -PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, unserialize); +PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doSerialize); +PHP_METHOD(Phalcon_Storage_Serializer_Msgpack, doUnserialize); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_serialize, 0, 0, IS_STRING, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_doserialize, 0, 1, IS_STRING, 0) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) +ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_storage_serializer_msgpack_dounserialize, 0, 0, 1) + ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_msgpack_method_entry) { - PHP_ME(Phalcon_Storage_Serializer_Msgpack, serialize, arginfo_phalcon_storage_serializer_msgpack_serialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Serializer_Msgpack, unserialize, arginfo_phalcon_storage_serializer_msgpack_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Storage_Serializer_Msgpack, doSerialize, arginfo_phalcon_storage_serializer_msgpack_doserialize, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Storage_Serializer_Msgpack, doUnserialize, arginfo_phalcon_storage_serializer_msgpack_dounserialize, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/storage/serializer/none.zep.c b/ext/phalcon/storage/serializer/none.zep.c index cf315577ffc..9c7c5160f26 100644 --- a/ext/phalcon/storage/serializer/none.zep.c +++ b/ext/phalcon/storage/serializer/none.zep.c @@ -24,11 +24,6 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -/** - * Class None - * - * @package Phalcon\Storage\Serializer - */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, None, phalcon, storage_serializer_none, phalcon_storage_serializer_abstractserializer_ce, phalcon_storage_serializer_none_method_entry, 0); @@ -39,7 +34,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None) /** * Serializes data * - * @return string + * @return mixed */ PHP_METHOD(Phalcon_Storage_Serializer_None, serialize) { @@ -53,13 +48,14 @@ PHP_METHOD(Phalcon_Storage_Serializer_None, serialize) /** * Unserializes data * - * @param string $data + * @param mixed $data * * @retrun void */ PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize) { - zval *data, data_sub; + zval data_sub; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); diff --git a/ext/phalcon/storage/serializer/none.zep.h b/ext/phalcon/storage/serializer/none.zep.h index e7ce6130577..8104c8a302c 100644 --- a/ext/phalcon/storage/serializer/none.zep.h +++ b/ext/phalcon/storage/serializer/none.zep.h @@ -6,13 +6,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_None); PHP_METHOD(Phalcon_Storage_Serializer_None, serialize); PHP_METHOD(Phalcon_Storage_Serializer_None, unserialize); -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_serialize, 0, 0, IS_NULL, 0) +#endif ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_none_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() +#endif ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_none_method_entry) { PHP_ME(Phalcon_Storage_Serializer_None, serialize, arginfo_phalcon_storage_serializer_none_serialize, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/storage/serializer/php.zep.c b/ext/phalcon/storage/serializer/php.zep.c index c814399e6a8..1bc9425ed18 100644 --- a/ext/phalcon/storage/serializer/php.zep.c +++ b/ext/phalcon/storage/serializer/php.zep.c @@ -16,8 +16,6 @@ #include "kernel/fcall.h" #include "kernel/object.h" #include "kernel/operators.h" -#include "kernel/exception.h" -#include "ext/spl/spl_exceptions.h" /** @@ -57,7 +55,7 @@ PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize) zephir_read_property(&_1, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, &_1); zephir_check_call_status(); - if (!(zephir_is_true(&_0))) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_MEMBER(getThis(), "data"); } zephir_read_property(&_2, this_ptr, ZEND_STRL("data"), PH_NOISY_CC | PH_READONLY); @@ -69,58 +67,30 @@ PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize) /** * Unserializes data * - * @param string $data - */ -PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize) -{ - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub; - zval *this_ptr = getThis(); - - ZVAL_UNDEF(&data_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) - ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); - - - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processserializable", NULL, 0, data); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processnotserializable", NULL, 0, data); - zephir_check_call_status(); - ZEPHIR_MM_RESTORE(); -} - -/** * @param mixed $data */ -PHP_METHOD(Phalcon_Storage_Serializer_Php, processSerializable) +PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize) { + zend_bool _8; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, __$false, __$null, version, _0, _1$$3, _2$$3, _3$$3, _8$$3, _4$$5, _5$$5, _6$$6, _7$$6; + zval data_sub, __$false, __$true, result, version, _0, _1, _2, _3, _4$$4, _5$$4, _6$$5, _7$$5; + zval *data; zval *this_ptr = getThis(); ZVAL_UNDEF(&data_sub); ZVAL_BOOL(&__$false, 0); - ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&result); ZVAL_UNDEF(&version); ZVAL_UNDEF(&_0); - ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_3$$3); - ZVAL_UNDEF(&_8$$3); - ZVAL_UNDEF(&_4$$5); - ZVAL_UNDEF(&_5$$5); - ZVAL_UNDEF(&_6$$6); - ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -135,76 +105,95 @@ PHP_METHOD(Phalcon_Storage_Serializer_Php, processSerializable) ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - if (Z_TYPE_P(data) != IS_STRING) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Data for the unserializer must of type string", "phalcon/Storage/Serializer/Php.zep", 54); - return; - } - ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 87); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); + RETURN_MM_NULL(); + } + ZEPHIR_CALL_FUNCTION(&version, "phpversion", NULL, 127); + zephir_check_call_status(); + ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "8.0"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, ">="); + ZEPHIR_CALL_FUNCTION(&_3, "version_compare", NULL, 128, &version, &_1, &_2); + zephir_check_call_status(); + if (zephir_is_true(&_3)) { + ZEPHIR_INIT_VAR(&_4$$4); + ZEPHIR_INIT_NVAR(&_4$$4); + zephir_create_closure_ex(&_4$$4, NULL, phalcon_11__closure_ce, SL("__invoke")); + ZVAL_LONG(&_5$$4, 8); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_4$$4, &_5$$4); zephir_check_call_status(); - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$false); - ZEPHIR_INIT_VAR(&_1$$3); - ZVAL_STRING(&_1$$3, "8.0"); - ZEPHIR_INIT_VAR(&_2$$3); - ZVAL_STRING(&_2$$3, ">="); - ZEPHIR_CALL_FUNCTION(&_3$$3, "version_compare", NULL, 88, &version, &_1$$3, &_2$$3); + } else { + ZEPHIR_INIT_VAR(&_6$$5); + ZEPHIR_INIT_NVAR(&_6$$5); + zephir_create_closure_ex(&_6$$5, NULL, phalcon_12__closure_ce, SL("__invoke")); + ZVAL_LONG(&_7$$5, 8); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_6$$5, &_7$$5); zephir_check_call_status(); - if (zephir_is_true(&_3$$3)) { - ZEPHIR_INIT_VAR(&_4$$5); - ZEPHIR_INIT_NVAR(&_4$$5); - zephir_create_closure_ex(&_4$$5, NULL, phalcon_15__closure_ce, SL("__invoke")); - ZVAL_LONG(&_5$$5, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_4$$5, &_5$$5); - zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(&result, this_ptr, "phpunserialize", NULL, 0, data); + zephir_check_call_status(); + ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 130); + zephir_check_call_status(); + _8 = ZEPHIR_GLOBAL(warning).enable; + if (!(_8)) { + _8 = ZEPHIR_IS_FALSE_IDENTICAL(&result); + } + if (UNEXPECTED(_8)) { + if (0) { + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$true); } else { - ZEPHIR_INIT_VAR(&_6$$6); - ZEPHIR_INIT_NVAR(&_6$$6); - zephir_create_closure_ex(&_6$$6, NULL, phalcon_16__closure_ce, SL("__invoke")); - ZVAL_LONG(&_7$$6, 8); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_6$$6, &_7$$6); - zephir_check_call_status(); - } - ZEPHIR_CALL_FUNCTION(&_8$$3, "unserialize", NULL, 16, data); - zephir_check_call_status(); - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &_8$$3); - ZEPHIR_CALL_FUNCTION(NULL, "restore_error_handler", NULL, 91); - zephir_check_call_status(); - if (UNEXPECTED(ZEPHIR_GLOBAL(warning).enable)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &__$null); + zephir_update_property_zval(this_ptr, ZEND_STRL("isSuccess"), &__$false); } + ZEPHIR_INIT_NVAR(&result); + ZVAL_STRING(&result, ""); } + zephir_update_property_zval(this_ptr, ZEND_STRL("data"), &result); ZEPHIR_MM_RESTORE(); } /** - * @param mixed $data + * @param string $data + * @param array $options + * + * @return mixed */ -PHP_METHOD(Phalcon_Storage_Serializer_Php, processNotSerializable) +PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, data_sub, _0; + zval options; + zval *data_param = NULL, *options_param = NULL; + zval data; zval *this_ptr = getThis(); - ZVAL_UNDEF(&data_sub); - ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&options); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(data) + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(data) + Z_PARAM_OPTIONAL + Z_PARAM_ARRAY(options) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &data); + zephir_fetch_params(1, 1, 1, &data_param, &options_param); + zephir_get_strval(&data, data_param); + if (!options_param) { + ZEPHIR_INIT_VAR(&options); + array_init(&options); + } else { + zephir_get_arrval(&options, options_param); + } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "isserializable", NULL, 0, data); + ZEPHIR_RETURN_CALL_FUNCTION("unserialize", NULL, 16, &data, &options); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - zephir_update_property_zval(this_ptr, ZEND_STRL("data"), data); - } - ZEPHIR_MM_RESTORE(); + RETURN_MM(); } diff --git a/ext/phalcon/storage/serializer/php.zep.h b/ext/phalcon/storage/serializer/php.zep.h index 9d3ccdfb7a4..ce6bc2f91f0 100644 --- a/ext/phalcon/storage/serializer/php.zep.h +++ b/ext/phalcon/storage/serializer/php.zep.h @@ -5,31 +5,37 @@ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_Php); PHP_METHOD(Phalcon_Storage_Serializer_Php, serialize); PHP_METHOD(Phalcon_Storage_Serializer_Php, unserialize); -PHP_METHOD(Phalcon_Storage_Serializer_Php, processSerializable); -PHP_METHOD(Phalcon_Storage_Serializer_Php, processNotSerializable); +PHP_METHOD(Phalcon_Storage_Serializer_Php, phpUnserialize); ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_serialize, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_unserialize, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_processserializable, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_processnotserializable, 0, 1, IS_VOID, 0) - - ZEND_ARG_INFO(0, data) +#endif + +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_phpunserialize, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_storage_serializer_php_phpunserialize, 0, 1, IS_NULL, 0) +#endif + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#if PHP_VERSION_ID >= 80000 + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]") +#else + ZEND_ARG_ARRAY_INFO(0, options, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_storage_serializer_php_method_entry) { PHP_ME(Phalcon_Storage_Serializer_Php, serialize, arginfo_phalcon_storage_serializer_php_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Storage_Serializer_Php, unserialize, arginfo_phalcon_storage_serializer_php_unserialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Storage_Serializer_Php, processSerializable, arginfo_phalcon_storage_serializer_php_processserializable, ZEND_ACC_PRIVATE) - PHP_ME(Phalcon_Storage_Serializer_Php, processNotSerializable, arginfo_phalcon_storage_serializer_php_processnotserializable, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Storage_Serializer_Php, phpUnserialize, arginfo_phalcon_storage_serializer_php_phpunserialize, ZEND_ACC_PRIVATE) PHP_FE_END }; diff --git a/ext/phalcon/storage/serializer/redisigbinary.zep.c b/ext/phalcon/storage/serializer/redisigbinary.zep.c new file mode 100644 index 00000000000..bb84cf4320c --- /dev/null +++ b/ext/phalcon/storage/serializer/redisigbinary.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Redis 'igbinary' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisIgbinary, phalcon, storage_serializer_redisigbinary, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/redisigbinary.zep.h b/ext/phalcon/storage/serializer/redisigbinary.zep.h new file mode 100644 index 00000000000..47a238fd48b --- /dev/null +++ b/ext/phalcon/storage/serializer/redisigbinary.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_redisigbinary_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisIgbinary); + diff --git a/ext/phalcon/storage/serializer/redisjson.zep.c b/ext/phalcon/storage/serializer/redisjson.zep.c new file mode 100644 index 00000000000..a76c46bf9e4 --- /dev/null +++ b/ext/phalcon/storage/serializer/redisjson.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Redis 'json' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisJson, phalcon, storage_serializer_redisjson, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/redisjson.zep.h b/ext/phalcon/storage/serializer/redisjson.zep.h new file mode 100644 index 00000000000..c0ba3747945 --- /dev/null +++ b/ext/phalcon/storage/serializer/redisjson.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_redisjson_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisJson); + diff --git a/ext/phalcon/storage/serializer/redismsgpack.zep.c b/ext/phalcon/storage/serializer/redismsgpack.zep.c new file mode 100644 index 00000000000..435d8afe019 --- /dev/null +++ b/ext/phalcon/storage/serializer/redismsgpack.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Redis 'msgpack' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisMsgpack, phalcon, storage_serializer_redismsgpack, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/redismsgpack.zep.h b/ext/phalcon/storage/serializer/redismsgpack.zep.h new file mode 100644 index 00000000000..4f2cb1dcd0f --- /dev/null +++ b/ext/phalcon/storage/serializer/redismsgpack.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_redismsgpack_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisMsgpack); + diff --git a/ext/phalcon/storage/serializer/redisnone.zep.c b/ext/phalcon/storage/serializer/redisnone.zep.c new file mode 100644 index 00000000000..84b81d55912 --- /dev/null +++ b/ext/phalcon/storage/serializer/redisnone.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Redis 'none' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisNone, phalcon, storage_serializer_redisnone, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/redisnone.zep.h b/ext/phalcon/storage/serializer/redisnone.zep.h new file mode 100644 index 00000000000..bad2a9552fa --- /dev/null +++ b/ext/phalcon/storage/serializer/redisnone.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_redisnone_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisNone); + diff --git a/ext/phalcon/storage/serializer/redisphp.zep.c b/ext/phalcon/storage/serializer/redisphp.zep.c new file mode 100644 index 00000000000..602dfd55613 --- /dev/null +++ b/ext/phalcon/storage/serializer/redisphp.zep.c @@ -0,0 +1,34 @@ + +#ifdef HAVE_CONFIG_H +#include "../../../ext_config.h" +#endif + +#include +#include "../../../php_ext.h" +#include "../../../ext.h" + +#include +#include +#include + +#include "kernel/main.h" + + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +/** + * Serializer using the built-in Redis 'php' serializer + */ +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp) +{ + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Storage\\Serializer, RedisPhp, phalcon, storage_serializer_redisphp, phalcon_storage_serializer_none_ce, NULL, 0); + + return SUCCESS; +} + diff --git a/ext/phalcon/storage/serializer/redisphp.zep.h b/ext/phalcon/storage/serializer/redisphp.zep.h new file mode 100644 index 00000000000..6a6ef994a33 --- /dev/null +++ b/ext/phalcon/storage/serializer/redisphp.zep.h @@ -0,0 +1,5 @@ + +extern zend_class_entry *phalcon_storage_serializer_redisphp_ce; + +ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_RedisPhp); + diff --git a/ext/phalcon/storage/serializer/serializerinterface.zep.c b/ext/phalcon/storage/serializer/serializerinterface.zep.c index b9ee266462a..f32d2e1b9b6 100644 --- a/ext/phalcon/storage/serializer/serializerinterface.zep.c +++ b/ext/phalcon/storage/serializer/serializerinterface.zep.c @@ -20,11 +20,6 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -/** - * Interface SerializerInterface - * - * @package Phalcon\Storage\Serializer - */ ZEPHIR_INIT_CLASS(Phalcon_Storage_Serializer_SerializerInterface) { ZEPHIR_REGISTER_INTERFACE(Phalcon\\Storage\\Serializer, SerializerInterface, phalcon, storage_serializer_serializerinterface, phalcon_storage_serializer_serializerinterface_method_entry); diff --git a/ext/phalcon/storage/serializerfactory.zep.c b/ext/phalcon/storage/serializerfactory.zep.c index 77997c21652..235cd28744a 100644 --- a/ext/phalcon/storage/serializerfactory.zep.c +++ b/ext/phalcon/storage/serializerfactory.zep.c @@ -141,13 +141,21 @@ PHP_METHOD(Phalcon_Storage_SerializerFactory, getServices) - zephir_create_array(return_value, 6, 0); + zephir_create_array(return_value, 14, 0); add_assoc_stringl_ex(return_value, SL("base64"), SL("Phalcon\\Storage\\Serializer\\Base64")); add_assoc_stringl_ex(return_value, SL("igbinary"), SL("Phalcon\\Storage\\Serializer\\Igbinary")); add_assoc_stringl_ex(return_value, SL("json"), SL("Phalcon\\Storage\\Serializer\\Json")); + add_assoc_stringl_ex(return_value, SL("memcached_igbinary"), SL("Phalcon\\Storage\\Serializer\\MemcachedIgbinary")); + add_assoc_stringl_ex(return_value, SL("memcached_json"), SL("Phalcon\\Storage\\Serializer\\MemcachedJson")); + add_assoc_stringl_ex(return_value, SL("memcached_php"), SL("Phalcon\\Storage\\Serializer\\MemcachedPhp")); add_assoc_stringl_ex(return_value, SL("msgpack"), SL("Phalcon\\Storage\\Serializer\\Msgpack")); add_assoc_stringl_ex(return_value, SL("none"), SL("Phalcon\\Storage\\Serializer\\None")); add_assoc_stringl_ex(return_value, SL("php"), SL("Phalcon\\Storage\\Serializer\\Php")); + add_assoc_stringl_ex(return_value, SL("redis_igbinary"), SL("Phalcon\\Storage\\Serializer\\RedisIgbinary")); + add_assoc_stringl_ex(return_value, SL("redis_json"), SL("Phalcon\\Storage\\Serializer\\RedisJson")); + add_assoc_stringl_ex(return_value, SL("redis_msgpack"), SL("Phalcon\\Storage\\Serializer\\RedisMsgpack")); + add_assoc_stringl_ex(return_value, SL("redis_none"), SL("Phalcon\\Storage\\Serializer\\RedisNone")); + add_assoc_stringl_ex(return_value, SL("redis_php"), SL("Phalcon\\Storage\\Serializer\\RedisPhp")); return; } diff --git a/ext/phalcon/support/collection.zep.c b/ext/phalcon/support/collection.zep.c index 437a7ccf2b6..7721fa60b90 100644 --- a/ext/phalcon/support/collection.zep.c +++ b/ext/phalcon/support/collection.zep.c @@ -661,7 +661,8 @@ PHP_METHOD(Phalcon_Support_Collection, offsetExists) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -676,7 +677,6 @@ PHP_METHOD(Phalcon_Support_Collection, offsetExists) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -695,7 +695,8 @@ PHP_METHOD(Phalcon_Support_Collection, offsetGet) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -710,7 +711,6 @@ PHP_METHOD(Phalcon_Support_Collection, offsetGet) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -729,7 +729,8 @@ PHP_METHOD(Phalcon_Support_Collection, offsetSet) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub, *value, value_sub; + zval element_sub, value_sub; + zval *element = NULL, *value; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -746,7 +747,6 @@ PHP_METHOD(Phalcon_Support_Collection, offsetSet) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &element, &value); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -765,7 +765,8 @@ PHP_METHOD(Phalcon_Support_Collection, offsetUnset) zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *element = NULL, element_sub; + zval element_sub; + zval *element = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); @@ -780,7 +781,6 @@ PHP_METHOD(Phalcon_Support_Collection, offsetUnset) ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_SEPARATE_PARAM(element); zephir_cast_to_string(&_0, element); @@ -965,37 +965,76 @@ PHP_METHOD(Phalcon_Support_Collection, toJson) */ PHP_METHOD(Phalcon_Support_Collection, unserialize) { - zval _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serialized = NULL, serialized_sub, data; + zval *serialized_param = NULL, data; + zval serialized; zval *this_ptr = getThis(); - ZVAL_UNDEF(&serialized_sub); + ZVAL_UNDEF(&serialized); ZVAL_UNDEF(&data); - ZVAL_UNDEF(&_0); #if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ZVAL(serialized) + Z_PARAM_STR(serialized) ZEND_PARSE_PARAMETERS_END(); #endif ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &serialized); - ZEPHIR_SEPARATE_PARAM(serialized); + zephir_fetch_params(1, 1, 0, &serialized_param); + zephir_get_strval(&serialized, serialized_param); - zephir_cast_to_string(&_0, serialized); - ZEPHIR_CPY_WRT(serialized, &_0); - ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 16, serialized); + ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 16, &serialized); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } +PHP_METHOD(Phalcon_Support_Collection, __serialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + + + ZEPHIR_MM_GROW(); + + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "toarray", NULL, 0); + zephir_check_call_status(); + RETURN_MM(); +} + +PHP_METHOD(Phalcon_Support_Collection, __unserialize) +{ + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *data_param = NULL; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); +#if PHP_VERSION_ID >= 80000 + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY(data) + ZEND_PARSE_PARAMETERS_END(); +#endif + + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &data_param); + zephir_get_arrval(&data, data_param); + + + ZEPHIR_CALL_METHOD(NULL, this_ptr, "init", NULL, 0, &data); + zephir_check_call_status(); + ZEPHIR_MM_RESTORE(); +} + /** * Internal method to set data */ diff --git a/ext/phalcon/support/collection.zep.h b/ext/phalcon/support/collection.zep.h index 49cf713ecee..b597fbecd35 100644 --- a/ext/phalcon/support/collection.zep.h +++ b/ext/phalcon/support/collection.zep.h @@ -27,6 +27,8 @@ PHP_METHOD(Phalcon_Support_Collection, serialize); PHP_METHOD(Phalcon_Support_Collection, toArray); PHP_METHOD(Phalcon_Support_Collection, toJson); PHP_METHOD(Phalcon_Support_Collection, unserialize); +PHP_METHOD(Phalcon_Support_Collection, __serialize); +PHP_METHOD(Phalcon_Support_Collection, __unserialize); PHP_METHOD(Phalcon_Support_Collection, setData); PHP_METHOD(Phalcon_Support_Collection, phpJsonEncode); PHP_METHOD(Phalcon_Support_Collection, processKey); @@ -102,7 +104,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offse ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() @@ -138,9 +144,22 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_tojso ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_unserialize, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, serialized) +ZEND_END_ARG_INFO() +#endif + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection___serialize, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection___unserialize, 0, 1, IS_VOID, 0) - ZEND_ARG_INFO(0, serialized) + ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_collection_setdata, 0, 2, IS_VOID, 0) @@ -187,6 +206,8 @@ ZEPHIR_INIT_FUNCS(phalcon_support_collection_method_entry) { PHP_ME(Phalcon_Support_Collection, toArray, arginfo_phalcon_support_collection_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, toJson, arginfo_phalcon_support_collection_tojson, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, unserialize, arginfo_phalcon_support_collection_unserialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Support_Collection, __serialize, arginfo_phalcon_support_collection___serialize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Support_Collection, __unserialize, arginfo_phalcon_support_collection___unserialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Support_Collection, setData, arginfo_phalcon_support_collection_setdata, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Support_Collection, phpJsonEncode, arginfo_phalcon_support_collection_phpjsonencode, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Support_Collection, processKey, arginfo_phalcon_support_collection_processkey, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/support/debug.zep.c b/ext/phalcon/support/debug.zep.c index c8ff928b66f..13ed5d59820 100644 --- a/ext/phalcon/support/debug.zep.c +++ b/ext/phalcon/support/debug.zep.c @@ -341,7 +341,7 @@ PHP_METHOD(Phalcon_Support_Debug, listenLowSeverity) ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "onUncaughtLowSeverity"); zephir_array_fast_append(&_0, &_1); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 89, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 129, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); zephir_create_array(&_2, 2, 0); @@ -386,7 +386,7 @@ PHP_METHOD(Phalcon_Support_Debug, onUncaughtException) ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 0); zephir_check_call_status(); if (ZEPHIR_GT_LONG(&obLevel, 0)) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 0); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 486); zephir_check_call_status(); } zephir_read_static_property_ce(&_0, phalcon_support_debug_ce, SL("isActive"), PH_NOISY_CC | PH_READONLY); @@ -1554,7 +1554,7 @@ PHP_METHOD(Phalcon_Support_Debug, showTraceItem) } else { ZEPHIR_INIT_VAR(&classReflection); object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 172, &className); + ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 151, &className); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 0); zephir_check_call_status(); @@ -1587,7 +1587,7 @@ PHP_METHOD(Phalcon_Support_Debug, showTraceItem) if ((zephir_function_exists(&functionName) == SUCCESS)) { ZEPHIR_INIT_VAR(&functionReflection); object_init_ex(&functionReflection, zephir_get_internal_ce(SL("reflectionfunction"))); - ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 166, &functionName); + ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 145, &functionName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 0); zephir_check_call_status(); diff --git a/ext/phalcon/support/debug/dump.zep.c b/ext/phalcon/support/debug/dump.zep.c index aaa6f4a1305..2b86bb95f0b 100644 --- a/ext/phalcon/support/debug/dump.zep.c +++ b/ext/phalcon/support/debug/dump.zep.c @@ -890,7 +890,7 @@ PHP_METHOD(Phalcon_Support_Debug_Dump, output) ZEPHIR_CONCAT_VS(&_45$$11, &_44$$11, "[skipped]\n"); zephir_concat_self(&output, &_45$$11); } else if (_42$$9) { - ZEPHIR_CALL_FUNCTION(&_46$$12, "get_object_vars", NULL, 505, variable); + ZEPHIR_CALL_FUNCTION(&_46$$12, "get_object_vars", NULL, 424, variable); zephir_check_call_status(); zephir_is_iterable(&_46$$12, 0, "phalcon/Support/Debug/Dump.zep", 263); if (Z_TYPE_P(&_46$$12) == IS_ARRAY) { @@ -981,10 +981,10 @@ PHP_METHOD(Phalcon_Support_Debug_Dump, output) } else { ZEPHIR_INIT_VAR(&reflect$$15); object_init_ex(&reflect$$15, zephir_get_internal_ce(SL("reflectionclass"))); - ZEPHIR_CALL_METHOD(NULL, &reflect$$15, "__construct", NULL, 172, variable); + ZEPHIR_CALL_METHOD(NULL, &reflect$$15, "__construct", NULL, 151, variable); zephir_check_call_status(); ZVAL_LONG(&_67$$15, ((1 | 2) | 4)); - ZEPHIR_CALL_METHOD(&props$$15, &reflect$$15, "getproperties", NULL, 176, &_67$$15); + ZEPHIR_CALL_METHOD(&props$$15, &reflect$$15, "getproperties", NULL, 157, &_67$$15); zephir_check_call_status(); zephir_is_iterable(&props$$15, 0, "phalcon/Support/Debug/Dump.zep", 289); if (Z_TYPE_P(&props$$15) == IS_ARRAY) { @@ -1262,7 +1262,7 @@ PHP_METHOD(Phalcon_Support_Debug_Dump, output) ZEPHIR_CONCAT_VV(return_value, &output, &_145$$26); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_147, "is_float", NULL, 228, variable); + ZEPHIR_CALL_FUNCTION(&_147, "is_float", NULL, 209, variable); zephir_check_call_status(); if (zephir_is_true(&_147)) { ZEPHIR_INIT_VAR(&_148$$27); @@ -1423,16 +1423,16 @@ PHP_METHOD(Phalcon_Support_Debug_Dump, encode) ZVAL_LONG(&_1, depth); ZEPHIR_INIT_VAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_2, "json_last_error", NULL, 189); zephir_check_call_status(); if (UNEXPECTED(!ZEPHIR_IS_LONG_IDENTICAL(&_2, 0))) { ZEPHIR_INIT_VAR(&_3$$3); object_init_ex(&_3$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_4$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5$$3); ZEPHIR_CONCAT_SV(&_5$$3, "json_encode error: ", &_4$$3); - ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 40, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 191, &_5$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$3, "phalcon/Support/Debug/Dump.zep", 356); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/support/helper/arr/abstractarr.zep.c b/ext/phalcon/support/helper/arr/abstractarr.zep.c index 14c51154e14..44139ff8201 100644 --- a/ext/phalcon/support/helper/arr/abstractarr.zep.c +++ b/ext/phalcon/support/helper/arr/abstractarr.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/blacklist.zep.c b/ext/phalcon/support/helper/arr/blacklist.zep.c index c9e60ace6cc..572da3e77ed 100644 --- a/ext/phalcon/support/helper/arr/blacklist.zep.c +++ b/ext/phalcon/support/helper/arr/blacklist.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -73,12 +73,12 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_Blacklist, __invoke) ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_17__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_0, NULL, phalcon_13__closure_ce, SL("__invoke")); ZEPHIR_CALL_METHOD(&blackListed, this_ptr, "tofilter", NULL, 0, &blackList, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 203, &blackListed); + ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 95, &blackListed); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 487, &collection, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("array_diff_key", NULL, 94, &collection, &_1); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/support/helper/arr/chunk.zep.c b/ext/phalcon/support/helper/arr/chunk.zep.c index ffb64cc88dd..2703c9ba7e3 100644 --- a/ext/phalcon/support/helper/arr/chunk.zep.c +++ b/ext/phalcon/support/helper/arr/chunk.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/filter.zep.c b/ext/phalcon/support/helper/arr/filter.zep.c index d93f629d399..5cc14713acb 100644 --- a/ext/phalcon/support/helper/arr/filter.zep.c +++ b/ext/phalcon/support/helper/arr/filter.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/first.zep.c b/ext/phalcon/support/helper/arr/first.zep.c index 1a74c81c756..48e3a3f047a 100644 --- a/ext/phalcon/support/helper/arr/first.zep.c +++ b/ext/phalcon/support/helper/arr/first.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -77,7 +77,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_First, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); ZEPHIR_MAKE_REF(&filtered); - ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 0, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("reset", NULL, 474, &filtered); ZEPHIR_UNREF(&filtered); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/support/helper/arr/firstkey.zep.c b/ext/phalcon/support/helper/arr/firstkey.zep.c index 2be2968260a..597f25429ef 100644 --- a/ext/phalcon/support/helper/arr/firstkey.zep.c +++ b/ext/phalcon/support/helper/arr/firstkey.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/flatten.zep.c b/ext/phalcon/support/helper/arr/flatten.zep.c index 569d7290686..680eccc6dcb 100644 --- a/ext/phalcon/support/helper/arr/flatten.zep.c +++ b/ext/phalcon/support/helper/arr/flatten.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/get.zep.c b/ext/phalcon/support/helper/arr/get.zep.c index f2b5155cf2c..425fa704582 100644 --- a/ext/phalcon/support/helper/arr/get.zep.c +++ b/ext/phalcon/support/helper/arr/get.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/group.zep.c b/ext/phalcon/support/helper/arr/group.zep.c index 16c182e1ae1..9fb2abcfc15 100644 --- a/ext/phalcon/support/helper/arr/group.zep.c +++ b/ext/phalcon/support/helper/arr/group.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -193,7 +193,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_Group, processCallable) ZEPHIR_CALL_METHOD(&_0, this_ptr, "iscallable", NULL, 0, method); zephir_check_call_status(); if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { - ZEPHIR_CALL_FUNCTION(&key, "call_user_func", NULL, 199, method, element); + ZEPHIR_CALL_FUNCTION(&key, "call_user_func", NULL, 180, method, element); zephir_check_call_status(); zephir_array_update_multi(&output, element, SL("za"), 2, &key); } diff --git a/ext/phalcon/support/helper/arr/has.zep.c b/ext/phalcon/support/helper/arr/has.zep.c index 348ebc9547b..66ffa1eb7bb 100644 --- a/ext/phalcon/support/helper/arr/has.zep.c +++ b/ext/phalcon/support/helper/arr/has.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/isunique.zep.c b/ext/phalcon/support/helper/arr/isunique.zep.c index 82dc90749d4..0d8e83865b8 100644 --- a/ext/phalcon/support/helper/arr/isunique.zep.c +++ b/ext/phalcon/support/helper/arr/isunique.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -65,7 +65,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_IsUnique, __invoke) zephir_get_arrval(&collection, collection_param); - ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 191, &collection); + ZEPHIR_CALL_FUNCTION(&_0, "array_unique", NULL, 172, &collection); zephir_check_call_status(); RETURN_MM_BOOL(zephir_fast_count_int(&collection) == zephir_fast_count_int(&_0)); } diff --git a/ext/phalcon/support/helper/arr/last.zep.c b/ext/phalcon/support/helper/arr/last.zep.c index bb8c1c45b1e..3635f5d215d 100644 --- a/ext/phalcon/support/helper/arr/last.zep.c +++ b/ext/phalcon/support/helper/arr/last.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -77,7 +77,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_Last, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); ZEPHIR_MAKE_REF(&filtered); - ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 338, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("end", NULL, 320, &filtered); ZEPHIR_UNREF(&filtered); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/support/helper/arr/lastkey.zep.c b/ext/phalcon/support/helper/arr/lastkey.zep.c index 2cb9b9429b2..0ad0ed21e05 100644 --- a/ext/phalcon/support/helper/arr/lastkey.zep.c +++ b/ext/phalcon/support/helper/arr/lastkey.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -76,7 +76,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_LastKey, __invoke) ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &collection, method); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_key_last", NULL, 49, &filtered); + ZEPHIR_RETURN_CALL_FUNCTION("array_key_last", NULL, 36, &filtered); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/support/helper/arr/order.zep.c b/ext/phalcon/support/helper/arr/order.zep.c index f3da822841e..2e58d9353a7 100644 --- a/ext/phalcon/support/helper/arr/order.zep.c +++ b/ext/phalcon/support/helper/arr/order.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/pluck.zep.c b/ext/phalcon/support/helper/arr/pluck.zep.c index 82c385cd5ac..14dc101673b 100644 --- a/ext/phalcon/support/helper/arr/pluck.zep.c +++ b/ext/phalcon/support/helper/arr/pluck.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/set.zep.c b/ext/phalcon/support/helper/arr/set.zep.c index 8fac86f1461..a575dbdaab9 100644 --- a/ext/phalcon/support/helper/arr/set.zep.c +++ b/ext/phalcon/support/helper/arr/set.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/sliceleft.zep.c b/ext/phalcon/support/helper/arr/sliceleft.zep.c index 2c386cda63c..11ae20d4c1c 100644 --- a/ext/phalcon/support/helper/arr/sliceleft.zep.c +++ b/ext/phalcon/support/helper/arr/sliceleft.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -75,7 +75,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_SliceLeft, __invoke) ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, elements); - ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 0, &collection, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 498, &collection, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/support/helper/arr/sliceright.zep.c b/ext/phalcon/support/helper/arr/sliceright.zep.c index 41e78a15c81..1a98591b1a0 100644 --- a/ext/phalcon/support/helper/arr/sliceright.zep.c +++ b/ext/phalcon/support/helper/arr/sliceright.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -73,7 +73,7 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_SliceRight, __invoke) ZVAL_LONG(&_0, elements); - ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 0, &collection, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 498, &collection, &_0); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/support/helper/arr/split.zep.c b/ext/phalcon/support/helper/arr/split.zep.c index 872ef8a2ac8..8ba788f5cc8 100644 --- a/ext/phalcon/support/helper/arr/split.zep.c +++ b/ext/phalcon/support/helper/arr/split.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/toobject.zep.c b/ext/phalcon/support/helper/arr/toobject.zep.c index 525b794346f..cf27a3b9478 100644 --- a/ext/phalcon/support/helper/arr/toobject.zep.c +++ b/ext/phalcon/support/helper/arr/toobject.zep.c @@ -18,7 +18,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/validateall.zep.c b/ext/phalcon/support/helper/arr/validateall.zep.c index 25db5e9ec41..ea61e26184d 100644 --- a/ext/phalcon/support/helper/arr/validateall.zep.c +++ b/ext/phalcon/support/helper/arr/validateall.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/validateany.zep.c b/ext/phalcon/support/helper/arr/validateany.zep.c index a27a43ff31b..2f419a10a0c 100644 --- a/ext/phalcon/support/helper/arr/validateany.zep.c +++ b/ext/phalcon/support/helper/arr/validateany.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/arr/whitelist.zep.c b/ext/phalcon/support/helper/arr/whitelist.zep.c index 42b8e7785d5..59fbd2d9910 100644 --- a/ext/phalcon/support/helper/arr/whitelist.zep.c +++ b/ext/phalcon/support/helper/arr/whitelist.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -73,10 +73,10 @@ PHP_METHOD(Phalcon_Support_Helper_Arr_Whitelist, __invoke) ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_18__closure_ce, SL("__invoke")); + zephir_create_closure_ex(&_0, NULL, phalcon_14__closure_ce, SL("__invoke")); ZEPHIR_CALL_METHOD(&filtered, this_ptr, "tofilter", NULL, 0, &whiteList, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 203, &filtered); + ZEPHIR_CALL_FUNCTION(&_1, "array_flip", NULL, 95, &filtered); zephir_check_call_status(); ZEPHIR_RETURN_CALL_FUNCTION("array_intersect_key", NULL, 2, &collection, &_1); zephir_check_call_status(); diff --git a/ext/phalcon/support/helper/file/basename.zep.c b/ext/phalcon/support/helper/file/basename.zep.c index 11815fc1fb8..14b4d0f2d0b 100644 --- a/ext/phalcon/support/helper/file/basename.zep.c +++ b/ext/phalcon/support/helper/file/basename.zep.c @@ -22,7 +22,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -100,7 +100,7 @@ PHP_METHOD(Phalcon_Support_Helper_File_Basename, __invoke) ZVAL_STRING(&_2, "/"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "@"); - ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 432, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "preg_quote", NULL, 356, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_5); ZEPHIR_CONCAT_SVS(&_5, "@[^", &_4, "]+$@"); @@ -116,13 +116,13 @@ PHP_METHOD(Phalcon_Support_Helper_File_Basename, __invoke) if (1 != ZEPHIR_IS_EMPTY(&suffix)) { ZEPHIR_INIT_VAR(&_6$$3); ZVAL_STRING(&_6$$3, "@"); - ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 432, &suffix, &_6$$3); + ZEPHIR_CALL_FUNCTION(&_7$$3, "preg_quote", NULL, 356, &suffix, &_6$$3); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_8$$3); ZEPHIR_CONCAT_SVS(&_8$$3, "@", &_7$$3, "$@"); ZEPHIR_INIT_NVAR(&_6$$3); ZVAL_STRING(&_6$$3, ""); - ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 50, &_8$$3, &_6$$3, &fileName); + ZEPHIR_CALL_FUNCTION(&_9$$3, "preg_replace", NULL, 37, &_8$$3, &_6$$3, &fileName); zephir_check_call_status(); ZEPHIR_CPY_WRT(&fileName, &_9$$3); } diff --git a/ext/phalcon/support/helper/json/decode.zep.c b/ext/phalcon/support/helper/json/decode.zep.c index 31d9092ecef..ed42bcab43b 100644 --- a/ext/phalcon/support/helper/json/decode.zep.c +++ b/ext/phalcon/support/helper/json/decode.zep.c @@ -23,7 +23,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -107,16 +107,16 @@ PHP_METHOD(Phalcon_Support_Helper_Json_Decode, __invoke) ZVAL_LONG(&_2, options); ZEPHIR_INIT_VAR(&decoded); zephir_json_decode(&decoded, &data, zephir_get_intval(&_0) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0)) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, spl_ce_InvalidArgumentException); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_6$$3); ZEPHIR_CONCAT_SV(&_6$$3, "json_decode error: ", &_5$$3); - ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 40, &_6$$3); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 191, &_6$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_4$$3, "phalcon/Support/Helper/Json/Decode.zep", 45); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/support/helper/json/encode.zep.c b/ext/phalcon/support/helper/json/encode.zep.c index 9386573708e..5eebe8d27ae 100644 --- a/ext/phalcon/support/helper/json/encode.zep.c +++ b/ext/phalcon/support/helper/json/encode.zep.c @@ -21,7 +21,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -107,12 +107,12 @@ PHP_METHOD(Phalcon_Support_Helper_Json_Encode, __invoke) ZVAL_LONG(&_2, depth); ZEPHIR_INIT_NVAR(&encoded); zephir_json_encode(&encoded, data, zephir_get_intval(&_1) ); - ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 209); + ZEPHIR_CALL_FUNCTION(&_3, "json_last_error", NULL, 189); zephir_check_call_status(); if (!ZEPHIR_IS_LONG_IDENTICAL(&_3, 0)) { ZEPHIR_INIT_VAR(&_4$$3); object_init_ex(&_4$$3, zephir_get_internal_ce(SL("jsonexception"))); - ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 210); + ZEPHIR_CALL_FUNCTION(&_5$$3, "json_last_error_msg", NULL, 190); zephir_check_call_status(); ZVAL_LONG(&_6$$3, 5); ZEPHIR_CALL_METHOD(NULL, &_4$$3, "__construct", NULL, 0, &_5$$3, &_6$$3); diff --git a/ext/phalcon/support/helper/number/isbetween.zep.c b/ext/phalcon/support/helper/number/isbetween.zep.c index d36e2919a8f..ffabbba3843 100644 --- a/ext/phalcon/support/helper/number/isbetween.zep.c +++ b/ext/phalcon/support/helper/number/isbetween.zep.c @@ -18,7 +18,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/abstractstr.zep.c b/ext/phalcon/support/helper/str/abstractstr.zep.c index 8f3db70a16c..b0e8a9b4463 100644 --- a/ext/phalcon/support/helper/str/abstractstr.zep.c +++ b/ext/phalcon/support/helper/str/abstractstr.zep.c @@ -22,7 +22,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/camelize.zep.c b/ext/phalcon/support/helper/str/camelize.zep.c index fced12fc8e3..f0f356b250b 100644 --- a/ext/phalcon/support/helper/str/camelize.zep.c +++ b/ext/phalcon/support/helper/str/camelize.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -86,7 +86,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Camelize, __invoke) ZEPHIR_CALL_PARENT(&result, phalcon_support_helper_str_camelize_ce, getThis(), "__invoke", &_0, 0, &text, &delimiters); zephir_check_call_status(); if (lowerFirst == 1) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "lcfirst", NULL, 104, &result); + ZEPHIR_CALL_FUNCTION(&_1$$3, "lcfirst", NULL, 73, &result); zephir_check_call_status(); ZEPHIR_CPY_WRT(&result, &_1$$3); } diff --git a/ext/phalcon/support/helper/str/concat.zep.c b/ext/phalcon/support/helper/str/concat.zep.c index c694f279659..b9046690959 100644 --- a/ext/phalcon/support/helper/str/concat.zep.c +++ b/ext/phalcon/support/helper/str/concat.zep.c @@ -23,7 +23,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -81,19 +81,19 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Concat, __invoke) return; } ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&delimiter, "reset", NULL, 0, &arguments); + ZEPHIR_CALL_FUNCTION(&delimiter, "reset", NULL, 474, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(&_1, "array_slice", NULL, 0, &arguments, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "array_slice", NULL, 498, &arguments, &_0); zephir_check_call_status(); ZEPHIR_CPY_WRT(&arguments, &_1); ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&first, "reset", NULL, 0, &arguments); + ZEPHIR_CALL_FUNCTION(&first, "reset", NULL, 474, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZEPHIR_MAKE_REF(&arguments); - ZEPHIR_CALL_FUNCTION(&last, "end", NULL, 338, &arguments); + ZEPHIR_CALL_FUNCTION(&last, "end", NULL, 320, &arguments); ZEPHIR_UNREF(&arguments); zephir_check_call_status(); ZEPHIR_INIT_VAR(&prefix); diff --git a/ext/phalcon/support/helper/str/countvowels.zep.c b/ext/phalcon/support/helper/str/countvowels.zep.c index d25bf715aa5..56d3bafb067 100644 --- a/ext/phalcon/support/helper/str/countvowels.zep.c +++ b/ext/phalcon/support/helper/str/countvowels.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/decapitalize.zep.c b/ext/phalcon/support/helper/str/decapitalize.zep.c index b2c2227b7d0..1ecc57fee11 100644 --- a/ext/phalcon/support/helper/str/decapitalize.zep.c +++ b/ext/phalcon/support/helper/str/decapitalize.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -91,7 +91,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Decapitalize, __invoke) ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 242, &text, &_0); + ZEPHIR_CALL_FUNCTION(&substr, "mb_substr", NULL, 223, &text, &_0); zephir_check_call_status(); if (upperRest) { ZEPHIR_CALL_METHOD(&suffix, this_ptr, "toupper", NULL, 0, &substr, &encoding); @@ -101,7 +101,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Decapitalize, __invoke) } ZVAL_LONG(&_0, 0); ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_FUNCTION(&_3, "mb_substr", NULL, 242, &text, &_0, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "mb_substr", NULL, 223, &text, &_0, &_2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "tolower", NULL, 0, &_3, &encoding); zephir_check_call_status(); diff --git a/ext/phalcon/support/helper/str/decrement.zep.c b/ext/phalcon/support/helper/str/decrement.zep.c index 1b4d54bb01c..6542bc3feef 100644 --- a/ext/phalcon/support/helper/str/decrement.zep.c +++ b/ext/phalcon/support/helper/str/decrement.zep.c @@ -21,7 +21,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/dirfromfile.zep.c b/ext/phalcon/support/helper/str/dirfromfile.zep.c index 472409719b5..b86af9fd3ad 100644 --- a/ext/phalcon/support/helper/str/dirfromfile.zep.c +++ b/ext/phalcon/support/helper/str/dirfromfile.zep.c @@ -21,7 +21,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -75,16 +75,16 @@ PHP_METHOD(Phalcon_Support_Helper_Str_DirFromFile, __invoke) ZVAL_LONG(&_0, 8); - ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 116, &file, &_0); + ZEPHIR_CALL_FUNCTION(&name, "pathinfo", NULL, 85, &file, &_0); zephir_check_call_status(); ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, -2); - ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 242, &name, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 223, &name, &_0, &_1); zephir_check_call_status(); if (!zephir_is_true(&start)) { ZVAL_LONG(&_2$$3, 0); ZVAL_LONG(&_3$$3, 1); - ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 242, &name, &_2$$3, &_3$$3); + ZEPHIR_CALL_FUNCTION(&start, "mb_substr", NULL, 223, &name, &_2$$3, &_3$$3); zephir_check_call_status(); } ZEPHIR_INIT_VAR(&_4); diff --git a/ext/phalcon/support/helper/str/dirseparator.zep.c b/ext/phalcon/support/helper/str/dirseparator.zep.c index 504aee593c2..17e86e99400 100644 --- a/ext/phalcon/support/helper/str/dirseparator.zep.c +++ b/ext/phalcon/support/helper/str/dirseparator.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/dynamic.zep.c b/ext/phalcon/support/helper/str/dynamic.zep.c index 585c202da96..69974fa0a84 100644 --- a/ext/phalcon/support/helper/str/dynamic.zep.c +++ b/ext/phalcon/support/helper/str/dynamic.zep.c @@ -24,7 +24,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -142,9 +142,9 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 432, &leftDelimiter); + ZEPHIR_CALL_FUNCTION(&ldS, "preg_quote", NULL, 356, &leftDelimiter); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 432, &rightDelimiter); + ZEPHIR_CALL_FUNCTION(&rdS, "preg_quote", NULL, 356, &rightDelimiter); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_4); ZEPHIR_CONCAT_SVSVVSVS(&_4, "/", &ldS, "([^", &ldS, &rdS, "]+)", &rdS, "/"); @@ -174,16 +174,16 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_INIT_NVAR(&words); zephir_fast_explode(&words, &separator, &_9$$6, LONG_MAX); ZEPHIR_OBS_NVAR(&word); - ZEPHIR_CALL_FUNCTION(&_10$$6, "array_rand", &_11, 215, &words); + ZEPHIR_CALL_FUNCTION(&_10$$6, "array_rand", &_11, 196, &words); zephir_check_call_status(); zephir_array_fetch(&word, &words, &_10$$6, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62); zephir_array_fetch_long(&_12$$6, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63); - ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 432, &_12$$6, &separator); + ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 356, &_12$$6, &separator); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_13$$6); ZEPHIR_CONCAT_SVS(&_13$$6, "/", &sub, "/"); ZVAL_LONG(&_14$$6, 1); - ZEPHIR_CALL_FUNCTION(&_15$$6, "preg_replace", &_16, 50, &_13$$6, &word, &text, &_14$$6); + ZEPHIR_CALL_FUNCTION(&_15$$6, "preg_replace", &_16, 37, &_13$$6, &word, &text, &_14$$6); zephir_check_call_status(); zephir_get_strval(&text, &_15$$6); } ZEND_HASH_FOREACH_END(); @@ -209,16 +209,16 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Dynamic, __invoke) ZEPHIR_INIT_NVAR(&words); zephir_fast_explode(&words, &separator, &_18$$8, LONG_MAX); ZEPHIR_OBS_NVAR(&word); - ZEPHIR_CALL_FUNCTION(&_19$$8, "array_rand", &_11, 215, &words); + ZEPHIR_CALL_FUNCTION(&_19$$8, "array_rand", &_11, 196, &words); zephir_check_call_status(); zephir_array_fetch(&word, &words, &_19$$8, PH_NOISY, "phalcon/Support/Helper/Str/Dynamic.zep", 62); zephir_array_fetch_long(&_20$$8, &match, 0, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Dynamic.zep", 63); - ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 432, &_20$$8, &separator); + ZEPHIR_CALL_FUNCTION(&sub, "preg_quote", NULL, 356, &_20$$8, &separator); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_21$$8); ZEPHIR_CONCAT_SVS(&_21$$8, "/", &sub, "/"); ZVAL_LONG(&_22$$8, 1); - ZEPHIR_CALL_FUNCTION(&_23$$8, "preg_replace", &_16, 50, &_21$$8, &word, &text, &_22$$8); + ZEPHIR_CALL_FUNCTION(&_23$$8, "preg_replace", &_16, 37, &_21$$8, &word, &text, &_22$$8); zephir_check_call_status(); zephir_get_strval(&text, &_23$$8); ZEPHIR_CALL_METHOD(NULL, &matches, "next", NULL, 0); diff --git a/ext/phalcon/support/helper/str/endswith.zep.c b/ext/phalcon/support/helper/str/endswith.zep.c index c6bcbd138a7..d47294d6cd7 100644 --- a/ext/phalcon/support/helper/str/endswith.zep.c +++ b/ext/phalcon/support/helper/str/endswith.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/firstbetween.zep.c b/ext/phalcon/support/helper/str/firstbetween.zep.c index 5c0e5798447..e36e992a05c 100644 --- a/ext/phalcon/support/helper/str/firstbetween.zep.c +++ b/ext/phalcon/support/helper/str/firstbetween.zep.c @@ -21,7 +21,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/friendly.zep.c b/ext/phalcon/support/helper/str/friendly.zep.c index d381ee0ac59..458afb03618 100644 --- a/ext/phalcon/support/helper/str/friendly.zep.c +++ b/ext/phalcon/support/helper/str/friendly.zep.c @@ -23,7 +23,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -145,7 +145,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, __invoke) ZVAL_STRING(&_4, "/[^a-zA-Z0-9\\/_|+ -]/"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ""); - ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 50, &_4, &_5, &text); + ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 37, &_4, &_5, &text); zephir_check_call_status(); if (lowercase) { ZEPHIR_INIT_VAR(&_6$$5); @@ -154,7 +154,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Friendly, __invoke) } ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "/[\\/_|+ -]+/"); - ZEPHIR_CALL_FUNCTION(&_7, "preg_replace", NULL, 50, &_4, &separator, &friendly); + ZEPHIR_CALL_FUNCTION(&_7, "preg_replace", NULL, 37, &_4, &separator, &friendly); zephir_check_call_status(); ZEPHIR_CPY_WRT(&friendly, &_7); zephir_fast_trim(return_value, &friendly, &separator, ZEPHIR_TRIM_BOTH); diff --git a/ext/phalcon/support/helper/str/humanize.zep.c b/ext/phalcon/support/helper/str/humanize.zep.c index 9e42a389aac..e4c27b227ba 100644 --- a/ext/phalcon/support/helper/str/humanize.zep.c +++ b/ext/phalcon/support/helper/str/humanize.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -74,7 +74,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Humanize, __invoke) ZVAL_STRING(&_1, "#[_-]+#"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, " "); - ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &_1, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 37, &_1, &_2, &_0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); if (Z_TYPE_P(&result) == IS_NULL) { diff --git a/ext/phalcon/support/helper/str/includes.zep.c b/ext/phalcon/support/helper/str/includes.zep.c index 9ccd6c71a6b..eef80714d80 100644 --- a/ext/phalcon/support/helper/str/includes.zep.c +++ b/ext/phalcon/support/helper/str/includes.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -68,7 +68,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Includes, __invoke) zephir_get_strval(&needle, needle_param); - ZEPHIR_CALL_FUNCTION(&_0, "mb_strpos", NULL, 0, &haystack, &needle); + ZEPHIR_CALL_FUNCTION(&_0, "mb_strpos", NULL, 82, &haystack, &needle); zephir_check_call_status(); RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0)); } diff --git a/ext/phalcon/support/helper/str/increment.zep.c b/ext/phalcon/support/helper/str/increment.zep.c index 60342ca27dc..8476c1f2360 100644 --- a/ext/phalcon/support/helper/str/increment.zep.c +++ b/ext/phalcon/support/helper/str/increment.zep.c @@ -21,7 +21,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/isanagram.zep.c b/ext/phalcon/support/helper/str/isanagram.zep.c index 33cc1161101..da69c4354ca 100644 --- a/ext/phalcon/support/helper/str/isanagram.zep.c +++ b/ext/phalcon/support/helper/str/isanagram.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/islower.zep.c b/ext/phalcon/support/helper/str/islower.zep.c index 7fd9e9d8aaa..fb91ba90025 100644 --- a/ext/phalcon/support/helper/str/islower.zep.c +++ b/ext/phalcon/support/helper/str/islower.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/ispalindrome.zep.c b/ext/phalcon/support/helper/str/ispalindrome.zep.c index b59d6c28aa3..6b7405f7ed5 100644 --- a/ext/phalcon/support/helper/str/ispalindrome.zep.c +++ b/ext/phalcon/support/helper/str/ispalindrome.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/isupper.zep.c b/ext/phalcon/support/helper/str/isupper.zep.c index df8ea05a56e..d9ba17437c8 100644 --- a/ext/phalcon/support/helper/str/isupper.zep.c +++ b/ext/phalcon/support/helper/str/isupper.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/kebabcase.zep.c b/ext/phalcon/support/helper/str/kebabcase.zep.c index 1b91aab4a6c..2896912a3cb 100644 --- a/ext/phalcon/support/helper/str/kebabcase.zep.c +++ b/ext/phalcon/support/helper/str/kebabcase.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/len.zep.c b/ext/phalcon/support/helper/str/len.zep.c index 549dd7944fb..9163f5f876b 100644 --- a/ext/phalcon/support/helper/str/len.zep.c +++ b/ext/phalcon/support/helper/str/len.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -73,7 +73,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Len, __invoke) } - ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 250, &text, &encoding); + ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 229, &text, &encoding); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/support/helper/str/lower.zep.c b/ext/phalcon/support/helper/str/lower.zep.c index 281bb67cb9a..7ed3aae6927 100644 --- a/ext/phalcon/support/helper/str/lower.zep.c +++ b/ext/phalcon/support/helper/str/lower.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/pascalcase.zep.c b/ext/phalcon/support/helper/str/pascalcase.zep.c index 1b5c2ef8e8f..4830f35ba5d 100644 --- a/ext/phalcon/support/helper/str/pascalcase.zep.c +++ b/ext/phalcon/support/helper/str/pascalcase.zep.c @@ -22,7 +22,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -82,8 +82,8 @@ PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, __invoke) zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0); ZEPHIR_INIT_NVAR(&_0); - zephir_create_closure_ex(&_0, NULL, phalcon_2__closure_ce, SL("__invoke")); - ZEPHIR_CALL_FUNCTION(&output, "array_map", NULL, 97, &_0, &exploded); + zephir_create_closure_ex(&_0, NULL, phalcon_0__closure_ce, SL("__invoke")); + ZEPHIR_CALL_FUNCTION(&output, "array_map", NULL, 66, &_0, &exploded); zephir_check_call_status(); zephir_fast_join_str(return_value, SL(""), &output); RETURN_MM(); @@ -185,7 +185,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_PascalCase, processArray) ZEPHIR_CONCAT_SVS(&_10, "/[", &delimiters, "]+/"); ZVAL_LONG(&_11, -1); ZVAL_LONG(&_12, (2 | 1)); - ZEPHIR_CALL_FUNCTION(&result, "preg_split", NULL, 98, &_10, &text, &_11, &_12); + ZEPHIR_CALL_FUNCTION(&result, "preg_split", NULL, 67, &_10, &text, &_11, &_12); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_13); if (ZEPHIR_IS_FALSE_IDENTICAL(&result)) { diff --git a/ext/phalcon/support/helper/str/prefix.zep.c b/ext/phalcon/support/helper/str/prefix.zep.c index b00568f84fb..159dc4d7c89 100644 --- a/ext/phalcon/support/helper/str/prefix.zep.c +++ b/ext/phalcon/support/helper/str/prefix.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/random.zep.c b/ext/phalcon/support/helper/str/random.zep.c index 957f87412e6..4a9ab798ff7 100644 --- a/ext/phalcon/support/helper/str/random.zep.c +++ b/ext/phalcon/support/helper/str/random.zep.c @@ -22,7 +22,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -133,61 +133,61 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Random, __invoke) ZVAL_STRING(&_3, "a"); ZEPHIR_INIT_VAR(&_4); ZVAL_STRING(&_4, "z"); - ZEPHIR_CALL_FUNCTION(&_5, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "A"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "Z"); - ZEPHIR_CALL_FUNCTION(&_6, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_6, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); zephir_fast_array_merge(&_2, &_5, &_6); zephir_array_update_long(&pools, 1, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZEPHIR_INIT_NVAR(&_2); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_9, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_9, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "a"); ZEPHIR_INIT_NVAR(&_4); ZVAL_STRING(&_4, "f"); - ZEPHIR_CALL_FUNCTION(&_10, "range", NULL, 331, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&_10, "range", NULL, 313, &_3, &_4); zephir_check_call_status(); zephir_fast_array_merge(&_2, &_9, &_10); zephir_array_update_long(&pools, 2, &_2, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); zephir_array_update_long(&pools, 3, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 1); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); zephir_array_update_long(&pools, 4, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "2345679ACDEFHJKLMNPRSTUVWXYZ"); - ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 115, &_2); + ZEPHIR_CALL_FUNCTION(&_11, "str_split", NULL, 84, &_2); zephir_check_call_status(); zephir_array_update_long(&pools, 5, &_11, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); ZVAL_LONG(&_7, 0); ZVAL_LONG(&_8, 9); - ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 331, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&_11, "range", NULL, 313, &_7, &_8); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "a"); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "z"); - ZEPHIR_CALL_FUNCTION(&_12, "range", NULL, 331, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_12, "range", NULL, 313, &_2, &_3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2); ZVAL_STRING(&_2, "A"); ZEPHIR_INIT_NVAR(&_3); ZVAL_STRING(&_3, "Z"); - ZEPHIR_CALL_FUNCTION(&_13, "range", NULL, 331, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_13, "range", NULL, 313, &_2, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_14, "array_merge", NULL, 348, &_11, &_12, &_13); + ZEPHIR_CALL_FUNCTION(&_14, "array_merge", NULL, 330, &_11, &_12, &_13); zephir_check_call_status(); zephir_array_update_long(&pools, 0, &_14, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); zephir_array_fetch_long(&_15, &pools, type, PH_NOISY | PH_READONLY, "phalcon/Support/Helper/Str/Random.zep", 66); diff --git a/ext/phalcon/support/helper/str/reduceslashes.zep.c b/ext/phalcon/support/helper/str/reduceslashes.zep.c index 8429a7eb193..9bcfc308eed 100644 --- a/ext/phalcon/support/helper/str/reduceslashes.zep.c +++ b/ext/phalcon/support/helper/str/reduceslashes.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -70,7 +70,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_ReduceSlashes, __invoke) ZVAL_STRING(&_0, "#(? * diff --git a/ext/phalcon/support/helper/str/startswith.zep.c b/ext/phalcon/support/helper/str/startswith.zep.c index cba31f68cf8..bcb6133a8b0 100644 --- a/ext/phalcon/support/helper/str/startswith.zep.c +++ b/ext/phalcon/support/helper/str/startswith.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/suffix.zep.c b/ext/phalcon/support/helper/str/suffix.zep.c index a73c5653ea1..6982498e5ed 100644 --- a/ext/phalcon/support/helper/str/suffix.zep.c +++ b/ext/phalcon/support/helper/str/suffix.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/ucwords.zep.c b/ext/phalcon/support/helper/str/ucwords.zep.c index 34b1a8b5228..52a9033d8a5 100644 --- a/ext/phalcon/support/helper/str/ucwords.zep.c +++ b/ext/phalcon/support/helper/str/ucwords.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helper/str/uncamelize.zep.c b/ext/phalcon/support/helper/str/uncamelize.zep.c index 2af18543d37..b6e6a59fbad 100644 --- a/ext/phalcon/support/helper/str/uncamelize.zep.c +++ b/ext/phalcon/support/helper/str/uncamelize.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -80,11 +80,11 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Uncamelize, __invoke) ZEPHIR_INIT_VAR(&_0); ZEPHIR_CONCAT_VS(&_0, &delimiter, "\\0"); - ZEPHIR_CALL_FUNCTION(&_1, "lcfirst", NULL, 104, &text); + ZEPHIR_CALL_FUNCTION(&_1, "lcfirst", NULL, 73, &text); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "/[A-Z]/"); - ZEPHIR_CALL_FUNCTION(&_3, "preg_replace", NULL, 50, &_2, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "preg_replace", NULL, 37, &_2, &_0, &_1); zephir_check_call_status(); ZEPHIR_RETURN_CALL_FUNCTION("mb_strtolower", NULL, 10, &_3); zephir_check_call_status(); diff --git a/ext/phalcon/support/helper/str/underscore.zep.c b/ext/phalcon/support/helper/str/underscore.zep.c index 0efca0f97fd..296d91c0eb7 100644 --- a/ext/phalcon/support/helper/str/underscore.zep.c +++ b/ext/phalcon/support/helper/str/underscore.zep.c @@ -20,7 +20,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -74,7 +74,7 @@ PHP_METHOD(Phalcon_Support_Helper_Str_Underscore, __invoke) ZVAL_STRING(&_1, "#\\s+#"); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "_"); - ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 50, &_1, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&result, "preg_replace", NULL, 37, &_1, &_2, &_0); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_1); if (Z_TYPE_P(&result) == IS_NULL) { diff --git a/ext/phalcon/support/helper/str/upper.zep.c b/ext/phalcon/support/helper/str/upper.zep.c index c26cf5af11b..0caf5753e53 100644 --- a/ext/phalcon/support/helper/str/upper.zep.c +++ b/ext/phalcon/support/helper/str/upper.zep.c @@ -19,7 +19,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/helperfactory.zep.c b/ext/phalcon/support/helperfactory.zep.c index 8fb5e4cf4a7..48cd29f37b0 100644 --- a/ext/phalcon/support/helperfactory.zep.c +++ b/ext/phalcon/support/helperfactory.zep.c @@ -22,7 +22,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/ext/phalcon/support/registry.zep.c b/ext/phalcon/support/registry.zep.c index 828a8676be9..eeab06d3bd3 100644 --- a/ext/phalcon/support/registry.zep.c +++ b/ext/phalcon/support/registry.zep.c @@ -539,7 +539,8 @@ PHP_METHOD(Phalcon_Support_Registry, offsetGet) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *element, element_sub; + zval element_sub; + zval *element; zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); diff --git a/ext/phalcon/support/registry.zep.h b/ext/phalcon/support/registry.zep.h index 1f6e4b2c2d0..0f24b23d6b7 100644 --- a/ext/phalcon/support/registry.zep.h +++ b/ext/phalcon/support/registry.zep.h @@ -88,7 +88,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsete ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_support_registry_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, element) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/support/version.zep.c b/ext/phalcon/support/version.zep.c index 3a912d128d6..df2d7e5b2f3 100644 --- a/ext/phalcon/support/version.zep.c +++ b/ext/phalcon/support/version.zep.c @@ -120,10 +120,10 @@ PHP_METHOD(Phalcon_Support_Version, getVersion) ZVAL_LONG(&_0, 0); zephir_array_fast_append(return_value, &_0); ZEPHIR_INIT_NVAR(&_0); - ZVAL_LONG(&_0, 2); + ZVAL_LONG(&_0, 3); zephir_array_fast_append(return_value, &_0); ZEPHIR_INIT_NVAR(&_0); - ZVAL_LONG(&_0, 3); + ZVAL_LONG(&_0, 1); zephir_array_fast_append(return_value, &_0); RETURN_MM(); } @@ -270,11 +270,11 @@ PHP_METHOD(Phalcon_Support_Version, getId) zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/Support/Version.zep", 161); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 140, &_0, &medium); + ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 112, &_0, &medium); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "%02s"); - ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 140, &_0, &minor); + ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 112, &_0, &minor); zephir_check_call_status(); ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber); RETURN_MM(); diff --git a/ext/phalcon/tag.zep.c b/ext/phalcon/tag.zep.c index bea1b2f6c96..69e2c02bc06 100644 --- a/ext/phalcon/tag.zep.c +++ b/ext/phalcon/tag.zep.c @@ -645,7 +645,7 @@ PHP_METHOD(Phalcon_Tag, friendlyTitle) object_init_ex(&_3$$4, phalcon_tag_exception_ce); ZEPHIR_CALL_METHOD(&_4$$4, &ex, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 31, &_4$$4); + ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 29, &_4$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$4, "phalcon/Tag.zep", 308); ZEPHIR_MM_RESTORE(); @@ -960,7 +960,7 @@ PHP_METHOD(Phalcon_Tag, getTitle) zephir_read_static_property_ce(&_6$$3, phalcon_tag_ce, SL("documentPrependTitle"), PH_NOISY_CC); ZEPHIR_CPY_WRT(&documentPrependTitle, &_6$$3); if (!(ZEPHIR_IS_EMPTY(&documentPrependTitle))) { - ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 310, &documentPrependTitle); + ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 292, &documentPrependTitle); zephir_check_call_status(); zephir_is_iterable(&tmp$$5, 0, "phalcon/Tag.zep", 443); if (Z_TYPE_P(&tmp$$5) == IS_ARRAY) { @@ -1852,7 +1852,7 @@ PHP_METHOD(Phalcon_Tag, preload) zephir_fast_str_replace(&_5$$5, &_6$$5, &_7$$5, &href); ZEPHIR_INIT_VAR(&_8$$5); ZVAL_STRING(&_8$$5, "preload"); - ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 0, &_8$$5, &_5$$5, &attributes); + ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 496, &_8$$5, &_5$$5, &attributes); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_8$$5); object_init_ex(&_8$$5, phalcon_html_link_serializer_header_ce); @@ -1864,7 +1864,7 @@ PHP_METHOD(Phalcon_Tag, preload) ZEPHIR_INIT_VAR(&_10$$5); zephir_create_array(&_10$$5, 1, 0); zephir_array_fast_append(&_10$$5, &link); - ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 0, &_10$$5); + ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 497, &_10$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&header); ZEPHIR_CONCAT_SV(&header, "Link: ", &_9$$5); @@ -2154,7 +2154,7 @@ PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_16$$13, &value); ZEPHIR_INIT_NVAR(&_17$$13); ZEPHIR_CONCAT_SVSVS(&_17$$13, "Value at index: '", &key, "' type: '", &_16$$13, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 31, &_17$$13); + ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 29, &_17$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$13, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -2200,7 +2200,7 @@ PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_24$$18, &value); ZEPHIR_INIT_NVAR(&_25$$18); ZEPHIR_CONCAT_SVSVS(&_25$$18, "Value at index: '", &key, "' type: '", &_24$$18, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 31, &_25$$18); + ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 29, &_25$$18); zephir_check_call_status(); zephir_throw_exception_debug(&_23$$18, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -3106,7 +3106,7 @@ PHP_METHOD(Phalcon_Tag, textArea) ZVAL_STRING(&_1, "", &_2, ""); diff --git a/ext/phalcon/tag/select.zep.c b/ext/phalcon/tag/select.zep.c index d705a62e7dc..ea2ce281a54 100644 --- a/ext/phalcon/tag/select.zep.c +++ b/ext/phalcon/tag/select.zep.c @@ -292,7 +292,7 @@ PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) } ZEPHIR_INIT_NVAR(&optionText); ZVAL_COPY(&optionText, _0); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 337, &optionValue); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 319, &optionValue); zephir_check_call_status(); if (Z_TYPE_P(&optionText) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&_5$$4); @@ -345,7 +345,7 @@ PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) zephir_check_call_status(); ZEPHIR_CALL_METHOD(&optionText, &data, "current", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 337, &optionValue); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 319, &optionValue); zephir_check_call_status(); if (Z_TYPE_P(&optionText) == IS_ARRAY) { ZEPHIR_INIT_NVAR(&_16$$12); diff --git a/ext/phalcon/translate/adapter/abstractadapter.zep.c b/ext/phalcon/translate/adapter/abstractadapter.zep.c index cc8c5217acf..a4305798b76 100644 --- a/ext/phalcon/translate/adapter/abstractadapter.zep.c +++ b/ext/phalcon/translate/adapter/abstractadapter.zep.c @@ -195,7 +195,8 @@ PHP_METHOD(Phalcon_Translate_Adapter_AbstractAdapter, offsetGet) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *translateKey, translateKey_sub; + zval translateKey_sub; + zval *translateKey; zval *this_ptr = getThis(); ZVAL_UNDEF(&translateKey_sub); diff --git a/ext/phalcon/translate/adapter/abstractadapter.zep.h b/ext/phalcon/translate/adapter/abstractadapter.zep.h index 41163a8a7d5..7814b8790a8 100644 --- a/ext/phalcon/translate/adapter/abstractadapter.zep.h +++ b/ext/phalcon/translate/adapter/abstractadapter.zep.h @@ -34,7 +34,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstra ZEND_ARG_INFO(0, translateKey) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 80000 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 1, IS_MIXED, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_abstractadapter_offsetget, 0, 1, IS_NULL, 0) +#endif ZEND_ARG_INFO(0, translateKey) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/translate/adapter/csv.zep.c b/ext/phalcon/translate/adapter/csv.zep.c index 5063899fecf..72b5ac89ddb 100644 --- a/ext/phalcon/translate/adapter/csv.zep.c +++ b/ext/phalcon/translate/adapter/csv.zep.c @@ -327,7 +327,7 @@ PHP_METHOD(Phalcon_Translate_Adapter_Csv, load) object_init_ex(&_1$$3, phalcon_translate_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SVS(&_2$$3, "Error opening translation file '", &file, "'"); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/Csv.zep", 133); ZEPHIR_MM_RESTORE(); @@ -361,6 +361,20 @@ PHP_METHOD(Phalcon_Translate_Adapter_Csv, load) ZEPHIR_MM_RESTORE(); } +/** + * Returns the internal array + * + * @return array + */ +PHP_METHOD(Phalcon_Translate_Adapter_Csv, toArray) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "translate"); +} + /** * @todo to be removed when we get traits */ @@ -389,7 +403,7 @@ PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen) zephir_get_strval(&mode, mode_param); - ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 90, &filename, &mode); + ZEPHIR_RETURN_CALL_FUNCTION("fopen", NULL, 134, &filename, &mode); zephir_check_call_status(); RETURN_MM(); } diff --git a/ext/phalcon/translate/adapter/csv.zep.h b/ext/phalcon/translate/adapter/csv.zep.h index f33aabceb3b..763842af19e 100644 --- a/ext/phalcon/translate/adapter/csv.zep.h +++ b/ext/phalcon/translate/adapter/csv.zep.h @@ -8,6 +8,7 @@ PHP_METHOD(Phalcon_Translate_Adapter_Csv, exists); PHP_METHOD(Phalcon_Translate_Adapter_Csv, has); PHP_METHOD(Phalcon_Translate_Adapter_Csv, query); PHP_METHOD(Phalcon_Translate_Adapter_Csv, load); +PHP_METHOD(Phalcon_Translate_Adapter_Csv, toArray); PHP_METHOD(Phalcon_Translate_Adapter_Csv, phpFopen); zend_object *zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type); @@ -41,6 +42,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_csv_lo ZEND_ARG_TYPE_INFO(0, enclosure, IS_STRING, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_csv_toarray, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_csv_phpfopen, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) @@ -55,6 +59,7 @@ ZEPHIR_INIT_FUNCS(phalcon_translate_adapter_csv_method_entry) { PHP_ME(Phalcon_Translate_Adapter_Csv, has, arginfo_phalcon_translate_adapter_csv_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, query, arginfo_phalcon_translate_adapter_csv_query, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, load, arginfo_phalcon_translate_adapter_csv_load, ZEND_ACC_PRIVATE) + PHP_ME(Phalcon_Translate_Adapter_Csv, toArray, arginfo_phalcon_translate_adapter_csv_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_Csv, phpFopen, arginfo_phalcon_translate_adapter_csv_phpfopen, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/translate/adapter/nativearray.zep.c b/ext/phalcon/translate/adapter/nativearray.zep.c index cc579eb722f..0ae5ca81fca 100644 --- a/ext/phalcon/translate/adapter/nativearray.zep.c +++ b/ext/phalcon/translate/adapter/nativearray.zep.c @@ -252,7 +252,7 @@ PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound) object_init_ex(&_1$$3, phalcon_translate_exception_ce); ZEPHIR_INIT_VAR(&_2$$3); ZEPHIR_CONCAT_SV(&_2$$3, "Cannot find translation key: ", &index); - ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 31, &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 29, &_2$$3); zephir_check_call_status(); zephir_throw_exception_debug(&_1$$3, "phalcon/Translate/Adapter/NativeArray.zep", 107); ZEPHIR_MM_RESTORE(); @@ -324,6 +324,20 @@ PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query) RETURN_MM(); } +/** + * Returns the internal array + * + * @return array + */ +PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, toArray) +{ + zval *this_ptr = getThis(); + + + + RETURN_MEMBER(getThis(), "translate"); +} + zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_class_entry *class_type) { zval _0, _1$$3; diff --git a/ext/phalcon/translate/adapter/nativearray.zep.h b/ext/phalcon/translate/adapter/nativearray.zep.h index dd70dd9242a..69cccc24dd5 100644 --- a/ext/phalcon/translate/adapter/nativearray.zep.h +++ b/ext/phalcon/translate/adapter/nativearray.zep.h @@ -8,6 +8,7 @@ PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists); PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, has); PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, notFound); PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, query); +PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, toArray); zend_object *zephir_init_properties_Phalcon_Translate_Adapter_NativeArray(zend_class_entry *class_type); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_nativearray___construct, 0, 0, 2) @@ -36,6 +37,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_native #endif ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_translate_adapter_nativearray_toarray, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_translate_adapter_nativearray_zephir_init_properties_phalcon_translate_adapter_nativearray, 0, 0, 0) ZEND_END_ARG_INFO() @@ -45,5 +49,6 @@ ZEPHIR_INIT_FUNCS(phalcon_translate_adapter_nativearray_method_entry) { PHP_ME(Phalcon_Translate_Adapter_NativeArray, has, arginfo_phalcon_translate_adapter_nativearray_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_NativeArray, notFound, arginfo_phalcon_translate_adapter_nativearray_notfound, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Translate_Adapter_NativeArray, query, arginfo_phalcon_translate_adapter_nativearray_query, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Translate_Adapter_NativeArray, toArray, arginfo_phalcon_translate_adapter_nativearray_toarray, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/translate/interpolator/indexedarray.zep.c b/ext/phalcon/translate/interpolator/indexedarray.zep.c index cd69d6e2c08..1a1655e51b7 100644 --- a/ext/phalcon/translate/interpolator/indexedarray.zep.c +++ b/ext/phalcon/translate/interpolator/indexedarray.zep.c @@ -92,7 +92,7 @@ PHP_METHOD(Phalcon_Translate_Interpolator_IndexedArray, replacePlaceholders) if (1 != ZEPHIR_IS_EMPTY(&placeholders)) { ZEPHIR_MAKE_REF(&placeholders); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 285, &placeholders, &translation); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 267, &placeholders, &translation); ZEPHIR_UNREF(&placeholders); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_0$$3); diff --git a/ext/php_phalcon.h b/ext/php_phalcon.h index 7c90d409c0f..b6a494b6f64 100644 --- a/ext/php_phalcon.h +++ b/ext/php_phalcon.h @@ -11,10 +11,10 @@ #include "kernel/globals.h" #define PHP_PHALCON_NAME "phalcon" -#define PHP_PHALCON_VERSION "5.0.0beta3" +#define PHP_PHALCON_VERSION "5.0.0RC1" #define PHP_PHALCON_EXTNAME "phalcon" #define PHP_PHALCON_AUTHOR "Phalcon Team and contributors" -#define PHP_PHALCON_ZEPVERSION "0.15.2-5828ae2" +#define PHP_PHALCON_ZEPVERSION "0.16.0-4fac47b" #define PHP_PHALCON_DESCRIPTION "Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance." typedef struct _zephir_struct_db { diff --git a/package.xml b/package.xml index b80f6fa2edd..524d77f8ca2 100644 --- a/package.xml +++ b/package.xml @@ -22,11 +22,11 @@ ruud@ruudboon.io yes - 2021-11-16 + 2022-05-31 - 5.0.0beta3 - 5.0.0beta3 + 5.0.0RC1 + 5.0.0RC1 beta @@ -37,18 +37,45 @@ Full changelog can be found at: https://github.com/phalcon/cphalcon/blob/master/CHANGELOG-5.0.md ## Changed - - Renamed `Phalcon\Db\Result\Pdo` to `Phalcon\Db\Result\PdoResult` to avoid collisions with `\PDO` [#15874](https://github.com/phalcon/cphalcon/issues/15854) + - Changed `Phalcon\Session\Bag::__construct()` to accept a `Phalcon\Session\Manager` as the first parameter and `name` as the second one [#15904](https://github.com/phalcon/cphalcon/issues/15904) + - Changed `Phalcon\Logger\Logger` to no longer depend on PSR interfaces [#15925](https://github.com/phalcon/cphalcon/issues/15925) + - Changed `Phalcon\Cache\Cache` to no longer depend on PSR interfaces [#15927](https://github.com/phalcon/cphalcon/issues/15927) + - Changed `Phalcon\Html\Link` to no longer depend on PSR interfaces [#15930](https://github.com/phalcon/cphalcon/issues/15930) ## Fixed - - Fixed `Phalcon\Logger\AbstractAdapter::getFormattedItem()` to not add `PHP_EOL` at the end of the message and added it to the `Phalcon\Logger\Adapter\Stream` [#14547](https://github.com/phalcon/cphalcon/issues/14547) - - Fixed `Phalcon\Html\Helper\Title:__invoke()` to not use the `$separator` as parameter - no need to redefine it in a view [#15866](https://github.com/phalcon/cphalcon/issues/15866) - - Fixed the delimiters for `Phalcon\Support\Helper\SnakeCase` and `Phalcon\Support\Helper\KamelCase` [#15850](https://github.com/phalcon/cphalcon/issues/15850) - - Fixed `Phalcon\Mvc\Router\Route::getName()` and `Phalcon\Mvc\Router\Route::getHostname()` to also return `null` [#15880](https://github.com/phalcon/cphalcon/issues/15880) - - Fixed `Phalcon\Mvc\Router\RouteInterface::getName()` and `Phalcon\Mvc\Router\RouteInterface::getHostname()` to also return `null` [#15880](https://github.com/phalcon/cphalcon/issues/15880) - - Fixed `Phalcon\Mvc\Model::findFirst()` to return `mixed` or `null` [#15883](https://github.com/phalcon/cphalcon/issues/15883) + - Fixed `Phalcon\Html\Helper\Input\Numeric` to produce correct elements [#15896](https://github.com/phalcon/cphalcon/issues/15896) + - Fixed `Phalcon\Storage\Adapter\*` to correctly store `null` values [#15904](https://github.com/phalcon/cphalcon/issues/15904) ## Added - - Added `Phalcon\Html\Helper\Title:setSeparator` to allow setting the separator independently [#15866](https://github.com/phalcon/cphalcon/issues/15866) + - Added `Phalcon\Encryption\Crypt::isValidDecryptLength($input)` to allow checking for the length of the decryption string [#15879](https://github.com/phalcon/cphalcon/issues/15879) + - Added `Phalcon\Di\InitializationAwareInterface` to allow auto calling the `initialize` method when accessing service through DIC [#15916](https://github.com/phalcon/cphalcon/pull/15916) + - Added + - `Phalcon\Storage\Serializer\MemcachedIgbinary` + - `Phalcon\Storage\Serializer\MemcachedJson` + - `Phalcon\Storage\Serializer\MemcachedPhp` + - `Phalcon\Storage\Serializer\RedisIgbinary` + - `Phalcon\Storage\Serializer\RedisJson` + - `Phalcon\Storage\Serializer\RedisMsgpack` + - `Phalcon\Storage\Serializer\RedisNone` + - `Phalcon\Storage\Serializer\RedisPhp` to be used if adapter serialization is required [#15904](https://github.com/phalcon/cphalcon/issues/15904) + - Added + - `Phalcon\Logger\LoggerInterface` + - `Phalcon\Logger\AbstractLogger` to be used in the logger class but also the proxy-psr3 repo [#15925](https://github.com/phalcon/cphalcon/issues/15925) + - Added + - `Phalcon\Cache\CacheInterface` + - `Phalcon\Cache\AbstractCache` to be used in the cache class but also the proxy-psr16 repo [#15927](https://github.com/phalcon/cphalcon/issues/15927) + - Added + - EvolvableLinkInterface.zep + - `Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface` + - `Phalcon\Html\Link\Interfaces\LinkInterface` + - `Phalcon\Html\Link\Interfaces\LinkProviderInterface` + - `Phalcon\Html\Link\AbstractLink` + - `Phalcon\Html\Link\AbstractLinkProvider` to be used in the link class but also the proxy-psr13 repo [#15930](https://github.com/phalcon/cphalcon/issues/15930) + - Added `Phalcon\Translate\Adapter\Csv::toArray()` and `Phalcon\Translate\Adapter\NativeArray::toArray()` to return the translation array back [#15902](https://github.com/phalcon/cphalcon/issues/15902) + - + ## Removed + - Removed `Phalcon\Container\Container` and moved its contents to the `proxy-psr11` repo [#15928](https://github.com/phalcon/cphalcon/issues/15928) + - Removed `Phalcon\Http\Message\*` and `Phalcon\Http\Server\*` classes. This removes PSR from Phalcon. PSR-7 available in v6 [#15929](https://github.com/phalcon/cphalcon/issues/15929) @@ -68,16 +95,11 @@ 7.4.1 - 8.0.99 + 8.1.99 1.10 - - psr - pecl.php.net - 1.1.0 - phalcon diff --git a/phalcon/Acl/Adapter/AbstractAdapter.zep b/phalcon/Acl/Adapter/AbstractAdapter.zep index 0939bd5180d..c3a79c984ee 100644 --- a/phalcon/Acl/Adapter/AbstractAdapter.zep +++ b/phalcon/Acl/Adapter/AbstractAdapter.zep @@ -64,7 +64,7 @@ abstract class AbstractAdapter extends AbstractEventsAware implements AdapterInt } /** - * Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY) + * Sets the default access level (Phalcon\Acl\Enum::ALLOW or Phalcon\Acl\Enum::DENY) */ public function setDefaultAction(int defaultAccess) -> void { diff --git a/phalcon/Annotations/Adapter/AbstractAdapter.zep b/phalcon/Annotations/Adapter/AbstractAdapter.zep index fea45896f03..a96b3697d3b 100644 --- a/phalcon/Annotations/Adapter/AbstractAdapter.zep +++ b/phalcon/Annotations/Adapter/AbstractAdapter.zep @@ -72,37 +72,28 @@ abstract class AbstractAdapter implements AdapterInterface } /** - * Returns the annotations found in a specific method + * Returns the annotations found in a specific constant */ - public function getMethod(string className, string methodName) -> + public function getConstant(string className, string constantName) -> { - var classAnnotations, methods, method, methodKey; + var constants, constant; - /** - * Get the full annotations from the class - */ - let classAnnotations = this->get(className); - - let methods = classAnnotations->getMethodsAnnotations(); + let constants = this->getConstants(className); - if typeof methods == "array" { - for methodKey, method in methods { - if !strcasecmp(methodKey, methodName) { - return method; - } - } + if !fetch constant, constants[constantName] { + /** + * Returns a collection anyways + */ + return new Collection(); } - /** - * Returns a collection anyway - */ - return new Collection(); + return constant; } /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' constants */ - public function getMethods(string className) -> array + public function getConstants(string className) -> array { var classAnnotations; @@ -111,7 +102,7 @@ abstract class AbstractAdapter implements AdapterInterface */ let classAnnotations = this->get(className); - return classAnnotations->getMethodsAnnotations(); + return classAnnotations->getConstantsAnnotations(); } /** @@ -139,7 +130,7 @@ abstract class AbstractAdapter implements AdapterInterface } /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' properties */ public function getProperties(string className) -> array { @@ -153,6 +144,49 @@ abstract class AbstractAdapter implements AdapterInterface return classAnnotations->getPropertiesAnnotations(); } + /** + * Returns the annotations found in a specific method + */ + public function getMethod(string className, string methodName) -> + { + var classAnnotations, methods, method, methodKey; + + /** + * Get the full annotations from the class + */ + let classAnnotations = this->get(className); + + let methods = classAnnotations->getMethodsAnnotations(); + + if typeof methods == "array" { + for methodKey, method in methods { + if !strcasecmp(methodKey, methodName) { + return method; + } + } + } + + /** + * Returns a collection anyway + */ + return new Collection(); + } + + /** + * Returns the annotations found in all the class' methods + */ + public function getMethods(string className) -> array + { + var classAnnotations; + + /** + * Get the full annotations from the class + */ + let classAnnotations = this->get(className); + + return classAnnotations->getMethodsAnnotations(); + } + /** * Returns the annotation reader */ diff --git a/phalcon/Annotations/Adapter/AdapterInterface.zep b/phalcon/Annotations/Adapter/AdapterInterface.zep index abeba717a91..da6367616e6 100644 --- a/phalcon/Annotations/Adapter/AdapterInterface.zep +++ b/phalcon/Annotations/Adapter/AdapterInterface.zep @@ -25,14 +25,14 @@ interface AdapterInterface public function get(string className) -> ; /** - * Returns the annotations found in a specific method + * Returns the annotations found in a specific constant */ - public function getMethod(string className, string methodName) -> ; + public function getConstant(string className, string constantName) -> ; /** - * Returns the annotations found in all the class' methods + * Returns the annotations found in all the class' constants */ - public function getMethods(string className) -> array; + public function getConstants(string className) -> array; /** * Returns the annotations found in a specific property @@ -44,6 +44,16 @@ interface AdapterInterface */ public function getProperties(string className) -> array; + /** + * Returns the annotations found in a specific method + */ + public function getMethod(string className, string methodName) -> ; + + /** + * Returns the annotations found in all the class' methods + */ + public function getMethods(string className) -> array; + /** * Returns the annotation reader */ diff --git a/phalcon/Annotations/Collection.zep b/phalcon/Annotations/Collection.zep index a9a871d35a2..818bff99d8f 100644 --- a/phalcon/Annotations/Collection.zep +++ b/phalcon/Annotations/Collection.zep @@ -69,7 +69,7 @@ class Collection implements Iterator, Countable /** * Returns the current annotation in the iterator */ - public function current() -> | bool + public function current() -> mixed { var annotation; diff --git a/phalcon/Annotations/Reader.zep b/phalcon/Annotations/Reader.zep index 459f37baef7..d74a8e53f8d 100644 --- a/phalcon/Annotations/Reader.zep +++ b/phalcon/Annotations/Reader.zep @@ -22,9 +22,10 @@ class Reader implements ReaderInterface */ public function parse(string className) -> array { - var reflection, comment, properties, methods, property, method, - classAnnotations, line, annotationsProperties, propertyAnnotations, - annotationsMethods, methodAnnotations; + var reflection, comment, line, arrayKeys, classAnnotations, + properties, property, annotationsProperties, propertyAnnotations, + methods, method, annotationsMethods, methodAnnotations, + constants, constant, anotationsConstants, constantAnnotations, constantReflection; array annotations; let annotations = []; @@ -36,7 +37,6 @@ class Reader implements ReaderInterface let comment = reflection->getDocComment(); if typeof comment == "string" { - /** * Read annotations from class */ @@ -54,6 +54,47 @@ class Reader implements ReaderInterface } } + /** + * Get class constants + */ + let constants = reflection->getConstants(); + + if count(constants) { + /** + * Line declaration for constants isn't available + */ + let line = 1; + let arrayKeys = array_keys(constants); + let anotationsConstants = []; + + for constant in arrayKeys { + /** + * Read comment from constant docblock + */ + let constantReflection = reflection->getReflectionConstant(constant); + let comment = constantReflection->getDocComment(); + + if typeof comment == "string" { + /** + * Parse constant docblock comment + */ + let constantAnnotations = phannot_parse_annotations( + comment, + reflection->getFileName(), + line + ); + + if typeof constantAnnotations == "array" { + let anotationsConstants[constant] = constantAnnotations; + } + } + } + + if count(anotationsConstants) { + let annotations["constants"] = anotationsConstants; + } + } + /** * Get the class properties */ @@ -64,18 +105,17 @@ class Reader implements ReaderInterface * Line declaration for properties isn't available */ let line = 1; - let annotationsProperties = []; for property in properties { /** - * Read comment from method + * Read comment from property */ let comment = property->getDocComment(); if typeof comment == "string" { /** - * Read annotations from the docblock + * Parse property docblock comment */ let propertyAnnotations = phannot_parse_annotations( comment, @@ -110,7 +150,7 @@ class Reader implements ReaderInterface if typeof comment == "string" { /** - * Read annotations from class + * Parse method docblock comment */ let methodAnnotations = phannot_parse_annotations( comment, diff --git a/phalcon/Annotations/ReaderInterface.zep b/phalcon/Annotations/ReaderInterface.zep index 3865600e8e1..21d574e454f 100644 --- a/phalcon/Annotations/ReaderInterface.zep +++ b/phalcon/Annotations/ReaderInterface.zep @@ -16,7 +16,7 @@ namespace Phalcon\Annotations; interface ReaderInterface { /** - * Reads annotations from the class docblocks, its methods and/or properties + * Reads annotations from the class docblocks, its constants, properties and methods */ public function parse(string className) -> array; diff --git a/phalcon/Annotations/Reflection.zep b/phalcon/Annotations/Reflection.zep index 6d7d87d84b9..585560d5112 100644 --- a/phalcon/Annotations/Reflection.zep +++ b/phalcon/Annotations/Reflection.zep @@ -40,7 +40,7 @@ class Reflection * @var array * TODO: Make always array */ - protected methodAnnotations; + protected constantAnnotations; /** * @var array @@ -48,6 +48,12 @@ class Reflection */ protected propertyAnnotations; + /** + * @var array + * TODO: Make always array + */ + protected methodAnnotations; + /** * @var array */ @@ -80,31 +86,31 @@ class Reflection } /** - * Returns the annotations found in the methods' docblocks + * Returns the annotations found in the constants' docblocks */ - public function getMethodsAnnotations() -> | bool + public function getConstantsAnnotations() -> | bool { - var reflectionMethods, methodName, reflectionMethod; + var reflectionConstants, constant, reflectionConstant; - if this->methodAnnotations === null { - if fetch reflectionMethods, this->reflectionData["methods"] { - if count(reflectionMethods) { - let this->methodAnnotations = []; + if this->constantAnnotations === null { + if fetch reflectionConstants, this->reflectionData["constants"] { + if count(reflectionConstants) { + let this->constantAnnotations = []; - for methodName, reflectionMethod in reflectionMethods { - let this->methodAnnotations[methodName] = new Collection( - reflectionMethod + for constant, reflectionConstant in reflectionConstants { + let this->constantAnnotations[constant] = new Collection( + reflectionConstant ); } - return this->methodAnnotations; + return this->constantAnnotations; } } - let this->methodAnnotations = false; + let this->constantAnnotations = false; } - return this->methodAnnotations; + return this->constantAnnotations; } /** @@ -135,6 +141,34 @@ class Reflection return this->propertyAnnotations; } + /** + * Returns the annotations found in the methods' docblocks + */ + public function getMethodsAnnotations() -> | bool + { + var reflectionMethods, methodName, reflectionMethod; + + if this->methodAnnotations === null { + if fetch reflectionMethods, this->reflectionData["methods"] { + if count(reflectionMethods) { + let this->methodAnnotations = []; + + for methodName, reflectionMethod in reflectionMethods { + let this->methodAnnotations[methodName] = new Collection( + reflectionMethod + ); + } + + return this->methodAnnotations; + } + } + + let this->methodAnnotations = false; + } + + return this->methodAnnotations; + } + /** * Returns the raw parsing intermediate definitions used to construct the * reflection diff --git a/phalcon/Application/AbstractApplication.zep b/phalcon/Application/AbstractApplication.zep index a5286f3235c..eda9320e40e 100644 --- a/phalcon/Application/AbstractApplication.zep +++ b/phalcon/Application/AbstractApplication.zep @@ -26,9 +26,9 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte protected container = null; /** - * @var string|null + * @var string */ - protected defaultModule = null; + protected defaultModule = ""; /** * @var ManagerInterface|null diff --git a/phalcon/Assets/Asset.zep b/phalcon/Assets/Asset.zep index 36fc80f561b..368af9badd2 100644 --- a/phalcon/Assets/Asset.zep +++ b/phalcon/Assets/Asset.zep @@ -264,7 +264,7 @@ class Asset implements AssetInterface */ public function isAutoVersion() -> bool { - return $this->isAutoVersion; + return this->isAutoVersion; } /** diff --git a/phalcon/Assets/Collection.zep b/phalcon/Assets/Collection.zep index ab8a650790b..a45691c1f5a 100644 --- a/phalcon/Assets/Collection.zep +++ b/phalcon/Assets/Collection.zep @@ -241,7 +241,7 @@ class Collection implements Countable, IteratorAggregate * * @link https://php.net/manual/en/iteratoraggregate.getiterator.php */ - public function getIterator() + public function getIterator() -> <\Traversable> { return new ArrayIterator(this->assets); } diff --git a/phalcon/Assets/Manager.zep b/phalcon/Assets/Manager.zep index 599b38012c4..d5e13cf3d85 100644 --- a/phalcon/Assets/Manager.zep +++ b/phalcon/Assets/Manager.zep @@ -654,8 +654,7 @@ class Manager extends AbstractInjectionAware } } - if (true !== empty(filters) && join) - { + if (true !== empty(filters) && join) { /** * Write the file using file_put_contents. This respects the * openbase-dir also writes to streams diff --git a/phalcon/Cache/AbstractCache.zep b/phalcon/Cache/AbstractCache.zep new file mode 100644 index 00000000000..a82e3b35b84 --- /dev/null +++ b/phalcon/Cache/AbstractCache.zep @@ -0,0 +1,241 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Cache; + +use DateInterval; +use Phalcon\Cache\Adapter\AdapterInterface; +use Phalcon\Cache\Exception\InvalidArgumentException; +use Traversable; + +/** + * This component offers caching capabilities for your application. + * Phalcon\Cache implements PSR-16. + * + * @property AdapterInterface $adapter + */ +abstract class AbstractCache implements CacheInterface +{ + /** + * The adapter + * + * @var AdapterInterface + */ + protected adapter; + + /** + * Constructor. + * + * @param AdapterInterface $adapter The cache adapter + */ + public function __construct( adapter) + { + let this->adapter = adapter; + } + + /** + * Returns the current adapter + * + * @return AdapterInterface + */ + public function getAdapter() -> + { + return this->adapter; + } + + /** + * Checks the key. If it contains invalid characters an exception is thrown + * + * @param mixed $key + * + * @throws InvalidArgumentException + */ + protected function checkKey(string key) -> void + { + var exception; + + if (preg_match("/[^A-Za-z0-9-_.]/", key)) { + let exception = this->getExceptionClass(); + throw new {exception}( + "The key contains invalid characters" + ); + } + } + + /** + * Checks the key. If it contains invalid characters an exception is thrown + * + * @param mixed $keys + * + * @throws InvalidArgumentException + */ + protected function checkKeys(var keys) -> void + { + var exception; + + if (!(typeof keys === "array" || keys instanceof Traversable)) { + let exception = this->getExceptionClass(); + throw new {exception}( + "The keys need to be an array or instance of Traversable" + ); + } + } + + /** + * Wipes clean the entire cache's keys. + * + * @return bool True on success and false on failure. + */ + protected function doClear() -> bool + { + return this->adapter->clear(); + } + + /** + * Delete an item from the cache by its unique key. + * + * @param string $key The unique cache key of the item to delete. + * + * @return bool True if the item was successfully removed. False if there + * was an error. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + protected function doDelete(string key) -> bool + { + this->checkKey(key); + + return this->adapter->delete(key); + } + + /** + * Deletes multiple cache items in a single operation. + */ + protected function doDeleteMultiple(var keys) -> bool + { + var key, result; + + this->checkKeys(keys); + + let result = true; + for key in keys { + if (true !== this->adapter->delete(key)) { + let result = false; + } + } + + return result; + } + + /** + * Fetches a value from the cache. + * + * @param string $key The unique key of this item in the cache. + * @param mixed $defaultValue Default value to return if the key does not exist. + * + * @return mixed The value of the item from the cache, or $default in case + * of cache miss. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + protected function doGet(string key, var defaultValue = null) + { + this->checkKey(key); + + return this->adapter->get(key, defaultValue); + } + + /** + * Obtains multiple cache items by their unique keys. + */ + protected function doGetMultiple(var keys, var defaultValue = null) + { + var element, results; + + this->checkKeys(keys); + + let results = []; + for element in keys { + let results[element] = this->get(element, defaultValue); + } + + return results; + } + + /** + * Determines whether an item is present in the cache. + * + * @param string $key The cache item key. + * + * @return bool + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + protected function doHas(string key) -> bool + { + this->checkKey(key); + + return this->adapter->has(key); + } + + /** + * Persists data in the cache, uniquely referenced by a key with an optional + * expiration TTL time. + * + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store. + * Must be serializable. + * @param null|int|DateInterval $ttl Optional. The TTL value of this + * item. If no value is sent and the + * driver supports TTL then the library + * may set a default value for it or + * let the driver take care of that. + * + * @return bool True on success and false on failure. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is not + * a legal value. + */ + protected function doSet(string key, var value, var ttl = null) -> bool + { + this->checkKey(key); + + return this->adapter->set(key, value, ttl); + } + + /** + * Persists a set of key => value pairs in the cache, with an optional TTL. + */ + protected function doSetMultiple(values, var ttl = null) -> bool + { + var key, result, value; + + this->checkKeys(values); + + let result = true; + for key, value in values { + if (true !== this->set(key, value, ttl)) { + let result = false; + } + } + + return result; + } + + /** + * Returns the exception class that will be used for exceptions thrown + * + * @return string + */ + abstract protected function getExceptionClass() -> string; +} diff --git a/phalcon/Cache/Cache.zep b/phalcon/Cache/Cache.zep index 2dfaee6f037..2b599511da8 100644 --- a/phalcon/Cache/Cache.zep +++ b/phalcon/Cache/Cache.zep @@ -13,8 +13,6 @@ namespace Phalcon\Cache; use DateInterval; use Phalcon\Cache\Adapter\AdapterInterface; use Phalcon\Cache\Exception\InvalidArgumentException; -use Psr\SimpleCache\CacheInterface; -use Traversable; /** * This component offers caching capabilities for your application. @@ -22,25 +20,8 @@ use Traversable; * * @property AdapterInterface $adapter */ -class Cache implements CacheInterface +class Cache extends AbstractCache { - /** - * The adapter - * - * @var AdapterInterface - */ - protected adapter { get }; - - /** - * Constructor. - * - * @param AdapterInterface $adapter The cache adapter - */ - public function __construct( adapter) - { - let this->adapter = adapter; - } - /** * Wipes clean the entire cache's keys. * @@ -48,7 +29,7 @@ class Cache implements CacheInterface */ public function clear() -> bool { - return this->adapter->clear(); + return this->doClear(); } /** @@ -62,50 +43,24 @@ class Cache implements CacheInterface * @throws InvalidArgumentException MUST be thrown if the $key string is * not a legal value. */ - public function delete(var key) -> bool + public function delete(string key) -> bool { - let key = (string) key; - - this->checkKey(key); - - return this->adapter->delete(key); + return this->doDelete(key); } /** * Deletes multiple cache items in a single operation. - * - * @param iterable $keys A list of string-based keys to be deleted. - * - * @return bool True if the items were successfully removed. False if there - * was an error. - * - * @throws InvalidArgumentException MUST be thrown if $keys is neither an - * array nor a Traversable, or if any of - * the $keys are not a legal value. */ public function deleteMultiple(var keys) -> bool { - var key, result; - - this->checkKeys(keys); - - let result = true; - - for key in keys { - if !this->adapter->delete(key) { - let result = false; - } - } - - return result; + return this->doDeleteMultiple(keys); } /** * Fetches a value from the cache. * * @param string $key The unique key of this item in the cache. - * @param mixed $defaultValue Default value to return if the key does - * not exist. + * @param mixed $defaultValue Default value to return if the key does not exist. * * @return mixed The value of the item from the cache, or $default in case * of cache miss. @@ -113,42 +68,17 @@ class Cache implements CacheInterface * @throws InvalidArgumentException MUST be thrown if the $key string is * not a legal value. */ - public function get(var key, var defaultValue = null) -> var + public function get(string key, var defaultValue = null) { - let key = (string) key; - - this->checkKey(key); - - return this->adapter->get(key, defaultValue); + return this->doGet(key, defaultValue); } /** * Obtains multiple cache items by their unique keys. - * - * @param iterable $keys A list of keys that can obtained in a - * single operation. - * @param mixed defaultValue Default value to return for keys that do - * not exist. - * - * @return iterable A list of key => value pairs. Cache - * keys that do not exist or are stale will have $default as value. - * - * @throws InvalidArgumentException MUST be thrown if $keys is neither an - * array nor a Traversable, or if any of the $keys are not a legal value. */ - public function getMultiple(var keys, var defaultValue = null) -> var + public function getMultiple(var keys, var defaultValue = null) { - var element; - array results; - - this->checkKeys(keys); - - let results = []; - for element in keys { - let results[element] = this->get(element, defaultValue); - } - - return results; + return this->doGetMultiple(keys, defaultValue); } /** @@ -161,13 +91,9 @@ class Cache implements CacheInterface * @throws InvalidArgumentException MUST be thrown if the $key string is * not a legal value. */ - public function has(var key) -> bool + public function has(string key) -> bool { - let key = (string) key; - - this->checkKey(key); - - return this->adapter->has(key); + return this->doHas(key); } /** @@ -188,78 +114,26 @@ class Cache implements CacheInterface * @throws InvalidArgumentException MUST be thrown if the $key string is not * a legal value. */ - public function set(var key, var value, var ttl = null) -> bool + public function set(string key, var value, var ttl = null) -> bool { - let key = (string) key; - - this->checkKey(key); - - return this->adapter->set(key, value, ttl); + return this->doSet(key, value, ttl); } /** * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * @param iterable $values A list of key => value pairs for a - * multiple-set operation. - * @param null|int|DateInterval $ttl Optional. The TTL value of this - * item. If no value is sent and the - * driver supports TTL then the - * library may set a default value for - * it or let the driver take care of - * that. - * - * @return bool True on success and false on failure. - * - * @throws InvalidArgumentException MUST be thrown if $values is neither an - * array nor a Traversable, or if any of the $values are not a legal value. */ public function setMultiple(var values, var ttl = null) -> bool { - var key, value; - bool result; - - this->checkKeys(values); - - let result = true; - for key, value in values { - if !this->set(key, value, ttl) { - let result = false; - } - } - - return result; - } - - /** - * Checks the key. If it contains invalid characters an exception is thrown - * - * @param mixed $key - * - * @throws InvalidArgumentException - */ - protected function checkKey(string key) -> void - { - if preg_match("/[^A-Za-z0-9-_.]/", key) { - throw new InvalidArgumentException( - "The key contains invalid characters" - ); - } + return this->doSetMultiple(values, ttl); } /** - * Checks the key. If it contains invalid characters an exception is thrown - * - * @param mixed $keys + * Returns the exception class that will be used for exceptions thrown * - * @throws InvalidArgumentException + * @return string */ - protected function checkKeys(var keys) -> void + protected function getExceptionClass() -> string { - if !(typeof keys === "array" || keys instanceof Traversable) { - throw new InvalidArgumentException( - "The keys need to be an array or instance of Traversable" - ); - } + return "Phalcon\\Cache\\Exception\\InvalidArgumentException"; } } diff --git a/phalcon/Cache/CacheFactory.zep b/phalcon/Cache/CacheFactory.zep index 2288df68efe..38872cea313 100644 --- a/phalcon/Cache/CacheFactory.zep +++ b/phalcon/Cache/CacheFactory.zep @@ -15,7 +15,6 @@ use Phalcon\Cache\Cache; use Phalcon\Cache\Exception\Exception; use Phalcon\Config\ConfigInterface; use Phalcon\Factory\AbstractConfigFactory; -use Psr\SimpleCache\CacheInterface; /** * Creates a new Cache class diff --git a/phalcon/Cache/CacheInterface.zep b/phalcon/Cache/CacheInterface.zep new file mode 100644 index 00000000000..cc0d4e21d4e --- /dev/null +++ b/phalcon/Cache/CacheInterface.zep @@ -0,0 +1,101 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Cache; + +use DateInterval; +use Phalcon\Cache\Exception\InvalidArgumentException; + +/** + * Interface for Phalcon\Cache\Cache + */ +interface CacheInterface +{ + /** + * Wipes clean the entire cache's keys. + * + * @return bool True on success and false on failure. + */ + public function clear() -> bool; + + /** + * Delete an item from the cache by its unique key. + * + * @param string $key The unique cache key of the item to delete. + * + * @return bool True if the item was successfully removed. False if there + * was an error. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + public function delete(string key) -> bool; + + /** + * Deletes multiple cache items in a single operation. + */ + public function deleteMultiple(var keys) -> bool; + + /** + * Fetches a value from the cache. + * + * @param string $key The unique key of this item in the cache. + * @param mixed $defaultValue Default value to return if the key does not exist. + * + * @return mixed The value of the item from the cache, or $default in case + * of cache miss. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + public function get(string key, var defaultValue = null); + + /** + * Obtains multiple cache items by their unique keys. + */ + public function getMultiple(var keys, var defaultValue = null); + + /** + * Determines whether an item is present in the cache. + * + * @param string $key The cache item key. + * + * @return bool + * + * @throws InvalidArgumentException MUST be thrown if the $key string is + * not a legal value. + */ + public function has(string key) -> bool; + + /** + * Persists data in the cache, uniquely referenced by a key with an optional + * expiration TTL time. + * + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store. + * Must be serializable. + * @param null|int|DateInterval $ttl Optional. The TTL value of this + * item. If no value is sent and the + * driver supports TTL then the library + * may set a default value for it or + * let the driver take care of that. + * + * @return bool True on success and false on failure. + * + * @throws InvalidArgumentException MUST be thrown if the $key string is not + * a legal value. + */ + public function set(string key, var value, var ttl = null) -> bool; + + /** + * Persists a set of key => value pairs in the cache, with an optional TTL. + */ + public function setMultiple(var values, var ttl = null) -> bool; +} diff --git a/phalcon/Cache/Exception/Exception.zep b/phalcon/Cache/Exception/Exception.zep index 468269e7875..94a96abe3d2 100644 --- a/phalcon/Cache/Exception/Exception.zep +++ b/phalcon/Cache/Exception/Exception.zep @@ -13,7 +13,7 @@ namespace Phalcon\Cache\Exception; /** * Exceptions thrown in Phalcon\Cache will use this class */ -class Exception extends \Exception implements \Psr\SimpleCache\CacheException +class Exception extends \Exception { } diff --git a/phalcon/Cache/Exception/InvalidArgumentException.zep b/phalcon/Cache/Exception/InvalidArgumentException.zep index 3b369c2f693..adedf84626d 100644 --- a/phalcon/Cache/Exception/InvalidArgumentException.zep +++ b/phalcon/Cache/Exception/InvalidArgumentException.zep @@ -13,7 +13,7 @@ namespace Phalcon\Cache\Exception; /** * Exceptions thrown in Phalcon\Cache will use this class */ -class InvalidArgumentException extends \Exception implements \Psr\SimpleCache\InvalidArgumentException +class InvalidArgumentException extends \Exception { } diff --git a/phalcon/Cli/Router.zep b/phalcon/Cli/Router.zep index 6feddfa7f97..ca71eb6b09c 100644 --- a/phalcon/Cli/Router.zep +++ b/phalcon/Cli/Router.zep @@ -49,9 +49,9 @@ class Router extends AbstractInjectionAware protected defaultAction = null; /** - * @var string|null + * @var string */ - protected defaultModule = null; + protected defaultModule = ""; /** * @var array @@ -75,9 +75,9 @@ class Router extends AbstractInjectionAware protected matches = null; /** - * @var string|null + * @var string */ - protected module = null; + protected module = ""; /** * @var array diff --git a/phalcon/Config/Adapter/Grouped.zep b/phalcon/Config/Adapter/Grouped.zep index edb8e61fcd1..71cbbeb6432 100644 --- a/phalcon/Config/Adapter/Grouped.zep +++ b/phalcon/Config/Adapter/Grouped.zep @@ -19,7 +19,7 @@ use Phalcon\Factory\Exception as FactoryException; /** * Reads multiple files (or arrays) and merges them all together. * - * See `Phalcon\Config\Factory::load` To load Config Adapter class using 'adapter' option. + * See `Phalcon\Config\ConfigFactory::load` To load Config Adapter class using 'adapter' option. * * ```php * use Phalcon\Config\Adapter\Grouped; diff --git a/phalcon/Config/Config.zep b/phalcon/Config/Config.zep index d463b9f941a..26e0af38058 100644 --- a/phalcon/Config/Config.zep +++ b/phalcon/Config/Config.zep @@ -19,7 +19,7 @@ use Phalcon\Support\Collection; * code. * *```php - * $config = new \Phalcon\Config( + * $config = new \Phalcon\Config\Config( * [ * "database" => [ * "adapter" => "Mysql", @@ -62,7 +62,7 @@ class Config extends Collection implements ConfigInterface * Merges a configuration into the current one * *```php - * $appConfig = new \Phalcon\Config( + * $appConfig = new \Phalcon\Config\Config( * [ * "database" => [ * "host" => "localhost", diff --git a/phalcon/Config/ConfigInterface.zep b/phalcon/Config/ConfigInterface.zep index 15fe36a33da..4ce1c12d56b 100644 --- a/phalcon/Config/ConfigInterface.zep +++ b/phalcon/Config/ConfigInterface.zep @@ -15,7 +15,7 @@ use Phalcon\Support\Collection\CollectionInterface; /** * Phalcon\Config\ConfigInterface * - * Interface for Phalcon\Config class + * Interface for Phalcon\Config\Config class */ interface ConfigInterface extends CollectionInterface { diff --git a/phalcon/Container/Container.zep b/phalcon/Container/Container.zep deleted file mode 100644 index c058a727c51..00000000000 --- a/phalcon/Container/Container.zep +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -namespace Phalcon\Container; - -use Psr\Container\ContainerInterface; -use Phalcon\Di\DiInterface; - -/** - * PSR-11 Wrapper for `Phalcon\Di` - */ -class Container implements ContainerInterface -{ - /** - * @var DiInterface - */ - protected container; - - /** - * Phalcon\Container constructor - */ - public function __construct( container) - { - let this->container = container; - } - - /** - * Return the service - */ - public function get(string name) -> var - { - return this->container->getShared(name); - } - - /** - * Whether a service exists or not in the container - */ - public function has(string name) -> bool - { - return this->container->has(name); - } -} diff --git a/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep b/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep index d9adbfafe22..7884fd16751 100644 --- a/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep +++ b/phalcon/DataMapper/Pdo/Profiler/MemoryLogger.zep @@ -15,14 +15,17 @@ namespace Phalcon\DataMapper\Pdo\Profiler; -use Psr\Log\AbstractLogger; +use Phalcon\Logger\Enum; +use Phalcon\Logger\Adapter\AdapterInterface; +use Phalcon\Logger\Adapter\Noop; +use Phalcon\Logger\LoggerInterface; /** - * A naive memory-based logger. + * A memory-based logger. * * @property array $messages */ -class MemoryLogger extends AbstractLogger +class MemoryLogger implements LoggerInterface { /** * @var array @@ -30,85 +33,124 @@ class MemoryLogger extends AbstractLogger protected messages = []; /** - * Returns the logged messages. - * - * @return array + * @param string message + * @param mixed[] context */ - public function getMessages() -> array + public function alert(string message, array context = []) -> void { - return this->messages; + this->log(Enum::ALERT, message, context); } /** * @param string message * @param mixed[] context */ - public function emergency(var message, array context = []) + public function critical(string message, array context = []) -> void { - parent::emergency(message, context); + this->log(Enum::CRITICAL, message, context); } /** * @param string message * @param mixed[] context */ - public function alert(var message, array context = []) + public function debug(string message, array context = []) -> void { - parent::alert(message, context); + this->log(Enum::DEBUG, message, context); } /** * @param string message * @param mixed[] context */ - public function critical(var message, array context = []) + public function emergency(string message, array context = []) -> void { - parent::critical(message, context); + this->log(Enum::EMERGENCY, message, context); } /** * @param string message * @param mixed[] context */ - public function error(var message, array context = []) + public function error(string message, array context = []) -> void { - parent::error(message, context); + this->log(Enum::ERROR, message, context); } /** - * @param string message - * @param mixed[] context + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + */ + public function getAdapter(string name) -> + { + return new Noop(); + } + + /** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ + public function getAdapters() -> array + { + return []; + } + + /** + * Returns the log level */ - public function warning(var message, array context = []) + public function getLogLevel() -> int { - parent::warning(message, context); + return Enum::CUSTOM; + } + + /** + * Returns the logged messages. + * + * @return array + */ + public function getMessages() -> array + { + return this->messages; + } + + /** + * Returns the name of the logger + */ + public function getName() -> string + { + return "memory logger"; } /** * @param string message * @param mixed[] context */ - public function notice(var message, array context = []) + public function info(string message, array context = []) -> void { - parent::notice(message, context); + this->log(Enum::INFO, message, context); } /** * @param string message * @param mixed[] context */ - public function info(var message, array context = []) + public function notice(string message, array context = []) -> void { - parent::info(message, context); + this->log(Enum::NOTICE, message, context); } + /** * @param string message * @param mixed[] context */ - public function debug(var message, array context = []) + public function warning(string message, array context = []) -> void { - parent::debug(message, context); + this->log(Enum::WARNING, message, context); } /** @@ -118,7 +160,7 @@ class MemoryLogger extends AbstractLogger * @param string $message * @param array $context */ - public function log(var level, var message, array context = []) + public function log(var level, string message, array context = []) -> void { var key, value; array replace = []; diff --git a/phalcon/DataMapper/Pdo/Profiler/Profiler.zep b/phalcon/DataMapper/Pdo/Profiler/Profiler.zep index b0b478f3139..348d50fac0f 100644 --- a/phalcon/DataMapper/Pdo/Profiler/Profiler.zep +++ b/phalcon/DataMapper/Pdo/Profiler/Profiler.zep @@ -17,8 +17,8 @@ namespace Phalcon\DataMapper\Pdo\Profiler; use InvalidArgumentException; // @todo this will also be removed when traits are available use Phalcon\DataMapper\Pdo\Exception\Exception; -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; +use Phalcon\Logger\Enum; +use Phalcon\Logger\LoggerInterface; /** * Sends query profiles to a logger. @@ -68,7 +68,7 @@ class Profiler implements ProfilerInterface } let this->logFormat = "{method} ({duration}s): {statement} {backtrace}", - this->logLevel = LogLevel::DEBUG, + this->logLevel = Enum::DEBUG, this->logger = logger; } diff --git a/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep b/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep index c71ae1b4cda..299a74dbe2e 100644 --- a/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep +++ b/phalcon/DataMapper/Pdo/Profiler/ProfilerInterface.zep @@ -15,7 +15,7 @@ namespace Phalcon\DataMapper\Pdo\Profiler; -use Psr\Log\LoggerInterface; +use Phalcon\Logger\LoggerInterface; /** * Interface to send query profiles to a logger. diff --git a/phalcon/Db/Adapter/AbstractAdapter.zep b/phalcon/Db/Adapter/AbstractAdapter.zep index 6faea4ff40f..f967d7b3275 100644 --- a/phalcon/Db/Adapter/AbstractAdapter.zep +++ b/phalcon/Db/Adapter/AbstractAdapter.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. diff --git a/phalcon/Db/Adapter/AdapterInterface.zep b/phalcon/Db/Adapter/AdapterInterface.zep index 97c46a70de4..32dadc72c2f 100644 --- a/phalcon/Db/Adapter/AdapterInterface.zep +++ b/phalcon/Db/Adapter/AdapterInterface.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Db/Adapter/Pdo/AbstractPdo.zep b/phalcon/Db/Adapter/Pdo/AbstractPdo.zep index 8c249075b1a..780669027eb 100644 --- a/phalcon/Db/Adapter/Pdo/AbstractPdo.zep +++ b/phalcon/Db/Adapter/Pdo/AbstractPdo.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Db/Adapter/Pdo/Mysql.zep b/phalcon/Db/Adapter/Pdo/Mysql.zep index 49dc134912c..77c485cbea1 100644 --- a/phalcon/Db/Adapter/Pdo/Mysql.zep +++ b/phalcon/Db/Adapter/Pdo/Mysql.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Db/Adapter/Pdo/Postgresql.zep b/phalcon/Db/Adapter/Pdo/Postgresql.zep index 1803b5f39ce..a3a371bc5dc 100644 --- a/phalcon/Db/Adapter/Pdo/Postgresql.zep +++ b/phalcon/Db/Adapter/Pdo/Postgresql.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Db/Adapter/Pdo/Sqlite.zep b/phalcon/Db/Adapter/Pdo/Sqlite.zep index ae81b9488a6..6ec309db58c 100644 --- a/phalcon/Db/Adapter/Pdo/Sqlite.zep +++ b/phalcon/Db/Adapter/Pdo/Sqlite.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -113,7 +113,6 @@ class Sqlite extends PdoAdapter ); for field in fields { - /** * By default the bind types is two */ @@ -293,7 +292,7 @@ class Sqlite extends PdoAdapter * Check if the column is default values * When field is empty default value is null */ - if strcasecmp(field[4], "null") != 0 && field[4] != "" { + if !empty(field[4]) && strcasecmp(field[4], "null") !== 0 { let definition["default"] = preg_replace( "/^'|'$/", "", diff --git a/phalcon/Db/Enum.zep b/phalcon/Db/Enum.zep index 836bcf9fb57..bfaed5209d8 100644 --- a/phalcon/Db/Enum.zep +++ b/phalcon/Db/Enum.zep @@ -32,4 +32,5 @@ class Enum const FETCH_PROPS_LATE = \Pdo::FETCH_PROPS_LATE; const FETCH_SERIALIZE = \Pdo::FETCH_SERIALIZE; const FETCH_UNIQUE = \Pdo::FETCH_UNIQUE; + const FETCH_DEFAULT = 0; // TODO: Use \Pdo::FETCH_DEFAULT after min PHP version is 8.0.7; } diff --git a/phalcon/Db/Result/PdoResult.zep b/phalcon/Db/Result/PdoResult.zep index 96fb7fe78f6..b9989f493fe 100644 --- a/phalcon/Db/Result/PdoResult.zep +++ b/phalcon/Db/Result/PdoResult.zep @@ -10,6 +10,7 @@ namespace Phalcon\Db\Result; +use Pdo; use Phalcon\Db\Enum; use Phalcon\Db\ResultInterface; use Phalcon\Db\Adapter\AdapterInterface; @@ -55,7 +56,7 @@ class PdoResult implements ResultInterface * * @var int */ - protected fetchMode = Enum::FETCH_OBJ; + protected fetchMode = Enum::FETCH_DEFAULT; /** * Internal resultset @@ -83,9 +84,13 @@ class PdoResult implements ResultInterface /** * Phalcon\Db\Result\Pdo constructor */ - public function __construct( connection, <\PDOStatement> result, - sqlStatement = null, bindParams = null, bindTypes = null) - { + public function __construct( + connection, + <\PDOStatement> result, + sqlStatement = null, + bindParams = null, + bindTypes = null + ) { let this->connection = connection, this->pdoStatement = result, this->sqlStatement = sqlStatement, @@ -147,7 +152,7 @@ class PdoResult implements ResultInterface number--; while n != number { - statement->$fetch(); + statement->$fetch(this->fetchMode); let n++; } @@ -180,10 +185,14 @@ class PdoResult implements ResultInterface * } *``` */ - public function $fetch(var fetchStyle = null, var cursorOrientation = null, var cursorOffset = null) + public function $fetch(int fetchStyle = null, int cursorOrientation = Pdo::FETCH_ORI_NEXT, int cursorOffset = 0) { + var mode; + + let mode = typeof fetchStyle === "int" ? fetchStyle : this->fetchMode; + return this->pdoStatement->$fetch( - fetchStyle, + mode, cursorOrientation, cursorOffset ); @@ -202,22 +211,15 @@ class PdoResult implements ResultInterface * $robots = $result->fetchAll(); *``` */ - public function fetchAll(var fetchStyle = null, var fetchArgument = null, var ctorArgs = null) -> array + public function fetchAll(int fetchStyle = null, int fetchArgument = Pdo::FETCH_ORI_NEXT, int ctorArgs = 0) -> array { - var pdoStatement; + var pdoStatement, mode; let pdoStatement = this->pdoStatement; - - if typeof fetchStyle != "integer" { - return pdoStatement->fetchAll(); - } + let mode = typeof fetchStyle === "int" ? fetchStyle : this->fetchMode; if fetchStyle == Enum::FETCH_CLASS { - return pdoStatement->fetchAll( - fetchStyle, - fetchArgument, - ctorArgs - ); + return pdoStatement->fetchAll(mode, fetchArgument, ctorArgs); } if fetchStyle == Enum::FETCH_COLUMN || fetchStyle == Enum::FETCH_FUNC { @@ -246,7 +248,7 @@ class PdoResult implements ResultInterface */ public function fetchArray() { - return this->pdoStatement->$fetch(); + return this->pdoStatement->$fetch(this->fetchMode); } /** diff --git a/phalcon/Di/Di.zep b/phalcon/Di/Di.zep index e97afc454ef..06e2a8229b1 100644 --- a/phalcon/Di/Di.zep +++ b/phalcon/Di/Di.zep @@ -19,6 +19,7 @@ use Phalcon\Config\Adapter\Yaml; use Phalcon\Config\ConfigInterface; use Phalcon\Di\ServiceInterface; use Phalcon\Events\ManagerInterface; +use Phalcon\Di\InitializationAwareInterface; use Phalcon\Di\InjectionAwareInterface; use Phalcon\Di\ServiceProviderInterface; @@ -240,6 +241,10 @@ class Di implements DiInterface if instance instanceof InjectionAwareInterface { instance->setDI(this); } + + if instance instanceof InitializationAwareInterface { + instance->initialize(); + } } /** @@ -453,7 +458,7 @@ class Di implements DiInterface * var_dump($di["request"]); *``` */ - public function offsetGet(var name) -> var + public function offsetGet(mixed name) -> mixed { return this->getShared(name); } @@ -461,7 +466,7 @@ class Di implements DiInterface /** * Check if a service is registered using the array syntax */ - public function offsetExists(var name) -> bool + public function offsetExists(mixed name) -> bool { return this->has(name); } @@ -473,7 +478,7 @@ class Di implements DiInterface * $di["request"] = new \Phalcon\Http\Request(); *``` */ - public function offsetSet(var name, var definition) -> void + public function offsetSet(mixed name, mixed definition) -> void { this->setShared(name, definition); } @@ -481,7 +486,7 @@ class Di implements DiInterface /** * Removes a service from the services container using the array syntax */ - public function offsetUnset(var name) -> void + public function offsetUnset(mixed name) -> void { this->remove(name); } diff --git a/phalcon/Di/InitializationAwareInterface.zep b/phalcon/Di/InitializationAwareInterface.zep new file mode 100644 index 00000000000..1ecc8153580 --- /dev/null +++ b/phalcon/Di/InitializationAwareInterface.zep @@ -0,0 +1,6 @@ +namespace Phalcon\Di; + +interface InitializationAwareInterface +{ + public function initialize() -> void; +} diff --git a/phalcon/Di/Injectable.zep b/phalcon/Di/Injectable.zep index 4301e05b105..1a494ee34a2 100644 --- a/phalcon/Di/Injectable.zep +++ b/phalcon/Di/Injectable.zep @@ -23,14 +23,14 @@ use Phalcon\Session\BagInterface; * @property \Phalcon\Http\Request|\Phalcon\Http\RequestInterface $request * @property \Phalcon\Http\Response|\Phalcon\Http\ResponseInterface $response * @property \Phalcon\Http\Response\Cookies|\Phalcon\Http\Response\CookiesInterface $cookies - * @property \Phalcon\Filter $filter + * @property \Phalcon\Filter\Filter $filter * @property \Phalcon\Flash\Direct $flash * @property \Phalcon\Flash\Session $flashSession * @property \Phalcon\Session\ManagerInterface $session * @property \Phalcon\Events\Manager|\Phalcon\Events\ManagerInterface $eventsManager * @property \Phalcon\Db\Adapter\AdapterInterface $db - * @property \Phalcon\Security $security - * @property \Phalcon\Crypt\Crypt|\Phalcon\Crypt\CryptInterface $crypt + * @property \Phalcon\Encryption\Security $security + * @property \Phalcon\Encryption\Crypt|\Phalcon\Encryption\Crypt\CryptInterface $crypt * @property \Phalcon\Tag $tag * @property \Phalcon\Html\Escaper|\Phalcon\Html\Escaper\EscaperInterface $escaper * @property \Phalcon\Annotations\Adapter\Memory|\Phalcon\Annotations\Adapter $annotations diff --git a/phalcon/Encryption/Crypt.zep b/phalcon/Encryption/Crypt.zep index c6c46e20454..f837d73a4be 100644 --- a/phalcon/Encryption/Crypt.zep +++ b/phalcon/Encryption/Crypt.zep @@ -432,6 +432,27 @@ class Crypt implements CryptInterface return this->key; } + /** + * Returns if the input length for decryption is valid or not + * (number of bytes required by the cipher). + * + * @param string $input + * + * @return bool + */ + public function isValidDecryptLength(string input) -> bool + { + var length; + + let length = this->phpOpensslCipherIvLength(this->cipher); + + if length === false { + return false; + } + + return length <= mb_strlen(input); + } + /** * @param string $data * @@ -967,6 +988,11 @@ class Crypt implements CryptInterface return function_exists(name); } + protected function phpOpensslCipherIvLength(string cipher) -> int|bool + { + return openssl_cipher_iv_length(cipher); + } + protected function phpOpensslRandomPseudoBytes(int length) { return openssl_random_pseudo_bytes(length); diff --git a/phalcon/Events/AbstractEventsAware.zep b/phalcon/Events/AbstractEventsAware.zep index 4b4c7c650d3..f261a8eb772 100644 --- a/phalcon/Events/AbstractEventsAware.zep +++ b/phalcon/Events/AbstractEventsAware.zep @@ -13,10 +13,7 @@ namespace Phalcon\Events; use Phalcon\Events\ManagerInterface; /** - * Trait EventsAwareTrait - * - * @package Phalcon\Events\Traits - * + * This abstract class offers access to the events manager * @property ?ManagerInterface $eventsManager */ abstract class AbstractEventsAware diff --git a/phalcon/Events/Event.zep b/phalcon/Events/Event.zep index edcb4e8c8d5..27142b0df9c 100644 --- a/phalcon/Events/Event.zep +++ b/phalcon/Events/Event.zep @@ -11,8 +11,6 @@ namespace Phalcon\Events; /** - * Phalcon\Events\Event - * * This class offers contextual information of a fired event in the * EventsManager * diff --git a/phalcon/Events/EventInterface.zep b/phalcon/Events/EventInterface.zep index c2c609868c6..d4266f8d706 100644 --- a/phalcon/Events/EventInterface.zep +++ b/phalcon/Events/EventInterface.zep @@ -11,8 +11,6 @@ namespace Phalcon\Events; /** - * Phalcon\Events\EventInterface - * * Interface for Phalcon\Events\Event class */ interface EventInterface diff --git a/phalcon/Events/EventsAwareInterface.zep b/phalcon/Events/EventsAwareInterface.zep index 0c9bf42742c..ed8e3e0bc47 100644 --- a/phalcon/Events/EventsAwareInterface.zep +++ b/phalcon/Events/EventsAwareInterface.zep @@ -11,8 +11,6 @@ namespace Phalcon\Events; /** - * Phalcon\Events\EventsAwareInterface - * * This interface must for those classes that accept an EventsManager and * dispatch events */ diff --git a/phalcon/Events/Exception.zep b/phalcon/Events/Exception.zep index 5dbf8c0847a..1bb5aff7da6 100644 --- a/phalcon/Events/Exception.zep +++ b/phalcon/Events/Exception.zep @@ -11,11 +11,8 @@ namespace Phalcon\Events; /** - * Phalcon\Events\Exception - * * Exceptions thrown in Phalcon\Events will use this class */ class Exception extends \Exception { - } diff --git a/phalcon/Events/Manager.zep b/phalcon/Events/Manager.zep index 98e185bbe79..6eba3a1d501 100644 --- a/phalcon/Events/Manager.zep +++ b/phalcon/Events/Manager.zep @@ -14,8 +14,6 @@ use Closure; use SplPriorityQueue; /** - * Phalcon\Events\Manager - * * Phalcon Events Manager, offers an easy way to intercept and manipulate, if * needed, the normal flow of operation. With the EventsManager the developer * can create hooks or plugins that will offer monitoring of data, manipulation, diff --git a/phalcon/Events/ManagerInterface.zep b/phalcon/Events/ManagerInterface.zep index 172c7e48fc0..c0bdb078dc6 100644 --- a/phalcon/Events/ManagerInterface.zep +++ b/phalcon/Events/ManagerInterface.zep @@ -11,8 +11,6 @@ namespace Phalcon\Events; /** - * Phalcon\Events\ManagerInterface - * * Interface for Phalcon\Events managers. */ interface ManagerInterface diff --git a/phalcon/Filter/Sanitize/StringVal.zep b/phalcon/Filter/Sanitize/StringVal.zep index 76320af13d6..65cd68b759e 100644 --- a/phalcon/Filter/Sanitize/StringVal.zep +++ b/phalcon/Filter/Sanitize/StringVal.zep @@ -11,8 +11,6 @@ namespace Phalcon\Filter\Sanitize; /** - * Phalcon\Filter\Sanitize\String - * * Sanitizes a value to string */ class StringVal @@ -20,10 +18,24 @@ class StringVal /** * @param mixed $input The text to sanitize * - * @return string + * @return string|false */ public function __invoke(var input) { - return filter_var(input, FILTER_SANITIZE_STRING); + /** + * Since PHP8.1, filter `FILTER_SANITIZE_STRING` is deprecated. + * + * Code below is identical replication of `filter_var(input, FILTER_SANITIZE_STRING)` + * for backward compatibility. + */ + + if typeof input === "array" { + return false; + } + + let input = str_replace(chr(0), "", (string)input); + let input = preg_replace("/<[^>]*>?/", "", input); + + return str_replace(["'", "\""], ["'", """], input); } } diff --git a/phalcon/Filter/Validation/AbstractValidator.zep b/phalcon/Filter/Validation/AbstractValidator.zep index 03e9f34fdd6..83990007af6 100644 --- a/phalcon/Filter/Validation/AbstractValidator.zep +++ b/phalcon/Filter/Validation/AbstractValidator.zep @@ -178,13 +178,13 @@ abstract class AbstractValidator implements ValidatorInterface /** * Prepares a validation code. */ - protected function prepareCode(string! field) -> int | null + protected function prepareCode(string! field) -> int { var code; - let code = this->getOption("code"); + let code = this->getOption("code", 0); - if typeof code == "array" { + if typeof code === "array" { let code = code[field]; } diff --git a/phalcon/Filter/Validation/Validator/Regex.zep b/phalcon/Filter/Validation/Validator/Regex.zep index e8261ffd73d..242a478b2ef 100644 --- a/phalcon/Filter/Validation/Validator/Regex.zep +++ b/phalcon/Filter/Validation/Validator/Regex.zep @@ -90,11 +90,14 @@ class Regex extends AbstractValidator let pattern = this->getOption("pattern"); - if typeof pattern == "array" { + if typeof pattern === "array" { let pattern = pattern[field]; } - if preg_match(pattern, value, matches) { + /** + * Since PHP8.1 $value can't be null. + */ + if value !== null && preg_match(pattern, value, matches) { let failed = matches[0] != value; } else { let failed = true; diff --git a/phalcon/Forms/Element/AbstractElement.zep b/phalcon/Forms/Element/AbstractElement.zep index 003871ec6e1..2849182025d 100644 --- a/phalcon/Forms/Element/AbstractElement.zep +++ b/phalcon/Forms/Element/AbstractElement.zep @@ -82,7 +82,7 @@ abstract class AbstractElement implements ElementInterface protected value = null; /** - * Phalcon\Forms\Element constructor + * Constructor * * @param string name Attribute name (value of 'name' attribute of HTML element) * @param array attributes Additional HTML element attributes diff --git a/phalcon/Forms/Element/Email.zep b/phalcon/Forms/Element/Email.zep index 670eb832606..36edcb76739 100644 --- a/phalcon/Forms/Element/Email.zep +++ b/phalcon/Forms/Element/Email.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag; /** - * Phalcon\Forms\Element\Email - * * Component INPUT[type=email] for forms */ class Email extends AbstractElement diff --git a/phalcon/Forms/Element/Hidden.zep b/phalcon/Forms/Element/Hidden.zep index 2418cfafdde..63793377eea 100644 --- a/phalcon/Forms/Element/Hidden.zep +++ b/phalcon/Forms/Element/Hidden.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag; /** - * Phalcon\Forms\Element\Hidden - * * Component INPUT[type=hidden] for forms */ class Hidden extends AbstractElement diff --git a/phalcon/Forms/Element/Numeric.zep b/phalcon/Forms/Element/Numeric.zep index 8998f57977a..e6873eade11 100644 --- a/phalcon/Forms/Element/Numeric.zep +++ b/phalcon/Forms/Element/Numeric.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag; /** - * Phalcon\Forms\Element\Numeric - * * Component INPUT[type=number] for forms */ class Numeric extends AbstractElement diff --git a/phalcon/Forms/Element/Password.zep b/phalcon/Forms/Element/Password.zep index a693fe838bb..ca5a4bf8a9c 100644 --- a/phalcon/Forms/Element/Password.zep +++ b/phalcon/Forms/Element/Password.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag; /** - * Phalcon\Forms\Element\Password - * * Component INPUT[type=password] for forms */ class Password extends AbstractElement diff --git a/phalcon/Forms/Element/Radio.zep b/phalcon/Forms/Element/Radio.zep index 03199d385da..199aea91ab0 100644 --- a/phalcon/Forms/Element/Radio.zep +++ b/phalcon/Forms/Element/Radio.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag; /** - * Phalcon\Forms\Element\Radio - * * Component INPUT[type=radio] for forms */ class Radio extends AbstractElement diff --git a/phalcon/Forms/Element/Select.zep b/phalcon/Forms/Element/Select.zep index 771fa8694b9..2c803cf3ff6 100644 --- a/phalcon/Forms/Element/Select.zep +++ b/phalcon/Forms/Element/Select.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Tag\Select as SelectTag; /** - * Phalcon\Forms\Element\Select - * * Component SELECT (choice) for forms */ class Select extends AbstractElement @@ -25,7 +23,7 @@ class Select extends AbstractElement protected optionsValues = null; /** - * Phalcon\Forms\Element constructor + * Constructor * * @param object|array options * @param array attributes diff --git a/phalcon/Forms/Element/Text.zep b/phalcon/Forms/Element/Text.zep index 86ee352d3b9..9257ba2a4a8 100644 --- a/phalcon/Forms/Element/Text.zep +++ b/phalcon/Forms/Element/Text.zep @@ -13,8 +13,6 @@ namespace Phalcon\Forms\Element; use Phalcon\Forms\Exception; /** - * Phalcon\Forms\Element\Text - * * Component INPUT[type=text] for forms */ class Text extends AbstractElement diff --git a/phalcon/Forms/Form.zep b/phalcon/Forms/Form.zep index 894ebfd949e..91daecf2180 100644 --- a/phalcon/Forms/Form.zep +++ b/phalcon/Forms/Form.zep @@ -319,7 +319,7 @@ class Form extends Injectable implements Countable, Iterator, AttributesInterfac /** * Returns the current element in the iterator */ - public function current() -> | bool + public function current() -> mixed { var element; diff --git a/phalcon/Html/Attributes.zep b/phalcon/Html/Attributes.zep index ed7a53bee5a..0a379abac49 100644 --- a/phalcon/Html/Attributes.zep +++ b/phalcon/Html/Attributes.zep @@ -23,7 +23,7 @@ class Attributes extends Collection implements RenderInterface */ public function render() -> string { - return $this->renderAttributes(this->toArray()); + return this->renderAttributes(this->toArray()); } /** diff --git a/phalcon/Html/Helper/AbstractHelper.zep b/phalcon/Html/Helper/AbstractHelper.zep index 53445d51828..ad56dece83c 100644 --- a/phalcon/Html/Helper/AbstractHelper.zep +++ b/phalcon/Html/Helper/AbstractHelper.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/AbstractList.zep b/phalcon/Html/Helper/AbstractList.zep index e30ac700e43..8b17fc7c74b 100644 --- a/phalcon/Html/Helper/AbstractList.zep +++ b/phalcon/Html/Helper/AbstractList.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/AbstractSeries.zep b/phalcon/Html/Helper/AbstractSeries.zep index 235bacd0f70..e204088b45d 100644 --- a/phalcon/Html/Helper/AbstractSeries.zep +++ b/phalcon/Html/Helper/AbstractSeries.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Anchor.zep b/phalcon/Html/Helper/Anchor.zep index 892a6bef00a..ab25d7335b9 100644 --- a/phalcon/Html/Helper/Anchor.zep +++ b/phalcon/Html/Helper/Anchor.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Base.zep b/phalcon/Html/Helper/Base.zep index 73a0dd9a0ba..139809e968c 100644 --- a/phalcon/Html/Helper/Base.zep +++ b/phalcon/Html/Helper/Base.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Body.zep b/phalcon/Html/Helper/Body.zep index 263afb7c270..b4191df00c3 100644 --- a/phalcon/Html/Helper/Body.zep +++ b/phalcon/Html/Helper/Body.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Button.zep b/phalcon/Html/Helper/Button.zep index 40144535093..38bdfc6b042 100644 --- a/phalcon/Html/Helper/Button.zep +++ b/phalcon/Html/Helper/Button.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Close.zep b/phalcon/Html/Helper/Close.zep index 765da4edb6c..e8a18f43818 100644 --- a/phalcon/Html/Helper/Close.zep +++ b/phalcon/Html/Helper/Close.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Element.zep b/phalcon/Html/Helper/Element.zep index 75b133916a3..070e67fa15b 100644 --- a/phalcon/Html/Helper/Element.zep +++ b/phalcon/Html/Helper/Element.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Form.zep b/phalcon/Html/Helper/Form.zep index c6fb57e37a0..55e977d162b 100644 --- a/phalcon/Html/Helper/Form.zep +++ b/phalcon/Html/Helper/Form.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Img.zep b/phalcon/Html/Helper/Img.zep index 0f5be20a12a..7ba62c2e10e 100644 --- a/phalcon/Html/Helper/Img.zep +++ b/phalcon/Html/Helper/Img.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/AbstractInput.zep b/phalcon/Html/Helper/Input/AbstractInput.zep index f43deb28a64..7c8d649fdb8 100644 --- a/phalcon/Html/Helper/Input/AbstractInput.zep +++ b/phalcon/Html/Helper/Input/AbstractInput.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Checkbox.zep b/phalcon/Html/Helper/Input/Checkbox.zep index 7dd8932bfca..e3cfd60c1ae 100644 --- a/phalcon/Html/Helper/Input/Checkbox.zep +++ b/phalcon/Html/Helper/Input/Checkbox.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Color.zep b/phalcon/Html/Helper/Input/Color.zep index 5d03e1a5c34..f5acc4616cd 100644 --- a/phalcon/Html/Helper/Input/Color.zep +++ b/phalcon/Html/Helper/Input/Color.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Date.zep b/phalcon/Html/Helper/Input/Date.zep index 202245f9dd5..503c2a88287 100644 --- a/phalcon/Html/Helper/Input/Date.zep +++ b/phalcon/Html/Helper/Input/Date.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/DateTime.zep b/phalcon/Html/Helper/Input/DateTime.zep index 484672e6bdd..ae409e6f432 100644 --- a/phalcon/Html/Helper/Input/DateTime.zep +++ b/phalcon/Html/Helper/Input/DateTime.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/DateTimeLocal.zep b/phalcon/Html/Helper/Input/DateTimeLocal.zep index 420dd3ad602..87f82b809a1 100644 --- a/phalcon/Html/Helper/Input/DateTimeLocal.zep +++ b/phalcon/Html/Helper/Input/DateTimeLocal.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Email.zep b/phalcon/Html/Helper/Input/Email.zep index de139517812..18c542e4df5 100644 --- a/phalcon/Html/Helper/Input/Email.zep +++ b/phalcon/Html/Helper/Input/Email.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/File.zep b/phalcon/Html/Helper/Input/File.zep index 540cd53a525..a61e4606b4c 100644 --- a/phalcon/Html/Helper/Input/File.zep +++ b/phalcon/Html/Helper/Input/File.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Hidden.zep b/phalcon/Html/Helper/Input/Hidden.zep index d5e6986e065..f2a775c6ff0 100644 --- a/phalcon/Html/Helper/Input/Hidden.zep +++ b/phalcon/Html/Helper/Input/Hidden.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Image.zep b/phalcon/Html/Helper/Input/Image.zep index fc038955bb8..774a761bd50 100644 --- a/phalcon/Html/Helper/Input/Image.zep +++ b/phalcon/Html/Helper/Input/Image.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Input.zep b/phalcon/Html/Helper/Input/Input.zep index e4069d376f2..de7dd901ce7 100644 --- a/phalcon/Html/Helper/Input/Input.zep +++ b/phalcon/Html/Helper/Input/Input.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Month.zep b/phalcon/Html/Helper/Input/Month.zep index 55890ed52da..7df31a187c1 100644 --- a/phalcon/Html/Helper/Input/Month.zep +++ b/phalcon/Html/Helper/Input/Month.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Numeric.zep b/phalcon/Html/Helper/Input/Numeric.zep index bd96d94a225..bd441ab08ce 100644 --- a/phalcon/Html/Helper/Input/Numeric.zep +++ b/phalcon/Html/Helper/Input/Numeric.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -15,5 +15,5 @@ namespace Phalcon\Html\Helper\Input; */ class Numeric extends AbstractInput { - protected type = "numeric"; + protected type = "number"; } diff --git a/phalcon/Html/Helper/Input/Password.zep b/phalcon/Html/Helper/Input/Password.zep index e822de49bcb..452322464c9 100644 --- a/phalcon/Html/Helper/Input/Password.zep +++ b/phalcon/Html/Helper/Input/Password.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Radio.zep b/phalcon/Html/Helper/Input/Radio.zep index cb6c12baf86..c7efbcbc9bf 100644 --- a/phalcon/Html/Helper/Input/Radio.zep +++ b/phalcon/Html/Helper/Input/Radio.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Range.zep b/phalcon/Html/Helper/Input/Range.zep index 33c63576d82..dfb5d68d3b4 100644 --- a/phalcon/Html/Helper/Input/Range.zep +++ b/phalcon/Html/Helper/Input/Range.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Search.zep b/phalcon/Html/Helper/Input/Search.zep index 4c4e911281f..15a0d0bfbe2 100644 --- a/phalcon/Html/Helper/Input/Search.zep +++ b/phalcon/Html/Helper/Input/Search.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Select.zep b/phalcon/Html/Helper/Input/Select.zep index a46a4cd7ec8..89fb95229ab 100644 --- a/phalcon/Html/Helper/Input/Select.zep +++ b/phalcon/Html/Helper/Input/Select.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Submit.zep b/phalcon/Html/Helper/Input/Submit.zep index 2a27d08828f..aed0cfaa211 100644 --- a/phalcon/Html/Helper/Input/Submit.zep +++ b/phalcon/Html/Helper/Input/Submit.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Tel.zep b/phalcon/Html/Helper/Input/Tel.zep index edfe39fd8f0..120f0c672c3 100644 --- a/phalcon/Html/Helper/Input/Tel.zep +++ b/phalcon/Html/Helper/Input/Tel.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Text.zep b/phalcon/Html/Helper/Input/Text.zep index bae19c1eeec..178ea34515a 100644 --- a/phalcon/Html/Helper/Input/Text.zep +++ b/phalcon/Html/Helper/Input/Text.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Textarea.zep b/phalcon/Html/Helper/Input/Textarea.zep index b80b89dcbf6..8adf55ec67d 100644 --- a/phalcon/Html/Helper/Input/Textarea.zep +++ b/phalcon/Html/Helper/Input/Textarea.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Time.zep b/phalcon/Html/Helper/Input/Time.zep index 2edc9bbf259..a28be7c7d80 100644 --- a/phalcon/Html/Helper/Input/Time.zep +++ b/phalcon/Html/Helper/Input/Time.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Url.zep b/phalcon/Html/Helper/Input/Url.zep index a3fbed3bd30..aa678bf0c7c 100644 --- a/phalcon/Html/Helper/Input/Url.zep +++ b/phalcon/Html/Helper/Input/Url.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Input/Week.zep b/phalcon/Html/Helper/Input/Week.zep index 0c545e11ffa..e370af696f6 100644 --- a/phalcon/Html/Helper/Input/Week.zep +++ b/phalcon/Html/Helper/Input/Week.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Label.zep b/phalcon/Html/Helper/Label.zep index c51314a9206..e3286b3e618 100644 --- a/phalcon/Html/Helper/Label.zep +++ b/phalcon/Html/Helper/Label.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Meta.zep b/phalcon/Html/Helper/Meta.zep index 77a49a6c7b9..c17427dd701 100644 --- a/phalcon/Html/Helper/Meta.zep +++ b/phalcon/Html/Helper/Meta.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Ol.zep b/phalcon/Html/Helper/Ol.zep index 828bddaf119..b29b160cf07 100644 --- a/phalcon/Html/Helper/Ol.zep +++ b/phalcon/Html/Helper/Ol.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Script.zep b/phalcon/Html/Helper/Script.zep index b70bd225ff4..0dded9316ce 100644 --- a/phalcon/Html/Helper/Script.zep +++ b/phalcon/Html/Helper/Script.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Style.zep b/phalcon/Html/Helper/Style.zep index c99f6e45016..cbf35169585 100644 --- a/phalcon/Html/Helper/Style.zep +++ b/phalcon/Html/Helper/Style.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Title.zep b/phalcon/Html/Helper/Title.zep index 79066f0729f..7826daab759 100644 --- a/phalcon/Html/Helper/Title.zep +++ b/phalcon/Html/Helper/Title.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Helper/Ul.zep b/phalcon/Html/Helper/Ul.zep index d4389814125..02a5c5a3798 100644 --- a/phalcon/Html/Helper/Ul.zep +++ b/phalcon/Html/Helper/Ul.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Html/Link/AbstractLink.zep b/phalcon/Html/Link/AbstractLink.zep new file mode 100644 index 00000000000..1e7d99aa586 --- /dev/null +++ b/phalcon/Html/Link/AbstractLink.zep @@ -0,0 +1,217 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link; + +use Phalcon\Support\Collection; + +/** + * @property array $attributes + * @property string $href + * @property array $rels + * @property bool $templated + */ +abstract class AbstractLink +{ + /** + * @var Collection + */ + protected attributes; + + /** + * @var string + */ + protected href = ""; + + /** + * @var Collection + */ + protected rels; + + /** + * @var bool + */ + protected templated = false; + + /** + * Link constructor. + * + * @param string $rel + * @param string $href + * @param array $attributes + */ + public function __construct( + string rel = "", + string href = "", + array attributes = [] + ) { + let this->attributes = new Collection(attributes), + this->rels = new Collection(), + this->href = href, + this->templated = this->hrefIsTemplated(href); + + if (true !== empty(rel)) { + this->rels->set(rel, true); + } + } + + /** + * Returns a list of attributes that describe the target URI. + * + * @return array + * A key-value list of attributes, where the key is a string and the value + * is either a PHP primitive or an array of PHP strings. If no values are + * found an empty array MUST be returned. + */ + protected function doGetAttributes() -> array + { + return this->attributes->toArray(); + } + + /** + * Returns the target of the link. + * + * The target link must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative link + * is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * + * If a URI template is returned, isTemplated() MUST return True. + * + * @return string + */ + protected function doGetHref() -> string + { + return this->href; + } + + /** + * Returns the relationship type(s) of the link. + * + * This method returns 0 or more relationship types for a link, expressed + * as an array of strings. + * + * @return string[] + */ + protected function doGetRels() -> array + { + return this->rels->getKeys(false); + } + + /** + * Returns whether this is a templated link. + * + * @return bool + * True if this link object is templated, False otherwise. + */ + protected function doIsTemplated() -> bool + { + return this->templated; + } + + /** + * Determines if a href is a templated link or not. + * + * @see https://tools.ietf.org/html/rfc6570 + * + * @param string $href + * + * @return bool + */ + protected function hrefIsTemplated(string href) -> bool + { + return ( + false !== mb_strpos(href, "{") && + false !== mb_strpos(href, "}") + ); + } + /** + * @param string $key + * @param mixed $value + * + * @return mixed + */ + protected function doWithAttribute(string key, var value) + { + var newInstance; + + let newInstance = clone this; + + newInstance->attributes->set(key, value); + + return newInstance; + } + + /** + * @param string $href + * + * @return mixed + */ + protected function doWithHref(string href) + { + var newInstance; + + let newInstance = clone this; + + let newInstance->href = href, + newInstance->templated = this->hrefIsTemplated(href); + + return newInstance; + } + + /** + * @param string $key + * + * @return mixed + */ + protected function doWithRel(string key) + { + var newInstance; + + let newInstance = clone this; + + newInstance->rels->set(key, true); + + return newInstance; + } + + /** + * @param string $key + * + * @return mixed + */ + protected function doWithoutAttribute(string key) + { + var newInstance; + + let newInstance = clone this; + + newInstance->attributes->remove(key); + + return newInstance; + } + + /** + * @param string $key + * + * @return mixed + */ + protected function doWithoutRel(string key) + { + var newInstance; + + let newInstance = clone this; + + newInstance->rels->remove(key); + + return newInstance; + } +} diff --git a/phalcon/Html/Link/AbstractLinkProvider.zep b/phalcon/Html/Link/AbstractLinkProvider.zep new file mode 100644 index 00000000000..275973b208e --- /dev/null +++ b/phalcon/Html/Link/AbstractLinkProvider.zep @@ -0,0 +1,141 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link; + +use Phalcon\Html\Link\Interfaces\LinkInterface; + +/** + * @property array $links + */ +abstract class AbstractLinkProvider +{ + /** + * @var array + */ + protected links = []; + + /** + * LinkProvider constructor. + * + * @param array $links + */ + public function __construct(array links = []) + { + var link; + + for link in links { + if ( + true === is_a(link, "Phalcon\\Html\\Link\\Interfaces\\LinkInterface") || + true === is_a(link, "Psr\\Link\\LinkInterface") + ) { + let this->links[this->getKey(link)] = link; + } + } + } + + /** + * Returns an iterable of LinkInterface objects. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * are available, an empty array or \Traversable MUST be returned. + * + * @return array + */ + protected function doGetLinks() -> array + { + return this->links; + } + + /** + * Returns an iterable of LinkInterface objects that have a specific + * relationship. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * with that relationship are available, an empty array or \Traversable + * MUST be returned. + * + * @return array + */ + protected function doGetLinksByRel(string rel) -> array + { + var link, rels; + array filtered; + + let filtered = []; + for link in this->links { + let rels = link->getRels(); + if (true === in_array(rel, rels)) { + let filtered[] = link; + } + } + + return filtered; + } + + /** + * Returns an instance with the specified link included. + * + * If the specified link is already present, this method MUST return + * normally without errors. The link is present if $link is === identical + * to a link object already in the collection. + * + * @param mixed $link A link object that should be included in this + * collection. + * + * @return $this + */ + protected function doWithLink(link) + { + var key, newInstance; + + let key = this->getKey(link), + newInstance = clone this; + + let newInstance->links[key] = link; + + return newInstance; + } + + /** + * Returns an instance with the specified link removed. + * + * If the specified link is not present, this method MUST return normally + * without errors. The link is present if $link is === identical to a link + * object already in the collection. + * + * @param mixed $link The link to remove. + * + * @return $this + */ + protected function doWithoutLink(link) + { + var key, newInstance; + + let key = this->getKey(link), + newInstance = clone this; + + unset(newInstance->links[key]); + + return newInstance; + } + + /** + * Returns the object hash key + * + * @param mixed link + * + * @return string + */ + protected function getKey(link) -> string + { + return spl_object_hash(link); + } +} diff --git a/phalcon/Html/Link/EvolvableLink.zep b/phalcon/Html/Link/EvolvableLink.zep index ac231e08862..57788705b72 100644 --- a/phalcon/Html/Link/EvolvableLink.zep +++ b/phalcon/Html/Link/EvolvableLink.zep @@ -10,7 +10,7 @@ namespace Phalcon\Html\Link; -use Psr\Link\EvolvableLinkInterface; +use Phalcon\Html\Link\Interfaces\EvolvableLinkInterface; /** * Class Phalcon\Http\Link\EvolvableLink @@ -28,20 +28,12 @@ class EvolvableLink extends Link implements EvolvableLinkInterface * If the specified attribute is already present, it will be overwritten * with the new value. * - * @param string attribute The attribute to include. - * @param string value The value of the attribute to set. - * - * @return static + * @param string $attribute The attribute to include. + * @param string $value The value of the attribute to set. */ - public function withAttribute(var attribute, var value) + public function withAttribute(var attribute, var value) -> { - var newInstance; - - let newInstance = clone this; - - newInstance->attributes->set(attribute, value); - - return newInstance; + return this->doWithAttribute(attribute, value); } /** @@ -59,17 +51,11 @@ class EvolvableLink extends Link implements EvolvableLinkInterface * An implementing library SHOULD evaluate a passed object to a string * immediately rather than waiting for it to be returned later. * - * @return static + * @param string $rel The relationship value to add. */ - public function withHref(var href) + public function withHref(string href) -> { - var newInstance; - - let newInstance = clone this, - newInstance->href = href, - newInstance->templated = this->hrefIsTemplated(href); - - return newInstance; + return this->doWithHref(href); } /** @@ -78,20 +64,11 @@ class EvolvableLink extends Link implements EvolvableLinkInterface * If the specified rel is already present, this method MUST return * normally without errors, but without adding the rel a second time. * - * @param string rel - * The relationship value to add. - * - * @return static + * @param string $rel The relationship value to add. */ - public function withRel(var rel) + public function withRel(string rel) -> { - var newInstance; - - let newInstance = clone this; - - newInstance->rels->set(rel, true); - - return newInstance; + return this->doWithRel(rel); } /** @@ -100,20 +77,11 @@ class EvolvableLink extends Link implements EvolvableLinkInterface * If the specified attribute is not present, this method MUST return * normally without errors. * - * @param string attribute - * The attribute to remove. - * - * @return static + * @param string $attribute The attribute to remove. */ - public function withoutAttribute(var attribute) + public function withoutAttribute(string attribute) -> { - var newInstance; - - let newInstance = clone this; - - newInstance->attributes->remove(attribute); - - return newInstance; + return this->doWithoutAttribute(attribute); } /** @@ -122,19 +90,10 @@ class EvolvableLink extends Link implements EvolvableLinkInterface * If the specified rel is not present, this method MUST return * normally without errors. * - * @param string rel - * The relationship value to exclude. - * - * @return static + * @param string $rel The relationship value to exclude. */ - public function withoutRel(var rel) + public function withoutRel(string rel) -> { - var newInstance; - - let newInstance = clone this; - - newInstance->rels->remove(rel); - - return newInstance; + return this->doWithoutRel(rel); } } diff --git a/phalcon/Html/Link/EvolvableLinkProvider.zep b/phalcon/Html/Link/EvolvableLinkProvider.zep index 81add25dbf0..a9a97700f74 100644 --- a/phalcon/Html/Link/EvolvableLinkProvider.zep +++ b/phalcon/Html/Link/EvolvableLinkProvider.zep @@ -10,8 +10,8 @@ namespace Phalcon\Html\Link; -use Psr\Link\EvolvableLinkProviderInterface; -use Psr\Link\LinkInterface; +use Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface; +use Phalcon\Html\Link\Interfaces\LinkInterface; /** * Class Phalcon\Http\Link\LinkProvider @@ -32,16 +32,9 @@ class EvolvableLinkProvider extends LinkProvider implements EvolvableLinkProvide * * @return static */ - public function withLink( link) + public function withLink( link) -> { - var key, newInstance; - - let key = this->getKey(link), - newInstance = clone this; - - let newInstance->links[key] = link; - - return newInstance; + return this->doWithLink(link); } /** @@ -56,18 +49,8 @@ class EvolvableLinkProvider extends LinkProvider implements EvolvableLinkProvide * * @return static */ - public function withoutLink( link) + public function withoutLink( link) -> { - var key, links, newInstance; - - let key = this->getKey(link), - newInstance = clone this, - links = this->links; - - unset links[key]; - - let newInstance->links = links; - - return newInstance; + return this->doWithoutLink(link); } } diff --git a/phalcon/Html/Link/Interfaces/EvolvableLinkInterface.zep b/phalcon/Html/Link/Interfaces/EvolvableLinkInterface.zep new file mode 100644 index 00000000000..78fb874a2bf --- /dev/null +++ b/phalcon/Html/Link/Interfaces/EvolvableLinkInterface.zep @@ -0,0 +1,76 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link\Interfaces; + +/** + * An evolvable link value object. + */ +interface EvolvableLinkInterface extends LinkInterface +{ + /** + * Returns an instance with the specified href. + * + * @param string $href + * The href value to include. It must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative + * link is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * - An object implementing __toString() that produces one of the + * above values. + * + * An implementing library SHOULD evaluate a passed object to a string + * immediately rather than waiting for it to be returned later. + */ + public function withHref(string href) -> ; + + /** + * Returns an instance with the specified relationship included. + * + * If the specified rel is already present, this method MUST return + * normally without errors, but without adding the rel a second time. + * + * @param string $rel The relationship value to add. + */ + public function withRel(string rel) -> ; + + /** + * Returns an instance with the specified relationship excluded. + * + * If the specified rel is already not present, this method MUST return + * normally without errors. + * + * @param string $rel The relationship value to exclude. + */ + public function withoutRel(string rel) -> ; + + /** + * Returns an instance with the specified attribute added. + * + * If the specified attribute is already present, it will be overwritten + * with the new value. + * + * @param string $attribute The attribute to include. + * @param string $value The value of the attribute to set. + */ + public function withAttribute(string attribute, string value) -> ; + + + /** + * Returns an instance with the specified attribute excluded. + * + * If the specified attribute is not present, this method MUST return + * normally without errors. + * + * @param string $attribute The attribute to remove. + */ + public function withoutAttribute(string attribute) -> ; +} diff --git a/phalcon/Html/Link/Interfaces/EvolvableLinkProviderInterface.zep b/phalcon/Html/Link/Interfaces/EvolvableLinkProviderInterface.zep new file mode 100644 index 00000000000..a59beb6f757 --- /dev/null +++ b/phalcon/Html/Link/Interfaces/EvolvableLinkProviderInterface.zep @@ -0,0 +1,39 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link\Interfaces; + +/** + * An evolvable link provider value object. + */ +interface EvolvableLinkProviderInterface extends LinkProviderInterface +{ + /** + * Returns an instance with the specified link included. + * + * If the specified link is already present, this method MUST return + * normally without errors. The link is present if $link is === identical + * to a link object already in the collection. + * + * @param LinkInterface $link A link object that should be included in this collection. + */ + public function withLink( link) -> ; + + /** + * Returns an instance with the specifed link removed. + * + * If the specified link is not present, this method MUST return normally + * without errors. The link is present if $link is === identical to a link + * object already in the collection. + * + * @param LinkInterface $link The link to remove. + */ + public function withoutLink( link) -> ; +} diff --git a/phalcon/Html/Link/Interfaces/LinkInterface.zep b/phalcon/Html/Link/Interfaces/LinkInterface.zep new file mode 100644 index 00000000000..9edf8b0840e --- /dev/null +++ b/phalcon/Html/Link/Interfaces/LinkInterface.zep @@ -0,0 +1,60 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link\Interfaces; + +/** + * A readable link object. + */ +interface LinkInterface +{ + /** + * Returns a list of attributes that describe the target URI. + * + * @return array + * A key-value list of attributes, where the key is a string and the value + * is either a PHP primitive or an array of PHP strings. If no values are + * found an empty array MUST be returned. + */ + public function getAttributes() -> array; + + /** + * Returns the target of the link. + * + * The target link must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative link + * is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * + * If a URI template is returned, isTemplated() MUST return True. + * + * @return string + */ + public function getHref() -> string; + + /** + * Returns the relationship type(s) of the link. + * + * This method returns 0 or more relationship types for a link, expressed + * as an array of strings. + * + * @return string[] + */ + public function getRels() -> array; + + /** + * Returns whether this is a templated link. + * + * @return bool + * True if this link object is templated, False otherwise. + */ + public function isTemplated() -> bool; +} diff --git a/phalcon/Html/Link/Interfaces/LinkProviderInterface.zep b/phalcon/Html/Link/Interfaces/LinkProviderInterface.zep new file mode 100644 index 00000000000..107c8038e9b --- /dev/null +++ b/phalcon/Html/Link/Interfaces/LinkProviderInterface.zep @@ -0,0 +1,28 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Html\Link\Interfaces; + +/** + * A link provider object. + */ +interface LinkProviderInterface +{ + /** + * Returns an array of LinkInterface objects. + */ + public function getLinks() -> array; + + /** + * Returns an array of LinkInterface objects that have a specific + * relationship. + */ + public function getLinksByRel(string rel) -> array; +} diff --git a/phalcon/Html/Link/Link.zep b/phalcon/Html/Link/Link.zep index cb2f497e79b..5cedb8239bd 100644 --- a/phalcon/Html/Link/Link.zep +++ b/phalcon/Html/Link/Link.zep @@ -12,7 +12,7 @@ namespace Phalcon\Html\Link; use Phalcon\Support\Collection; use Phalcon\Support\Collection\CollectionInterface; -use Psr\Link\LinkInterface; +use Phalcon\Html\Link\Interfaces\LinkInterface; /** * Class Phalcon\Http\Link\Link @@ -22,49 +22,8 @@ use Psr\Link\LinkInterface; * @property array rels * @property bool templated */ -class Link implements LinkInterface +class Link extends AbstractLink implements LinkInterface { - /** - * @var Collection|CollectionInterface - */ - protected attributes; - - /** - * @var string - */ - protected href = ""; - - /** - * @var Collection|CollectionInterface - */ - protected rels; - - /** - * @var bool - */ - protected templated = false; - - /** - * Link constructor. - * - * @param string rel - * @param string href - */ - public function __construct( - string rel = "", - string href = "", - array attributes = [] - ) { - let this->rels = new Collection(), - this->attributes = new Collection(attributes), - this->href = href, - this->templated = this->hrefIsTemplated(href); - - if !empty rel { - this->rels->set(rel, true); - } - } - /** * Returns a list of attributes that describe the target URI. * @@ -73,9 +32,9 @@ class Link implements LinkInterface * is either a PHP primitive or an array of PHP strings. If no values are * found an empty array MUST be returned. */ - public function getAttributes() + public function getAttributes() -> array { - return this->attributes->toArray(); + return this->doGetAttributes(); } /** @@ -91,9 +50,9 @@ class Link implements LinkInterface * * @return string */ - public function getHref() + public function getHref() -> string { - return this->href; + return this->doGetHref(); } /** @@ -104,9 +63,9 @@ class Link implements LinkInterface * * @return string[] */ - public function getRels() + public function getRels() -> array { - return this->rels->getKeys(false); + return this->doGetRels(); } /** @@ -114,25 +73,8 @@ class Link implements LinkInterface * * @return bool True if this link object is templated, False otherwise. */ - public function isTemplated() - { - return this->templated; - } - - /** - * Determines if a href is a templated link or not. - * - * @see https://tools.ietf.org/html/rfc6570 - * - * @param string href - * - * @return bool - */ - protected function hrefIsTemplated(string href) -> bool + public function isTemplated() -> bool { - return ( - false !== strpos(href, "{") && - false !== strrpos(href, "}") - ); + return this->doIsTemplated(); } } diff --git a/phalcon/Html/Link/LinkProvider.zep b/phalcon/Html/Link/LinkProvider.zep index 584b5a3e600..d0797a00305 100644 --- a/phalcon/Html/Link/LinkProvider.zep +++ b/phalcon/Html/Link/LinkProvider.zep @@ -10,46 +10,23 @@ namespace Phalcon\Html\Link; -use Psr\Link\LinkInterface; -use Psr\Link\LinkProviderInterface; +use Phalcon\Html\Link\Interfaces\LinkInterface; +use Phalcon\Html\Link\Interfaces\LinkProviderInterface; /** * @property LinkInterface[] links */ -class LinkProvider implements LinkProviderInterface +class LinkProvider extends AbstractLinkProvider implements LinkProviderInterface { - /** - * @var LinkInterface[] - */ - protected links = []; - - /** - * LinkProvider constructor. - * - * @param array links - */ - public function __construct(array links = []) - { - var link; - - for link in links { - if link instanceof LinkInterface { - let this->links[this->getKey(link)] = link; - } - } - } - /** * Returns an iterable of LinkInterface objects. * * The iterable may be an array or any PHP \Traversable object. If no links * are available, an empty array or \Traversable MUST be returned. - * - * @return LinkInterface[]|\Traversable */ - public function getLinks() + public function getLinks() -> array { - return this->links; + return this->doGetLinks(); } /** @@ -59,33 +36,9 @@ class LinkProvider implements LinkProviderInterface * The iterable may be an array or any PHP \Traversable object. If no links * with that relationship are available, an empty array or \Traversable * MUST be returned. - * - * @return LinkInterface[]|\Traversable - */ - public function getLinksByRel(var rel) - { - var link, links, rels; - - let links = []; - for link in this->links { - let rels = link->getRels(); - if true === in_array(rel, rels) { - let links[] = link; - } - } - - return links; - } - - /** - * Returns the object hash key - * - * @param LinkInterface link - * - * @return string */ - protected function getKey( link) -> string + public function getLinksByRel(var rel) -> array { - return spl_object_hash(link); + return this->doGetLinksByRel(rel); } } diff --git a/phalcon/Html/Link/Serializer/Header.zep b/phalcon/Html/Link/Serializer/Header.zep index 9cb1a611fd4..cffd2d254b3 100644 --- a/phalcon/Html/Link/Serializer/Header.zep +++ b/phalcon/Html/Link/Serializer/Header.zep @@ -10,8 +10,6 @@ namespace Phalcon\Html\Link\Serializer; -use Psr\Link\EvolvableLinkInterface; - /** * Class Phalcon\Http\Link\Serializer\Header */ diff --git a/phalcon/Http/Message/AbstractCommon.zep b/phalcon/Http/Message/AbstractCommon.zep deleted file mode 100644 index 4d43ef0c51a..00000000000 --- a/phalcon/Http/Message/AbstractCommon.zep +++ /dev/null @@ -1,71 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; - -/** - * Common methods - */ -abstract class AbstractCommon -{ - /** - * Returns a new instance having set the parameter - * - * @param mixed $element - * @param string $property - * - * @return static - */ - final protected function cloneInstance(var element, string property) -> var - { - var newInstance; - - let newInstance = clone this, - newInstance->{property} = element; - - return newInstance; - } - - /** - * Checks the element passed if it is a string - * - * @param mixed $element - */ - final protected function checkStringParameter(element) -> void - { - if typeof element !== "string" { - throw new InvalidArgumentException( - "Method requires a string argument" - ); - } - } - - /** - * Checks the element passed; assigns it to the property and returns a - * clone of the object back - * - * @param mixed $element - * @param string $property - * - * @return static - */ - final protected function processWith(var element, string property) -> var - { - this->checkStringParameter(element); - - return this->cloneInstance(element, property); - } -} diff --git a/phalcon/Http/Message/AbstractMessage.zep b/phalcon/Http/Message/AbstractMessage.zep deleted file mode 100644 index 5793596d047..00000000000 --- a/phalcon/Http/Message/AbstractMessage.zep +++ /dev/null @@ -1,545 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Support\Collection; -use Phalcon\Support\Collection\CollectionInterface; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UriInterface; - -/** - * Message methods - */ -abstract class AbstractMessage extends AbstractCommon -{ - /** - * Gets the body of the message. - * - * @var StreamInterface - */ - protected body { get }; - - /** - * @var Collection|CollectionInterface - */ - protected headers; - - /** - * Retrieves the HTTP protocol version as a string. - * - * The string MUST contain only the HTTP version number (e.g., '1.1', - * '1.0'). - * - * @return string HTTP protocol version. - * - * @var string - */ - protected protocolVersion = "1.1" { get }; - - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @var UriInterface - */ - protected uri { get }; - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name - * - * @return array - */ - public function getHeader(var name) -> array - { - let name = (string) name; - - return this->headers->get(name, []); - } - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name - * - * @return string - */ - public function getHeaderLine(var name) -> string - { - var header; - - let header = this->getHeader(name); - - return implode(',', header); - } - - /** - * Retrieves all message header values. - * - * The keys represent the header name as it will be sent over the wire, and - * each value is an array of strings associated with the header. - * - * // Represent the headers as a string - * foreach ($message->getHeaders() as $name => $values) { - * echo $name . ': ' . implode(', ', $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->getHeaders() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * While header names are not case-sensitive, getHeaders() will preserve the - * exact case in which headers were originally specified. - * - * @return array - */ - public function getHeaders() -> array - { - return this->headers->toArray(); - } - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name - * - * @return bool - */ - public function hasHeader(name) -> bool - { - return this->headers->has(name); - } - - /** - * Return an instance with the specified header appended with the given - * value. - * - * Existing values for the specified header will be maintained. The new - * value(s) will be appended to the existing list. If the header did not - * exist previously, it will be added. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new header and/or value. - * - * @param string $name - * @param string|string[] $value - * - * @return static - */ - public function withAddedHeader(var name, var value) -> var - { - var existing, headers; - - this->checkHeaderName(name); - - let headers = clone this->headers, - existing = headers->get(name, []), - value = this->getHeaderValue(value), - value = array_merge(existing, value); - - headers->set(name, value); - - return this->cloneInstance(headers, "headers"); - } - - /** - * Return an instance with the specified message body. - * - * The body MUST be a StreamInterface object. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return a new instance that has the - * new body stream. - * - * @param StreamInterface $body - * - * @return static - * @throws InvalidArgumentException When the body is not valid. - * - */ - public function withBody( body) -> var - { - var newBody; - - let newBody = this->processBody(body, "w+b"); - - return this->cloneInstance(newBody, "body"); - } - - /** - * Return an instance with the provided value replacing the specified - * header. - * - * While header names are case-insensitive, the casing of the header will - * be preserved by this function, and returned from getHeaders(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name - * @param string|string[] $value - * - * @return static - * @throws InvalidArgumentException for invalid header names or values. - * - */ - public function withHeader(var name, var value) -> var - { - var headers; - - this->checkHeaderName(name); - - let headers = clone this->headers, - value = this->getHeaderValue(value); - - headers->set(name, value); - - return this->cloneInstance(headers, "headers"); - } - - /** - * Return an instance with the specified HTTP protocol version. - * - * The version string MUST contain only the HTTP version number (e.g., - * '1.1', '1.0'). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new protocol version. - * - * @param string $version - * - * @return static - */ - public function withProtocolVersion(var version) -> var - { - this->processProtocol(version); - - return this->cloneInstance(version, "protocolVersion"); - } - - /** - * Return an instance without the specified header. - * - * Header resolution MUST be done without case-sensitivity. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the named header. - * - * @param string $name - * - * @return static - */ - public function withoutHeader(var name) -> var - { - var headers; - - let headers = clone this->headers; - - headers->remove(name); - - return this->cloneInstance(headers, "headers"); - } - - /** - * Ensure Host is the first header. - * - * @see: http://tools.ietf.org/html/rfc7230#section-5.4 - * - * @param CollectionInterface $collection - * - * @return CollectionInterface - */ - final protected function checkHeaderHost( collection) -> - { - var data, host, hostArray; - array header; - - if unlikely (collection->has("host") && - !empty(this->uri) && - "" !== this->uri->getHost()) { - - let host = this->getUriHost(this->uri), - hostArray = host; - if unlikely typeof host !== "array" { - let hostArray = [host]; - } - - collection->remove("host"); - - let data = collection->toArray(), - header = [], - header["Host"] = hostArray, - header = header + (array) data; - - collection->clear(); - collection->init(header); - } - - return collection; - } - - /** - * Check the name of the header. Throw exception if not valid - * - * @see http://tools.ietf.org/html/rfc7230#section-3.2 - */ - final protected function checkHeaderName(var name) -> void - { - if unlikely (typeof name !== "string" || - !preg_match("/^[a-zA-Z0-9'`#$%&*+.^_|~!-]+$/", name)) { - throw new InvalidArgumentException( - "Invalid header name " . name - ); - } - } - - /** - * Validates a header value - * - * Most HTTP header field values are defined using common syntax - * components (token, quoted-string, and comment) separated by - * whitespace or specific delimiting characters. Delimiters are chosen - * from the set of US-ASCII visual characters not allowed in a token - * (DQUOTE and '(),/:;<=>?@[\]{}'). - * - * token = 1*tchar - * - * tchar = '!' / '#' / '$' / '%' / '&' / ''' / '*' - * / '+' / '-' / '.' / '^' / '_' / '`' / '|' / '~' - * / DIGIT / ALPHA - * ; any VCHAR, except delimiters - * - * A string of text is parsed as a single value if it is quoted using - * double-quote marks. - * - * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE - * qdtext = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text - * obs-text = %x80-FF - * - * Comments can be included in some HTTP header fields by surrounding - * the comment text with parentheses. Comments are only allowed in - * fields containing 'comment' as part of their field value definition. - * - * comment = '(' *( ctext / quoted-pair / comment ) ')' - * ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text - * - * The backslash octet ('\') can be used as a single-octet quoting - * mechanism within quoted-string and comment constructs. Recipients - * that process the value of a quoted-string MUST handle a quoted-pair - * as if it were replaced by the octet following the backslash. - * - * quoted-pair = '\' ( HTAB / SP / VCHAR / obs-text ) - * - * A sender SHOULD NOT generate a quoted-pair in a quoted-string except - * where necessary to quote DQUOTE and backslash octets occurring within - * that string. A sender SHOULD NOT generate a quoted-pair in a comment - * except where necessary to quote parentheses ['(' and ')'] and - * backslash octets occurring within that comment. - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 - */ - final protected function checkHeaderValue(var value) -> void - { - if unlikely (typeof value !== "string" && true !== is_numeric(value)) { - throw new InvalidArgumentException("Invalid header value"); - } - - let value = (string) value; - - if unlikely (preg_match("#(?:(?:(? array - { - var value, valueArray, valueData; - - let valueArray = values; - if unlikely typeof values !== "array" { - let valueArray = [values]; - } - - if unlikely empty(valueArray) { - throw new InvalidArgumentException( - "Invalid header value: must be a string or " . - "array of strings; cannot be an empty array" - ); - } - - let valueData = []; - for value in valueArray { - this->checkHeaderValue(value); - - let valueData[] = (string) value; - } - - return valueData; - } - - /** - * Return the host and if applicable the port - * - * @param UriInterface $uri - * - * @return string - */ - final protected function getUriHost( uri) -> string - { - var host; - - let host = uri->getHost(); - - if unlikely null !== uri->getPort() { - let host .= ":" . uri->getPort(); - } - - return host; - } - - /** - * Populates the header collection - * - * @param array $headers - * - * @return CollectionInterface - */ - final protected function populateHeaderCollection(array headers) -> - { - var collection, name, value; - - let collection = new Collection(); - for name, value in headers { - this->checkHeaderName(name); - - let name = (string) name, - value = this->getHeaderValue(value); - - collection->set(name, value); - } - - return collection; - } - - /** - * Set a valid stream - * - * @param StreamInterface|resource|string $body - * @param string $mode - * - * @return StreamInterface - */ - final protected function processBody(var body = "php://memory", string! mode = "r+b") -> - { - if unlikely (typeof body === "object" && body instanceof StreamInterface) { - return body; - } - - if unlikely (typeof body !== "string" && typeof body !== "resource") { - throw new InvalidArgumentException( - "Invalid stream passed as a parameter" - ); - } - - return new Stream(body, mode); - } - - /** - * Sets the headers - */ - final protected function processHeaders(var headers) -> - { - var collection; - - if likely typeof headers === "array" { - let collection = this->populateHeaderCollection(headers); - let collection = this->checkHeaderHost(collection); - } else { - if unlikely !(typeof headers === "object" && headers instanceof CollectionInterface) { - throw new InvalidArgumentException( - "Headers needs to be either an array or instance of Phalcon\\Support\\Collection" - ); - } - - let collection = headers; - } - - return collection; - } - - /** - * Checks the protocol - * - * @param string $protocol - * - * @return string - */ - final protected function processProtocol(var protocol = "") -> string - { - var protocols; - - let protocols = [ - "1.0" : 1, - "1.1" : 1, - "2.0" : 1, - "3.0" : 1 - ]; - - if unlikely (empty(protocol) || typeof protocol !== "string") { - throw new InvalidArgumentException("Invalid protocol value"); - } - - if unlikely !isset protocols[protocol] { - throw new InvalidArgumentException( - "Unsupported protocol " . protocol - ); - } - - return protocol; - } -} diff --git a/phalcon/Http/Message/AbstractRequest.zep b/phalcon/Http/Message/AbstractRequest.zep deleted file mode 100644 index 3bf9f831111..00000000000 --- a/phalcon/Http/Message/AbstractRequest.zep +++ /dev/null @@ -1,247 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the - * LICENSE.txt file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\UriInterface; - -/** - * Request methods - */ -abstract class AbstractRequest extends AbstractMessage implements RequestMethodInterface -{ - /** - * Retrieves the HTTP method of the request. - * - * @var string - */ - protected method = self::METHOD_GET { get }; - - /** - * The request-target, if it has been provided or calculated. - * - * @var null|string - */ - protected requestTarget; - - /** - * Retrieves the URI instance. - * - * This method MUST return a UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @var UriInterface - */ - protected uri { get }; - - /** - * Retrieves the message's request target. - * - * Retrieves the message's request-target either as it will appear (for - * clients), as it appeared at request (for servers), or as it was - * specified for the instance (see withRequestTarget()). - * - * In most cases, this will be the origin-form of the composed URI, unless a - * value was provided to the concrete implementation (see - * withRequestTarget() below). - * - * @return string - */ - public function getRequestTarget() -> string - { - var requestTarget; - - let requestTarget = this->requestTarget; - - if unlikely null === requestTarget { - let requestTarget = this->uri->getPath(); - - if unlikely !empty(this->uri->getQuery()) { - let requestTarget .= "?" . this->uri->getQuery(); - } - - if unlikely empty(requestTarget) { - let requestTarget = "/"; - } - } - - return requestTarget; - } - - /** - * Return an instance with the provided HTTP method. - * - * While HTTP method names are typically all uppercase characters, HTTP - * method names are case-sensitive and thus implementations SHOULD NOT - * modify the given string. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request method. - * - * @param string $method - * - * @return static - * @throws InvalidArgumentException for invalid HTTP methods. - */ - public function withMethod(var method) -> var - { - this->processMethod(method); - - return this->cloneInstance(method, "method"); - } - - /** - * Return an instance with the specific request-target. - * - * If the request needs a non-origin-form request-target — e.g., for - * specifying an absolute-form, authority-form, or asterisk-form — - * this method may be used to create an instance with the specified - * request-target, verbatim. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * changed request target. - * - * @see http://tools.ietf.org/html/rfc7230#section-5.3 (for the various - * request-target forms allowed in request messages) - * - * @param mixed $requestTarget - * - * @return static - */ - public function withRequestTarget(var requestTarget) -> var - { - if unlikely preg_match("/\s/", requestTarget) { - throw new InvalidArgumentException( - "Invalid request target: cannot contain whitespace" - ); - } - - return this->cloneInstance(requestTarget, "requestTarget"); - } - - /** - * Returns an instance with the provided URI. - * - * This method MUST update the Host header of the returned request by - * default if the URI contains a host component. If the URI does not - * contain a host component, any pre-existing Host header MUST be carried - * over to the returned request. - * - * You can opt-in to preserving the original state of the Host header by - * setting `$preserveHost` to `true`. When `$preserveHost` is set to - * `true`, this method interacts with the Host header in the following - * ways: - * - * - If the Host header is missing or empty, and the new URI contains - * a host component, this method MUST update the Host header in the - * returned request. - * - If the Host header is missing or empty, and the new URI does not - * contain a host component, this method MUST NOT update the Host header in - * the returned request. - * - If a Host header is present and non-empty, this method MUST NOT update - * the Host header in the returned request. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new UriInterface instance. - * - * @see http://tools.ietf.org/html/rfc3986#section-4.3 - * - * @param UriInterface $uri - * @param bool $preserveHost - * - * @return static - */ - public function withUri( uri, var preserveHost = false) -> var - { - var headers, newInstance; - - let preserveHost = (bool) preserveHost, - headers = clone this->headers, - newInstance = this->cloneInstance(uri, "uri"); - - if unlikely !preserveHost { - let headers = this->checkHeaderHost(headers); - - let newInstance->headers = headers; - } - - return newInstance; - } - - /** - * Check the method - * - * @param string $method - * - * @return string - */ - final protected function processMethod(method = "") -> string - { - var methods; - - let methods = [ - self::METHOD_CONNECT : 1, - self::METHOD_DELETE : 1, - self::METHOD_GET : 1, - self::METHOD_HEAD : 1, - self::METHOD_OPTIONS : 1, - self::METHOD_PATCH : 1, - self::METHOD_POST : 1, - self::METHOD_PURGE : 1, - self::METHOD_PUT : 1, - self::METHOD_TRACE : 1 - ]; - - if unlikely !(!empty(method) && - typeof method === "string" && - isset methods[method]) { - throw new InvalidArgumentException( - "Invalid or unsupported method " . method - ); - } - - return method; - } - - /** - * Sets a valid Uri - * - * @param UriInterface|string|null $uri - * - * @return UriInterface - */ - final protected function processUri(var uri) -> - { - if unlikely (typeof uri === "object" && uri instanceof UriInterface) { - return uri; - } - - if likely typeof uri === "string" { - return new Uri(uri); - } - - if null === uri { - return new Uri(); - } - - throw new InvalidArgumentException( - "Invalid uri passed as a parameter" - ); - } -} diff --git a/phalcon/Http/Message/Request.zep b/phalcon/Http/Message/Request.zep deleted file mode 100644 index 0713c85cda0..00000000000 --- a/phalcon/Http/Message/Request.zep +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Stream\Input; -use Phalcon\Http\Message\AbstractRequest; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UriInterface; - -/** - * PSR-7 Request - */ -final class Request extends AbstractRequest implements RequestInterface -{ - /** - * Request constructor. - * - * @param string $method - * @param UriInterface|string|null $uri - * @param StreamInterface|resource|string $body - * @param array $headers - */ - public function __construct( - string method = self::METHOD_GET, - var uri = null, - var body = "php://memory", - var headers = [] - ) { - if unlikely "php://input" === body { - let body = new Input(); - } - - let this->uri = this->processUri(uri), - this->headers = this->processHeaders(headers), - this->method = this->processMethod(method), - this->body = this->processBody(body, "w+b"); - } -} diff --git a/phalcon/Http/Message/RequestFactory.zep b/phalcon/Http/Message/RequestFactory.zep deleted file mode 100644 index 04d9ea2f891..00000000000 --- a/phalcon/Http/Message/RequestFactory.zep +++ /dev/null @@ -1,38 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\RequestFactoryInterface; -use Psr\Http\Message\UriInterface; - -/** - * PSR-17 RequestFactory - */ -final class RequestFactory implements RequestFactoryInterface -{ - /** - * Create a new request. - * - * @param string $method - * @param UriInterface|string|null $uri - * - * @return RequestInterface - */ - public function createRequest(string! method, var uri) -> - { - return new Request(method, uri); - } -} diff --git a/phalcon/Http/Message/Response.zep b/phalcon/Http/Message/Response.zep deleted file mode 100644 index bfba95189f8..00000000000 --- a/phalcon/Http/Message/Response.zep +++ /dev/null @@ -1,271 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\AbstractMessage; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\ResponseInterface; - -/** - * PSR-7 Response - */ -final class Response extends AbstractMessage implements ResponseInterface, ResponseStatusCodeInterface -{ - /** - * Gets the response reason phrase associated with the status code. - * - * Because a reason phrase is not a required element in a response - * status line, the reason phrase value MAY be empty. Implementations MAY - * choose to return the default RFC 7231 recommended reason phrase (or - * those - * listed in the IANA HTTP Status Code Registry) for the response's - * status code. - * - * @see http://tools.ietf.org/html/rfc7231#section-6 - * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * - * @var string - */ - protected reasonPhrase = "" { get }; - - /** - * Gets the response status code. - * - * The status code is a 3-digit integer result code of the server's attempt - * to understand and satisfy the request. - * - * @var int - */ - protected statusCode = 200 { get }; - - /** - * Response constructor. - * - * @param string $body - * @param int $code - * @param array $headers - */ - public function __construct(var body = "php://memory", int code = 200, array headers = []) - { - this->processCode(code); - - let this->headers = this->processHeaders(headers), - this->body = this->processBody(body, "w+b"); - } - - /** - * Return an instance with the specified status code and, optionally, - * reason phrase. - * - * If no reason phrase is specified, implementations MAY choose to default - * to the RFC 7231 or IANA recommended reason phrase for the response's - * status code. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated status and reason phrase. - * - * @see http://tools.ietf.org/html/rfc7231#section-6 - * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml - * - * @param int $code - * @param string $reasonPhrase - * - * @return Response - */ - public function withStatus(var code, var reasonPhrase = "") -> - { - var newInstance; - - let newInstance = clone this; - - newInstance->processCode(code, reasonPhrase); - - return newInstance; - } - - /** - * Returns the list of status codes available - */ - protected function getPhrases() -> array - { - return [ - // Informational 1xx - self::STATUS_CONTINUE : "Continue", // Information - RFC 7231, 6.2.1 - self::STATUS_SWITCHING_PROTOCOLS : "Switching Protocols", // Information - RFC 7231, 6.2.2 - self::STATUS_PROCESSING : "Processing", // Information - RFC 2518, 10.1 - self::STATUS_EARLY_HINTS : "Early Hints", - - // Successful 2xx - self::STATUS_OK : "OK", // Success - RFC 7231, 6.3.1 - self::STATUS_CREATED : "Created", // Success - RFC 7231, 6.3.2 - self::STATUS_ACCEPTED : "Accepted", // Success - RFC 7231, 6.3.3 - self::STATUS_NON_AUTHORITATIVE_INFORMATION : "Non-Authoritative Information", // Success - RFC 7231, 6.3.4 - self::STATUS_NO_CONTENT : "No Content", // Success - RFC 7231, 6.3.5 - self::STATUS_RESET_CONTENT : "Reset Content", // Success - RFC 7231, 6.3.6 - self::STATUS_PARTIAL_CONTENT : "Partial Content", // Success - RFC 7233, 4.1 - self::STATUS_MULTI_STATUS : "Multi-status", // Success - RFC 4918, 11.1 - self::STATUS_ALREADY_REPORTED : "Already Reported", // Success - RFC 5842, 7.1 - self::STATUS_IM_USED : "IM Used", // Success - RFC 3229, 10.4.1 - - // Redirection 3xx - self::STATUS_MULTIPLE_CHOICES : "Multiple Choices", // Redirection - RFC 7231, 6.4.1 - self::STATUS_MOVED_PERMANENTLY : "Moved Permanently", // Redirection - RFC 7231, 6.4.2 - self::STATUS_FOUND : "Found", // Redirection - RFC 7231, 6.4.3 - self::STATUS_SEE_OTHER : "See Other", // Redirection - RFC 7231, 6.4.4 - self::STATUS_NOT_MODIFIED : "Not Modified", // Redirection - RFC 7232, 4.1 - self::STATUS_USE_PROXY : "Use Proxy", // Redirection - RFC 7231, 6.4.5 - self::STATUS_RESERVED : "Switch Proxy", // Redirection - RFC 7231, 6.4.6 (Deprecated) - self::STATUS_TEMPORARY_REDIRECT : "Temporary Redirect", // Redirection - RFC 7231, 6.4.7 - self::STATUS_PERMANENT_REDIRECT : "Permanent Redirect", // Redirection - RFC 7538, 3 - - // Client Errors 4xx - self::STATUS_BAD_REQUEST : "Bad Request", // Client Error - RFC 7231, 6.5.1 - self::STATUS_UNAUTHORIZED : "Unauthorized", // Client Error - RFC 7235, 3.1 - self::STATUS_PAYMENT_REQUIRED : "Payment Required", // Client Error - RFC 7231, 6.5.2 - self::STATUS_FORBIDDEN : "Forbidden", // Client Error - RFC 7231, 6.5.3 - self::STATUS_NOT_FOUND : "Not Found", // Client Error - RFC 7231, 6.5.4 - self::STATUS_METHOD_NOT_ALLOWED : "Method Not Allowed", // Client Error - RFC 7231, 6.5.5 - self::STATUS_NOT_ACCEPTABLE : "Not Acceptable", // Client Error - RFC 7231, 6.5.6 - self::STATUS_PROXY_AUTHENTICATION_REQUIRED : "Proxy Authentication Required", // Client Error - RFC 7235, 3.2 - self::STATUS_REQUEST_TIMEOUT : "Request Time-out", // Client Error - RFC 7231, 6.5.7 - self::STATUS_CONFLICT : "Conflict", // Client Error - RFC 7231, 6.5.8 - self::STATUS_GONE : "Gone", // Client Error - RFC 7231, 6.5.9 - self::STATUS_LENGTH_REQUIRED : "Length Required", // Client Error - RFC 7231, 6.5.10 - self::STATUS_PRECONDITION_FAILED : "Precondition Failed", // Client Error - RFC 7232, 4.2 - self::STATUS_PAYLOAD_TOO_LARGE : "Request Entity Too Large", // Client Error - RFC 7231, 6.5.11 - self::STATUS_URI_TOO_LONG : "Request-URI Too Large", // Client Error - RFC 7231, 6.5.12 - self::STATUS_UNSUPPORTED_MEDIA_TYPE : "Unsupported Media Type", // Client Error - RFC 7231, 6.5.13 - self::STATUS_RANGE_NOT_SATISFIABLE : "Requested range not satisfiable", // Client Error - RFC 7233, 4.4 - self::STATUS_EXPECTATION_FAILED : "Expectation Failed", // Client Error - RFC 7231, 6.5.14 - self::STATUS_IM_A_TEAPOT : "I'm a teapot", // Client Error - RFC 7168, 2.3.3 - self::STATUS_MISDIRECTED_REQUEST : "Misdirected Request", - self::STATUS_UNPROCESSABLE_ENTITY : "Unprocessable Entity", // Client Error - RFC 4918, 11.2 - self::STATUS_LOCKED : "Locked", // Client Error - RFC 4918, 11.3 - self::STATUS_FAILED_DEPENDENCY : "Failed Dependency", // Client Error - RFC 4918, 11.4 - self::STATUS_TOO_EARLY : "Unordered Collection", - self::STATUS_UPGRADE_REQUIRED : "Upgrade Required", // Client Error - RFC 7231, 6.5.15 - self::STATUS_PRECONDITION_REQUIRED : "Precondition Required", // Client Error - RFC 6585, 3 - self::STATUS_TOO_MANY_REQUESTS : "Too Many Requests", // Client Error - RFC 6585, 4 - self::STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE : "Request Header Fields Too Large", // Client Error - RFC 6585, 5 - self::STATUS_UNAVAILABLE_FOR_LEGAL_REASONS : "Unavailable For Legal Reasons", // Client Error - RFC 7725, 3 - - // Server Errors 5xx - self::STATUS_INTERNAL_SERVER_ERROR : "Internal Server Error", // Server Error - RFC 7231, 6.6.1 - self::STATUS_NOT_IMPLEMENTED : "Not Implemented", // Server Error - RFC 7231, 6.6.2 - self::STATUS_BAD_GATEWAY : "Bad Gateway", // Server Error - RFC 7231, 6.6.3 - self::STATUS_SERVICE_UNAVAILABLE : "Service Unavailable", // Server Error - RFC 7231, 6.6.4 - self::STATUS_GATEWAY_TIMEOUT : "Gateway Time-out", // Server Error - RFC 7231, 6.6.5 - self::STATUS_VERSION_NOT_SUPPORTED : "HTTP Version not supported", // Server Error - RFC 7231, 6.6.6 - self::STATUS_VARIANT_ALSO_NEGOTIATES : "Variant Also Negotiates", // Server Error - RFC 2295, 8.1 - self::STATUS_INSUFFICIENT_STORAGE : "Insufficient Storage", // Server Error - RFC 4918, 11.5 - self::STATUS_LOOP_DETECTED : "Loop Detected", // Server Error - RFC 5842, 7.2 - self::STATUS_NOT_EXTENDED : "Not Extended", // Server Error - RFC 2774, 7 - self::STATUS_NETWORK_AUTHENTICATION_REQUIRED : "Network Authentication Required", // Server Error - RFC 6585, 6 - - // Unofficial - self::STATUS_THIS_IS_FINE : "This is fine", // Unofficial - Apache Web Server - self::STATUS_PAGE_EXPIRED : "Page Expired", // Unofficial - Laravel Framework - self::STATUS_METHOD_FAILURE : "Method Failure", // Unofficial - Spring Framework - self::STATUS_LOGIN_TIMEOUT : "Login Time-out", // Unofficial - IIS - self::STATUS_NO_RESPONSE : "No Response", // Unofficial - nginx - self::STATUS_RETRY_WITH : "Retry With", // Unofficial - IIS - self::STATUS_BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS : "Blocked by Windows Parental Controls (Microsoft)", // Unofficial - nginx - self::STATUS_REQUEST_HEADER_TOO_LARGE : "Request header too large", // Unofficial - nginx - self::STATUS_SSL_CERTIFICATE_ERROR : "SSL Certificate Error", // Unofficial - nginx - self::STATUS_SSL_CERTIFICATE_REQUIRED : "SSL Certificate Required", // Unofficial - nginx - self::STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT : "HTTP Request Sent to HTTPS Port", // Unofficial - nginx - self::STATUS_INVALID_TOKEN_ESRI : "Invalid Token (Esri)", // Unofficial - ESRI - self::STATUS_CLIENT_CLOSED_REQUEST : "Client Closed Request", // Unofficial - nginx - self::STATUS_BANDWIDTH_LIMIT_EXCEEDED : "Bandwidth Limit Exceeded", // Unofficial - Apache/cPanel - self::STATUS_UNKNOWN_ERROR : "Unknown Error", // Unofficial - Cloudflare - self::STATUS_WEB_SERVER_IS_DOWN : "Web Server Is Down", // Unofficial - Cloudflare - self::STATUS_CONNECTION_TIMEOUT : "Connection Timed Out", // Unofficial - Cloudflare - self::STATUS_ORIGIN_IS_UNREACHABLE : "Origin Is Unreachable", // Unofficial - Cloudflare - self::STATUS_TIMEOUT_OCCURRED : "A Timeout Occurred", // Unofficial - Cloudflare - self::STATUS_SSL_HANDSHAKE_FAILED : "SSL Handshake Failed", // Unofficial - Cloudflare - self::STATUS_INVALID_SSL_CERTIFICATE : "Invalid SSL Certificate", // Unofficial - Cloudflare - self::STATUS_RAILGUN_ERROR : "Railgun Error", // Unofficial - Cloudflare - self::STATUS_ORIGIN_DNS_ERROR : "Origin DNS Error", // Unofficial - Cloudflare - self::STATUS_NETWORK_READ_TIMEOUT_ERROR : "Network read timeout error", // Unofficial - self::STATUS_NETWORK_CONNECT_TIMEOUT_ERROR : "Network Connect Timeout Error" // Unofficial - ]; - } - - /** - * Set a valid status code and phrase - * - * @param mixed $code - * @param mixed $phrase - */ - protected function processCode(var code, var phrase = "") -> void - { - var phrases; - - let phrases = this->getPhrases(); - - this->checkCodeType(code); - - let code = (int) code; - this->checkCodeValue(code); - - if unlikely typeof phrase !== "string" { - throw new InvalidArgumentException("Invalid response reason"); - } - - if likely "" === phrase && isset phrases[code] { - let phrase = phrases[code]; - } - - let this->statusCode = code, - this->reasonPhrase = phrase; - } - - /** - * Checks if a code is integer or string - * - * @param mixed $code - */ - private function checkCodeType(var code) -> void - { - if unlikely (typeof code !== "int" && typeof code !== "string") { - throw new InvalidArgumentException( - "Invalid status code; it must be an integer or string" - ); - } - } - - /** - * Checks if a code is integer or string - * - * @param int $code - */ - private function checkCodeValue(int code) -> void - { - if (true !== this->isBetween(code, 100, 599)) { - throw new InvalidArgumentException( - "Invalid status code '" . code . "', (allowed values 100-599)" - ); - } - } - - /** - * @todo Remove this when we get traits - */ - private function isBetween(int value, int from, int to) -> bool - { - return value >= from && value <= to; - } -} diff --git a/phalcon/Http/Message/ResponseFactory.zep b/phalcon/Http/Message/ResponseFactory.zep deleted file mode 100644 index a7e8370ca84..00000000000 --- a/phalcon/Http/Message/ResponseFactory.zep +++ /dev/null @@ -1,40 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ResponseFactoryInterface; - -/** - * PSR-17 ResponseFactory - */ -final class ResponseFactory implements ResponseFactoryInterface -{ - /** - * Create a new response. - * - * @param int $code The HTTP status code. Defaults to 200. - * @param string $reasonPhrase The reason phrase to associate with the status - * code in the generated response. If none is - * provided, implementations MAY use the defaults - * as suggested in the HTTP specification. - * - * @return ResponseInterface - */ - public function createResponse(int code = 200, string reasonPhrase = "") -> - { - return (new Response())->withStatus(code, reasonPhrase); - } -} diff --git a/phalcon/Http/Message/ServerRequest.zep b/phalcon/Http/Message/ServerRequest.zep deleted file mode 100644 index c617e7446ae..00000000000 --- a/phalcon/Http/Message/ServerRequest.zep +++ /dev/null @@ -1,355 +0,0 @@ - -/** -* This file is part of the Phalcon Framework. -* -* (c) Phalcon Team -* -* For the full copyright and license information, please view the LICENSE.txt -* file that was distributed with this source code. -* -* Implementation of this file has been influenced by Zend Diactoros -* @link https://github.com/zendframework/zend-diactoros -* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md -*/ - -namespace Phalcon\Http\Message; - -use Phalcon\Support\Collection; -use Phalcon\Support\Collection\CollectionInterface; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Stream\Input; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UploadedFileInterface; -use Psr\Http\Message\UriInterface; - -/** - * PSR-7 ServerRequest - */ -final class ServerRequest extends AbstractRequest implements ServerRequestInterface -{ - /** - * @var Collection|CollectionInterface - */ - protected attributes; - - /** - * Retrieve cookies. - * - * Retrieves cookies sent by the client to the server. - * - * The data MUST be compatible with the structure of the $_COOKIE - * superglobal. - * - * @var array - */ - protected cookieParams = [] { get }; - - /** - * Retrieve any parameters provided in the request body. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, this method MUST - * return the contents of $_POST. - * - * Otherwise, this method may return any results of deserializing - * the request body content; as parsing returns structured content, the - * potential types MUST be arrays or objects only. A null value indicates - * the absence of body content. - * - * @var mixed - */ - protected parsedBody { get }; - - /** - * Retrieve query string arguments. - * - * Retrieves the deserialized query string arguments, if any. - * - * Note: the query params might not be in sync with the URI or server - * params. If you need to ensure you are only getting the original - * values, you may need to parse the query string from - * `getUri()->getQuery()` or from the `QUERY_STRING` server param. - * - * @var array - */ - protected queryParams = [] { get }; - - /** - * Retrieve server parameters. - * - * Retrieves data related to the incoming request environment, - * typically derived from PHP's $_SERVER superglobal. The data IS NOT - * REQUIRED to originate from $_SERVER. - * - * @var array - */ - protected serverParams = [] { get }; - - /** - * Retrieve normalized file upload data. - * - * This method returns upload metadata in a normalized tree, with each leaf - * an instance of Psr\Http\Message\UploadedFileInterface. - * - * These values MAY be prepared from $_FILES or the message body during - * instantiation, or MAY be injected via withUploadedFiles(). - * - * @var array - */ - protected uploadedFiles = [] { get }; - - /** - * ServerRequest constructor. - * - * @param string $method - * @param UriInterface|string|null $uri - * @param array $serverParams - * @param StreamInterface|string $body - * @param array $headers - * @param array $cookies - * @param array $queryParams - * @param array $uploadFiles - * @param null|array|object $parsedBody - * @param string $protocol - */ - public function __construct( - string method = self::METHOD_GET, - var uri = null, - array serverParams = [], - var body = "php://input", - var headers = [], - array cookies = [], - array queryParams = [], - array uploadFiles = [], - var parsedBody = null, - string protocol = "1.1" - ) { - if unlikely "php://input" === body { - let body = new Input(); - } - - this->checkUploadedFiles(uploadFiles); - - let this->protocolVersion = this->processProtocol(protocol), - this->method = this->processMethod(method), - this->headers = this->processHeaders(headers), - this->uri = this->processUri(uri), - this->body = this->processBody(body, "w+b"), - this->uploadedFiles = uploadFiles, - this->parsedBody = parsedBody, - this->serverParams = serverParams, - this->cookieParams = cookies, - this->queryParams = queryParams, - this->attributes = new Collection(); - } - - /** - * Retrieve a single derived request attribute. - * - * Retrieves a single derived request attribute as described in - * getAttributes(). If the attribute has not been previously set, returns - * the default value as provided. - * - * This method obviates the need for a hasAttribute() method, as it allows - * specifying a default value to return if the attribute is not found. - * - * @param string $name - * @param mixed|null $defaultValue - * - * @return mixed - */ - public function getAttribute(var name, var defaultValue = null) -> var - { - return this->attributes->get(name, defaultValue); - } - - /** - * Retrieve attributes derived from the request. - * - * The request 'attributes' may be used to allow injection of any - * parameters derived from the request: e.g., the results of path - * match operations; the results of decrypting cookies; the results of - * deserializing non-form-encoded message bodies; etc. Attributes - * will be application and request specific, and CAN be mutable. - * - * @return array - */ - public function getAttributes() -> array - { - return this->attributes->toArray(); - } - - /** - * Return an instance with the specified derived request attribute. - * - * This method allows setting a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated attribute. - * - * @param string $name - * @param mixed $value - * - * @return ServerRequest - */ - public function withAttribute(name, value) -> - { - var attributes; - - let attributes = clone this->attributes; - - attributes->set(name, value); - - return this->cloneInstance(attributes, "attributes"); - } - - /** - * Return an instance with the specified cookies. - * - * The data IS NOT REQUIRED to come from the $_COOKIE superglobal, but MUST - * be compatible with the structure of $_COOKIE. Typically, this data will - * be injected at instantiation. - * - * This method MUST NOT update the related Cookie header of the request - * instance, nor related values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated cookie values. - * - * @param array $cookies - * - * @return ServerRequest - */ - public function withCookieParams(array cookies) -> - { - return this->cloneInstance(cookies, "cookieParams"); - } - - /** - * Return an instance with the specified body parameters. - * - * These MAY be injected during instantiation. - * - * If the request Content-Type is either application/x-www-form-urlencoded - * or multipart/form-data, and the request method is POST, use this method - * ONLY to inject the contents of $_POST. - * - * The data IS NOT REQUIRED to come from $_POST, but MUST be the results of - * deserializing the request body content. Deserialization/parsing returns - * structured data, and, as such, this method ONLY accepts arrays or - * objects, or a null value if nothing was available to parse. - * - * As an example, if content negotiation determines that the request data - * is a JSON payload, this method could be used to create a request - * instance with the deserialized parameters. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array|object|null $data - * - * @return ServerRequest - * @throws InvalidArgumentException if an unsupported argument type is provided. - * - */ - public function withParsedBody(data) -> - { - return this->cloneInstance(data, "parsedBody"); - } - - /** - * Return an instance with the specified query string arguments. - * - * These values SHOULD remain immutable over the course of the incoming - * request. They MAY be injected during instantiation, such as from PHP's - * $_GET superglobal, or MAY be derived from some other value such as the - * URI. In cases where the arguments are parsed from the URI, the data - * MUST be compatible with what PHP's parse_str() would return for - * purposes of how duplicate query parameters are handled, and how nested - * sets are handled. - * - * Setting query string arguments MUST NOT change the URI stored by the - * request, nor the values in the server params. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated query string arguments. - * - * @param array $query - * - * @return ServerRequest - */ - public function withQueryParams(array query) -> - { - return this->cloneInstance(query, "queryParams"); - } - - /** - * Create a new instance with the specified uploaded files. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * updated body parameters. - * - * @param array $uploadedFiles - * - * @return ServerRequest - * @throws InvalidArgumentException if an invalid structure is provided. - * - */ - public function withUploadedFiles(array uploadedFiles) -> - { - this->checkUploadedFiles(uploadedFiles); - - return this->cloneInstance(uploadedFiles, "uploadedFiles"); - } - - /** - * Return an instance that removes the specified derived request attribute. - * - * This method allows removing a single derived request attribute as - * described in getAttributes(). - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that removes - * the attribute. - * - * @param string $name - * - * @return ServerRequest - */ - public function withoutAttribute(name) -> - { - var attributes; - - let attributes = clone this->attributes; - attributes->remove(name); - - return this->cloneInstance(attributes, "attributes"); - } - - /** - * Checks the uploaded files - * - * @param array $files - */ - private function checkUploadedFiles(array files) -> void - { - var file; - - for file in files { - if unlikely typeof file === "array" { - this->checkUploadedFiles(file); - } else { - if unlikely !(typeof file === "object" && file instanceof UploadedFileInterface) { - throw new InvalidArgumentException("Invalid uploaded file"); - } - } - } - } -} diff --git a/phalcon/Http/Message/ServerRequestFactory.zep b/phalcon/Http/Message/ServerRequestFactory.zep deleted file mode 100644 index f850a0a0f3f..00000000000 --- a/phalcon/Http/Message/ServerRequestFactory.zep +++ /dev/null @@ -1,612 +0,0 @@ - -/** -* This file is part of the Phalcon Framework. -* -* (c) Phalcon Team -* -* For the full copyright and license information, please view the LICENSE.txt -* file that was distributed with this source code. -* -* Implementation of this file has been influenced by Zend Diactoros -* @link https://github.com/zendframework/zend-diactoros -* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md -*/ - -namespace Phalcon\Http\Message; - -use Phalcon\Support\Collection; -use Phalcon\Support\Collection\CollectionInterface; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\ServerRequestFactoryInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\UriInterface; -use Psr\Http\Message\UploadedFileInterface; - -/** - * PSR-17 ServerRequestFactory - */ -class ServerRequestFactory implements ServerRequestFactoryInterface, RequestMethodInterface -{ - /** - * Create a new server request. - * - * Note that server-params are taken precisely as given - no - * parsing/processing of the given values is performed, and, in particular, - * no attempt is made to determine the HTTP method or URI, which must be - * provided explicitly. - * - * @param string $method The HTTP method associated with - * the request. - * @param UriInterface|string $uri The URI associated with the - * request. If the value is a - * string, the factory MUST create - * a UriInterface instance based - * on it. - * @param array $serverParams Array of SAPI parameters with - * which to seed the generated - * request instance. - * - * @return ServerRequestInterface - */ - public function createServerRequest( - string method, - var uri, - array serverParams = [] - ) -> { - - return new ServerRequest(method, uri, serverParams); - } - - /** - * Create a request from the supplied superglobal values. - * - * If any argument is not supplied, the corresponding superglobal value will - * be used. - * - * @param array $server $_SERVER superglobal - * @param array $get $_GET superglobal - * @param array $post $_POST superglobal - * @param array $cookies $_COOKIE superglobal - * @param array $files $_FILES superglobal - * - * @return ServerRequest - * @see fromServer() - */ - public function load( - array server = null, - array get = null, - array post = null, - array cookies = null, - array files = null - ) -> { - var cookiesCollection, filesCollection, headers, method, protocol, - serverCollection; - array globalCookies = [], globalFiles = [], globalGet = [], - globalPost = [], globalServer = []; - - /** - * Ensure that superglobals are defined if not - */ - if !empty _COOKIE { - let globalCookies = _COOKIE; - } - - if !empty _FILES { - let globalFiles = _FILES; - } - - if !empty _GET { - let globalGet = _GET; - } - - if !empty _POST { - let globalPost = _POST; - } - - if !empty _SERVER { - let globalServer = _SERVER; - } - - let server = this->checkNullArray(server, globalServer), - files = this->checkNullArray(files, globalFiles), - cookies = this->checkNullArray(cookies, globalCookies), - get = this->checkNullArray(get, globalGet), - post = this->checkNullArray(post, globalPost), - serverCollection = this->parseServer(server), - method = serverCollection->get("REQUEST_METHOD", self::METHOD_GET), - protocol = this->parseProtocol(serverCollection), - headers = this->parseHeaders(serverCollection), - filesCollection = this->parseUploadedFiles(files), - cookiesCollection = cookies; - - if unlikely (empty(cookies) && headers->has("cookie")) { - let cookiesCollection = this->parseCookieHeader(headers->get("cookie")); - } - - return new ServerRequest( - method, - this->parseUri(serverCollection, headers), - serverCollection->toArray(), - "php://input", - headers->toArray(), - cookiesCollection, - get, - filesCollection->toArray(), - post, - protocol - ); - } - - /** - * Returns the apache_request_headers if it exists - * - * @return array|false - */ - protected function getHeaders() - { - if likely function_exists("apache_request_headers") { - return apache_request_headers(); - } - - return false; - } - - /** - * Calculates the host and port from the headers or the server superglobal - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return array - */ - private function calculateUriHost( server, headers) -> array - { - var host, port; - array defaults; - - let defaults = ["", null]; - - if unlikely this->getHeader(headers, "host", false) { - let host = this->getHeader(headers, "host"); - return this->calculateUriHostFromHeader(host); - } - - if unlikely !server->has("SERVER_NAME") { - return defaults; - } - - let host = server->get("SERVER_NAME"), - port = server->get("SERVER_PORT", null); - - return [host, port]; - } - - /** - * Get the host and calculate the port if present from the header - * - * @param string $host - * - * @return array - */ - private function calculateUriHostFromHeader(string host) -> array - { - var matches, port; - - let port = null; - - // works for regname, IPv4 & IPv6 - if unlikely preg_match("|:(\d+)$|", host, matches) { - let host = substr(host, 0, -1 * (strlen(matches[1]) + 1)), - port = (int) matches[1]; - } - - return [host, port]; - } - - /** - * Get the path from the request from IIS7/Rewrite, REQUEST_URL or - * ORIG_PATH_INFO - * - * @param CollectionInterface $server - * - * @return string - */ - private function calculateUriPath( server) -> string - { - var iisRewrite, origPathInfo, requestUri, unencodedUrl; - /** - * IIS7 with URL Rewrite - double slash - */ - let iisRewrite = server->get("IIS_WasUrlRewritten", null), - unencodedUrl = server->get("UNENCODED_URL", ""); - - if unlikely ("1" === iisRewrite && !empty(unencodedUrl)) { - return unencodedUrl; - } - - /** - * REQUEST_URI - */ - let requestUri = server->get("REQUEST_URI", null); - - if unlikely null !== requestUri { - return preg_replace("#^[^/:]+://[^/]+#", "", requestUri); - } - - /** - * ORIG_PATH_INFO - */ - let origPathInfo = server->get("ORIG_PATH_INFO", null); - if unlikely empty(origPathInfo) { - return "/"; - } - - return origPathInfo; - } - - /** - * Get the query string from the server array - * - * @param CollectionInterface $server - * - * @return string - */ - private function calculateUriQuery( server) -> string - { - return ltrim(server->get("QUERY_STRING", ""), "?"); - } - - /** - * Calculates the scheme from the server variables - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return string - */ - private function calculateUriScheme( server, headers) -> string - { - var header, isHttps; - string scheme; - - // URI scheme - let scheme = "https", - isHttps = true; - if likely server->has("HTTPS") { - let isHttps = (string) server->get("HTTPS", "on"), - isHttps = "off" !== strtolower(isHttps); - } - - let header = this->getHeader(headers, "x-forwarded-proto", "https"); - if unlikely (!isHttps || "https" !== header) { - let scheme = "http"; - } - - return scheme; - } - - /** - * Checks the source if it null and returns the super, otherwise the source - * array - */ - private function checkNullArray(var source, array super) -> array - { - if unlikely empty source { - return super; - } - - return source; - } - - /** - * Create an UploadedFile object from an $_FILES array element - * - * @param array $file The $_FILES element - * - * @return UploadedFile - * - * @throws InvalidArgumentException If one of the elements is missing - */ - private function createUploadedFile(array file) -> - { - var name, type; - - if unlikely (!isset file["tmp_name"] || !isset file["size"] || !isset file["error"]) { - throw new InvalidArgumentException( - "The file array must contain tmp_name, size and error; " . - "one or more are missing" - ); - } - - let name = isset file["name"] ? file["name"] : null, - type = isset file["type"] ? file["type"] : null; - - return new UploadedFile( - file["tmp_name"], - file["size"], - file["error"], - name, - type - ); - } - - /** - * Returns a header - * - * @param CollectionInterface $headers - * @param string $name - * @param mixed|null $defaultValue - * - * @return mixed|string - */ - private function getHeader( headers, string name, var defaultValue = null) -> var - { - var value; - - let value = headers->get(name, defaultValue); - - if typeof value === "array" { - let value = implode(",", value); - } - - return value; - } - - /** - * Parse a cookie header according to RFC 6265. - * - * @param string $cookieHeader A string cookie header value. - * - * @return array key/value cookie pairs. - * - */ - private function parseCookieHeader(string cookieHeader) -> array - { - var cookies; - - let cookies = []; - parse_str( - strtr( - cookieHeader, - [ - "&" : "%26", - "+" : "%2B", - ";" : "&" - ] - ), - cookies - ); - - return cookies; - } - - /** - * Processes headers from SAPI - * - * @param CollectionInterface $server - * - * @return CollectionInterface - */ - private function parseHeaders( server) -> - { - var headers, key, name, serverArray, value; - - /** - * @todo Figure out why server is not iterable - */ - let headers = new Collection(), - serverArray = server->toArray(); - - for key, value in serverArray { - if likely "" !== value { - /** - * Apache prefixes environment variables with REDIRECT_ - * if they are added by rewrite rules - */ - if unlikely strpos(key, "REDIRECT_") === 0 { - let key = substr(key, 9); - /** - * We will not overwrite existing variables with the - * prefixed versions, though - */ - if unlikely (true === server->has(key)) { - continue; - } - } - - if likely strpos(key, "HTTP_") === 0 { - let name = str_replace( - "_", - "-", - strtolower(substr(key, 5)) - ); - - headers->set(name, value); - continue; - } - - if unlikely strpos(key, "CONTENT_") === 0 { - let name = "content-" . strtolower(substr(key, 8)); - - headers->set(name, value); - continue; - } - } - } - - return headers; - } - - /** - * Parse the $_SERVER array amd check the server protocol. Raise an - * - * @param CollectionInterface $server The server variables - * - * @return string - */ - private function parseProtocol( server) -> string - { - var localProtocol, protocol, protocols; - - if true !== server->has("SERVER_PROTOCOL") { - return "1.1"; - } - - let protocol = (string) server->get("SERVER_PROTOCOL", "HTTP/1.1"), - localProtocol = strtolower(protocol), - protocols = [ - "1.0" : 1, - "1.1" : 1, - "2.0" : 1, - "3.0" : 1 - ]; - - if substr(localProtocol, 0, 5) !== "http/" { - throw new InvalidArgumentException( - "Incorrect protocol value " . protocol - ); - } - - let localProtocol = str_replace("http/", "", localProtocol); - - if unlikely !isset protocols[localProtocol] { - throw new InvalidArgumentException( - "Unsupported protocol " . protocol - ); - } - - return localProtocol; - } - - /** - * Parse the $_SERVER array amd return it back after looking for the - * authorization header - * - * @param array $server Either verbatim, or with an added - * HTTP_AUTHORIZATION header. - * - * @return CollectionInterface - */ - private function parseServer(array server) -> - { - var collection, headers, headersCollection; - - let collection = new Collection(server), - headers = this->getHeaders(); - - if unlikely (!collection->has("HTTP_AUTHORIZATION") && false !== headers) { - let headersCollection = new Collection(headers); - - if likely headersCollection->has("Authorization") { - collection->set( - "HTTP_AUTHORIZATION", - headersCollection->get("Authorization") - ); - } - } - - return collection; - } - - /** - * Traverses a $_FILES and creates UploadedFile objects from it. It is used - * recursively - * - * @param array $files - * - * @return CollectionInterface - */ - private function parseUploadedFiles(array files) -> - { - var collection, data, key, file; - - let collection = new Collection(); - - /** - * Loop through the files and check them recursively - */ - for key, file in files { - let key = (string) key; - - /** - * UriInterface - */ - if unlikely (typeof file === "object" && file instanceof UploadedFileInterface) { - collection->set(key, file); - continue; - } - - /** - * file is array with 'tmp_name' - */ - if likely (typeof file === "array" && isset file["tmp_name"]) { - collection->set(key, this->createUploadedFile(file)); - continue; - } - - /** - * file is array of elements - recursion - */ - if unlikely typeof file === "array" { - let data = this->parseUploadedFiles(file); - - collection->set(key, data->toArray()); - continue; - } - } - - return collection; - } - - /** - * Calculates the Uri from the server superglobal or the headers - * - * @param CollectionInterface $server - * @param CollectionInterface $headers - * - * @return Uri - */ - private function parseUri( server, headers) -> - { - var path, query, scheme, split, uri; - - let uri = new Uri(); - - /** - * Scheme - */ - let scheme = this->calculateUriScheme(server, headers), - uri = uri->withScheme(scheme); - - /** - * Host/Port - */ - let split = this->calculateUriHost(server, headers); - if likely !empty(split[0]) { - let uri = uri->withHost(split[0]); - if unlikely !empty(split[1]) { - let uri = uri->withPort(split[1]); - } - } - - /** - * Path - */ - let path = this->calculateUriPath(server), - split = explode("#", path), - path = explode("?", split[0]), - uri = uri->withPath(path[0]); - - if unlikely count(split) > 1 { - let uri = uri->withFragment(split[1]); - } - - /** - * Query - */ - let query = this->calculateUriQuery(server), - uri = uri->withQuery(query); - - return uri; - } -} diff --git a/phalcon/Http/Message/Stream.zep b/phalcon/Http/Message/Stream.zep deleted file mode 100644 index 7e856b081e9..00000000000 --- a/phalcon/Http/Message/Stream.zep +++ /dev/null @@ -1,426 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Exception; -use Psr\Http\Message\StreamInterface; -use RuntimeException; - -/** - * PSR-7 Stream - */ -class Stream implements StreamInterface -{ - /** - * @var resource | null - */ - protected handle = null; - - /** - * @var resource | string - */ - protected stream; - - /** - * Stream constructor. - * - * @param mixed $stream - * @param string $mode - */ - public function __construct(var stream, string! mode = "rb") - { - this->setStream(stream, mode); - } - - /** - * Closes the stream when the destructed. - */ - public function __destruct() - { - this->close(); - } - - /** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - */ - public function __toString() -> string - { - try { - if likely this->isReadable() { - if likely this->isSeekable() { - this->rewind(); - } - - return this->getContents(); - } - } - - return ""; - } - - /** - * Closes the stream and any underlying resources. - */ - public function close() -> void - { - var handle; - - if likely null !== this->handle { - let handle = this->detach(); - - fclose(handle); - } - } - - /** - * Separates any underlying resources from the stream. - * - * After the stream has been detached, the stream is in an unusable state. - * - * @return resource | null - */ - public function detach() -> resource | null - { - var handle; - - let handle = this->handle, - this->handle = null; - - return handle; - } - - /** - * Returns true if the stream is at the end of the stream. - */ - public function eof() -> bool - { - if likely this->handle { - return feof(this->handle); - } - - return true; - } - - /** - * Returns the remaining contents in a string - */ - public function getContents() -> string - { - var data; - - this->checkHandle(); - this->checkReadable(); - - let data = stream_get_contents(this->handle); - - if unlikely false === data { - throw new RuntimeException("Could not read from the file/stream"); - } - - return data; - } - - /** - * Get stream metadata as an associative array or retrieve a specific key. - * - * The keys returned are identical to the keys returned from PHP's - * stream_get_meta_data() function. - * - * @param mixed|null $key - * - * @return array|mixed|null - */ - public function getMetadata(var key = null) - { - var metadata; - - if unlikely null === this->handle { - return null; - } - - let metadata = stream_get_meta_data(this->handle); - - if unlikely null === key { - return metadata; - } - - return this->getArrVal(metadata, key, []); - } - - /** - * Get the size of the stream if known. - */ - public function getSize() -> null | int - { - var stats; - - if likely null !== this->handle { - let stats = fstat(this->handle); - - if likely false !== stats { - return this->getArrVal(stats, "size", null); - } - } - - return null; - } - - /** - * Returns whether or not the stream is readable. - */ - public function isReadable() -> bool - { - var mode; - - let mode = (string) this->getMetadata("mode"); - - return false !== strpbrk(mode, "r+"); - } - - /** - * Returns whether or not the stream is seekable. - */ - public function isSeekable() -> bool - { - return (bool) this->getMetadata("seekable"); - } - - /** - * Returns whether or not the stream is writable. - */ - public function isWritable() -> bool - { - var mode; - - let mode = (string) this->getMetadata("mode"); - - return false !== strpbrk(mode, "xwca+"); - } - - /** - * Read data from the stream. - * - * @param int $length - * - * @return string - */ - public function read(var length) -> string - { - var data; - - this->checkHandle(); - this->checkReadable(); - - let data = fread(this->handle, length); - - if unlikely false === data { - throw new RuntimeException("Could not read from the file/stream"); - } - - return data; - } - - /** - * Seek to the beginning of the stream. - * - * If the stream is not seekable, this method will raise an exception; - * otherwise, it will perform a seek(0). - */ - public function rewind() -> void - { - this->seek(0); - } - - /** - * Seek to a position in the stream. - * - * @param int $offset - * @param int $whence - */ - public function seek(var offset, var whence = 0) -> void - { - var seeker; - - this->checkHandle(); - this->checkSeekable(); - - let seeker = fseek(this->handle, offset, whence); - - if unlikely 0 !== seeker { - throw new RuntimeException("Could not seek on the file pointer"); - } - } - - /** - * Sets the stream - existing instance - * - * @param mixed $stream - * @param string $mode - */ - public function setStream(var stream, string! mode = "rb") -> void - { - var handle, version; - - let handle = stream; - let version = phpversion(); - - globals_set("warning.enable", false); - - if likely typeof stream === "string" { - if version_compare(version, "8.0", ">=") { - set_error_handler( - function (number, message, file, line) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } else { - set_error_handler( - function (number, message, file, line, context) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } - - let handle = fopen(stream, mode); - - restore_error_handler(); - } - - if unlikely ( - globals_get("warning.enable") || - typeof handle !== "resource" || - "stream" !== get_resource_type(handle) - ) { - throw new RuntimeException( - "The stream provided is not valid (string/resource) or could not be opened." - ); - } - - let this->handle = handle, - this->stream = stream; - } - - /** - * Returns the current position of the file read/write pointer - * - * @return int - */ - public function tell() -> int - { - var position; - - this->checkHandle(); - - let position = ftell(this->handle); - - if unlikely typeof position !== "int" { - throw new Exception("Could not retrieve the pointer position"); - } - - return position; - } - - /** - * Write data to the stream. - * - * @param string $data - * - * @return int - */ - public function write(var data) -> int - { - var bytes; - - this->checkHandle(); - this->checkWritable(); - - let bytes = fwrite(this->handle, data); - - if unlikely false === bytes { - throw new RuntimeException("Could not write to the file/stream"); - } - - return bytes; - } - - /** - * Checks if a handle is available and throws an exception otherwise - */ - private function checkHandle() -> void - { - if unlikely null === this->handle { - throw new RuntimeException("A valid resource is required."); - } - } - - /** - * Checks if a handle is readable and throws an exception otherwise - */ - private function checkReadable() -> void - { - if unlikely true !== this->isReadable() { - throw new RuntimeException("The resource is not readable."); - } - } - - /** - * Checks if a handle is seekable and throws an exception otherwise - */ - private function checkSeekable() -> void - { - if unlikely true !== this->isSeekable() { - throw new RuntimeException("The resource is not seekable."); - } - } - - /** - * Checks if a handle is writeable and throws an exception otherwise - */ - private function checkWritable() -> void - { - if unlikely true !== this->isWritable() { - throw new RuntimeException("The resource is not writable."); - } - } - - /** - * @todo Remove this when we get traits - */ - private function getArrVal( - array! collection, - var index, - var defaultValue = null - ) -> var { - var value; - - if unlikely !fetch value, collection[index] { - return defaultValue; - } - - return value; - } -} diff --git a/phalcon/Http/Message/Stream/Input.zep b/phalcon/Http/Message/Stream/Input.zep deleted file mode 100644 index bcad7b52b7e..00000000000 --- a/phalcon/Http/Message/Stream/Input.zep +++ /dev/null @@ -1,127 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; - -/** - * Describes a data stream from "php://input" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -class Input extends Stream -{ - /** - * @var string - */ - private data = ""; - - /** - * @var bool - */ - private eof = false; - - /** - * Input constructor. - */ - public function __construct() - { - parent::__construct("php://input", "rb"); - } - - /** - * Reads all data from the stream into a string, from the beginning to end. - * - * This method MUST attempt to seek to the beginning of the stream before - * reading data and read the stream until the end is reached. - * - * Warning: This could attempt to load a large amount of data into memory. - * - * This method MUST NOT raise an exception in order to conform with PHP's - * string casting operations. - * - * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring - */ - public function __toString() -> string - { - if unlikely this->eof { - return this->data; - } - - this->getContents(); - - return this->data; - } - - /** - * Returns the remaining contents in a string - * - * @param int $length - * - * @throws \RuntimeException If unable to read or if error occurs while reading. - * @return string - */ - public function getContents(int length = -1) -> string - { - var data; - - if unlikely this->eof { - return this->data; - } - - let data = stream_get_contents(this->handle, length), - this->data = data; - - if unlikely (-1 === length || this->eof()) { - let this->eof = true; - } - - return this->data; - } - - /** - * Returns whether or not the stream is writeable. - */ - public function isWritable() -> bool - { - return false; - } - - /** - * Read data from the stream. - * - * @param int $length - * - * @return string - */ - public function read(var length)-> string - { - var data; - - let data = parent::read(length); - - if unlikely true !== this->eof { - let this->data = data; - } - - if unlikely this->eof() { - let this->eof = true; - } - - return data; - } -} diff --git a/phalcon/Http/Message/Stream/Memory.zep b/phalcon/Http/Message/Stream/Memory.zep deleted file mode 100644 index d59a3fef315..00000000000 --- a/phalcon/Http/Message/Stream/Memory.zep +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; - -/** - * Describes a data stream from "php://memory" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -class Memory extends Stream -{ - /** - * Constructor - */ - public function __construct(var mode = "rb") - { - parent::__construct("php://memory", mode); - } -} diff --git a/phalcon/Http/Message/Stream/Temp.zep b/phalcon/Http/Message/Stream/Temp.zep deleted file mode 100644 index a3626feac40..00000000000 --- a/phalcon/Http/Message/Stream/Temp.zep +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; - -/** - * Describes a data stream from "php://temp" - * - * Typically, an instance will wrap a PHP stream; this interface provides - * a wrapper around the most common operations, including serialization of - * the entire stream to a string. - */ -class Temp extends Stream -{ - /** - * Constructor - */ - public function __construct(var mode = "rb") - { - parent::__construct("php://temp", mode); - } -} diff --git a/phalcon/Http/Message/StreamFactory.zep b/phalcon/Http/Message/StreamFactory.zep deleted file mode 100644 index 7f7894bd5d6..00000000000 --- a/phalcon/Http/Message/StreamFactory.zep +++ /dev/null @@ -1,84 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\StreamFactoryInterface; -use Psr\Http\Message\StreamInterface; - -/** - * PSR-17 StreamFactory - */ -final class StreamFactory implements StreamFactoryInterface -{ - /** - * Create a new stream from a string. - * - * The stream SHOULD be created with a temporary resource. - * - * @param string $content String content with which to populate the stream. - * - * @return StreamInterface - */ - public function createStream(string! content = "") -> - { - var handle; - - let handle = fopen("php://temp", "r+b"); - if unlikely false === handle { - throw new InvalidArgumentException("Cannot write to file."); - } - - fwrite(handle, content); - rewind(handle); - - return this->createStreamFromResource(handle); - } - - /** - * Create a stream from an existing file. - * - * The file MUST be opened using the given mode, which may be any mode - * supported by the `fopen` function. - * - * The `$filename` MAY be any string supported by `fopen()`. - * - * @param string $filename The filename or stream URI to use as basis of - * stream. - * @param string $mode The mode with which to open the underlying - * filename/stream. - * - * @return StreamInterface - */ - public function createStreamFromFile(string! filename, string! mode = "r+b") -> - { - return new Stream(filename, mode); - } - - /** - * Create a new stream from an existing resource. - * - * The stream MUST be readable and may be writable. - */ - public function createStreamFromResource(var phpResource) -> - { - if unlikely (typeof phpResource !== "resource" || - "stream" !== get_resource_type(phpResource)) { - throw new InvalidArgumentException("Invalid stream provided"); - } - - return new Stream(phpResource); - } -} diff --git a/phalcon/Http/Message/UploadedFile.zep b/phalcon/Http/Message/UploadedFile.zep deleted file mode 100644 index 054d60367a4..00000000000 --- a/phalcon/Http/Message/UploadedFile.zep +++ /dev/null @@ -1,354 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UploadedFileInterface; -use RuntimeException; - -/** - * PSR-7 UploadedFile - */ -final class UploadedFile implements UploadedFileInterface -{ - /** - * If the file has already been moved, we hold that status here - * - * @var bool - */ - private alreadyMoved = false; - - /** - * Retrieve the filename sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious filename with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'name' key of - * the file in the $_FILES array. - * - * @var string | null - */ - private clientFilename = null { get }; - - /** - * Retrieve the media type sent by the client. - * - * Do not trust the value returned by this method. A client could send - * a malicious media type with the intention to corrupt or hack your - * application. - * - * Implementations SHOULD return the value stored in the 'type' key of - * the file in the $_FILES array. - * - * @var string | null - */ - private clientMediaType = null { get }; - - /** - * Retrieve the error associated with the uploaded file. - * - * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants. - * - * If the file was uploaded successfully, this method MUST return - * UPLOAD_ERR_OK. - * - * Implementations SHOULD return the value stored in the 'error' key of - * the file in the $_FILES array. - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @var int - */ - private error = 0 { get }; - - /** - * If the stream is a string (file name) we store it here - * - * @var string - */ - private fileName = ""; - - /** - * Retrieve the file size. - * - * Implementations SHOULD return the value stored in the 'size' key of - * the file in the $_FILES array if available, as PHP calculates this based - * on the actual size transmitted. - * - * @var int | null - */ - private size = null { get }; - - /** - * Holds the stream/string for the uploaded file - * - * @var StreamInterface|string|null - */ - private stream; - - /** - * UploadedFile constructor. - * - * @param StreamInterface|string|null $stream - * @param int|null $size - * @param int $error - * @param string|null $clientFilename - * @param string|null $clientMediaType - */ - public function __construct( - var stream, - int size = null, - int error = 0, - string clientFilename = null, - string clientMediaType = null - ) { - /** - * Check the stream passed. It can be a string representing a file or - * a StreamInterface - */ - this->checkStream(stream, error); - - /** - * Check the error - */ - this->checkError(error); - - let this->size = size, - this->clientFilename = clientFilename, - this->clientMediaType = clientMediaType; - } - - /** - * Retrieve a stream representing the uploaded file. - * - * This method MUST return a StreamInterface instance, representing the - * uploaded file. The purpose of this method is to allow utilizing native - * PHP stream functionality to manipulate the file upload, such as - * stream_copy_to_stream() (though the result will need to be decorated in - * a native PHP stream wrapper to work with such functions). - * - * If the moveTo() method has been called previously, this method MUST - * raise an exception. - * - * @return StreamInterface Stream representation of the uploaded file. - * @throws RuntimeException in cases when no stream is available or can be created. - */ - public function getStream() -> var - { - if unlikely 0 !== this->error { - throw new InvalidArgumentException( - this->getErrorDescription(this->error) - ); - } - - if unlikely this->alreadyMoved { - throw new InvalidArgumentException( - "The file has already been moved to the target location" - ); - } - - if unlikely !(this->stream instanceof StreamInterface) { - let this->stream = new Stream(this->fileName); - } - - return this->stream; - } - - /** - * Move the uploaded file to a new location. - * - * Use this method as an alternative to move_uploaded_file(). This method is - * guaranteed to work in both SAPI and non-SAPI environments. - * Implementations must determine which environment they are in, and use the - * appropriate method (move_uploaded_file(), rename(), or a stream - * operation) to perform the operation. - * - * $targetPath may be an absolute path, or a relative path. If it is a - * relative path, resolution should be the same as used by PHP's rename() - * function. - * - * The original file or stream MUST be removed on completion. - * - * If this method is called more than once, any subsequent calls MUST raise - * an exception. - * - * When used in an SAPI environment where $_FILES is populated, when writing - * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be - * used to ensure permissions and upload status are verified correctly. - * - * If you wish to move to a stream, use getStream(), as SAPI operations - * cannot guarantee writing to stream destinations. - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws InvalidArgumentException if the $targetPath specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ - public function moveTo(var targetPath) -> void - { - var sapi; - - if unlikely this->alreadyMoved { - throw new InvalidArgumentException("File has already been moved"); - } - - if unlikely 0 !== this->error { - throw new InvalidArgumentException( - this->getErrorDescription(this->error) - ); - } - - /** - * All together for early failure - */ - if unlikely !(typeof targetPath === "string" && - !empty(targetPath) && - is_dir(dirname(targetPath)) && - is_writable(dirname(targetPath))) { - throw new InvalidArgumentException( - "Target folder is empty string, not a folder or not writable" - ); - } - - let sapi = constant("PHP_SAPI"); - - if unlikely (empty(sapi) || - !empty(this->fileName) || - starts_with(sapi, "cli") || - starts_with(sapi, "phpdbg")) { - this->storeFile(targetPath); - } else { - if true !== move_uploaded_file(this->fileName, targetPath) { - throw new InvalidArgumentException( - "The file cannot be moved to the target folder" - ); - } - } - - let this->alreadyMoved = true; - } - - /** - * Checks the passed error code and if not in the range throws an exception - * - * @param int $error - */ - private function checkError(int error) -> void - { - if unlikely true !== this->isBetween(error, 0, 8) { - throw new InvalidArgumentException( - "Invalid error. Must be one of the UPLOAD_ERR_* constants" - ); - } - - let this->error = error; - } - - /** - * Checks the passed error code and if not in the range throws an exception - * - * @param StreamInterface|resource|string $stream - * @param int $error - */ - private function checkStream(var stream, int error) -> void - { - if unlikely 0 === error { - switch (true) { - case (typeof stream === "string"): - let this->fileName = stream; - break; - case (typeof stream === "resource"): - let this->stream = new Stream(stream); - break; - case (stream instanceof StreamInterface): - let this->stream = stream; - break; - default: - throw new InvalidArgumentException("Invalid stream or file passed"); - } - } - } - - /** - * Returns a description string depending on the upload error code passed - * - * @param int $error - * - * @return string - */ - private function getErrorDescription(int error) -> string - { - array errors; - - let errors = [ - 0 : "There is no error, the file uploaded with success.", - 1 : "The uploaded file exceeds the upload_max_filesize directive in php.ini.", - 2 : "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", - 3 : "The uploaded file was only partially uploaded.", - 4 : "No file was uploaded.", - 6 : "Missing a temporary folder.", - 7 : "Failed to write file to disk.", - 8 : "A PHP extension stopped the file upload." - ]; - - if likely (true === isset(errors[error])) { - return errors[error]; - } - - return "Unknown upload error"; - } - - /** - * Store a file in the new location (stream) - * - * @param string $targetPath - */ - private function storeFile(string targetPath) -> void - { - var data, handle, stream; - - let handle = fopen(targetPath, "w+b"); - if unlikely false === handle { - throw new InvalidArgumentException("Cannot write to file."); - } - - let stream = this->getStream(); - - stream->rewind(); - - while true !== stream->eof() { - let data = stream->read(2048); - - fwrite(handle, data); - } - - fclose(handle); - } - - /** - * @todo Remove this when we get traits - */ - private function isBetween(int value, int from, int to) -> bool - { - return value >= from && value <= to; - } -} diff --git a/phalcon/Http/Message/UploadedFileFactory.zep b/phalcon/Http/Message/UploadedFileFactory.zep deleted file mode 100644 index 62804bb17a8..00000000000 --- a/phalcon/Http/Message/UploadedFileFactory.zep +++ /dev/null @@ -1,60 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UploadedFileInterface; -use Psr\Http\Message\UploadedFileFactoryInterface; - -/** - * PSR-17 UploadedFileFactory - */ -final class UploadedFileFactory implements UploadedFileFactoryInterface -{ - /** - * Create a new uploaded file. - * - * If a size is not provided it will be determined by checking the size of - * the stream. - * - * @link http://php.net/manual/features.file-upload.post-method.php - * @link http://php.net/manual/features.file-upload.errors.php - * - * @param StreamInterface $stream The underlying stream representing the - * uploaded file content. - * @param int $size The size of the file in bytes. - * @param int $error The PHP file upload error. - * @param string $clientFilename The filename as provided by the client, if any. - * @param string $clientMediaType The media type as provided by the client, if any. - * - * @throws \InvalidArgumentException If the file resource is not readable. - */ - public function createUploadedFile( - stream, - int size = null, - int error = 0, - string clientFilename = null, - string clientMediaType = null - ) -> - { - return new UploadedFile( - stream, - size, - error, - clientFilename, - clientMediaType - ); - } -} diff --git a/phalcon/Http/Message/Uri.zep b/phalcon/Http/Message/Uri.zep deleted file mode 100644 index 04043c92471..00000000000 --- a/phalcon/Http/Message/Uri.zep +++ /dev/null @@ -1,664 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Psr\Http\Message\UriInterface; - -/** - * PSR-7 Uri - */ -final class Uri extends AbstractCommon implements UriInterface -{ - /** - * Returns the fragment of the URL - * - * @var string - */ - protected fragment = "" { get }; - - /** - * Retrieve the host component of the URI. - * - * If no host is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.2.2. - * - * @see http://tools.ietf.org/html/rfc3986#section-3.2.2 - * - * @var string - */ - protected host = "" { get }; - - /** - * @var string - */ - protected pass = ""; - - /** - * Returns the path of the URL - * - * @var string - */ - protected path = "" { get }; - - /** - * Retrieve the port component of the URI. - * - * If a port is present, and it is non-standard for the current scheme, - * this method MUST return it as an integer. If the port is the standard - * port used with the current scheme, this method SHOULD return null. - * - * If no port is present, and no scheme is present, this method MUST return - * a null value. - * - * If no port is present, but a scheme is present, this method MAY return - * the standard port for that scheme, but SHOULD return null. - * - * @var int|null - */ - protected port = null { get }; - - /** - * Returns the query of the URL - * - * @var string - */ - protected query = "" { get }; - - /** - * Retrieve the scheme component of the URI. - * - * If no scheme is present, this method MUST return an empty string. - * - * The value returned MUST be normalized to lowercase, per RFC 3986 - * Section 3.1. - * - * The trailing ":" character is not part of the scheme and MUST NOT be - * added. - * - * @see https://tools.ietf.org/html/rfc3986#section-3.1 - * - * @var string - */ - protected scheme = "https" { get }; - - /** - * @var string - */ - protected user = ""; - - /** - * Uri constructor. - * - * @param string $uri - */ - public function __construct(string! uri = "") - { - var urlParts; - - if unlikely "" !== uri { - let urlParts = parse_url(uri); - - if unlikely false === urlParts { - let urlParts = []; - } - - let this->fragment = this->filterFragment(this->getArrVal(urlParts, "fragment", "")), - this->host = strtolower(this->getArrVal(urlParts, "host", "")), - this->pass = rawurlencode(this->getArrVal(urlParts, "pass", "")), - this->path = this->filterPath(this->getArrVal(urlParts, "path", "")), - this->port = this->filterPort(this->getArrVal(urlParts, "port", null)), - this->query = this->filterQuery(this->getArrVal(urlParts, "query", "")), - this->scheme = this->filterScheme(this->getArrVal(urlParts, "scheme", "")), - this->user = rawurlencode(this->getArrVal(urlParts, "user", "")); - } - } - - /** - * Return the string representation as a URI reference. - * - * Depending on which components of the URI are present, the resulting - * string is either a full URI or relative reference according to RFC 3986, - * Section 4.1. The method concatenates the various components of the URI, - * using the appropriate delimiters - * - * @return string - */ - public function __toString() -> string - { - var authority, path, uri; - - let authority = this->getAuthority(), - path = this->path; - - /** - * The path can be concatenated without delimiters. But there are two - * cases where the path has to be adjusted to make the URI reference - * valid as PHP does not allow to throw an exception in __toString(): - * - If the path is rootless and an authority is present, the path - * MUST be prefixed by "/". - * - If the path is starting with more than one "/" and no authority - * is present, the starting slashes MUST be reduced to one. - */ - if unlikely ("" !== path && true !== starts_with(path, "/") && "" !== authority) { - let path = "/" . path; - } - - let uri = this->checkValue(this->scheme, "", ":") - . this->checkValue(authority, "//") - . path - . this->checkValue(this->query, "?") - . this->checkValue(this->fragment, "#"); - - return uri; - } - - /** - * Retrieve the authority component of the URI. - * - * @return string - */ - public function getAuthority() -> string - { - var authority, userInfo; - - /** - * If no authority information is present, this method MUST return an - * empty string. - */ - if unlikely "" === this->host { - return ""; - } - - let authority = this->host, - userInfo = this->getUserInfo(); - - /** - * The authority syntax of the URI is: - * - * [user-info@]host[:port] - */ - if unlikely "" !== userInfo { - let authority = userInfo . "@" . authority; - } - - /** - * If the port component is not set or is the standard port for the - * current scheme, it SHOULD NOT be included. - */ - if unlikely null !== this->port { - let authority .= ":" . this->port; - } - - return authority; - } - - /** - * Retrieve the user information component of the URI. - * - * If no user information is present, this method MUST return an empty - * string. - * - * If a user is present in the URI, this will return that value; - * additionally, if the password is also present, it will be appended to the - * user value, with a colon (":") separating the values. - * - * The trailing "@" character is not part of the user information and MUST - * NOT be added. - * - * @return string The URI user information, in "username[:password]" format. - */ - public function getUserInfo() -> string - { - if unlikely true !== empty(this->pass) { - return this->user . ":" . this->pass; - } - - return this->user; - } - - /** - * Return an instance with the specified URI fragment. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified URI fragment. - * - * Users can provide both encoded and decoded fragment characters. - * Implementations ensure the correct encoding as outlined in getFragment(). - * - * An empty fragment value is equivalent to removing the fragment. - * - * @param string $fragment - * - * @return Uri - */ - public function withFragment(var fragment) -> - { - this->checkStringParameter(fragment); - - let fragment = this->filterFragment(fragment); - - return this->cloneInstance(fragment, "fragment"); - } - - /** - * Return an instance with the specified path. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified path. - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * If an HTTP path is intended to be host-relative rather than path-relative - * then it must begin with a slash ("/"). HTTP paths not starting with a - * slash are assumed to be relative to some base path known to the - * application or consumer. - * - * Users can provide both encoded and decoded path characters. - * Implementations ensure the correct encoding as outlined in getPath(). - * - * @param string $path - * - * @return Uri - * @throws InvalidArgumentException for invalid paths. - */ - public function withPath(var path) -> - { - this->checkStringParameter(path); - - if unlikely (false !== strpos(path, "?") || false !== strpos(path, "#")) { - throw new InvalidArgumentException( - "Path cannot contain a query string or fragment" - ); - } - - let path = this->filterPath(path); - - return this->cloneInstance(path, "path"); - } - - /** - * Return an instance with the specified port. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified port. - * - * Implementations MUST raise an exception for ports outside the - * established TCP and UDP port ranges. - * - * A null value provided for the port is equivalent to removing the port - * information. - * - * @param int|null $port - * - * @return Uri - * @throws InvalidArgumentException for invalid ports. - */ - public function withPort(var port) -> - { - if unlikely null !== port { - let port = this->filterPort(port); - - if unlikely (null !== port && (port < 1 || port > 65535)) { - throw new InvalidArgumentException( - "Method expects valid port (1-65535)" - ); - } - } - - return this->cloneInstance(port, "port"); - } - - /** - * Return an instance with the specified query string. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified query string. - * - * Users can provide both encoded and decoded query characters. - * Implementations ensure the correct encoding as outlined in getQuery(). - * - * An empty query string value is equivalent to removing the query string. - * - * @param string $query - * - * @return Uri - * @throws InvalidArgumentException for invalid query strings. - */ - public function withQuery(var query) -> - { - this->checkStringParameter(query); - - if unlikely false !== strpos(query, "#") { - throw new InvalidArgumentException( - "Query cannot contain a query fragment" - ); - } - - let query = this->filterQuery(query); - - return this->cloneInstance(query, "query"); - } - - /** - * Return an instance with the specified scheme. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified scheme. - * - * Implementations MUST support the schemes "http" and "https" case - * insensitively, and MAY accommodate other schemes if required. - * - * An empty scheme is equivalent to removing the scheme. - * - * @param string $scheme - * - * @return Uri - * @throws InvalidArgumentException for invalid schemes. - * @throws InvalidArgumentException for unsupported schemes. - */ - public function withScheme(scheme) -> - { - this->checkStringParameter(scheme); - - let scheme = this->filterScheme(scheme); - - return this->processWith(scheme, "scheme"); - } - - /** - * Return an instance with the specified user information. - * - * @param string $user - * @param string|null $password - * - * @return Uri - */ - public function withUserInfo(var user, var password = null) -> - { - var newInstance; - - this->checkStringParameter(user); - - if unlikely null !== password { - this->checkStringParameter(user); - } - - let user = rawurlencode(user); - - if unlikely null !== password { - let password = rawurlencode(password); - } - - /** - * Immutable - need to send a new object back - */ - let newInstance = this->cloneInstance(user, "user"), - newInstance->pass = password; - - return newInstance; - } - - /** - * Return an instance with the specified host. - * - * This method MUST retain the state of the current instance, and return - * an instance that contains the specified host. - * - * An empty host value is equivalent to removing the host. - * - * @param string $host - * - * @return Uri - * @throws InvalidArgumentException for invalid hostnames. - * - */ - public function withHost(host) -> - { - return this->processWith(host, "host"); - } - - /** - * If the value passed is empty it returns it prefixed and suffixed with - * the passed parameters - * - * @param string $value - * @param string $prefix - * @param string $suffix - * - * @return string - */ - private function checkValue( - string! value, - string! prefix = "", - string! suffix = "" - ) -> string - { - if unlikely "" !== value { - let value = prefix . value . suffix; - } - - return value; - } - - /** - * If no fragment is present, this method MUST return an empty string. - * - * The leading "#" character is not part of the fragment and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.5. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.5 - * - * @param string $fragment - * - * @return string - */ - private function filterFragment(string! fragment) -> string - { - return rawurlencode(fragment); - } - - /** - * - * The path can either be empty or absolute (starting with a slash) or - * rootless (not starting with a slash). Implementations MUST support all - * three syntaxes. - * - * Normally, the empty path "" and absolute path "/" are considered equal as - * defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically - * do this normalization because in contexts with a trimmed base path, e.g. - * the front controller, this difference becomes significant. It's the task - * of the user to handle both "" and "/". - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.3. - * - * As an example, if the value should include a slash ("/") not intended as - * delimiter between path segments, that value MUST be passed in encoded - * form (e.g., "%2F") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.3 - * - * @param string $path - * - * @return string The URI path. - */ - private function filterPath(string! path) -> string - { - var element, key, parts; - - if unlikely ("" === path || true !== starts_with(path, "/")) { - return path; - } - - let parts = explode("/", path); - for key, element in parts { - let parts[key] = rawurlencode(element); - } - - let path = implode("/", parts); - - return "/" . ltrim(path, "/"); - } - - /** - * Checks the port. If it is a standard one (80,443) then it returns null - * - * @param int|null $port - * - * @return int|null - */ - private function filterPort(var port) -> int | null - { - array ports; - - let ports = [ - 80 : 1, - 443 : 1 - ]; - - if unlikely null !== port { - let port = (int) port; - if unlikely isset ports[port] { - let port = null; - } - } - - return port; - } - - /** - * If no query string is present, this method MUST return an empty string. - * - * The leading "?" character is not part of the query and MUST NOT be - * added. - * - * The value returned MUST be percent-encoded, but MUST NOT double-encode - * any characters. To determine what characters to encode, please refer to - * RFC 3986, Sections 2 and 3.4. - * - * As an example, if a value in a key/value pair of the query string should - * include an ampersand ("&") not intended as a delimiter between values, - * that value MUST be passed in encoded form (e.g., "%26") to the instance. - * - * @see https://tools.ietf.org/html/rfc3986#section-2 - * @see https://tools.ietf.org/html/rfc3986#section-3.4 - * - * @param string $query - * - * @return string The URI query string. - */ - private function filterQuery(string query) -> string - { - var index, part, parts, split; - - if unlikely "" === query { - return ""; - } - - let query = ltrim(query, "?"), - parts = explode("&", query); - - for index, part in parts { - let split = this->splitQueryValue(part); - if unlikely null === split[1] { - let parts[index] = rawurlencode(split[0]); - continue; - } - - let parts[index] = rawurlencode(split[0]) . "=" . rawurlencode(split[1]); - } - - return implode("&", parts); - } - - /** - * Filters the passed scheme - only allowed schemes - * - * @param string $scheme - * - * @return string - */ - private function filterScheme(string! scheme) -> string - { - var filtered; - array schemes; - - let filtered = preg_replace("#:(//)?$#", "", mb_strtolower(scheme)), - schemes = [ - "http" : 1, - "https" : 1 - ]; - - if unlikely "" === filtered { - return ""; - } - - if unlikely !isset schemes[filtered] { - throw new InvalidArgumentException( - "Unsupported scheme [" . filtered . "]. " . - "Scheme must be one of [" . - implode(", ", array_keys(schemes)) . "]" - ); - } - - return scheme; - } - - /** - * @param string $element - * - * @return array - */ - private function splitQueryValue(string element) -> array - { - var data; - - let data = explode("=", element, 2); - if unlikely !isset data[1] { - let data[] = null; - } - - return data; - } - - /** - * @todo Remove this when we get traits - */ - private function getArrVal( - array! collection, - var index, - var defaultValue = null - ) -> var { - var value; - - if unlikely !fetch value, collection[index] { - return defaultValue; - } - - return value; - } -} diff --git a/phalcon/Http/Message/UriFactory.zep b/phalcon/Http/Message/UriFactory.zep deleted file mode 100644 index 04389cf684b..00000000000 --- a/phalcon/Http/Message/UriFactory.zep +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - * - * Implementation of this file has been influenced by Zend Diactoros - * @link https://github.com/zendframework/zend-diactoros - * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md - */ - -namespace Phalcon\Http\Message; - -use Psr\Http\Message\UriFactoryInterface; -use Psr\Http\Message\UriInterface; - -/** - * PSR-17 UriFactory - */ -final class UriFactory implements UriFactoryInterface -{ - /** - * Returns a Locator object with all the helpers defined in anonynous - * functions - */ - public function createUri(string! uri = "") -> - { - return new Uri(uri); - } -} - - diff --git a/phalcon/Http/Request/File.zep b/phalcon/Http/Request/File.zep index 3c33f150a9c..8ae53db2c9e 100644 --- a/phalcon/Http/Request/File.zep +++ b/phalcon/Http/Request/File.zep @@ -117,7 +117,7 @@ class File implements FileInterface let finfo = finfo_open(FILEINFO_MIME_TYPE); - if typeof finfo != "resource" { + if finfo === false { return ""; } diff --git a/phalcon/Http/Server/AbstractMiddleware.zep b/phalcon/Http/Server/AbstractMiddleware.zep deleted file mode 100644 index 2cb7bc9b3b4..00000000000 --- a/phalcon/Http/Server/AbstractMiddleware.zep +++ /dev/null @@ -1,38 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -namespace Phalcon\Http\Server; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\MiddlewareInterface; -use Psr\Http\Server\RequestHandlerInterface; - -/** - * Participant in processing a server request and response. - * - * An HTTP middleware component participates in processing an HTTP message: - * by acting on the request, generating the response, or forwarding the - * request to a subsequent middleware and possibly acting on its response. - */ -abstract class AbstractMiddleware implements MiddlewareInterface -{ - /** - * Process an incoming server request. - * - * Processes an incoming server request in order to produce a response. - * If unable to produce the response itself, it may delegate to the provided - * request handler to do so. - */ - abstract public function process( - request, - handler - ) -> ; -} diff --git a/phalcon/Http/Server/AbstractRequestHandler.zep b/phalcon/Http/Server/AbstractRequestHandler.zep deleted file mode 100644 index a19f8f41eaf..00000000000 --- a/phalcon/Http/Server/AbstractRequestHandler.zep +++ /dev/null @@ -1,31 +0,0 @@ - -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -namespace Phalcon\Http\Server; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\RequestHandlerInterface; - -/** - * Handles a server request and produces a response. - * - * An HTTP request handler process an HTTP request in order to produce an - * HTTP response. - */ -abstract class AbstractRequestHandler implements RequestHandlerInterface -{ - /** - * Handles a request and produces a response. - * - * May call other collaborating code to generate the response. - */ - abstract public function handle( request) -> ; -} diff --git a/phalcon/Image/Adapter/AbstractAdapter.zep b/phalcon/Image/Adapter/AbstractAdapter.zep index 0a96b2b3900..4e2a9951560 100644 --- a/phalcon/Image/Adapter/AbstractAdapter.zep +++ b/phalcon/Image/Adapter/AbstractAdapter.zep @@ -14,8 +14,6 @@ use Phalcon\Image\Enum; use Phalcon\Image\Exception; /** - * Phalcon\Image\Adapter - * * All image adapters must use this class */ abstract class AbstractAdapter implements AdapterInterface diff --git a/phalcon/Image/Adapter/AdapterInterface.zep b/phalcon/Image/Adapter/AdapterInterface.zep index 15ce0cc2be0..c3d0f847658 100644 --- a/phalcon/Image/Adapter/AdapterInterface.zep +++ b/phalcon/Image/Adapter/AdapterInterface.zep @@ -12,6 +12,9 @@ namespace Phalcon\Image\Adapter; use Phalcon\Image\Enum; +/** + * Interface for Phalcon\Image\Adapter classes + */ interface AdapterInterface { public function background(string color, int opacity = 100) -> ; diff --git a/phalcon/Image/Exception.zep b/phalcon/Image/Exception.zep index 657d6170c12..90b95e82ae6 100644 --- a/phalcon/Image/Exception.zep +++ b/phalcon/Image/Exception.zep @@ -10,7 +10,9 @@ namespace Phalcon\Image; +/** + * Exceptions thrown in Phalcon\Image will use this class + */ class Exception extends \Exception { - } diff --git a/phalcon/Image/ImageFactory.zep b/phalcon/Image/ImageFactory.zep index ad46c38682a..24e2e94a363 100644 --- a/phalcon/Image/ImageFactory.zep +++ b/phalcon/Image/ImageFactory.zep @@ -13,13 +13,10 @@ namespace Phalcon\Image; use Phalcon\Factory\AbstractFactory; use Phalcon\Image\Adapter\AdapterInterface; -/** - * Phalcon\Image/ImageFactory - */ class ImageFactory extends AbstractFactory { /** - * TagFactory constructor. + * Constructor */ public function __construct(array! services = []) { diff --git a/phalcon/Logger/AbstractLogger.zep b/phalcon/Logger/AbstractLogger.zep new file mode 100644 index 00000000000..19913373c08 --- /dev/null +++ b/phalcon/Logger/AbstractLogger.zep @@ -0,0 +1,362 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Logger; + +use DateTimeImmutable; +use DateTimeZone; +use Exception; +use Phalcon\Logger\Exception as LoggerException; +use Phalcon\Logger\Adapter\AdapterInterface; + +/** + * Abstract Logger Class + * + * A PSR compatible logger, with various adapters and formatters. A formatter + * interface is available as well as an adapter one. Adapters can be created + * easily using the built in AdapterFactory. A LoggerFactory is also available + * that allows developers to create new instances of the Logger or load them + * from config files (see Phalcon\Config\Config object). + * + * @package Phalcon\Logger + * + * @property AdapterInterface[] $adapters + * @property array $excluded + * @property int $logLevel + * @property string $name + * @property string $timezone + */ +abstract class AbstractLogger +{ + const ALERT = 2; + const CRITICAL = 1; + const CUSTOM = 8; + const DEBUG = 7; + const EMERGENCY = 0; + const ERROR = 3; + const INFO = 6; + const NOTICE = 5; + const WARNING = 4; + + /** + * The adapter stack + * + * @var AdapterInterface[] + */ + protected adapters = []; + + /** + * The excluded adapters for this log process + * + * @var array + */ + protected excluded = []; + + /** + * Minimum log level for the logger + * + * @var int + */ + protected logLevel = 8; + + /** + * @var string + */ + protected name = ""; + + /** + * @var DateTimeZone + */ + protected timezone; + + /** + * Constructor. + * + * @param string $name The name of the logger + * @param array $adapters The collection of adapters to be used + * for logging (default []) + * @param DateTimeZone|null $timezone Timezone. If omitted, + * date_Default_timezone_get() is used + */ + public function __construct( + string name, + array adapters = [], + timezone = null + ) { + var defaultTimezone; + + if (null == timezone) { + let defaultTimezone = date_default_timezone_get(); + + if unlikely true === empty(defaultTimezone) { + let defaultTimezone = "UTC"; + } + + let timezone = new DateTimeZone(defaultTimezone); + } + + let this->name = name, + this->timezone = timezone; + + this->setAdapters(adapters); + } + + /** + * Add an adapter to the stack. For processing we use FIFO + * + * @param string $name The name of the adapter + * @param AdapterInterface $adapter The adapter to add to the stack + * + * @return AbstractLogger + */ + public function addAdapter(string name, adapter) -> + { + let this->adapters[name] = adapter; + + return this; + } + + /** + * Exclude certain adapters. + * + * @param array $adapters + * + * @return AbstractLogger + */ + public function excludeAdapters(array adapters = []) -> + { + var adapter, registered; + + /** + * Loop through what has been passed. Check these names with + * the registered adapters. If they match, add them to the + * this->excluded array + */ + let registered = this->adapters; + + /** + * Loop through what has been passed. Check these names with + * the registered adapters. If they match, add them to the + * this->excluded array + */ + for adapter in adapters { + if (true === isset(registered[adapter])) { + let this->excluded[adapter] = true; + } + } + + return this; + } + + /** + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + * @throws LoggerException + */ + public function getAdapter(string name) -> + { + if (true !== isset(this->adapters[name])) { + throw new LoggerException( + "Adapter does not exist for this logger" + ); + } + + return this->adapters[name]; + } + + /** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ + public function getAdapters() -> array + { + return this->adapters; + } + + /** + * Returns the log level + */ + public function getLogLevel() -> int + { + return this->logLevel; + } + + /** + * Returns the name of the logger + */ + public function getName() -> string + { + return this->name; + } + + /** + * Removes an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AbstractLogger + * @throws LoggerException + */ + public function removeAdapter(string name) -> + { + if (true !== isset(this->adapters[name])) { + throw new LoggerException( + "Adapter does not exist for this logger" + ); + } + + unset(this->adapters[name]); + + return this; + } + + /** + * Sets the adapters stack overriding what is already there + * + * @param array $adapters An array of adapters + * + * @return AbstractLogger + */ + public function setAdapters(array adapters) -> + { + let this->adapters = adapters; + + return this; + } + + /** + * Sets the adapters stack overriding what is already there + * + * @param int $level + * + * @return AbstractLogger + */ + public function setLogLevel(int level) -> + { + var levels; + + let levels = this->getLevels(), + this->logLevel = true === isset(levels[level]) ? level : self::CUSTOM; + + return this; + } + + + /** + * Adds a message to each handler for processing + * + * @param int level + * @param string $message + * @param array $context + * + * @return bool + * @throws Exception + * @throws LoggerException + */ + protected function addMessage( + int level, + string message, + array context = [] + ) -> bool { + var adapter, collection, item, levelName, levels, method; + if (this->logLevel >= level) { + if (count(this->adapters) === 0) { + throw new LoggerException("No adapters specified"); + } + + let levels = this->getLevels(), + levelName = true === isset(levels[level]) ? levels[level] : levels[self::CUSTOM]; + + let item = new Item( + message, + levelName, + level, + new DateTimeImmutable("now", this->timezone), + context + ); + + /** + * Log only if the key does not exist in the excluded ones + */ + let collection = array_diff_key(this->adapters, this->excluded); + for adapter in collection { + let method = "process"; + if (true === adapter->inTransaction()) { + let method = "add"; + } + + adapter->{method}(item); + } + + /** + * Clear the excluded array since we made the call now + */ + let this->excluded = []; + } + + return true; + } + + /** + * Converts the level from string/word to an integer + * + * @param mixed $level + * + * @return int + */ + protected function getLevelNumber(level) -> int + { + var levelName, levels; + + /** + * If someone uses "critical" as the level (string) + */ + if (true === is_string(level)) { + let levelName = strtoupper(level), + levels = array_flip(this->getLevels()); + + if (isset(levels[levelName])) { + return levels[levelName]; + } + } elseif (true === is_numeric(level)) { + let levels = this->getLevels(); + + if (isset(levels[level])) { + return (int) level; + } + } + + return self::CUSTOM; + } + + /** + * Returns an array of log levels with integer to string conversion + * + * @return string[] + */ + protected function getLevels() -> array + { + return [ + self::ALERT : "ALERT", + self::CRITICAL : "CRITICAL", + self::DEBUG : "DEBUG", + self::EMERGENCY : "EMERGENCY", + self::ERROR : "ERROR", + self::INFO : "INFO", + self::NOTICE : "NOTICE", + self::WARNING : "WARNING", + self::CUSTOM : "CUSTOM" + ]; + } +} diff --git a/phalcon/Logger/Adapter/AbstractAdapter.zep b/phalcon/Logger/Adapter/AbstractAdapter.zep index f08b6af72df..2a829658193 100644 --- a/phalcon/Logger/Adapter/AbstractAdapter.zep +++ b/phalcon/Logger/Adapter/AbstractAdapter.zep @@ -37,7 +37,7 @@ abstract class AbstractAdapter implements AdapterInterface * * @var FormatterInterface|null */ - protected formatter; + protected formatter = null; /** * Tells if there is an active transaction or not @@ -139,7 +139,7 @@ abstract class AbstractAdapter implements AdapterInterface */ public function getFormatter() -> { - if typeof this->formatter !== "object" { + if null === this->formatter { let this->formatter = create_instance(this->defaultFormatter); } diff --git a/phalcon/Logger/Adapter/Stream.zep b/phalcon/Logger/Adapter/Stream.zep index a16d10ecd07..5756194518a 100644 --- a/phalcon/Logger/Adapter/Stream.zep +++ b/phalcon/Logger/Adapter/Stream.zep @@ -79,14 +79,9 @@ class Stream extends AbstractAdapter /** * Mode */ - if fetch mode, options["mode"] { - if memstr(mode, "r") { - throw new Exception("Adapter cannot be opened in read mode"); - } - } - - if mode === null { - let mode = "ab"; + let mode = true === isset(options["mode"]) ? options["mode"] : "ab"; + if (false !== mb_strpos(mode, "r")) { + throw new Exception("Adapter cannot be opened in read mode"); } let this->name = name, @@ -125,11 +120,11 @@ class Stream extends AbstractAdapter let this->handler = null; throw new LogicException( - sprintf( - "The file '%s' cannot be opened with mode '%s'", - this->name, - this->mode - ) + "The file '" . + this->name . + "' cannot be opened with mode '" . + this->mode . + "'" ); } } diff --git a/phalcon/Logger/Enum.zep b/phalcon/Logger/Enum.zep new file mode 100644 index 00000000000..6ecd36950e5 --- /dev/null +++ b/phalcon/Logger/Enum.zep @@ -0,0 +1,27 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Logger; + +/** + * Log Level Enum constants + */ +class Enum +{ + const ALERT = 2; + const CRITICAL = 1; + const CUSTOM = 8; + const DEBUG = 7; + const EMERGENCY = 0; + const ERROR = 3; + const INFO = 6; + const NOTICE = 5; + const WARNING = 4; +} diff --git a/phalcon/Logger/Formatter/FormatterInterface.zep b/phalcon/Logger/Formatter/FormatterInterface.zep index d213cf65cad..9c34826dc81 100644 --- a/phalcon/Logger/Formatter/FormatterInterface.zep +++ b/phalcon/Logger/Formatter/FormatterInterface.zep @@ -26,5 +26,5 @@ interface FormatterInterface * * @return string */ - public function format( item) -> string | array; + public function format( item) -> string; } diff --git a/phalcon/Logger/Logger.zep b/phalcon/Logger/Logger.zep index 136b140b8ab..1e79cf6850f 100644 --- a/phalcon/Logger/Logger.zep +++ b/phalcon/Logger/Logger.zep @@ -10,120 +10,20 @@ namespace Phalcon\Logger; -use DateTimeImmutable; -use DateTimeZone; use Exception; -use Phalcon\Logger\Adapter\AdapterInterface; use Phalcon\Logger\Exception as LoggerException; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LoggerInterface; /** * Phalcon Logger. * - * A PSR compatible logger, with various adapters and formatters. A formatter + * A logger, with various adapters and formatters. A formatter * interface is available as well as an adapter one. Adapters can be created - * easily using the built in AdapterFactory. A LoggerFactory is also available + * easily using the built-in AdapterFactory. A LoggerFactory is also available * that allows developers to create new instances of the Logger or load them * from config files (see Phalcon\Config\Config object). - * - * @package Phalcon\Logger - * - * @property AdapterInterface[] $adapters - * @property array $excluded - * @property int $logLevel - * @property string $name - * @property string $timezone */ -class Logger implements LoggerInterface +class Logger extends AbstractLogger implements LoggerInterface { - const ALERT = 2; - const CRITICAL = 1; - const CUSTOM = 8; - const DEBUG = 7; - const EMERGENCY = 0; - const ERROR = 3; - const INFO = 6; - const NOTICE = 5; - const WARNING = 4; - - /** - * The adapter stack - * - * @var AdapterInterface[] - */ - protected adapters = [] { get }; - - /** - * The excluded adapters for this log process - * - * @var array - */ - protected excluded = []; - - /** - * Minimum log level for the logger - * - * @var int - */ - protected logLevel = 8 { get }; - - /** - * @var string - */ - protected name = "" { get }; - - /** - * @var DateTimeZone - */ - protected timezone; - - /** - * Constructor. - * - * @param string $name The name of the logger - * @param array $adapters The collection of adapters to be used - * for logging (default []) - * @param DateTimeZone|null $timezone Timezone. If omitted, - * date_Default_timezone_get() is used - */ - public function __construct( - string! name, - array! adapters = [], - timezone = null - ) { - var localTimeZone; - - let localTimeZone = timezone; - - if empty timezone { - let localTimeZone = date_default_timezone_get(); - if empty localTimeZone { - let localTimeZone = "UTC"; - } - } - - let this->name = name, - this->timezone = new DateTimeZone(localTimeZone); - - this->setAdapters(adapters); - } - - /** - * Add an adapter to the stack. For processing we use FIFO - * - * @param string $name The name of the adapter - * @param AdapterInterface $adapter The adapter to add to the stack - * - * @return Logger - */ - public function addAdapter(string name, adapter) -> - { - let this->adapters[name] = adapter; - - return this; - } - /** * Action must be taken immediately. * @@ -134,10 +34,12 @@ class Logger implements LoggerInterface * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ - public function alert(message, array context = []) -> void + public function alert(string message, array context = []) -> void { - this->addMessage(self::ALERT, (string) message, context); + this->addMessage(self::ALERT, message, context); } /** @@ -149,10 +51,12 @@ class Logger implements LoggerInterface * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ - public function critical(message, array context = []) -> void + public function critical(string message, array context = []) -> void { - this->addMessage(self::CRITICAL, (string) message, context); + this->addMessage(self::CRITICAL, message, context); } /** @@ -162,90 +66,43 @@ class Logger implements LoggerInterface * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ - public function debug(var message, array context = []) -> void + public function debug(string message, array context = []) -> void { - this->addMessage(self::DEBUG, (string) message, context); + this->addMessage(self::DEBUG, message, context); } /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. + * System is unusable. * * @param string $message * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ - public function error(message, array context = []) -> void + public function emergency(string message, array context = []) -> void { - this->addMessage(self::ERROR, (string) message, context); + this->addMessage(self::EMERGENCY, message, context); } /** - * System is unusable. + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. * * @param string $message * @param array $context * * @return void - */ - public function emergency(message, array context = []) -> void - { - this->addMessage(self::EMERGENCY, (string) message, context); - } - - /** - * Exclude certain adapters. - * - * @param array $adapters - * - * @return Logger - */ - public function excludeAdapters(array adapters = []) -> - { - var adapter, registered; - - /** - * Loop through what has been passed. Check these names with - * the registered adapters. If they match, add them to the - * this->excluded array - */ - let registered = this->adapters; - - /** - * Loop through what has been passed. Check these names with - * the registered adapters. If they match, add them to the - * this->excluded array - */ - for adapter in adapters { - if (isset(registered[adapter])) { - let this->excluded[adapter] = true; - } - } - - return this; - } - - /** - * Returns an adapter from the stack - * - * @param string $name The name of the adapter - * - * @return AdapterInterface + * @throws Exception * @throws LoggerException */ - public function getAdapter(string name) -> + public function error(string message, array context = []) -> void { - var adapter, adapters; - - let adapters = this->adapters; - - if !fetch adapter, adapters[name] { - throw new LoggerException("Adapter does not exist for this logger"); - } - - return adapter; + this->addMessage(self::ERROR, message, context); } /** @@ -257,22 +114,26 @@ class Logger implements LoggerInterface * @param array $context * * @return void + * @throws Exception + * @throws LoggerException */ - public function info(message, array context = []) -> void + public function info(string message, array context = []) -> void { - this->addMessage(self::INFO, (string) message, context); + this->addMessage(self::INFO, message, context); } /** * Logs with an arbitrary level. * - * @param mixed $level - * @param mixed $message - * @param array $context + * @param mixed $level + * @param string $message + * @param array $context * + * @return void + * @throws Exception * @throws LoggerException */ - public function log(level, message, array context = []) -> void + public function log(var level, string message, array context = []) -> void { var intLevel; @@ -288,70 +149,12 @@ class Logger implements LoggerInterface * @param array $context * * @return void - */ - public function notice(message, array context = []) -> void - { - this->addMessage(self::NOTICE, (string) message, context); - } - - /** - * Removes an adapter from the stack - * - * @param string $name The name of the adapter - * - * @return Logger + * @throws Exception * @throws LoggerException */ - public function removeAdapter(string name) -> - { - var adapters; - - let adapters = this->adapters; - - if true !== isset(adapters[name]) { - throw new LoggerException("Adapter does not exist for this logger"); - } - - unset adapters[name]; - - let this->adapters = adapters; - - return this; - } - - /** - * Sets the adapters stack overriding what is already there - * - * @param array $adapters An array of adapters - * - * @return Logger - */ - public function setAdapters(array! adapters) -> + public function notice(string message, array context = []) -> void { - let this->adapters = adapters; - - return this; - } - - /** - * Sets the adapters stack overriding what is already there - * - * @param int $level - * - * @return Logger - */ - public function setLogLevel(int level) -> - { - var levels; - - let levels = this->getLevels(); - if !isset levels[level] { - let level = self::CUSTOM; - } - - let this->logLevel = level; - - return this; + this->addMessage(self::NOTICE, message, context); } /** @@ -364,125 +167,11 @@ class Logger implements LoggerInterface * @param array $context * * @return void - */ - public function warning(message, array context = []) -> void - { - this->addMessage(self::WARNING, (string) message, context); - } - - /** - * Adds a message to each handler for processing - * - * @param int $level - * @param string $message - * @param array $context - * - * @return bool * @throws Exception * @throws LoggerException */ - protected function addMessage( - int level, - string message, - array context = [] - ) -> bool { - var adapter, adapters, excluded, item, levelName, levels, registered; - - if this->logLevel >= level { - let registered = this->adapters, - excluded = this->excluded, - levels = this->getLevels(); - - if (true === empty(registered)) { - throw new LoggerException("No adapters specified"); - } - - if unlikely !fetch levelName, levels[level] { - let levelName = levels[self::CUSTOM]; - } - - let item = new Item( - message, - levelName, - level, - new DateTimeImmutable("now", this->timezone), - context - ); - - /** - * Log only if the key does not exist in the excluded ones - */ - let adapters = array_diff_key(registered, excluded); - for adapter in adapters { - if (true === adapter->inTransaction()) { - adapter->add(item); - } else { - adapter->process(item); - } - } - - /** - * Clear the excluded array since we made the call now - */ - let this->excluded = []; - } - - return true; - } - - /** - * Returns an array of log levels with integer to string conversion - * - * @return string[] - */ - protected function getLevels() -> array + public function warning(string message, array context = []) -> void { - return [ - self::ALERT : "ALERT", - self::CRITICAL : "CRITICAL", - self::DEBUG : "DEBUG", - self::EMERGENCY : "EMERGENCY", - self::ERROR : "ERROR", - self::INFO : "INFO", - self::NOTICE : "NOTICE", - self::WARNING : "WARNING", - self::CUSTOM : "CUSTOM" - ]; - } - - /** - * Converts the level from string/word to an integer - * - * @param mixed $level - * - * @return int - * @throws InvalidArgumentException - */ - private function getLevelNumber(var level) -> int - { - var levelName, levels; - - /** - * If someone uses "critical" as the level (string) - */ - if typeof level === "string" { - let levelName = strtoupper(level), - levels = array_flip(this->getLevels()); - - if isset levels[levelName] { - return levels[levelName]; - } - /** - * If someone uses 1 as the level ("critical") - */ - } elseif is_numeric(level) { - let levels = this->getLevels(); - - if isset levels[level] { - return (int) level; - } - } - - return self::CUSTOM; + this->addMessage(self::WARNING, message, context); } } diff --git a/phalcon/Logger/LoggerInterface.zep b/phalcon/Logger/LoggerInterface.zep new file mode 100644 index 00000000000..ef22d7822bc --- /dev/null +++ b/phalcon/Logger/LoggerInterface.zep @@ -0,0 +1,147 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Logger; + +use Phalcon\Logger\Adapter\AdapterInterface; + +/** + * Interface for Phalcon based logger objects. + */ +interface LoggerInterface +{ + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function alert(string message, array context = []) -> void; + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function critical(string message, array context = []) -> void; + + /** + * Detailed debug information. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function debug(string message, array context = []) -> void; + + /** + * System is unusable. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function emergency(string message, array context = []) -> void; + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function error(string message, array context = []) -> void; + + /** + * Returns an adapter from the stack + * + * @param string $name The name of the adapter + * + * @return AdapterInterface + * @throws Exception + */ + public function getAdapter(string name) -> ; + + /** + * Returns the adapter stack array + * + * @return AdapterInterface[] + */ + public function getAdapters() -> array; + + /** + * Returns the log level + */ + public function getLogLevel() -> int; + + /** + * Returns the name of the logger + */ + public function getName() -> string; + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function info(string message, array context = []) -> void; + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string $message + * @param array $context + * + * @return void + * + * @throws Exception + */ + public function log(var level, string message, array context = []) -> void; + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function notice(string message, array context = []) -> void; + + /** + * Normal but significant events. + * + * @param string $message + * @param array $context + * + * @return void + */ + public function warning(string message, array context = []) -> void; +} diff --git a/phalcon/Messages/Messages.zep b/phalcon/Messages/Messages.zep index bfb27a03d5d..bb8e2ee3cac 100644 --- a/phalcon/Messages/Messages.zep +++ b/phalcon/Messages/Messages.zep @@ -201,7 +201,7 @@ class Messages implements ArrayAccess, Countable, Iterator, JsonSerializable * * @param int index */ - public function offsetExists(var index) -> boolean + public function offsetExists(mixed index) -> bool { return isset this->messages[index]; } @@ -215,7 +215,7 @@ class Messages implements ArrayAccess, Countable, Iterator, JsonSerializable * ); *``` */ - public function offsetGet(var index) -> var + public function offsetGet(mixed index) -> mixed { var message, returnValue = null; @@ -235,7 +235,7 @@ class Messages implements ArrayAccess, Countable, Iterator, JsonSerializable * * @param \Phalcon\Messages\Message message */ - public function offsetSet(var index, var message) -> void + public function offsetSet(mixed index, mixed message) -> void { if typeof message != "object" { throw new Exception("The message must be an object"); @@ -251,7 +251,7 @@ class Messages implements ArrayAccess, Countable, Iterator, JsonSerializable * unset($message["database"]); *``` */ - public function offsetUnset(var index) -> void + public function offsetUnset(mixed index) -> void { if isset this->messages[index] { array_splice(this->messages, index, 1); diff --git a/phalcon/Mvc/Application.zep b/phalcon/Mvc/Application.zep index 9207df9c33e..83aac9654f1 100644 --- a/phalcon/Mvc/Application.zep +++ b/phalcon/Mvc/Application.zep @@ -94,7 +94,7 @@ class Application extends AbstractApplication let container = this->container; - if unlikely typeof container != "object" { + if container === null { throw new Exception( "A dependency injection container is required to access internal services" ); @@ -106,10 +106,8 @@ class Application extends AbstractApplication * Call boot event, this allow the developer to perform initialization * actions */ - if typeof eventsManager == "object" { - if eventsManager->fire("application:boot", this) === false { - return false; - } + if eventsManager !== null && eventsManager->fire("application:boot", this) === false { + return false; } let router = container->getShared("router"); diff --git a/phalcon/Mvc/Micro.zep b/phalcon/Mvc/Micro.zep index 5eaa40285f5..5974990ca3d 100644 --- a/phalcon/Mvc/Micro.zep +++ b/phalcon/Mvc/Micro.zep @@ -995,10 +995,12 @@ class Micro extends Injectable implements ArrayAccess, EventsAwareInterface /** * Check if a service is registered in the internal services container using * the array syntax + * + * @param mixed offset */ - public function offsetExists(var alias) -> bool + public function offsetExists(mixed offset) -> bool { - return this->hasService(alias); + return this->hasService(offset); } /** @@ -1010,10 +1012,12 @@ class Micro extends Injectable implements ArrayAccess, EventsAwareInterface * $app["request"] * ); *``` + * + * @param mixed offset */ - public function offsetGet(var alias) -> var + public function offsetGet(mixed offset) -> mixed { - return this->getService(alias); + return this->getService(offset); } /** @@ -1024,28 +1028,22 @@ class Micro extends Injectable implements ArrayAccess, EventsAwareInterface * $app["request"] = new \Phalcon\Http\Request(); *``` */ - public function offsetSet(var alias, var definition) -> void + public function offsetSet(mixed offset, mixed value) -> void { - this->setService(alias, definition); + this->setService(offset, value); } /** * Removes a service from the internal services container using the array * syntax */ - public function offsetUnset(var alias) -> void + public function offsetUnset(mixed offset) -> void { - var container; - - let container = this->container; - - if typeof container != "object" { - let container = new FactoryDefault(); - - let this->container = container; + if this->container === null { + let this->container = new FactoryDefault(); } - container->remove(alias); + this->container->remove(offset); } /** diff --git a/phalcon/Mvc/Micro/Collection.zep b/phalcon/Mvc/Micro/Collection.zep index e10dd21815b..a56deb882b7 100644 --- a/phalcon/Mvc/Micro/Collection.zep +++ b/phalcon/Mvc/Micro/Collection.zep @@ -290,9 +290,9 @@ class Collection implements CollectionInterface * @param string|array method * @param string routePattern * @param callable handler - * @param string name + * @param string|null name */ - protected function addMap(var method, string! routePattern, callable handler, string name) -> void + protected function addMap(var method, string! routePattern, callable handler, string name = null) -> void { let this->handlers[] = [method, routePattern, handler, name]; } diff --git a/phalcon/Mvc/Model.zep b/phalcon/Mvc/Model.zep index 5816a90ad2a..8de4e19078b 100644 --- a/phalcon/Mvc/Model.zep +++ b/phalcon/Mvc/Model.zep @@ -1484,10 +1484,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * ``` * * @param array|string|int|null parameters = [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -1601,10 +1601,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * ``` * * @param array|string|int|null parameters = [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -5217,7 +5217,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -5226,10 +5226,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -5244,7 +5244,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * ] * ] */ - protected function belongsTo(var fields, string! referenceModel, var referencedFields, options = null) -> + protected function belongsTo(var fields, string! referenceModel, var referencedFields, array options = []) -> { return ( this->modelsManager)->addBelongsTo( this, @@ -5329,7 +5329,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -5338,10 +5338,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -5356,7 +5356,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * ] * ] */ - protected function hasMany(var fields, string! referenceModel, var referencedFields, options = null) -> + protected function hasMany(var fields, string! referenceModel, var referencedFields, array options = []) -> { return ( this->modelsManager)->addHasMany( this, @@ -5395,7 +5395,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * @param string|array intermediateReferencedFields * @param string referenceModel * @param string|array referencedFields - * @param array options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -5404,10 +5404,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -5429,7 +5429,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, var intermediateReferencedFields, string! referenceModel, var referencedFields, - options = [] + array options = [] ) -> { return ( this->modelsManager)->addHasManyToMany( @@ -5461,7 +5461,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * } *``` * - * @param array|null options = [ + * @param array $options = [ * 'reusable' => false, * 'alias' => 'someAlias', * 'foreignKey' => [ @@ -5470,10 +5470,10 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * 'action' => null * ], * 'params' => [ - * 'conditions' => '' + * 'conditions' => '', * 'columns' => '', * 'bind' => [], - * 'bindTypes => [], + * 'bindTypes' => [], * 'order' => '', * 'limit' => 10, * 'offset' => 5, @@ -5488,7 +5488,7 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * ] * ] */ - protected function hasOne(var fields, string! referenceModel, var referencedFields, options = null) -> + protected function hasOne(var fields, string! referenceModel, var referencedFields, array options = []) -> { return ( this->modelsManager)->addHasOne( this, @@ -5521,14 +5521,14 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, * } *``` * - * @param string|array fields - * @param string|array intermediateFields - * @param string|array intermediateReferencedFields - * @param string|array referencedFields - * @param array options + * @param string|array $fields + * @param string|array $intermediateFields + * @param string|array $intermediateReferencedFields + * @param string|array $referencedFields + * @param array $options */ protected function hasOneThrough(var fields, string! intermediateModel, var intermediateFields, var intermediateReferencedFields, - string! referenceModel, var referencedFields, options = null) -> + string! referenceModel, var referencedFields, array options = []) -> { return ( this->modelsManager)->addHasOneThrough( this, @@ -5814,4 +5814,104 @@ abstract class Model extends AbstractInjectionAware implements EntityInterface, return key; } + + public function __serialize() -> array + { + /** + * Use the standard serialize function to serialize the array data + */ + var attributes, manager, dirtyState, snapshot = null; + + let attributes = this->toArray(), + dirtyState = this->dirtyState, + manager = this->getModelsManager(); + + if manager->isKeepingSnapshots(this) && this->snapshot !== null && attributes != this->snapshot { + let snapshot = this->snapshot; + } + + return [ + "attributes": attributes, + "snapshot": snapshot, + "dirtyState": dirtyState + ]; + } + + public function __unserialize(array data) -> void + { + var container, manager, key, value, snapshot, properties, dirtyState; + + if !isset data["attributes"] { + let data = [ + "attributes": data + ]; + } + + /** + * Obtain the default DI + */ + let container = Di::getDefault(); + if container === null { + throw new Exception( + "A dependency injection container is required to access the services related to the ODM" + ); + } + + /** + * Update the dependency injector + */ + let this->container = container; + + /** + * Gets the default modelsManager service + */ + let manager = container->getShared("modelsManager"); + if manager === null { + throw new Exception( + "The injected service 'modelsManager' is not valid" + ); + } + + /** + * Update the models manager + */ + let this->modelsManager = manager; + + /** + * Try to initialize the model + */ + manager->initialize(this); + + /** + * Fetch serialized props + */ + if fetch properties, data["attributes"] { + /** + * Update the objects properties + */ + for key, value in properties { + let this->{key} = value; + } + } else { + let properties = []; + } + + /** + * Fetch serialized dirtyState + */ + if fetch dirtyState, data["dirtyState"] { + let this->dirtyState = dirtyState; + } + + /** + * Fetch serialized snapshot when option is active + */ + if manager->isKeepingSnapshots(this) { + if fetch snapshot, data["snapshot"] { + let this->snapshot = snapshot; + } else { + let this->snapshot = properties; + } + } + } } diff --git a/phalcon/Mvc/Model/Manager.zep b/phalcon/Mvc/Model/Manager.zep index 73c2d7e6a43..41e688bc27f 100644 --- a/phalcon/Mvc/Model/Manager.zep +++ b/phalcon/Mvc/Model/Manager.zep @@ -768,7 +768,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI * @param array options */ public function addHasOne( model, var fields, string! referencedModel, - var referencedFields, var options = null) -> + var referencedFields, array options = []) -> { var entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations; @@ -857,7 +857,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI * @param array options */ public function addHasOneThrough( model, var fields, string! intermediateModel, - var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, var options = null) -> + var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, array options = []) -> { var entityName, referencedEntity, hasOneThrough, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity; @@ -972,7 +972,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI * @param array options */ public function addBelongsTo( model, var fields, string! referencedModel, - var referencedFields, var options = null) -> + var referencedFields, array options = []) -> { var entityName, referencedEntity, relation, relations, alias, lowerAlias, singleRelations; @@ -1058,7 +1058,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI * @param array options */ public function addHasMany( model, var fields, string! referencedModel, - var referencedFields, var options = null) -> + var referencedFields, array options = []) -> { var entityName, referencedEntity, hasMany, relation, relations, alias, lowerAlias, singleRelations; @@ -1148,7 +1148,7 @@ class Manager implements ManagerInterface, InjectionAwareInterface, EventsAwareI * @param array options */ public function addHasManyToMany( model, var fields, string! intermediateModel, - var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, var options = null) -> + var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, array options = []) -> { var entityName, referencedEntity, hasManyToMany, relation, relations, alias, lowerAlias, singleRelations, intermediateEntity; diff --git a/phalcon/Mvc/Model/ManagerInterface.zep b/phalcon/Mvc/Model/ManagerInterface.zep index 6db2719f19b..2cb4c23c138 100644 --- a/phalcon/Mvc/Model/ManagerInterface.zep +++ b/phalcon/Mvc/Model/ManagerInterface.zep @@ -25,7 +25,10 @@ interface ManagerInterface /** * Binds a behavior to a model */ - public function addBehavior( model, behavior) -> void; + public function addBehavior( + model, + behavior + ) -> void; /** * Setup a relation reverse 1-1 between two models @@ -34,7 +37,13 @@ interface ManagerInterface * @param mixed referencedFields * @param array options */ - public function addBelongsTo( model, fields, string! referencedModel, referencedFields, options = null) -> ; + public function addBelongsTo( + model, + var fields, + string! referencedModel, + var referencedFields, + array options = [] + ) -> ; /** * Setup a relation 1-n between two models @@ -43,7 +52,13 @@ interface ManagerInterface * @param mixed referencedFields * @param array options */ - public function addHasMany( model, fields, string! referencedModel, referencedFields, options = null) -> ; + public function addHasMany( + model, + var fields, + string! referencedModel, + var referencedFields, + array options = [] + ) -> ; /** * Setup a 1-1 relation between two models @@ -52,7 +67,13 @@ interface ManagerInterface * @param mixed referencedFields * @param array options */ - public function addHasOne( model, fields, string! referencedModel, referencedFields, options = null) -> ; + public function addHasOne( + model, + var fields, + string! referencedModel, + var referencedFields, + array options = [] + ) -> ; /** * Setups a 1-1 relation between two models using an intermediate table @@ -63,8 +84,16 @@ interface ManagerInterface * @param string referencedFields * @param array options */ - public function addHasOneThrough( model, var fields, string! intermediateModel, - var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, var options = null) -> ; + public function addHasOneThrough( + model, + var fields, + string! intermediateModel, + var intermediateFields, + var intermediateReferencedFields, + string! referencedModel, + var referencedFields, + array options = [] + ) -> ; /** * Setups a relation n-m between two models @@ -75,8 +104,16 @@ interface ManagerInterface * @param string referencedFields * @param array options */ - public function addHasManyToMany( model, var fields, string! intermediateModel, - var intermediateFields, var intermediateReferencedFields, string! referencedModel, var referencedFields, var options = null) -> ; + public function addHasManyToMany( + model, + var fields, + string! intermediateModel, + var intermediateFields, + var intermediateReferencedFields, + string! referencedModel, + var referencedFields, + array options = [] + ) -> ; /** * Creates a Phalcon\Mvc\Model\Query\Builder @@ -109,11 +146,17 @@ interface ManagerInterface * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ - public function getBelongsToRecords(string! modelName, string! modelRelation, record, parameters = null, string method = null) -> | bool; + public function getBelongsToRecords( + string! modelName, + string! modelRelation, + record, + var parameters = null, + string method = null + ) -> | bool; /** * Gets hasMany relations defined on a model @@ -125,11 +168,17 @@ interface ManagerInterface * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ - public function getHasManyRecords(string! modelName, string! modelRelation, record, parameters = null, string method = null) -> | bool; + public function getHasManyRecords( + string! modelName, + string! modelRelation, + record, + var parameters = null, + string method = null + ) -> | bool; /** * Gets hasManyToMany relations defined on a model @@ -156,11 +205,17 @@ interface ManagerInterface * * @param string $modelName * @param string $modelRelation - * @param array|string|null $parameters * @param ModelInterface $record + * @param array|string|null $parameters * @param string|null $method */ - public function getHasOneRecords(string! modelName, string! modelRelation, record, parameters = null, string method = null) -> | bool; + public function getHasOneRecords( + string! modelName, + string! modelRelation, + record, + var parameters = null, + string method = null + ) -> | bool; /** * Get last initialized model @@ -207,7 +262,12 @@ interface ManagerInterface * * @return \Phalcon\Mvc\Model\Resultset\Simple|int|false */ - public function getRelationRecords( relation, record, var parameters = null, string method = null); + public function getRelationRecords( + relation, + record, + var parameters = null, + string method = null + ); /** * Query all the relationships defined on a model diff --git a/phalcon/Mvc/Model/Query.zep b/phalcon/Mvc/Model/Query.zep index b67ee506166..848a72517b7 100644 --- a/phalcon/Mvc/Model/Query.zep +++ b/phalcon/Mvc/Model/Query.zep @@ -24,7 +24,6 @@ use Phalcon\Mvc\Model\Resultset\Simple; use Phalcon\Di\InjectionAwareInterface; use Phalcon\Db\DialectInterface; use Phalcon\Mvc\Model\Query\Lang; -use Psr\SimpleCache\CacheInterface; /** * Phalcon\Mvc\Model\Query @@ -100,7 +99,7 @@ class Query implements QueryInterface, InjectionAwareInterface protected bindTypes = []; /** - * @var \Psr\SimpleCache\CacheInterface|null + * @var mixed|null */ protected cache = null; @@ -297,8 +296,11 @@ class Query implements QueryInterface, InjectionAwareInterface let cache = this->container->getShared(cacheService); - if unlikely !(cache instanceof CacheInterface) { - throw new Exception("Cache service must be an object implementing Psr\SimpleCache\CacheInterface"); + if unlikely (true !== is_a(cache, "Phalcon\\Cache\\CacheInterface")) { + throw new Exception( + "Cache service must be an object implementing " . + "Phalcon\Cache\CacheInterface" + ); } let result = cache->get(key); diff --git a/phalcon/Mvc/Model/Resultset.zep b/phalcon/Mvc/Model/Resultset.zep index ae846638a4d..b53ed2fb33b 100644 --- a/phalcon/Mvc/Model/Resultset.zep +++ b/phalcon/Mvc/Model/Resultset.zep @@ -15,12 +15,12 @@ use Closure; use Countable; use Iterator; use JsonSerializable; +use Phalcon\Cache\CacheInterface; use Phalcon\Db\Enum; use Phalcon\Messages\MessageInterface; use Phalcon\Mvc\Model; use Phalcon\Mvc\ModelInterface; use Phalcon\Storage\Serializer\SerializerInterface; -use Psr\SimpleCache\CacheInterface; use SeekableIterator; use Serializable; @@ -129,17 +129,17 @@ abstract class Resultset /** * Phalcon\Mvc\Model\Resultset constructor * - * @param ResultInterface|false result - * @param CacheInterface|null cache + * @param ResultInterface|false $result + * @param mixed|null $cache */ - public function __construct(result, cache = null) + public function __construct(var result, var cache = null) { var prefetchRecords, rowCount, rows; /** * 'false' is given as result for empty result-sets */ - if typeof result != "object" { + if typeof result !== "object" { let this->count = 0; let this->rows = []; @@ -155,6 +155,17 @@ abstract class Resultset * Update the related cache if any */ if cache !== null { + if unlikely ( + true !== is_a(cache, "Phalcon\\Cache\\CacheInterface") && + true !== is_a(cache, "Psr\\SimpleCache\\CacheInterface") + ) { + throw new Exception( + "Cache service must be an object implementing " . + "Phalcon\Cache\CacheInterface or Psr\SimpleCache\CacheInterface" + ); + } + + let this->cache = cache; } @@ -481,7 +492,7 @@ abstract class Resultset /** * Gets row in a specific position of the resultset */ - public function offsetGet(var index) -> | bool + public function offsetGet(mixed index) -> mixed { if unlikely index >= this->count { throw new Exception("The index does not exist in the cursor"); diff --git a/phalcon/Mvc/Model/Resultset/Complex.zep b/phalcon/Mvc/Model/Resultset/Complex.zep index 072a4811c5a..24a889a632a 100644 --- a/phalcon/Mvc/Model/Resultset/Complex.zep +++ b/phalcon/Mvc/Model/Resultset/Complex.zep @@ -20,7 +20,6 @@ use Phalcon\Mvc\Model\ResultsetInterface; use Phalcon\Mvc\Model\Row; use Phalcon\Mvc\ModelInterface; use Phalcon\Storage\Serializer\SerializerInterface; -use Psr\SimpleCache\CacheInterface; use stdClass; /** @@ -47,14 +46,14 @@ class Complex extends Resultset implements ResultsetInterface /** * Phalcon\Mvc\Model\Resultset\Complex constructor * - * @param array columnTypes - * @param ResultInterface|null result - * @param CacheInterface|null cache + * @param array $columnTypes + * @param ResultInterface|null $result + * @param mixed|null $cache */ public function __construct( var columnTypes, result = null, - cache = null + var cache = null ) { /** @@ -68,7 +67,7 @@ class Complex extends Resultset implements ResultsetInterface /** * Returns current row in the resultset */ - final public function current() -> | bool + final public function current() -> mixed { var row, hydrateMode, eager, dirtyState, alias, activeRow, type, column, columnValue, value, attribute, source, attributes, columnMap, @@ -166,7 +165,6 @@ class Complex extends Resultset implements ResultsetInterface * Generate the column value according to the hydration type */ switch hydrateMode { - case Resultset::HYDRATE_RECORDS: // Check if the resultset must keep snapshots if !fetch keepSnapshots, column["keepSnapshots"] { @@ -174,7 +172,6 @@ class Complex extends Resultset implements ResultsetInterface } if globals_get("orm.late_state_binding") { - if column["instance"] instanceof Model { let modelName = get_class(column["instance"]); } else { @@ -188,9 +185,7 @@ class Complex extends Resultset implements ResultsetInterface dirtyState, keepSnapshots ); - } else { - /** * Get the base instance. Assign the values to the * attributes using a column map @@ -221,9 +216,7 @@ class Complex extends Resultset implements ResultsetInterface * The complete object is assigned to an attribute with the name of the alias or the model name */ let attribute = column["balias"]; - } else { - /** * Scalar columns are simply assigned to the result object */ @@ -244,7 +237,6 @@ class Complex extends Resultset implements ResultsetInterface } if !fetch eager, column["eager"] { - /** * Assign the instance according to the hydration type */ @@ -309,8 +301,7 @@ class Complex extends Resultset implements ResultsetInterface hydrateMode = this->hydrateMode; let container = Di::getDefault(); - - if unlikely typeof container != "object" { + if container === null { throw new Exception( "The dependency injector container is not valid" ); @@ -354,8 +345,64 @@ class Complex extends Resultset implements ResultsetInterface let this->disableHydration = true; let container = Di::getDefault(); + if container === null { + throw new Exception( + "The dependency injector container is not valid" + ); + } + + if container->has("serializer") { + let serializer = container->getShared("serializer"); + + serializer->unserialize(data); + let resultset = serializer->getData(); + } else { + let resultset = unserialize(data); + } + + if unlikely typeof resultset != "array" { + throw new Exception("Invalid serialization data"); + } + + let this->rows = resultset["rows"], + this->count = count(resultset["rows"]), + this->cache = resultset["cache"], + this->columnTypes = resultset["columnTypes"], + this->hydrateMode = resultset["hydrateMode"]; + } + + public function __serialize() -> array + { + var records, cache, columnTypes, hydrateMode; - if unlikely typeof container != "object" { + /** + * Obtain the records as an array + */ + let records = this->toArray(); + + let cache = this->cache, + columnTypes = this->columnTypes, + hydrateMode = this->hydrateMode; + + return [ + "cache" : cache, + "rows" : records, + "columnTypes" : columnTypes, + "hydrateMode" : hydrateMode + ]; + } + + public function __unserialize(array data) -> void + { + var resultset, container, serializer; + + /** + * Rows are already hydrated + */ + let this->disableHydration = true; + + let container = Di::getDefault(); + if container === null { throw new Exception( "The dependency injector container is not valid" ); diff --git a/phalcon/Mvc/Model/Resultset/Simple.zep b/phalcon/Mvc/Model/Resultset/Simple.zep index a6cd38aca1e..320ab145da5 100644 --- a/phalcon/Mvc/Model/Resultset/Simple.zep +++ b/phalcon/Mvc/Model/Resultset/Simple.zep @@ -18,7 +18,6 @@ use Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\Row; use Phalcon\Mvc\ModelInterface; use Phalcon\Storage\Serializer\SerializerInterface; -use Psr\SimpleCache\CacheInterface; /** * Phalcon\Mvc\Model\Resultset\Simple @@ -49,14 +48,14 @@ class Simple extends Resultset * @param array columnMap * @param ModelInterface|Row model * @param \Phalcon\Db\ResultInterface|false result - * @param CacheInterface|null cache + * @param mixed|null cache * @param bool keepSnapshots false */ public function __construct( var columnMap, var model, result, - cache = null, + var cache = null, bool keepSnapshots = false ) { @@ -255,8 +254,7 @@ class Simple extends Resultset array data; let container = Di::getDefault(); - - if unlikely typeof container != "object" { + if container === null { throw new Exception( "The dependency injector container is not valid" ); @@ -293,8 +291,7 @@ class Simple extends Resultset var resultset, keepSnapshots, container, serializer; let container = Di::getDefault(); - - if unlikely typeof container != "object" { + if container === null { throw new Exception( "The dependency injector container is not valid" ); @@ -309,7 +306,7 @@ class Simple extends Resultset let resultset = unserialize(data); } - if unlikely typeof resultset != "array" { + if unlikely typeof resultset !== "array" { throw new Exception("Invalid serialization data"); } @@ -324,4 +321,32 @@ class Simple extends Resultset let this->keepSnapshots = keepSnapshots; } } + + public function __serialize() -> array + { + return [ + "model" : this->model, + "cache" : this->cache, + "rows" : this->toArray(false), + "columnMap" : this->columnMap, + "hydrateMode" : this->hydrateMode, + "keepSnapshots" : this->keepSnapshots + ]; + } + + public function __unserialize(array data) -> void + { + var keepSnapshots; + + let this->model = data["model"], + this->rows = data["rows"], + this->count = count(data["rows"]), + this->cache = data["cache"], + this->columnMap = data["columnMap"], + this->hydrateMode = data["hydrateMode"]; + + if fetch keepSnapshots, data["keepSnapshots"] { + let this->keepSnapshots = keepSnapshots; + } + } } diff --git a/phalcon/Mvc/Model/ResultsetInterface.zep b/phalcon/Mvc/Model/ResultsetInterface.zep index 7052d397e59..8c1b2062773 100644 --- a/phalcon/Mvc/Model/ResultsetInterface.zep +++ b/phalcon/Mvc/Model/ResultsetInterface.zep @@ -13,7 +13,6 @@ namespace Phalcon\Mvc\Model; use Closure; use Phalcon\Messages\MessageInterface; use Phalcon\Mvc\ModelInterface; -use Psr\SimpleCache\CacheInterface; /** * Phalcon\Mvc\Model\ResultsetInterface @@ -45,7 +44,7 @@ interface ResultsetInterface /** * Returns the associated cache for the resultset */ - public function getCache() -> | null; + public function getCache() -> var | null; /** * Get first row in the resultset diff --git a/phalcon/Mvc/Model/Row.zep b/phalcon/Mvc/Model/Row.zep index 6a1ee1c4097..134abdcb61c 100644 --- a/phalcon/Mvc/Model/Row.zep +++ b/phalcon/Mvc/Model/Row.zep @@ -16,8 +16,6 @@ use Phalcon\Mvc\EntityInterface; use Phalcon\Mvc\ModelInterface; /** - * Phalcon\Mvc\Model\Row - * * This component allows Phalcon\Mvc\Model to return rows without an associated entity. * This objects implements the ArrayAccess interface to allow access the object as object->x or array[x]. */ @@ -38,15 +36,13 @@ class Row implements EntityInterface, ResultInterface, ArrayAccess, JsonSerializ * * @return string|ModelInterface */ - public function offsetGet(var index) -> var + public function offsetGet(mixed index) -> mixed { - var value; - - if unlikely !fetch value, this->{index} { + if !this->offsetExists(index) { throw new Exception("The index does not exist in the row"); } - return value; + return this->{index}; } /** @@ -54,7 +50,7 @@ class Row implements EntityInterface, ResultInterface, ArrayAccess, JsonSerializ * * @param string|int $index */ - public function offsetExists(var index) -> bool + public function offsetExists(mixed index) -> bool { return isset this->{index}; } @@ -65,7 +61,7 @@ class Row implements EntityInterface, ResultInterface, ArrayAccess, JsonSerializ * @param string|int index * @param ModelInterface value */ - public function offsetSet(var index, var value) -> void + public function offsetSet(mixed index, mixed value) -> void { throw new Exception("Row is an immutable ArrayAccess object"); } @@ -75,7 +71,7 @@ class Row implements EntityInterface, ResultInterface, ArrayAccess, JsonSerializ * * @param string|int offset */ - public function offsetUnset(var offset) -> void + public function offsetUnset(mixed offset) -> void { throw new Exception("Row is an immutable ArrayAccess object"); } diff --git a/phalcon/Mvc/Router.zep b/phalcon/Mvc/Router.zep index cc54e887e8e..d71a1c6f501 100644 --- a/phalcon/Mvc/Router.zep +++ b/phalcon/Mvc/Router.zep @@ -54,34 +54,34 @@ class Router extends AbstractInjectionAware implements RouterInterface, EventsAw const POSITION_LAST = 1; /** - * @var string|null + * @var string */ - protected action = null; + protected action = ""; /** - * @var string|null + * @var string */ - protected controller = null; + protected controller = ""; /** - * @var string|null + * @var string */ - protected defaultAction = null; + protected defaultAction = ""; /** - * @var string|null + * @var string */ - protected defaultController = null; + protected defaultController = ""; /** - * @var string|null + * @var string */ - protected defaultModule = null; + protected defaultModule = ""; /** - * @var string|null + * @var string */ - protected defaultNamespace = null; + protected defaultNamespace = ""; /** * @var array @@ -114,14 +114,14 @@ class Router extends AbstractInjectionAware implements RouterInterface, EventsAw protected matches = []; /** - * @var string|null + * @var string */ - protected module = null; + protected module = ""; /** - * @var string|null + * @var string */ - protected namespaceName = null; + protected namespaceName = ""; /** * @var array|string|null @@ -1151,7 +1151,7 @@ class Router extends AbstractInjectionAware implements RouterInterface, EventsAw // Set a default namespace if fetch namespaceName, defaults["namespace"] { - let this->defaultNamespace = namespaceName; + let this->defaultNamespace = (string)namespaceName; } // Set a default module diff --git a/phalcon/Mvc/Router/Annotations.zep b/phalcon/Mvc/Router/Annotations.zep index 23811d0a334..1a4ce69275c 100644 --- a/phalcon/Mvc/Router/Annotations.zep +++ b/phalcon/Mvc/Router/Annotations.zep @@ -180,6 +180,7 @@ class Annotations extends Router * Check if the scope has a module associated */ fetch moduleName, scope[2]; + let moduleName = moduleName !== null ? moduleName : ""; let sufixed = controllerName . controllerSuffix; diff --git a/phalcon/Paginator/PaginatorFactory.zep b/phalcon/Paginator/PaginatorFactory.zep index 1ba70cd5d85..b31808c3fd2 100644 --- a/phalcon/Paginator/PaginatorFactory.zep +++ b/phalcon/Paginator/PaginatorFactory.zep @@ -46,7 +46,7 @@ class PaginatorFactory extends AbstractFactory * $paginator = (new PaginatorFactory())->load($options); *``` * - * @param array|\Phalcon\Config = [ + * @param array|\Phalcon\Config\Config config = [ * 'adapter' => 'queryBuilder', * 'limit' => 20, * 'page' => 1, diff --git a/phalcon/Session/Adapter/AbstractAdapter.zep b/phalcon/Session/Adapter/AbstractAdapter.zep index 9404c462abf..70b9c844464 100644 --- a/phalcon/Session/Adapter/AbstractAdapter.zep +++ b/phalcon/Session/Adapter/AbstractAdapter.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -31,10 +31,10 @@ abstract class AbstractAdapter implements SessionHandlerInterface /** * Destroy */ - public function destroy(var id) -> bool + public function destroy(var sessionId) -> bool { - if !empty(id) && this->adapter->has(id) { - return this->adapter->delete(id); + if !empty(sessionId) && this->adapter->has(sessionId) { + return this->adapter->delete(sessionId); } return true; @@ -42,8 +42,11 @@ abstract class AbstractAdapter implements SessionHandlerInterface /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ - public function gc(var maxlifetime) + public function gc(int maxlifetime) -> int|bool { return true; } @@ -51,10 +54,10 @@ abstract class AbstractAdapter implements SessionHandlerInterface /** * Read */ - public function read(var id) -> string + public function read(var sessionId) -> string { var data; - let data = this->adapter->get(id); + let data = this->adapter->get(sessionId); return null === data ? "" : data; } @@ -70,9 +73,9 @@ abstract class AbstractAdapter implements SessionHandlerInterface /** * Write */ - public function write(var id, var data) -> bool + public function write(var sessionId, var data) -> bool { - return this->adapter->set(id, data); + return this->adapter->set(sessionId, data); } /** diff --git a/phalcon/Session/Adapter/Libmemcached.zep b/phalcon/Session/Adapter/Libmemcached.zep index bc75deffd0c..b9dc9def664 100644 --- a/phalcon/Session/Adapter/Libmemcached.zep +++ b/phalcon/Session/Adapter/Libmemcached.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -18,9 +18,10 @@ use Phalcon\Storage\AdapterFactory; class Libmemcached extends AbstractAdapter { /** - * Constructor + * Libmemcached constructor. * - * @param array options = [ + * @param AdapterFactory $factory + * @param array $options = [ * 'servers' => [ * [ * 'host' => 'localhost', diff --git a/phalcon/Session/Adapter/Noop.zep b/phalcon/Session/Adapter/Noop.zep index 2403d124a99..351f6380d34 100644 --- a/phalcon/Session/Adapter/Noop.zep +++ b/phalcon/Session/Adapter/Noop.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -88,15 +88,18 @@ class Noop implements SessionHandlerInterface /** * Destroy */ - public function destroy(var id) -> bool + public function destroy(var sessionId) -> bool { return true; } /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ - public function gc(var maxlifetime) + public function gc(int maxlifetime) -> int|bool { return true; } @@ -104,7 +107,7 @@ class Noop implements SessionHandlerInterface /** * Read */ - public function read(var id) -> string + public function read(var sessionId) -> string { return ""; } @@ -120,7 +123,7 @@ class Noop implements SessionHandlerInterface /** * Write */ - public function write(var id, var data) -> bool + public function write(var sessionId, var data) -> bool { return true; } diff --git a/phalcon/Session/Adapter/Redis.zep b/phalcon/Session/Adapter/Redis.zep index d1980e820d1..dfeb6bdd5bd 100644 --- a/phalcon/Session/Adapter/Redis.zep +++ b/phalcon/Session/Adapter/Redis.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -20,14 +20,15 @@ use Phalcon\Storage\AdapterFactory; /** * Constructor * - * @param array options = [ - * 'prefix' => 'sess-reds-', - * 'host' => '127.0.0.1', - * 'port' => 6379, - * 'index' => 0, - * 'persistent' => false, - * 'auth' => '', - * 'socket' => '' + * @param AdapterFactory $factory + * @param array $options = [ + * 'prefix' => 'sess-reds-', + * 'host' => '127.0.0.1', + * 'port' => 6379, + * 'index' => 0, + * 'persistent' => false, + * 'auth' => '', + * 'socket' => '', * ] */ public function __construct( factory, array! options = []) diff --git a/phalcon/Session/Adapter/Stream.zep b/phalcon/Session/Adapter/Stream.zep index 768d2f0792a..a0cb4aa584b 100644 --- a/phalcon/Session/Adapter/Stream.zep +++ b/phalcon/Session/Adapter/Stream.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -31,6 +31,10 @@ use Phalcon\Session\Exception; * ); * $session->setAdapter($files); * ``` + * + * @property array $options + * @property string $prefix + * @property string $path */ class Stream extends Noop { @@ -42,39 +46,39 @@ class Stream extends Noop /** * Constructor * - * @param array options = [ + * @param array $options = [ * 'prefix' => '', * 'savePath' => '' * ] */ public function __construct(array! options = []) { - var path, options; + var path; parent::__construct(options); - let options = this->options; - /** * Get the save_path from the passed options. If not defined * get it from php.ini */ - if !fetch path, options["savePath"] { - let path = ini_get("session.save_path"); + let path = this->getArrVal(options, "savePath", this->phpIniGet("session.save_path")); + + if unlikely true === empty(path) { + throw new Exception("The session save path cannot be empty"); } - if unlikely !is_writable(path) { + if unlikely true !== this->phpIsWritable(path) { throw new Exception("The session save path [" . path . "] is not writable"); } let this->path = this->getDirSeparator(path); } - public function destroy(var id) -> bool + public function destroy(var sessionId) -> bool { var file; - let file = this->path . this->getPrefixedName(id); + let file = this->path . this->getPrefixedName(sessionId); if file_exists(file) && is_file(file) { unlink(file); @@ -85,8 +89,11 @@ class Stream extends Noop /** * Garbage Collector + * + * @param int $maxlifetime + * @return false|int */ - public function gc(var maxlifetime) + public function gc(int maxlifetime) -> int|bool { var file, pattern, time; @@ -94,8 +101,8 @@ class Stream extends Noop time = time() - maxlifetime; for file in glob(pattern) { - if file_exists(file) && - is_file(file) && + if true === file_exists(file) && + true === is_file(file) && (filemtime(file) < time) { unlink(file); } @@ -114,18 +121,21 @@ class Stream extends Noop return true; } - public function read(var id) -> string + /** + * Reads data from the adapter + */ + public function read(var sessionId) -> string { var data, name, pointer; - let name = this->path . this->getPrefixedName(id), + let name = this->path . this->getPrefixedName(sessionId), data = ""; - if file_exists(name) { - let pointer = fopen(name, 'r'); + if true === this->phpFileExists(name) { + let pointer = this->phpFopen(name, "r"); if (flock(pointer, LOCK_SH)) { - let data = file_get_contents(name); + let data = this->phpFileGetContents(name); } fclose(pointer); @@ -138,20 +148,124 @@ class Stream extends Noop return data; } - public function write(var id, var data) -> bool + public function write(var sessionId, var data) -> bool { var name; - let name = this->path . this->getPrefixedName(id); + let name = this->path . this->getPrefixedName(sessionId); - return false !== file_put_contents(name, data, LOCK_EX); + return false !== this->phpFilePutContents(name, data, LOCK_EX); } /** * @todo Remove this when we get traits */ + protected function getArrVal( + array! collection, + var index, + var defaultValue = null, + string! cast = null + ) -> var { + var value; + + if unlikely !fetch value, collection[index] { + return defaultValue; + } + + if unlikely cast { + settype(value, cast); + } + + return value; + } + private function getDirSeparator(string! directory) -> string { return rtrim(directory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; } + + /** + * @param string $filename + * + * @return bool + * + * @link https://php.net/manual/en/function.file-exists.php + */ + protected function phpFileExists(string filename) + { + return file_exists(filename); + } + + /** + * @param string $filename + * + * @return string|false + * + * @link https://php.net/manual/en/function.file-get-contents.php + */ + protected function phpFileGetContents(string filename) + { + return file_get_contents(filename); + } + + /** + * @param string $filename + * @param mixed $data + * @param int $flags + * @param resource $context + * + * @return int|false + * + * @link https://php.net/manual/en/function.file-put-contents.php + */ + protected function phpFilePutContents( + string filename, + var data, + int flags = 0, + var context = null + ) { + return file_put_contents(filename, data, flags, context); + } + + /** + * @param string $filename + * @param string $mode + * + * @return resource|false + * + * @link https://php.net/manual/en/function.fopen.php + */ + protected function phpFopen(string filename, string mode) + { + return fopen(filename, mode); + } + + /** + * Gets the value of a configuration option + * + * @param string $varname + * + * @return string + * + * @link https://php.net/manual/en/function.ini-get.php + * @link https://php.net/manual/en/ini.list.php + */ + protected function phpIniGet(string varname) -> string + { + return ini_get(varname); + } + + /** + * Tells whether the filename is writable + * + * @param string $filename + * + * @return bool + * + * @link https://php.net/manual/en/function.is-writable.php + */ + protected function phpIsWritable(string filename) -> bool + { + return is_writable(filename); + } } diff --git a/phalcon/Session/Bag.zep b/phalcon/Session/Bag.zep index 310f24441bd..37f2db715c9 100644 --- a/phalcon/Session/Bag.zep +++ b/phalcon/Session/Bag.zep @@ -1,7 +1,7 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -9,10 +9,11 @@ namespace Phalcon\Session; -use Phalcon\Support\Collection; use Phalcon\Di\Di; use Phalcon\Di\DiInterface; use Phalcon\Di\InjectionAwareInterface; +use Phalcon\Session\ManagerInterface; +use Phalcon\Support\Collection; /** * Phalcon\Session\Bag @@ -27,8 +28,12 @@ use Phalcon\Di\InjectionAwareInterface; * $user->name = "Kimbra Johnson"; * $user->age = 22; * ``` + * + * @property DiInterface|null $container + * @property string $name + * @property ManagerInterface $session; */ -class Bag extends Collection implements InjectionAwareInterface +class Bag extends Collection implements BagInterface, InjectionAwareInterface { /** * @var DiInterface|null @@ -43,38 +48,25 @@ class Bag extends Collection implements InjectionAwareInterface private name; /** - * @var \Phalcon\Session\ManagerInterface + * @var ManagerInterface */ private session; /** - * Phalcon\Session\Bag constructor + * @param ManagerInterface $session + * @param string $name */ - public function __construct(string! name, container = null) + public function __construct( session, string name) { - var data, session; + var data; - let this->name = name; - - if unlikely null === container { - throw new Exception( - "A dependency injection container is required to access the 'session' service" - ); - } - - if unlikely true !== container->has("session") { - throw new Exception( - "A dependency injection container is required to access the 'session' service" - ); - } - - let session = container->getShared("session"), - this->container = container, - this->session = session; + let this->session = session, + this->name = name, + this->container = session->getDI(); let data = session->get(this->name); - if typeof data != "array" { + if typeof data !== "array" { let data = []; } @@ -106,7 +98,7 @@ class Bag extends Collection implements InjectionAwareInterface { parent::init(data); - this->session->set(this->name, this->data); + this->session->set(this->name, data); } /** diff --git a/phalcon/Session/BagInterface.zep b/phalcon/Session/BagInterface.zep new file mode 100644 index 00000000000..ff5feacabf4 --- /dev/null +++ b/phalcon/Session/BagInterface.zep @@ -0,0 +1,38 @@ +/** + * This file is part of the Phalcon. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Phalcon\Session; + +/** + * Phalcon\Session\BagInterface + * + * Interface for Phalcon\Session\Bag + */ +interface BagInterface +{ + public function __get(string element) -> var; + + public function __isset(string element) -> bool; + + public function __set(string element, value) -> void; + + public function __unset(string element) -> void; + + public function init(array data = []) -> void; + + public function get(string element, var defaultValue = null, string! cast = null) -> var; + + public function set(string element, var value) -> void; + + public function has(string element) -> bool; + + public function remove(string element) -> void; + + public function clear() -> void; +} diff --git a/phalcon/Session/Exception.zep b/phalcon/Session/Exception.zep index d790094619b..a4e8cf5cea8 100644 --- a/phalcon/Session/Exception.zep +++ b/phalcon/Session/Exception.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/phalcon/Session/Manager.zep b/phalcon/Session/Manager.zep index a5c60a4ead5..f65264b5855 100644 --- a/phalcon/Session/Manager.zep +++ b/phalcon/Session/Manager.zep @@ -1,10 +1,10 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ @@ -18,9 +18,10 @@ use Phalcon\Di\DiInterface; use Phalcon\Support\Helper\Arr\Get; /** - * Phalcon\Session\Manager - * - * Session manager class + * @property SessionHandlerInterface|null $adapter + * @property string $name + * @property array $options + * @property string $uniqueId */ class Manager extends AbstractInjectionAware implements ManagerInterface { @@ -47,7 +48,7 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Manager constructor. * - * @param array options = [ + * @param array $options = [ * 'uniqueId' => null * ] */ @@ -58,6 +59,10 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Alias: Gets a session variable from an application context + * + * @param string $key + * + * @return mixed */ public function __get(string key) -> var { @@ -66,6 +71,10 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Alias: Check whether a session variable is set in an application context + * + * @param string $key + * + * @return bool */ public function __isset(string key) -> bool { @@ -74,14 +83,19 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Alias: Sets a session variable in an application context + * + * @param string $key + * @param mixed $value */ - public function __set(string key, value) -> void + public function __set(string key, var value) -> void { this->set(key, value); } /** * Alias: Removes a session variable from an application context + * + * @param string $key */ public function __unset(string key) -> void { @@ -93,7 +107,7 @@ class Manager extends AbstractInjectionAware implements ManagerInterface */ public function destroy() -> void { - if true === this->exists() { + if (true === this->exists()) { session_destroy(); let _SESSION = []; @@ -102,6 +116,8 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Check whether the session has been started + * + * @return bool */ public function exists() -> bool { @@ -110,12 +126,20 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Gets a session variable from an application context + * + * @param string $key + * @param mixed|null $defaultValue + * @param bool $remove + * + * @return mixed|null */ public function get(string key, var defaultValue = null, bool remove = false) -> var { - var uniqueKey, value = null; + var value, uniqueKey; - if false === this->exists() { + let value = null; + + if (false === this->exists()) { // To use $_SESSION variable we need to start session first return value; } @@ -186,14 +210,10 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Regenerates the session id using the adapter. */ - public function regenerateId(deleteOldSession = true) -> + public function regenerateId(bool deleteOldSession = true) -> { - var delete; - - let delete = (bool) deleteOldSession; - if true === this->exists() { - session_regenerate_id(delete); + session_regenerate_id(deleteOldSession); } return this; @@ -204,32 +224,29 @@ class Manager extends AbstractInjectionAware implements ManagerInterface */ public function remove(string key) -> void { - if false === this->exists() { - // To use $_SESSION variable we need to start session first - return; - } - var uniqueKey; - let uniqueKey = this->getUniqueKey(key); + // To use $_SESSION variable we need to start session first + if true === this->exists() { + let uniqueKey = this->getUniqueKey(key); - unset(_SESSION[uniqueKey]); + unset _SESSION[uniqueKey]; + } } /** * Sets a session variable in an application context */ - public function set(string key, value) -> void + public function set(string key, var value) -> void { var uniqueKey; - if false === this->exists() { - // To use $_SESSION variable we need to start session first - return; - } + // To use $_SESSION variable we need to start session first + if true === this->exists() { + let uniqueKey = this->getUniqueKey(key); - let uniqueKey = this->getUniqueKey(key), - _SESSION[uniqueKey] = value; + let _SESSION[uniqueKey] = value; + } } /** @@ -245,16 +262,16 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Set session Id */ - public function setId(string id) -> + public function setId(string sessionId) -> { if unlikely (true === this->exists()) { - throw new RuntimeException( + throw new Exception( "The session has already been started. " . "To change the id, use regenerateId()" ); } - session_id(id); + session_id(sessionId); return this; } @@ -263,7 +280,7 @@ class Manager extends AbstractInjectionAware implements ManagerInterface * Set the session name. Throw exception if the session has started * and do not allow poop names * - * @param string name + * @param string $name * * @throws InvalidArgumentException * @@ -271,14 +288,14 @@ class Manager extends AbstractInjectionAware implements ManagerInterface */ public function setName(string name) -> { - if unlikely this->exists() { - throw new InvalidArgumentException( + if unlikely true === this->exists() { + throw new Exception( "Cannot set session name after a session has started" ); } if unlikely !preg_match("/^[\p{L}\p{N}_-]+$/u", name) { - throw new InvalidArgumentException( + throw new Exception( "The name contains non alphanum characters" ); } @@ -319,7 +336,7 @@ class Manager extends AbstractInjectionAware implements ManagerInterface /** * Cannot start this - headers already sent */ - if true === headers_sent() { + if (true === this->phpHeadersSent()) { return false; } @@ -368,20 +385,32 @@ class Manager extends AbstractInjectionAware implements ManagerInterface return self::SESSION_NONE; } + /** + * Checks if or where headers have been sent + * + * @return bool + * + * @link https://php.net/manual/en/function.headers-sent.php + */ + protected function phpHeadersSent() -> bool + { + return headers_sent(); + } + /** * Returns the key prefixed + * + * @param string $key + * + * @return string */ private function getUniqueKey(string key) -> string { - var uniqueId; + var prefix; - let uniqueId = this->uniqueId; + let prefix = (true !== empty(this->uniqueId)) ? this->uniqueId . "#" : ""; - if !empty uniqueId { - return this->uniqueId . "#" . key; - } else { - return key; - } + return prefix . key; } /** diff --git a/phalcon/Session/ManagerInterface.zep b/phalcon/Session/ManagerInterface.zep index 015931f7805..ea9c12b875b 100644 --- a/phalcon/Session/ManagerInterface.zep +++ b/phalcon/Session/ManagerInterface.zep @@ -1,8 +1,8 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -103,7 +103,7 @@ interface ManagerInterface /** * Set session Id */ - public function setId(string id) -> ; + public function setId(string sessionId) -> ; /** * Set the session name. Throw exception if the session has started @@ -132,5 +132,5 @@ interface ManagerInterface /** * Regenerates the session id using the adapter. */ - public function regenerateId(deleteOldSession = true) -> ; + public function regenerateId(bool deleteOldSession = true) -> ; } diff --git a/phalcon/Storage/Adapter/AbstractAdapter.zep b/phalcon/Storage/Adapter/AbstractAdapter.zep index c7dab52b3c4..7e9b87c7f8d 100644 --- a/phalcon/Storage/Adapter/AbstractAdapter.zep +++ b/phalcon/Storage/Adapter/AbstractAdapter.zep @@ -141,7 +141,18 @@ abstract class AbstractAdapter implements AdapterInterface * * @return mixed */ - abstract public function get(string! key, var defaultValue = null) -> var; + public function get(string key, defaultValue = null) -> var + { + var content; + + if (true !== this->has(key)) { + return defaultValue; + } + + let content = this->doGet(key); + + return this->getUnserializedData(content, defaultValue); + } /** * Returns the adapter - connects to the storage if not connected @@ -210,6 +221,16 @@ abstract class AbstractAdapter implements AdapterInterface let this->defaultSerializer = mb_strtolower(serializer); } + /** + * @param string $key + * + * @return mixed + */ + protected function doGet(string key) + { + return this->getAdapter()->get(key); + } + /** * Filters the keys array based on global and passed prefix * @@ -259,7 +280,7 @@ abstract class AbstractAdapter implements AdapterInterface */ protected function getSerializedData(var content) -> var { - if true !== empty(this->defaultSerializer) { + if (null !== this->serializer) { this->serializer->setData(content); let content = this->serializer->serialize(); } @@ -301,12 +322,13 @@ abstract class AbstractAdapter implements AdapterInterface */ protected function getUnserializedData(var content, var defaultValue = null) -> var { - if !content { - return defaultValue; - } - - if true !== empty(this->defaultSerializer) { + if (null !== this->serializer) { this->serializer->unserialize(content); + + if unlikely true !== this->serializer->isSuccess() { + return defaultValue; + } + let content = this->serializer->getData(); } diff --git a/phalcon/Storage/Adapter/Apcu.zep b/phalcon/Storage/Adapter/Apcu.zep index 0eea3249156..6e5ed0a2f42 100644 --- a/phalcon/Storage/Adapter/Apcu.zep +++ b/phalcon/Storage/Adapter/Apcu.zep @@ -52,7 +52,7 @@ class Apcu extends AbstractAdapter bool result; let pattern = "/^" . this->prefix . "/", - apc = new APCuIterator(pattern), + apc = this->phpApcuIterator(pattern), result = true; if typeof apc !== "object" { @@ -60,7 +60,7 @@ class Apcu extends AbstractAdapter } for item in iterator(apc) { - if !apcu_delete(item["key"]) { + if (true !== this->phpApcuDelete(item["key"])) { let result = false; } } @@ -78,7 +78,7 @@ class Apcu extends AbstractAdapter */ public function decrement(string! key, int value = 1) -> int | bool { - return apcu_dec(this->getPrefixedKey(key), value); + return this->phpApcuDec(this->getPrefixedKey(key), value); } /** @@ -90,24 +90,7 @@ class Apcu extends AbstractAdapter */ public function delete(string! key) -> bool { - return apcu_delete(this->getPrefixedKey(key)); - } - - /** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed - */ - public function get(string! key, var defaultValue = null) -> var - { - var content; - - let content = apcu_fetch(this->getPrefixedKey(key)); - - return this->getUnserializedData(content, defaultValue); + return (bool) this->phpApcuDelete(this->getPrefixedKey(key)); } /** @@ -123,7 +106,7 @@ class Apcu extends AbstractAdapter array results; let pattern = "/^" . this->prefix . prefix . "/", - apc = new APCuIterator(pattern), + apc = this->phpApcuIterator(pattern), results = []; if typeof apc !== "object" { @@ -148,7 +131,7 @@ class Apcu extends AbstractAdapter { var result; - let result = apcu_exists(this->getPrefixedKey(key)); + let result = this->phpApcuExists(this->getPrefixedKey(key)); return typeof result === "bool" ? result : false; } @@ -163,15 +146,19 @@ class Apcu extends AbstractAdapter */ public function increment(string! key, int value = 1) -> int | bool { - return apcu_inc(this->getPrefixedKey(key), value); + return this->phpApcuInc(this->getPrefixedKey(key), value); } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws Exception @@ -184,7 +171,7 @@ class Apcu extends AbstractAdapter return this->delete(key); } - let result = apcu_store( + let result = this->phpApcuStore( this->getPrefixedKey(key), this->getSerializedData(value), this->getTtl(ttl) @@ -206,11 +193,59 @@ class Apcu extends AbstractAdapter { var result; - let result = apcu_store( + let result = this->phpApcuStore( this->getPrefixedKey(key), this->getSerializedData(value) ); - return typeof result === "bool" ? result : false; + return is_bool(result) ? result : false; + } + + /** + * @param string $key + * + * @return mixed + */ + protected function doGet(string key) + { + return this->phpApcuFetch(this->getPrefixedKey(key)); + } + + /** + * @todo Remove the below once we get traits + */ + protected function phpApcuDec(var key, int step = 1, var success = null, int ttl = 0) -> bool | int + { + return apcu_dec(key, step, success, ttl); + } + + protected function phpApcuDelete(var key) -> bool | array + { + return apcu_delete(key); + } + + protected function phpApcuExists(var key) -> bool | array + { + return apcu_exists(key); + } + + protected function phpApcuInc(var key, int step = 1, var success = null, int ttl = 0) -> bool | int + { + return apcu_inc(key, step, success, ttl); + } + + protected function phpApcuFetch(var key, var success = null) -> var + { + return apcu_fetch(key, success); + } + + protected function phpApcuIterator(string pattern) -> | bool + { + return new APCuIterator(pattern); + } + + protected function phpApcuStore(var key, var payload, int ttl = 0) -> bool | array + { + return apcu_store(key, payload, ttl); } } diff --git a/phalcon/Storage/Adapter/Libmemcached.zep b/phalcon/Storage/Adapter/Libmemcached.zep index 23b6c16c4d2..b533bce2c80 100644 --- a/phalcon/Storage/Adapter/Libmemcached.zep +++ b/phalcon/Storage/Adapter/Libmemcached.zep @@ -87,23 +87,6 @@ class Libmemcached extends AbstractAdapter return this->getAdapter()->delete(key, 0); } - /** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed|null - * @throws StorageException - */ - public function get(string! key, var defaultValue = null) -> var - { - return this->getUnserializedData( - this->getAdapter()->get(key), - defaultValue - ); - } - /** * Returns the already connected adapter or connects to the Memcached * server(s) @@ -203,11 +186,15 @@ class Libmemcached extends AbstractAdapter } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -300,9 +287,9 @@ class Libmemcached extends AbstractAdapter array map; let map = [ - "php" : \Memcached::SERIALIZER_PHP, - "json" : \Memcached::SERIALIZER_JSON, - "igbinary" : \Memcached::SERIALIZER_IGBINARY + "memcached_igbinary" : \Memcached::SERIALIZER_IGBINARY, + "memcached_json" : \Memcached::SERIALIZER_JSON, + "memcached_php" : \Memcached::SERIALIZER_PHP ]; let serializer = strtolower(this->defaultSerializer); diff --git a/phalcon/Storage/Adapter/Memory.zep b/phalcon/Storage/Adapter/Memory.zep index 6c279c9025b..605275c2ef9 100644 --- a/phalcon/Storage/Adapter/Memory.zep +++ b/phalcon/Storage/Adapter/Memory.zep @@ -63,16 +63,18 @@ class Memory extends AbstractAdapter */ public function decrement(string! key, int value = 1) -> int | bool { - var current, prefixedKey, result; + var current, newValue, prefixedKey, result; - let prefixedKey = this->getPrefixedKey(key); + let prefixedKey = this->getPrefixedKey(key), + result = array_key_exists(prefixedKey, this->data); - if unlikely !fetch current, this->data[prefixedKey] { - return false; - } + if likely true === result { + let current = this->data[prefixedKey], + newValue = (int) current - value, + result = newValue; - let result = (int) current - value, - this->data[prefixedKey] = result; + let this->data[prefixedKey] = newValue; + } return result; } @@ -89,31 +91,13 @@ class Memory extends AbstractAdapter var exists, prefixedKey; let prefixedKey = this->getPrefixedKey(key), - exists = isset(this->data[prefixedKey]); + exists = array_key_exists(prefixedKey, this->data); unset(this->data[prefixedKey]); return exists; } - /** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed - */ - public function get(string key, defaultValue = null) - { - var content, prefixedKey; - - let prefixedKey = this->getPrefixedKey(key), - content = this->data[prefixedKey]; - - return this->getUnserializedData(content, defaultValue); - } - /** * Stores data in the adapter * @@ -139,7 +123,7 @@ class Memory extends AbstractAdapter let prefixedKey = this->getPrefixedKey(key); - return isset(this->data[prefixedKey]); + return array_key_exists(prefixedKey, this->data); } /** @@ -152,26 +136,32 @@ class Memory extends AbstractAdapter */ public function increment(string! key, int value = 1) -> int | bool { - var current, prefixedKey, result; + var current, newValue, prefixedKey, result; - let prefixedKey = this->getPrefixedKey(key); + let prefixedKey = this->getPrefixedKey(key), + result = array_key_exists(prefixedKey, this->data); - if unlikely !fetch current, this->data[prefixedKey] { - return false; - } + if likely true === result { + let current = this->data[prefixedKey], + newValue = (int) current + value, + result = newValue; - let result = (int) current + value, - this->data[prefixedKey] = result; + let this->data[prefixedKey] = newValue; + } return result; } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -205,4 +195,14 @@ class Memory extends AbstractAdapter { return this->set(key, value); } + + /** + * @param string $key + * + * @return mixed + */ + protected function doGet(string key) + { + return this->data[this->getPrefixedKey(key)]; + } } diff --git a/phalcon/Storage/Adapter/Redis.zep b/phalcon/Storage/Adapter/Redis.zep index 5eb1c3d3833..a919ed4b499 100644 --- a/phalcon/Storage/Adapter/Redis.zep +++ b/phalcon/Storage/Adapter/Redis.zep @@ -94,23 +94,6 @@ class Redis extends AbstractAdapter return (bool) this->getAdapter()->del(key); } - /** - * Reads data from the adapter - * - * @param string $key - * @param mixed|null $defaultValue - * - * @return mixed|null - * @throws StorageException - */ - public function get(string! key, var defaultValue = null) -> var - { - return this->getUnserializedData( - this->getAdapter()->get(key), - defaultValue - ); - } - /** * Returns the already connected adapter or connects to the Redis * server(s) @@ -184,11 +167,15 @@ class Redis extends AbstractAdapter } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool * @throws BaseException @@ -340,8 +327,8 @@ class Redis extends AbstractAdapter array map; let map = [ - "none" : \Redis::SERIALIZER_NONE, - "php" : \Redis::SERIALIZER_PHP + "redis_none" : \Redis::SERIALIZER_NONE, + "redis_php" : \Redis::SERIALIZER_PHP ]; /** @@ -349,15 +336,15 @@ class Redis extends AbstractAdapter * of Redis */ if (defined("\\Redis::SERIALIZER_IGBINARY")) { - let map["igbinary"] = constant("\\Redis::SERIALIZER_IGBINARY"); + let map["redis_igbinary"] = constant("\\Redis::SERIALIZER_IGBINARY"); } if (defined("\\Redis::SERIALIZER_MSGPACK")) { - let map["msgpack"] = constant("\\Redis::SERIALIZER_MSGPACK"); + let map["redis_msgpack"] = constant("\\Redis::SERIALIZER_MSGPACK"); } if (defined("\\Redis::SERIALIZER_JSON")) { - let map["json"] = constant("\\Redis::SERIALIZER_JSON"); + let map["redis_json"] = constant("\\Redis::SERIALIZER_JSON"); } let serializer = strtolower(this->defaultSerializer); diff --git a/phalcon/Storage/Adapter/Stream.zep b/phalcon/Storage/Adapter/Stream.zep index f2bd81e55c5..ff67aa292f3 100644 --- a/phalcon/Storage/Adapter/Stream.zep +++ b/phalcon/Storage/Adapter/Stream.zep @@ -86,7 +86,7 @@ class Stream extends AbstractAdapter iterator = this->getIterator(directory); for file in iterator { - if file->isFile() && !unlink(file->getPathName()) { + if unlikely true === file->isFile() && true !== this->phpUnlink(file->getPathName()) { let result = false; } } @@ -104,16 +104,21 @@ class Stream extends AbstractAdapter */ public function decrement(string! key, int value = 1) -> int | bool { - var data; + var data, result; - if !this->has(key) { + if unlikely true !== this->has(key) { return false; } let data = this->get(key), data = (int) data - value; - return this->set(key, data); + let result = this->set(key, data); + if likely result !== false { + let result = data; + } + + return result; } /** @@ -127,7 +132,7 @@ class Stream extends AbstractAdapter { var filepath; - if !this->has(key) { + if true !== this->has(key) { return false; } @@ -180,14 +185,14 @@ class Stream extends AbstractAdapter let files = [], directory = this->getDir(); - if !file_exists(directory) { + if unlikely true !== this->phpFileExists(directory) { return []; } let iterator = this->getIterator(directory); for file in iterator { - if file->isFile() { + if true === file->isFile() { let files[] = this->prefix . file->getFilename(); } } @@ -208,7 +213,7 @@ class Stream extends AbstractAdapter let filepath = this->getFilepath(key); - if !file_exists(filepath) { + if unlikely true !== this->phpFileExists(filepath) { return false; } @@ -231,24 +236,33 @@ class Stream extends AbstractAdapter */ public function increment(string! key, int value = 1) -> int | bool { - var data; + var data, result; - if !this->has(key) { + if unlikely true !== this->has(key) { return false; } let data = this->get(key), data = (int) data + value; - return this->set(key, data); + let result = this->set(key, data); + if likely result !== false { + let result = data; + } + + return result; } /** - * Stores data in the adapter + * Stores data in the adapter. If the TTL is `null` (default) or not defined + * then the default TTL will be used, as set in this adapter. If the TTL + * is `0` or a negative number, a `delete()` will be issued, since this + * item has expired. If you need to set this key forever, you should use + * the `setForever()` method. * - * @param string $key - * @param mixed $value - * @param \DateInterval|int|null $ttl + * @param string $key + * @param mixed $value + * @param DateInterval|int|null $ttl * * @return bool */ @@ -353,17 +367,17 @@ class Stream extends AbstractAdapter var payload, pointer, version; let payload = false, - pointer = fopen(filepath, 'r'); + pointer = this->phpFopen(filepath, "r"); /** * Cannot open file */ - if (false === pointer) { + if unlikely false === pointer { return []; } - if (flock(pointer, LOCK_SH)) { - let payload = file_get_contents(filepath); + if likely true === flock(pointer, LOCK_SH) { + let payload = this->phpFileGetContents(filepath); } fclose(pointer); @@ -371,7 +385,7 @@ class Stream extends AbstractAdapter /** * No results */ - if false === payload { + if unlikely false === payload { return []; } @@ -446,12 +460,43 @@ class Stream extends AbstractAdapter mkdir(directory, 0777, true); } - return false !== file_put_contents(directory . key, payload, LOCK_EX); + return ( + false !== this->phpFilePutContents(directory . key, payload, LOCK_EX) + ); } /** - * @todo Remove this when we get traits + * @todo Remove the methods below when we get traits */ + protected function phpFileExists(string filename) -> bool + { + return file_exists(filename); + } + + protected function phpFileGetContents(string filename) -> string | bool + { + return file_get_contents(filename); + } + + protected function phpFilePutContents( + string filename, + var data, + int flags = 0, + var context = null + ) -> int | bool { + return file_put_contents(filename, data, flags, context); + } + + protected function phpFopen(string filename, string mode) -> var + { + return fopen(filename, mode); + } + + protected function phpUnlink(string filename) -> bool + { + return unlink(filename); + } + private function getDirFromFile(string! file) -> string { var name, start; @@ -470,9 +515,6 @@ class Stream extends AbstractAdapter return implode("/", str_split(start, 2)) . "/"; } - /** - * @todo Remove this when we get traits - */ private function getDirSeparator(string! directory) -> string { return rtrim(directory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; diff --git a/phalcon/Storage/Serializer/AbstractSerializer.zep b/phalcon/Storage/Serializer/AbstractSerializer.zep index 36b9ed5b76e..d20ec493114 100644 --- a/phalcon/Storage/Serializer/AbstractSerializer.zep +++ b/phalcon/Storage/Serializer/AbstractSerializer.zep @@ -11,11 +11,8 @@ namespace Phalcon\Storage\Serializer; /** - * Class AbstractSerializer - * - * @package Phalcon\Storage\Serializer - * * @property mixed $data + * @property bool $isSuccess */ abstract class AbstractSerializer implements SerializerInterface { @@ -25,7 +22,12 @@ abstract class AbstractSerializer implements SerializerInterface protected data = null; /** - * Constructor. + * @var bool + */ + protected isSuccess = true; + + /** + * AbstractSerializer constructor. * * @param mixed|null $data */ @@ -35,29 +37,58 @@ abstract class AbstractSerializer implements SerializerInterface } /** - * If this returns true, then the data returns back as is - * - * @param mixed $data + * @return mixed + */ + public function getData() + { + return this->data; + } + + /** + * Returns `true` if the serialize/unserialize operation was successful; + * `false` otherwise * * @return bool */ - protected function isSerializable(var data) -> bool - { - return !(empty data || typeof data === "bool" || is_numeric(data)); - } + public function isSuccess() -> bool + { + return this->isSuccess; + } /** - * @return mixed + * @param mixed $data */ - public function getData() -> var + public function setData(data) -> void { - return this->data; + let this->data = data; } /** + * If this returns true, then the data is returned as is + * * @param mixed $data + * + * @return bool */ - public function setData(var data) -> void + protected function isSerializable(data) -> bool + { + return !( + null === data || + true === is_bool(data) || + true === is_numeric(data) + ); + } + + public function __serialize() -> array + { + if typeof this->data === "array" { + return this->data; + } + + return []; + } + + public function __unserialize(array data) -> void { let this->data = data; } diff --git a/phalcon/Storage/Serializer/Base64.zep b/phalcon/Storage/Serializer/Base64.zep index 751cbf3f34e..1eda10f8ee3 100644 --- a/phalcon/Storage/Serializer/Base64.zep +++ b/phalcon/Storage/Serializer/Base64.zep @@ -12,11 +12,6 @@ namespace Phalcon\Storage\Serializer; use InvalidArgumentException; -/** - * Class Base64 - * - * @package Phalcon\Storage\Serializer - */ class Base64 extends AbstractSerializer { /** @@ -38,18 +33,40 @@ class Base64 extends AbstractSerializer /** * Unserializes data * - * @param string $data + * @param mixed $data * * @retrun void */ - public function unserialize(var data) -> void + public function unserialize(mixed data) -> void { + var result; + if typeof data !== "string" { throw new InvalidArgumentException( "Data for the unserializer must of type string" ); } - let this->data = base64_decode(data); + let result = this->phpBase64Decode(data, true); + + if unlikely false === result { + let this->isSuccess = false, + result = ""; + } + + let this->data = result; + } + + /** + * Wrapper for base64_decode + * + * @param string $input + * @param bool $strict + * + * @return string|false + */ + protected function phpBase64Decode(string input, bool strict = false) + { + return base64_decode(input, strict); } } diff --git a/phalcon/Storage/Serializer/Igbinary.zep b/phalcon/Storage/Serializer/Igbinary.zep index 63df6f1ccfc..13b5a2cc73a 100644 --- a/phalcon/Storage/Serializer/Igbinary.zep +++ b/phalcon/Storage/Serializer/Igbinary.zep @@ -19,50 +19,101 @@ class Igbinary extends AbstractSerializer */ public function serialize() { + var result; + if (true !== this->isSerializable(this->data)) { return this->data; } - return igbinary_serialize(this->data); + let result = this->doSerialize(this->data); + + if unlikely null === result { + let this->isSuccess = false, + result = ""; + } + + return result; } /** * Unserializes data * - * @param string $data + * @param mixed $data * * @return void */ - public function unserialize(var data) -> void + public function unserialize(mixed data) -> void { - var version; - - let version = phpversion(); - - globals_set("warning.enable", false); - - if version_compare(version, "8.0", ">=") { - set_error_handler( - function (number, message, file, line) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } else { - set_error_handler( - function (number, message, file, line, context) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } - - let this->data = igbinary_unserialize(data); - - restore_error_handler(); - - if unlikely globals_get("warning.enable") { - let this->data = null; + var result, version; + + if (true !== this->isSerializable(data)) { + let this->data = data; + } else { + let version = phpversion(); + + globals_set("warning.enable", false); + if version_compare(version, "8.0", ">=") { + set_error_handler( + function (number, message, file, line) { + globals_set("warning.enable", true); + }, + E_WARNING + ); + } else { + set_error_handler( + function (number, message, file, line, context) { + globals_set("warning.enable", true); + }, + E_WARNING + ); + } + + let result = this->doUnserialize(data); + + restore_error_handler(); + + if unlikely globals_get("warning.enable") || false === result { + let this->isSuccess = false, + result = ""; + } + + let this->data = result; } } + + /** + * Wrapper for `igbinary_serialize` + * + * @param mixed $value + * + * @return string|null + */ + protected function phpIgbinarySerialize(var value) -> string | null + { + return igbinary_serialize(value); + } + + /** + * Serialize + * + * @param mixed $value + * + * @return string|null + */ + protected function doSerialize(var value) -> string | null + { + return this->phpIgbinarySerialize(value); + } + + /** + * Unserialize + * + * @param string $value + * + * @return mixed|false + */ + protected function doUnserialize(value) + { + return igbinary_unserialize(value); + } } diff --git a/phalcon/Storage/Serializer/Json.zep b/phalcon/Storage/Serializer/Json.zep index 223056a824f..ad7366b5d24 100644 --- a/phalcon/Storage/Serializer/Json.zep +++ b/phalcon/Storage/Serializer/Json.zep @@ -13,11 +13,6 @@ namespace Phalcon\Storage\Serializer; use InvalidArgumentException; use JsonSerializable; -/** - * Class Json - * - * @package Phalcon\Storage\Serializer - */ class Json extends AbstractSerializer { /** @@ -34,7 +29,7 @@ class Json extends AbstractSerializer ); } - if !this->isSerializable(this->data) { + if (true !== this->isSerializable(this->data)) { return this->data; } @@ -44,13 +39,17 @@ class Json extends AbstractSerializer /** * Unserializes data * - * @param string $data + * @param mixed $data * * @return void */ - public function unserialize(var data) -> void + public function unserialize(mixed data) -> void { - let this->data = this->getDecode(data); + if (true !== this->isSerializable(data)) { + let this->data = data; + } else { + let this->data = this->getDecode(data); + } } /** @@ -61,8 +60,7 @@ class Json extends AbstractSerializer bool associative = false, int depth = 512, int options = 0 - ) -> var - { + ) -> var { var decoded; let decoded = json_decode(data, associative, depth, options); @@ -83,8 +81,7 @@ class Json extends AbstractSerializer var data, int options = 0, int depth = 512 - ) -> string - { + ) -> string { var encoded; let encoded = json_encode(data, options, depth); @@ -97,5 +94,4 @@ class Json extends AbstractSerializer return encoded; } - } diff --git a/phalcon/Storage/Serializer/MemcachedIgbinary.zep b/phalcon/Storage/Serializer/MemcachedIgbinary.zep new file mode 100644 index 00000000000..6da7ea8c88e --- /dev/null +++ b/phalcon/Storage/Serializer/MemcachedIgbinary.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Memcached 'igbinary' serializer + */ +class MemcachedIgbinary extends None +{ +} diff --git a/phalcon/Http/Message/Exception/InvalidArgumentException.zep b/phalcon/Storage/Serializer/MemcachedJson.zep similarity index 62% rename from phalcon/Http/Message/Exception/InvalidArgumentException.zep rename to phalcon/Storage/Serializer/MemcachedJson.zep index 956cf704b67..c9a25fde709 100644 --- a/phalcon/Http/Message/Exception/InvalidArgumentException.zep +++ b/phalcon/Storage/Serializer/MemcachedJson.zep @@ -1,3 +1,4 @@ + /** * This file is part of the Phalcon Framework. * @@ -7,10 +8,11 @@ * file that was distributed with this source code. */ -namespace Phalcon\Http\Message\Exception; - -use Throwable; +namespace Phalcon\Storage\Serializer; -class InvalidArgumentException extends \InvalidArgumentException implements Throwable +/** + * Serializer using the built-in Memcached 'json' serializer + */ +class MemcachedJson extends None { } diff --git a/phalcon/Storage/Serializer/MemcachedPhp.zep b/phalcon/Storage/Serializer/MemcachedPhp.zep new file mode 100644 index 00000000000..b3b9b63b4ec --- /dev/null +++ b/phalcon/Storage/Serializer/MemcachedPhp.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Memcached 'php' serializer + */ +class MemcachedPhp extends None +{ +} diff --git a/phalcon/Storage/Serializer/Msgpack.zep b/phalcon/Storage/Serializer/Msgpack.zep index a356e2d76ca..f31aa9be676 100644 --- a/phalcon/Storage/Serializer/Msgpack.zep +++ b/phalcon/Storage/Serializer/Msgpack.zep @@ -10,59 +10,25 @@ namespace Phalcon\Storage\Serializer; -class Msgpack extends AbstractSerializer +class Msgpack extends Igbinary { /** * Serializes data * - * @return string|null + * @return string */ - public function serialize() -> string|null - { - if !this->isSerializable(this->data) { - return this->data; - } - + protected function doSerialize(var value) -> string + { return msgpack_pack(this->data); } /** - * Unserializes data - * - * @param string $data + * @param mixed $value * - * @return void + * @return mixed */ - public function unserialize(var data) -> void - { - var version; - - let version = phpversion(); - - globals_set("warning.enable", false); - - if version_compare(version, "8.0", ">=") { - set_error_handler( - function (number, message, file, line) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } else { - set_error_handler( - function (number, message, file, line, context) { - globals_set("warning.enable", true); - }, - E_WARNING - ); - } - - let this->data = msgpack_unpack(data); - - restore_error_handler(); - - if unlikely globals_get("warning.enable") { - let this->data = null; - } - } + protected function doUnserialize(value) + { + return msgpack_unpack(value); + } } diff --git a/phalcon/Storage/Serializer/None.zep b/phalcon/Storage/Serializer/None.zep index df4d051eb8e..e425eff63d7 100644 --- a/phalcon/Storage/Serializer/None.zep +++ b/phalcon/Storage/Serializer/None.zep @@ -10,19 +10,14 @@ namespace Phalcon\Storage\Serializer; -/** - * Class None - * - * @package Phalcon\Storage\Serializer - */ class None extends AbstractSerializer { /** * Serializes data * - * @return string + * @return mixed */ - public function serialize() -> string + public function serialize() -> mixed { return this->data; } @@ -30,11 +25,11 @@ class None extends AbstractSerializer /** * Unserializes data * - * @param string $data + * @param mixed $data * * @retrun void */ - public function unserialize(var data) -> void + public function unserialize(mixed data) -> void { let this->data = data; } diff --git a/phalcon/Storage/Serializer/Php.zep b/phalcon/Storage/Serializer/Php.zep index ae0064d5f39..d94d5983845 100644 --- a/phalcon/Storage/Serializer/Php.zep +++ b/phalcon/Storage/Serializer/Php.zep @@ -11,7 +11,6 @@ namespace Phalcon\Storage\Serializer; use InvalidArgumentException; -use Phalcon\Storage\Traits\StorageErrorHandlerTrait; class Php extends AbstractSerializer { @@ -22,75 +21,68 @@ class Php extends AbstractSerializer */ public function serialize() -> string { - if !this->isSerializable(this->data) { + if (true !== this->isSerializable(this->data)) { return this->data; } return serialize(this->data); } - /** - * Unserializes data - * - * @param string $data - */ - public function unserialize(var data) -> void - { - this->processSerializable(data); - this->processNotSerializable(data); - } - /** + * Unserializes data + * * @param mixed $data */ - private function processSerializable(var data) -> void + public function unserialize(mixed data) -> void { - var version; - - if (true === this->isSerializable(data)) { - if typeof data !== "string" { - throw new InvalidArgumentException( - "Data for the unserializer must of type string" - ); - } - - let version = phpversion(); - - globals_set("warning.enable", false); - - if version_compare(version, "8.0", ">=") { - set_error_handler( - function (number, message, file, line) { - globals_set("warning.enable", true); - }, - E_NOTICE - ); - } else { - set_error_handler( - function (number, message, file, line, context) { - globals_set("warning.enable", true); - }, - E_NOTICE - ); - } - - let this->data = unserialize(data); - - restore_error_handler(); - - if unlikely globals_get("warning.enable") { - let this->data = null; - } + var result, version; + + if (true !== this->isSerializable(data)) { + let this->data = data; + + return; } + + let version = phpversion(); + + globals_set("warning.enable", false); + + if version_compare(version, "8.0", ">=") { + set_error_handler( + function (number, message, file, line) { + globals_set("warning.enable", true); + }, + E_NOTICE + ); + } else { + set_error_handler( + function (number, message, file, line, context) { + globals_set("warning.enable", true); + }, + E_NOTICE + ); + } + + let result = this->phpUnserialize(data); + + restore_error_handler(); + + if unlikely globals_get("warning.enable") || result === false { + let this->isSuccess = false, + result = ""; + } + + let this->data = result; } /** - * @param mixed $data + * @param string $data + * @param array $options + * + * @return mixed */ - private function processNotSerializable(var data) -> void + private function phpUnserialize(string data, array options = []) -> mixed { - if (true !== this->isSerializable(data)) { - let this->data = data; - } + return unserialize(data, options); } } diff --git a/phalcon/Storage/Serializer/RedisIgbinary.zep b/phalcon/Storage/Serializer/RedisIgbinary.zep new file mode 100644 index 00000000000..bcdf90fb7eb --- /dev/null +++ b/phalcon/Storage/Serializer/RedisIgbinary.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Redis 'igbinary' serializer + */ +class RedisIgbinary extends None +{ +} diff --git a/phalcon/Storage/Serializer/RedisJson.zep b/phalcon/Storage/Serializer/RedisJson.zep new file mode 100644 index 00000000000..79137dc86c3 --- /dev/null +++ b/phalcon/Storage/Serializer/RedisJson.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Redis 'json' serializer + */ +class RedisJson extends None +{ +} diff --git a/phalcon/Storage/Serializer/RedisMsgpack.zep b/phalcon/Storage/Serializer/RedisMsgpack.zep new file mode 100644 index 00000000000..99b6ad0db91 --- /dev/null +++ b/phalcon/Storage/Serializer/RedisMsgpack.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Redis 'msgpack' serializer + */ +class RedisMsgpack extends None +{ +} diff --git a/phalcon/Storage/Serializer/RedisNone.zep b/phalcon/Storage/Serializer/RedisNone.zep new file mode 100644 index 00000000000..ef1499cadc8 --- /dev/null +++ b/phalcon/Storage/Serializer/RedisNone.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Redis 'none' serializer + */ +class RedisNone extends None +{ +} diff --git a/phalcon/Storage/Serializer/RedisPhp.zep b/phalcon/Storage/Serializer/RedisPhp.zep new file mode 100644 index 00000000000..51e689e493a --- /dev/null +++ b/phalcon/Storage/Serializer/RedisPhp.zep @@ -0,0 +1,18 @@ + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Storage\Serializer; + +/** + * Serializer using the built-in Redis 'php' serializer + */ +class RedisPhp extends None +{ +} diff --git a/phalcon/Storage/Serializer/SerializerInterface.zep b/phalcon/Storage/Serializer/SerializerInterface.zep index 2ddc8b6aa85..3ca94cb146a 100644 --- a/phalcon/Storage/Serializer/SerializerInterface.zep +++ b/phalcon/Storage/Serializer/SerializerInterface.zep @@ -12,11 +12,6 @@ namespace Phalcon\Storage\Serializer; use Serializable; -/** - * Interface SerializerInterface - * - * @package Phalcon\Storage\Serializer - */ interface SerializerInterface extends Serializable { /** diff --git a/phalcon/Storage/SerializerFactory.zep b/phalcon/Storage/SerializerFactory.zep index a34fc0e1114..9cb10cd8bca 100644 --- a/phalcon/Storage/SerializerFactory.zep +++ b/phalcon/Storage/SerializerFactory.zep @@ -56,12 +56,20 @@ class SerializerFactory extends AbstractFactory protected function getServices() -> array { return [ - "base64" : "Phalcon\\Storage\\Serializer\\Base64", - "igbinary" : "Phalcon\\Storage\\Serializer\\Igbinary", - "json" : "Phalcon\\Storage\\Serializer\\Json", - "msgpack" : "Phalcon\\Storage\\Serializer\\Msgpack", - "none" : "Phalcon\\Storage\\Serializer\\None", - "php" : "Phalcon\\Storage\\Serializer\\Php" + "base64" : "Phalcon\\Storage\\Serializer\\Base64", + "igbinary" : "Phalcon\\Storage\\Serializer\\Igbinary", + "json" : "Phalcon\\Storage\\Serializer\\Json", + "memcached_igbinary" : "Phalcon\\Storage\\Serializer\\MemcachedIgbinary", + "memcached_json" : "Phalcon\\Storage\\Serializer\\MemcachedJson", + "memcached_php" : "Phalcon\\Storage\\Serializer\\MemcachedPhp", + "msgpack" : "Phalcon\\Storage\\Serializer\\Msgpack", + "none" : "Phalcon\\Storage\\Serializer\\None", + "php" : "Phalcon\\Storage\\Serializer\\Php", + "redis_igbinary" : "Phalcon\\Storage\\Serializer\\RedisIgbinary", + "redis_json" : "Phalcon\\Storage\\Serializer\\RedisJson", + "redis_msgpack" : "Phalcon\\Storage\\Serializer\\RedisMsgpack", + "redis_none" : "Phalcon\\Storage\\Serializer\\RedisNone", + "redis_php" : "Phalcon\\Storage\\Serializer\\RedisPhp" ]; } } diff --git a/phalcon/Support/Collection.zep b/phalcon/Support/Collection.zep index bdda030a2ba..f14385bef50 100644 --- a/phalcon/Support/Collection.zep +++ b/phalcon/Support/Collection.zep @@ -231,7 +231,7 @@ class Collection implements * Whether a offset exists * See [offsetExists](https://php.net/manual/en/arrayaccess.offsetexists.php) */ - public function offsetExists(var element) -> bool + public function offsetExists(mixed element) -> bool { let element = (string) element; @@ -242,7 +242,7 @@ class Collection implements * Offset to retrieve * See [offsetGet](https://php.net/manual/en/arrayaccess.offsetget.php) */ - public function offsetGet(var element) + public function offsetGet(mixed element) -> mixed { let element = (string) element; @@ -253,7 +253,7 @@ class Collection implements * Offset to set * See [offsetSet](https://php.net/manual/en/arrayaccess.offsetset.php) */ - public function offsetSet(var element, var value) -> void + public function offsetSet(mixed element, mixed value) -> void { let element = (string) element; @@ -264,7 +264,7 @@ class Collection implements * Offset to unset * See [offsetUnset](https://php.net/manual/en/arrayaccess.offsetunset.php) */ - public function offsetUnset(var element) -> void + public function offsetUnset(mixed element) -> void { let element = (string) element; @@ -345,16 +345,25 @@ class Collection implements * Constructs the object * See [unserialize](https://php.net/manual/en/serializable.unserialize.php) */ - public function unserialize(var serialized) -> void + public function unserialize(string serialized) -> void { var data; - let serialized = (string) serialized, - data = unserialize(serialized); + let data = unserialize(serialized); this->init(data); } + public function __serialize() -> array + { + return this->toArray(); + } + + public function __unserialize(array data) -> void + { + this->init(data); + } + /** * Internal method to set data */ diff --git a/phalcon/Support/Debug.zep b/phalcon/Support/Debug.zep index 113656a85f2..aafddd60897 100644 --- a/phalcon/Support/Debug.zep +++ b/phalcon/Support/Debug.zep @@ -141,7 +141,7 @@ class Debug link = "https://docs.phalcon.io/" . version->getPart(Version::VERSION_MAJOR) . "." - . $version->getPart(Version::VERSION_MEDIUM) + . version->getPart(Version::VERSION_MEDIUM) . "/en/"; return "
Phalcon Framework " diff --git a/phalcon/Support/Helper/Arr/AbstractArr.zep b/phalcon/Support/Helper/Arr/AbstractArr.zep index 7bc9cac079d..3f48573d6d1 100644 --- a/phalcon/Support/Helper/Arr/AbstractArr.zep +++ b/phalcon/Support/Helper/Arr/AbstractArr.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Blacklist.zep b/phalcon/Support/Helper/Arr/Blacklist.zep index 209041f06f8..ea2c3473c86 100644 --- a/phalcon/Support/Helper/Arr/Blacklist.zep +++ b/phalcon/Support/Helper/Arr/Blacklist.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Chunk.zep b/phalcon/Support/Helper/Arr/Chunk.zep index 13b45843a35..814422d013f 100644 --- a/phalcon/Support/Helper/Arr/Chunk.zep +++ b/phalcon/Support/Helper/Arr/Chunk.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Filter.zep b/phalcon/Support/Helper/Arr/Filter.zep index e6f89206931..f7f6f3f00e7 100644 --- a/phalcon/Support/Helper/Arr/Filter.zep +++ b/phalcon/Support/Helper/Arr/Filter.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/First.zep b/phalcon/Support/Helper/Arr/First.zep index 2c4916a5e89..2e5cbda83fd 100644 --- a/phalcon/Support/Helper/Arr/First.zep +++ b/phalcon/Support/Helper/Arr/First.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/FirstKey.zep b/phalcon/Support/Helper/Arr/FirstKey.zep index 6276a93a181..a2fffbdf439 100644 --- a/phalcon/Support/Helper/Arr/FirstKey.zep +++ b/phalcon/Support/Helper/Arr/FirstKey.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Flatten.zep b/phalcon/Support/Helper/Arr/Flatten.zep index ebdcb55a027..d9cd460e095 100644 --- a/phalcon/Support/Helper/Arr/Flatten.zep +++ b/phalcon/Support/Helper/Arr/Flatten.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Get.zep b/phalcon/Support/Helper/Arr/Get.zep index 3ebab09d775..8515c51c0f4 100644 --- a/phalcon/Support/Helper/Arr/Get.zep +++ b/phalcon/Support/Helper/Arr/Get.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Group.zep b/phalcon/Support/Helper/Arr/Group.zep index 5cf76291b0d..66c154eb9d1 100644 --- a/phalcon/Support/Helper/Arr/Group.zep +++ b/phalcon/Support/Helper/Arr/Group.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Has.zep b/phalcon/Support/Helper/Arr/Has.zep index b8ebe4b2231..dce230dd143 100644 --- a/phalcon/Support/Helper/Arr/Has.zep +++ b/phalcon/Support/Helper/Arr/Has.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/IsUnique.zep b/phalcon/Support/Helper/Arr/IsUnique.zep index 224d6c036d3..c47f4d52a66 100644 --- a/phalcon/Support/Helper/Arr/IsUnique.zep +++ b/phalcon/Support/Helper/Arr/IsUnique.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Last.zep b/phalcon/Support/Helper/Arr/Last.zep index 54943a45954..e5a6990c07b 100644 --- a/phalcon/Support/Helper/Arr/Last.zep +++ b/phalcon/Support/Helper/Arr/Last.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/LastKey.zep b/phalcon/Support/Helper/Arr/LastKey.zep index 372dc55f48e..4db221295b4 100644 --- a/phalcon/Support/Helper/Arr/LastKey.zep +++ b/phalcon/Support/Helper/Arr/LastKey.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Order.zep b/phalcon/Support/Helper/Arr/Order.zep index 20235db6666..d5f74809137 100644 --- a/phalcon/Support/Helper/Arr/Order.zep +++ b/phalcon/Support/Helper/Arr/Order.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Pluck.zep b/phalcon/Support/Helper/Arr/Pluck.zep index a934d5724f2..18629ccd8d1 100644 --- a/phalcon/Support/Helper/Arr/Pluck.zep +++ b/phalcon/Support/Helper/Arr/Pluck.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Set.zep b/phalcon/Support/Helper/Arr/Set.zep index 453033b827a..a21764377d7 100644 --- a/phalcon/Support/Helper/Arr/Set.zep +++ b/phalcon/Support/Helper/Arr/Set.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/SliceLeft.zep b/phalcon/Support/Helper/Arr/SliceLeft.zep index ea8766436fb..2479bbefb40 100644 --- a/phalcon/Support/Helper/Arr/SliceLeft.zep +++ b/phalcon/Support/Helper/Arr/SliceLeft.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/SliceRight.zep b/phalcon/Support/Helper/Arr/SliceRight.zep index d5ca3477b04..dc2ab17357f 100644 --- a/phalcon/Support/Helper/Arr/SliceRight.zep +++ b/phalcon/Support/Helper/Arr/SliceRight.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Split.zep b/phalcon/Support/Helper/Arr/Split.zep index a4413666837..70d5f8a81cd 100644 --- a/phalcon/Support/Helper/Arr/Split.zep +++ b/phalcon/Support/Helper/Arr/Split.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/ToObject.zep b/phalcon/Support/Helper/Arr/ToObject.zep index 60d7a2f0a0d..d8371bc4e9d 100644 --- a/phalcon/Support/Helper/Arr/ToObject.zep +++ b/phalcon/Support/Helper/Arr/ToObject.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/ValidateAll.zep b/phalcon/Support/Helper/Arr/ValidateAll.zep index 99a38a316c5..a11a59a714b 100644 --- a/phalcon/Support/Helper/Arr/ValidateAll.zep +++ b/phalcon/Support/Helper/Arr/ValidateAll.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/ValidateAny.zep b/phalcon/Support/Helper/Arr/ValidateAny.zep index 41ef1ffd780..ea5a98cdab4 100644 --- a/phalcon/Support/Helper/Arr/ValidateAny.zep +++ b/phalcon/Support/Helper/Arr/ValidateAny.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Arr/Whitelist.zep b/phalcon/Support/Helper/Arr/Whitelist.zep index 56a39ac9045..93eea5c4721 100644 --- a/phalcon/Support/Helper/Arr/Whitelist.zep +++ b/phalcon/Support/Helper/Arr/Whitelist.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/File/Basename.zep b/phalcon/Support/Helper/File/Basename.zep index 452e421fabf..1283cb0b75e 100644 --- a/phalcon/Support/Helper/File/Basename.zep +++ b/phalcon/Support/Helper/File/Basename.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Json/Decode.zep b/phalcon/Support/Helper/Json/Decode.zep index d1b527351df..32f93fb5745 100644 --- a/phalcon/Support/Helper/Json/Decode.zep +++ b/phalcon/Support/Helper/Json/Decode.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Json/Encode.zep b/phalcon/Support/Helper/Json/Encode.zep index 901d5cf68ff..ddf25278dac 100644 --- a/phalcon/Support/Helper/Json/Encode.zep +++ b/phalcon/Support/Helper/Json/Encode.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Number/IsBetween.zep b/phalcon/Support/Helper/Number/IsBetween.zep index def19be0faf..b61204afe87 100644 --- a/phalcon/Support/Helper/Number/IsBetween.zep +++ b/phalcon/Support/Helper/Number/IsBetween.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/AbstractStr.zep b/phalcon/Support/Helper/Str/AbstractStr.zep index f9101d40e47..5b543cd0ebd 100644 --- a/phalcon/Support/Helper/Str/AbstractStr.zep +++ b/phalcon/Support/Helper/Str/AbstractStr.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Camelize.zep b/phalcon/Support/Helper/Str/Camelize.zep index c8b222d4433..7de5eb4d55f 100644 --- a/phalcon/Support/Helper/Str/Camelize.zep +++ b/phalcon/Support/Helper/Str/Camelize.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Concat.zep b/phalcon/Support/Helper/Str/Concat.zep index 70b43790958..335f771e287 100644 --- a/phalcon/Support/Helper/Str/Concat.zep +++ b/phalcon/Support/Helper/Str/Concat.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/CountVowels.zep b/phalcon/Support/Helper/Str/CountVowels.zep index c62353486d0..f116743d5c2 100644 --- a/phalcon/Support/Helper/Str/CountVowels.zep +++ b/phalcon/Support/Helper/Str/CountVowels.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Decapitalize.zep b/phalcon/Support/Helper/Str/Decapitalize.zep index 7b4e1268400..455bc5377bc 100644 --- a/phalcon/Support/Helper/Str/Decapitalize.zep +++ b/phalcon/Support/Helper/Str/Decapitalize.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Decrement.zep b/phalcon/Support/Helper/Str/Decrement.zep index e33e67e12a5..1642a2c31fa 100644 --- a/phalcon/Support/Helper/Str/Decrement.zep +++ b/phalcon/Support/Helper/Str/Decrement.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/DirFromFile.zep b/phalcon/Support/Helper/Str/DirFromFile.zep index 2736321c440..1a5b9c1b484 100644 --- a/phalcon/Support/Helper/Str/DirFromFile.zep +++ b/phalcon/Support/Helper/Str/DirFromFile.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/DirSeparator.zep b/phalcon/Support/Helper/Str/DirSeparator.zep index f5a0227acfb..6916a9bc14c 100644 --- a/phalcon/Support/Helper/Str/DirSeparator.zep +++ b/phalcon/Support/Helper/Str/DirSeparator.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Dynamic.zep b/phalcon/Support/Helper/Str/Dynamic.zep index 912d96d3e90..78aedce0148 100644 --- a/phalcon/Support/Helper/Str/Dynamic.zep +++ b/phalcon/Support/Helper/Str/Dynamic.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/EndsWith.zep b/phalcon/Support/Helper/Str/EndsWith.zep index 10b9daa924a..844657a4f22 100644 --- a/phalcon/Support/Helper/Str/EndsWith.zep +++ b/phalcon/Support/Helper/Str/EndsWith.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/FirstBetween.zep b/phalcon/Support/Helper/Str/FirstBetween.zep index 8dd160c2eba..b8c0ef8b4f0 100644 --- a/phalcon/Support/Helper/Str/FirstBetween.zep +++ b/phalcon/Support/Helper/Str/FirstBetween.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Friendly.zep b/phalcon/Support/Helper/Str/Friendly.zep index 3161e6fcb9d..8306b61dea0 100644 --- a/phalcon/Support/Helper/Str/Friendly.zep +++ b/phalcon/Support/Helper/Str/Friendly.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Humanize.zep b/phalcon/Support/Helper/Str/Humanize.zep index 9a563407542..4f84c3ab815 100644 --- a/phalcon/Support/Helper/Str/Humanize.zep +++ b/phalcon/Support/Helper/Str/Humanize.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Includes.zep b/phalcon/Support/Helper/Str/Includes.zep index f3473a8ddc4..4f987210e4c 100644 --- a/phalcon/Support/Helper/Str/Includes.zep +++ b/phalcon/Support/Helper/Str/Includes.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Increment.zep b/phalcon/Support/Helper/Str/Increment.zep index 1cb0c963e8d..5341e80cdf6 100644 --- a/phalcon/Support/Helper/Str/Increment.zep +++ b/phalcon/Support/Helper/Str/Increment.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/IsAnagram.zep b/phalcon/Support/Helper/Str/IsAnagram.zep index cd39216ac28..cb0f3295e9e 100644 --- a/phalcon/Support/Helper/Str/IsAnagram.zep +++ b/phalcon/Support/Helper/Str/IsAnagram.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/IsLower.zep b/phalcon/Support/Helper/Str/IsLower.zep index fa04cafab94..e74f673f7da 100644 --- a/phalcon/Support/Helper/Str/IsLower.zep +++ b/phalcon/Support/Helper/Str/IsLower.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/IsPalindrome.zep b/phalcon/Support/Helper/Str/IsPalindrome.zep index 8fa89d62729..6ecd4198825 100644 --- a/phalcon/Support/Helper/Str/IsPalindrome.zep +++ b/phalcon/Support/Helper/Str/IsPalindrome.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/IsUpper.zep b/phalcon/Support/Helper/Str/IsUpper.zep index 1749aba80d2..94c6270f288 100644 --- a/phalcon/Support/Helper/Str/IsUpper.zep +++ b/phalcon/Support/Helper/Str/IsUpper.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/KebabCase.zep b/phalcon/Support/Helper/Str/KebabCase.zep index 8dc8a5ca74c..5fa10639ab9 100644 --- a/phalcon/Support/Helper/Str/KebabCase.zep +++ b/phalcon/Support/Helper/Str/KebabCase.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Len.zep b/phalcon/Support/Helper/Str/Len.zep index 52ad72a5a4e..c46f60ea29f 100644 --- a/phalcon/Support/Helper/Str/Len.zep +++ b/phalcon/Support/Helper/Str/Len.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Lower.zep b/phalcon/Support/Helper/Str/Lower.zep index 9ebe19324b8..cf27a7b8cd8 100644 --- a/phalcon/Support/Helper/Str/Lower.zep +++ b/phalcon/Support/Helper/Str/Lower.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/PascalCase.zep b/phalcon/Support/Helper/Str/PascalCase.zep index 027f1009c09..a11e5649007 100644 --- a/phalcon/Support/Helper/Str/PascalCase.zep +++ b/phalcon/Support/Helper/Str/PascalCase.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * @@ -60,7 +60,7 @@ class PascalCase */ if strpos(delimiters, "\\-") !== false || strpos(delimiters, "-") !== false { let delimiters = str_replace(["\\-", "-"], ["", ""], delimiters), - delimiters = "-" . $delimiters; + delimiters = "-" . delimiters; } let result = preg_split( diff --git a/phalcon/Support/Helper/Str/Prefix.zep b/phalcon/Support/Helper/Str/Prefix.zep index d91c7e0719b..9a4214bb630 100644 --- a/phalcon/Support/Helper/Str/Prefix.zep +++ b/phalcon/Support/Helper/Str/Prefix.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Random.zep b/phalcon/Support/Helper/Str/Random.zep index 077f428eb03..236c446cfb9 100644 --- a/phalcon/Support/Helper/Str/Random.zep +++ b/phalcon/Support/Helper/Str/Random.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/ReduceSlashes.zep b/phalcon/Support/Helper/Str/ReduceSlashes.zep index b6f7884f56a..a651e7d1aff 100644 --- a/phalcon/Support/Helper/Str/ReduceSlashes.zep +++ b/phalcon/Support/Helper/Str/ReduceSlashes.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/SnakeCase.zep b/phalcon/Support/Helper/Str/SnakeCase.zep index b630b93338d..5cddc0e3489 100644 --- a/phalcon/Support/Helper/Str/SnakeCase.zep +++ b/phalcon/Support/Helper/Str/SnakeCase.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/StartsWith.zep b/phalcon/Support/Helper/Str/StartsWith.zep index 97e45894fc7..c0cceeeb6ab 100644 --- a/phalcon/Support/Helper/Str/StartsWith.zep +++ b/phalcon/Support/Helper/Str/StartsWith.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Suffix.zep b/phalcon/Support/Helper/Str/Suffix.zep index 956238f7caa..1cc125c936e 100644 --- a/phalcon/Support/Helper/Str/Suffix.zep +++ b/phalcon/Support/Helper/Str/Suffix.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Ucwords.zep b/phalcon/Support/Helper/Str/Ucwords.zep index 318aca33064..aa091a7a7b9 100644 --- a/phalcon/Support/Helper/Str/Ucwords.zep +++ b/phalcon/Support/Helper/Str/Ucwords.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Uncamelize.zep b/phalcon/Support/Helper/Str/Uncamelize.zep index 22c55ee974f..eeef9315e26 100644 --- a/phalcon/Support/Helper/Str/Uncamelize.zep +++ b/phalcon/Support/Helper/Str/Uncamelize.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Underscore.zep b/phalcon/Support/Helper/Str/Underscore.zep index 8bccbab2106..c31b48cf05f 100644 --- a/phalcon/Support/Helper/Str/Underscore.zep +++ b/phalcon/Support/Helper/Str/Underscore.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Helper/Str/Upper.zep b/phalcon/Support/Helper/Str/Upper.zep index 75ebfe4e189..626bb07813d 100644 --- a/phalcon/Support/Helper/Str/Upper.zep +++ b/phalcon/Support/Helper/Str/Upper.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/HelperFactory.zep b/phalcon/Support/HelperFactory.zep index b5eb9bdcf9c..86b4b67414b 100644 --- a/phalcon/Support/HelperFactory.zep +++ b/phalcon/Support/HelperFactory.zep @@ -1,6 +1,6 @@ /** - * This file is part of the Phalcon. + * This file is part of the Phalcon Framework. * * (c) Phalcon Team * diff --git a/phalcon/Support/Registry.zep b/phalcon/Support/Registry.zep index d7797c215b5..34f2771cbc0 100644 --- a/phalcon/Support/Registry.zep +++ b/phalcon/Support/Registry.zep @@ -183,7 +183,7 @@ final class Registry extends Collection * * @link https://php.net/manual/en/arrayaccess.offsetget.php */ - final public function offsetGet(var element) -> var + final public function offsetGet(mixed element) -> mixed { return parent::get(element); } diff --git a/phalcon/Support/Version.zep b/phalcon/Support/Version.zep index cb0e3b17b14..9acc032b7a6 100644 --- a/phalcon/Support/Version.zep +++ b/phalcon/Support/Version.zep @@ -77,7 +77,7 @@ class Version */ protected function getVersion() -> array { - return [5, 0, 0, 2, 3]; + return [5, 0, 0, 3, 1]; } /** diff --git a/phalcon/Translate/Adapter/AbstractAdapter.zep b/phalcon/Translate/Adapter/AbstractAdapter.zep index b0f7e43974c..041dbfe2eaa 100644 --- a/phalcon/Translate/Adapter/AbstractAdapter.zep +++ b/phalcon/Translate/Adapter/AbstractAdapter.zep @@ -85,7 +85,7 @@ abstract class AbstractAdapter implements AdapterInterface * * @return mixed */ - public function offsetGet(var translateKey) -> var + public function offsetGet(mixed translateKey) -> mixed { return this->query(translateKey); } diff --git a/phalcon/Translate/Adapter/Csv.zep b/phalcon/Translate/Adapter/Csv.zep index 239b04e5f0f..8478364d34c 100644 --- a/phalcon/Translate/Adapter/Csv.zep +++ b/phalcon/Translate/Adapter/Csv.zep @@ -150,6 +150,16 @@ class Csv extends AbstractAdapter implements ArrayAccess fclose(fileHandler); } + /** + * Returns the internal array + * + * @return array + */ + public function toArray() -> array + { + return this->translate; + } + /** * @todo to be removed when we get traits */ diff --git a/phalcon/Translate/Adapter/NativeArray.zep b/phalcon/Translate/Adapter/NativeArray.zep index 8cb482c66e7..1f76d340a97 100644 --- a/phalcon/Translate/Adapter/NativeArray.zep +++ b/phalcon/Translate/Adapter/NativeArray.zep @@ -129,4 +129,14 @@ class NativeArray extends AbstractAdapter implements ArrayAccess return this->replacePlaceholders(translation, placeholders); } + + /** + * Returns the internal array + * + * @return array + */ + public function toArray() -> array + { + return this->translate; + } } diff --git a/tests/README.md b/tests/README.md index 21ec97c7861..00394a840ad 100644 --- a/tests/README.md +++ b/tests/README.md @@ -220,8 +220,6 @@ After the compilation is completed, you can check if the extension is loaded: /app $ php -m | grep phalcon ``` -Note that Phalcon v4+ requires the [PSR][psr] extension to be loaded before Phalcon. In this environment we have compiled it for you. Once you see `phalcon` in the list, you have the extension compiled and ready to use. - ### Setup databases First, we need to have a `.env` file in the project root. @@ -343,4 +341,3 @@ Thanks! [composer]: http://getcomposer.org [codeception-intro]: http://codeception.com/docs/01-Introduction [codeception-cmds]: http://codeception.com/docs/reference/Commands -[psr]: https://github.com/jbboehr/php-psr diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index e0ad346ed7c..285a50746d3 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -2,8 +2,6 @@ declare(strict_types=1); -use Codeception\Util\Autoload; - $root = dirname(realpath(__DIR__) . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; define('PROJECT_PATH', $root); @@ -14,22 +12,4 @@ loadFolders(); loadDefined(); -// -///** -// * Setting this in the $_ENV so that DotLoad sets everything up properly -// */ -//$_ENV['PROJECT_PATH'] = $root; -// -//require_once $root . 'tests/shim.php'; -// -// -//define('APP_DATA', dataDir()); -//define('APP_PATH', codecept_root_dir()); -//define('APP_PATH_OUTPUT', outputDir()); -// -// -//loadEnvironment($root); -//loadFolders(); -// - unset($root); diff --git a/tests/_config/bootstrap.php b/tests/_config/bootstrap.php index fdbe37f0c2b..37e8f4c2ebd 100644 --- a/tests/_config/bootstrap.php +++ b/tests/_config/bootstrap.php @@ -1,15 +1,12 @@ set('dispatcher', Dispatcher::class); $application = new Application(); - $application->setDI($container); FactoryDefault::setDefault($container); diff --git a/tests/_config/functions.php b/tests/_config/functions.php index 84fe6fc0c9b..3c31119ef92 100644 --- a/tests/_config/functions.php +++ b/tests/_config/functions.php @@ -58,7 +58,6 @@ function loadDefined() defineFromEnv('DATA_MYSQL_PORT'); defineFromEnv('DATA_MYSQL_USER'); -// define('PATH_CACHE'); if (!defined('PATH_DATA')) { define('PATH_DATA', dataDir()); } @@ -66,7 +65,6 @@ function loadDefined() if (!defined('PATH_OUTPUT')) { define('PATH_OUTPUT', outputDir()); } -// define('PATH_FIXTURES'); } } @@ -207,7 +205,11 @@ function env(string $key, $default = null) return constant($key); } - return getenv($key) ?: $default; + if (getenv($key) !== false) { + return getenv($key); + } + + return $_ENV[$key] ?? $default; } } diff --git a/tests/_data/fixtures/Annotations/TestClass.php b/tests/_data/fixtures/Annotations/TestClass.php index 8ab592be021..b2560536b51 100644 --- a/tests/_data/fixtures/Annotations/TestClass.php +++ b/tests/_data/fixtures/Annotations/TestClass.php @@ -28,6 +28,13 @@ */ class TestClass { + /** + * @Simple + */ + const TEST_CONST1 = 'test-const-with-annotation'; + + const TEST_CONST2 = 'test-const-without-annotation'; + /** * This is a property string * diff --git a/tests/_data/fixtures/Di/InitializationAwareComponent.php b/tests/_data/fixtures/Di/InitializationAwareComponent.php new file mode 100644 index 00000000000..8e1b6a305f6 --- /dev/null +++ b/tests/_data/fixtures/Di/InitializationAwareComponent.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Fixtures\Di; + +use Phalcon\Di\InitializationAwareInterface; + +/** + * Class InitializationAwareComponent + * + * @package Phalcon\Tests\Fixtures\Di + */ +class InitializationAwareComponent implements InitializationAwareInterface +{ + private bool $initialized = false; + + public function initialize(): void + { + $this->initialized = true; + } + + public function isInitialized(): bool + { + return $this->initialized; + } +} diff --git a/tests/_data/fixtures/Http/Message/ServerRequestFactoryFixture.php b/tests/_data/fixtures/Http/Message/ServerRequestFactoryFixture.php deleted file mode 100644 index e8b13c18e46..00000000000 --- a/tests/_data/fixtures/Http/Message/ServerRequestFactoryFixture.php +++ /dev/null @@ -1,32 +0,0 @@ - 'en-us', - 'Accept-Encoding' => 'gzip, deflate', - 'Host' => 'dev.phalcon.ld', - 'Authorization' => 'Bearer', - ]; - } -} diff --git a/tests/_data/fixtures/Http/Message/StreamFixture.php b/tests/_data/fixtures/Http/Message/StreamFixture.php deleted file mode 100644 index 0a76aae5776..00000000000 --- a/tests/_data/fixtures/Http/Message/StreamFixture.php +++ /dev/null @@ -1,32 +0,0 @@ -handle = $handle; - } - - public function isSeekable(): bool - { - return false; - } - - public function isWritable(): bool - { - return false; - } -} diff --git a/tests/_data/fixtures/Http/Server/MiddlewareFixture.php b/tests/_data/fixtures/Http/Server/MiddlewareFixture.php deleted file mode 100644 index a0615963c50..00000000000 --- a/tests/_data/fixtures/Http/Server/MiddlewareFixture.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Fixtures\Http\Server; - -use Phalcon\Http\Server\AbstractMiddleware; -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\RequestHandlerInterface; - -class MiddlewareFixture extends AbstractMiddleware -{ - public function process( - ServerRequestInterface $request, - RequestHandlerInterface $handler - ): ResponseInterface { - } -} diff --git a/tests/_data/fixtures/Http/Server/RequestHandlerFixture.php b/tests/_data/fixtures/Http/Server/RequestHandlerFixture.php deleted file mode 100644 index 0b25bc62b84..00000000000 --- a/tests/_data/fixtures/Http/Server/RequestHandlerFixture.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Fixtures\Http\Server; - -use Phalcon\Http\Server\AbstractRequestHandler; -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; - -class RequestHandlerFixture extends AbstractRequestHandler -{ - public function handle(ServerRequestInterface $request): ResponseInterface - { - } -} diff --git a/tests/_data/fixtures/models/InvoicesSchema.php b/tests/_data/fixtures/models/InvoicesSchema.php index fee19208c76..fcdc05ac5b8 100644 --- a/tests/_data/fixtures/models/InvoicesSchema.php +++ b/tests/_data/fixtures/models/InvoicesSchema.php @@ -15,8 +15,6 @@ use Phalcon\Mvc\Model; -use function getenv; - class InvoicesSchema extends Model { public $inv_id; @@ -29,8 +27,6 @@ class InvoicesSchema extends Model public function initialize() { $this->setSource('co_invoices'); - $this->setSchema( - getenv('DATA_MYSQL_NAME') - ); + $this->setSchema(env('DATA_MYSQL_NAME')); } } diff --git a/tests/_support/Helper/Database.php b/tests/_support/Helper/Database.php index 5413e81f4e4..e72f3ab71b3 100644 --- a/tests/_support/Helper/Database.php +++ b/tests/_support/Helper/Database.php @@ -6,13 +6,13 @@ // all public methods declared in helper class will be available in $I use Codeception\Exception\ModuleException; +use Codeception\Module; use Codeception\TestInterface; use PDO; use Phalcon\DataMapper\Pdo\Connection; use function date; use function env; -use function getenv; use function getOptionsMysql; use function getOptionsPostgresql; use function getOptionsSqlite; @@ -25,7 +25,7 @@ * @property string $password * @property string $username */ -class Database extends \Codeception\Module +class Database extends Module { /** * @var string diff --git a/tests/cli/Cli/Router/GetModuleNameCest.php b/tests/cli/Cli/Router/GetModuleNameCest.php index 547d820c641..06e6f5fd2cd 100644 --- a/tests/cli/Cli/Router/GetModuleNameCest.php +++ b/tests/cli/Cli/Router/GetModuleNameCest.php @@ -29,7 +29,8 @@ public function cliRouterGetModuleName(CliTester $I) $I->wantToTest('Cli\Router - getModuleName()'); $router = new Router(); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $router->handle([ diff --git a/tests/cli/Cli/Router/HandleCest.php b/tests/cli/Cli/Router/HandleCest.php index ae2a375f8db..01a138da817 100644 --- a/tests/cli/Cli/Router/HandleCest.php +++ b/tests/cli/Cli/Router/HandleCest.php @@ -35,7 +35,8 @@ public function cliRouterHandle(CliTester $I) $router->handle( [] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertNull( @@ -54,7 +55,8 @@ public function cliRouterHandle(CliTester $I) 'task' => 'main', ] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertEquals( @@ -75,7 +77,8 @@ public function cliRouterHandle(CliTester $I) 'task' => 'echo', ] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertEquals( @@ -96,7 +99,8 @@ public function cliRouterHandle(CliTester $I) ] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertEquals( @@ -120,7 +124,8 @@ public function cliRouterHandle(CliTester $I) ] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertEquals( diff --git a/tests/cli/Cli/Router/SetDefaultModuleCest.php b/tests/cli/Cli/Router/SetDefaultModuleCest.php index f1c0d745618..ec42d0b47aa 100644 --- a/tests/cli/Cli/Router/SetDefaultModuleCest.php +++ b/tests/cli/Cli/Router/SetDefaultModuleCest.php @@ -29,9 +29,9 @@ public function cliRouterSetDefaultModule(CliTester $I) $I->wantToTest('Cli\Router - setDefaultModule()'); $router = new Router(false); - $I->assertNull($router->getModuleName()); + $I->assertSame('', $router->getModuleName()); $router->handle(""); - $I->assertNull($router->getModuleName()); + $I->assertSame('', $router->getModuleName()); $router->setDefaultModule("test"); $router->handle(""); $I->assertEquals("test", $router->getModuleName()); diff --git a/tests/cli/Cli/Router/SetDefaultsCest.php b/tests/cli/Cli/Router/SetDefaultsCest.php index dbab3fb9b35..cd139b80229 100644 --- a/tests/cli/Cli/Router/SetDefaultsCest.php +++ b/tests/cli/Cli/Router/SetDefaultsCest.php @@ -32,7 +32,8 @@ public function cliRouterSetDefaults(CliTester $I) $router->handle( [] ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); $I->assertNull( diff --git a/tests/database/DataMapper/Pdo/Profiler/MemoryLogger/LogCest.php b/tests/database/DataMapper/Pdo/Profiler/MemoryLogger/LogCest.php index f59b71ef276..b8e9443388b 100644 --- a/tests/database/DataMapper/Pdo/Profiler/MemoryLogger/LogCest.php +++ b/tests/database/DataMapper/Pdo/Profiler/MemoryLogger/LogCest.php @@ -13,7 +13,7 @@ use DatabaseTester; use Phalcon\DataMapper\Pdo\Profiler\MemoryLogger; -use Psr\Log\LogLevel; +use Phalcon\Logger\LogLevel; class LogCest { diff --git a/tests/database/DataMapper/Pdo/Profiler/Profiler/GetSetLogLevelCest.php b/tests/database/DataMapper/Pdo/Profiler/Profiler/GetSetLogLevelCest.php index 121377c8e04..cad0325f48b 100644 --- a/tests/database/DataMapper/Pdo/Profiler/Profiler/GetSetLogLevelCest.php +++ b/tests/database/DataMapper/Pdo/Profiler/Profiler/GetSetLogLevelCest.php @@ -13,7 +13,7 @@ use DatabaseTester; use Phalcon\DataMapper\Pdo\Profiler\Profiler; -use Psr\Log\LogLevel; +use Phalcon\Logger\LogLevel; class GetSetLogLevelCest { diff --git a/tests/database/Mvc/Model/FindCest.php b/tests/database/Mvc/Model/FindCest.php index 7da03b5aac8..5ca5fd3736b 100644 --- a/tests/database/Mvc/Model/FindCest.php +++ b/tests/database/Mvc/Model/FindCest.php @@ -226,7 +226,8 @@ public function mvcModelFindWithCacheException(DatabaseTester $I) $I->expectThrowable( new Exception( - 'Cache service must be an object implementing Psr\SimpleCache\CacheInterface' + "Cache service must be an object implementing " . + "Phalcon\Cache\CacheInterface" ), function () { $options = [ diff --git a/tests/integration.suite.yml b/tests/integration.suite.yml index 0444268f996..bc997bb2096 100644 --- a/tests/integration.suite.yml +++ b/tests/integration.suite.yml @@ -3,10 +3,9 @@ modules: enabled: - Phalcon5: bootstrap: 'tests/_config/bootstrap.php' -# - Helper\PhalconLibmemcached: -# host: '%DATA_MEMCACHED_HOST%' -# port: '%DATA_MEMCACHED_PORT%' -# weight: '%DATA_MEMCACHED_WEIGHT%' + - Memcache: + host: '%DATA_MEMCACHED_HOST%' + port: %DATA_MEMCACHED_PORT% - Redis: database: '%DATA_REDIS_NAME%' host: '%DATA_REDIS_HOST%' @@ -14,5 +13,4 @@ modules: - Asserts - Filesystem - Helper\Integration - - Helper\PhalconLibmemcached - Helper\Unit diff --git a/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php b/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php index 42e35e0b1cd..65c27ba6abb 100644 --- a/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php +++ b/tests/integration/Cache/Adapter/Apcu/GetKeysCest.php @@ -71,4 +71,44 @@ public function storageAdapterApcuGetKeys(IntegrationTester $I) sort($actual); $I->assertEquals($expected, $actual); } + + /** + * Tests Phalcon\Cache\Adapter\Apcu :: getKeys() - iterator error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuGetKeysIteratorError(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Apcu - getKeys() - iterator error'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer, + ], + [ + 'phpApcuIterator' => false, + ] + ); + + $adapter->set('key-1', 'test'); + $adapter->set('key-2', 'test'); + $adapter->set('one-1', 'test'); + $adapter->set('one-2', 'test'); + + $I->assertTrue($adapter->has('key-1')); + $I->assertTrue($adapter->has('key-2')); + $I->assertTrue($adapter->has('one-1')); + $I->assertTrue($adapter->has('one-2')); + + $actual = $adapter->getKeys(); + $I->assertIsArray($actual); + $I->assertEmpty($actual); + } } diff --git a/tests/integration/Cache/Adapter/ClearCest.php b/tests/integration/Cache/Adapter/ClearCest.php index de6223c392f..ae582fec8b2 100644 --- a/tests/integration/Cache/Adapter/ClearCest.php +++ b/tests/integration/Cache/Adapter/ClearCest.php @@ -14,6 +14,7 @@ namespace Phalcon\Tests\Integration\Cache\Adapter; use Codeception\Example; +use Codeception\Stub; use IntegrationTester; use Phalcon\Cache\Adapter\Apcu; use Phalcon\Cache\Adapter\Libmemcached; @@ -29,6 +30,133 @@ class ClearCest { + /** + * Tests Phalcon\Cache\Adapter\Apcu :: clear() - iterator error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuClearIteratorError(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Apcu - clear() - iterator error'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer + ], + [ + 'phpApcuIterator' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Cache\Adapter\Apcu :: clear() - delete error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuClearDeleteError(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Apcu - clear() - delete error'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer + ], + [ + 'phpApcuDelete' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Cache\Adapter\Stream :: clear() - cannot delete file + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws CacheException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamClearCannotDeleteFile(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Stream - clear() - cannot delete file'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpUnlink' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + + $I->safeDeleteDirectory(outputDir('ph-strm')); + } + /** * Tests Phalcon\Cache\Adapter\* :: clear() * diff --git a/tests/integration/Cache/Adapter/HasCest.php b/tests/integration/Cache/Adapter/HasCest.php index 77bca552893..b06fe68ac70 100644 --- a/tests/integration/Cache/Adapter/HasCest.php +++ b/tests/integration/Cache/Adapter/HasCest.php @@ -14,6 +14,7 @@ namespace Phalcon\Tests\Integration\Cache\Adapter; use Codeception\Example; +use Codeception\Stub; use IntegrationTester; use Phalcon\Cache\Adapter\Apcu; use Phalcon\Cache\Adapter\Libmemcached; @@ -30,6 +31,77 @@ class HasCest { + /** + * Tests Phalcon\Cache\Adapter\Stream :: has() - cannot open file + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamHasCannotOpenFile(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Stream - has() - cannot open file'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpFopen' => false, + ] + ); + + $key = uniqid(); + $actual = $adapter->set($key, 'test'); + $I->assertTrue($actual); + + $actual = $adapter->has($key); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Cache\Adapter\Stream :: has() - empty payload + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamHasEmptyPayload(IntegrationTester $I) + { + $I->wantToTest('Cache\Adapter\Stream - has() - empty payload'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpFileGetContents' => false, + ] + ); + + $key = uniqid(); + $actual = $adapter->set($key, 'test'); + $I->assertTrue($actual); + + $actual = $adapter->has($key); + $I->assertFalse($actual); + } + /** * Tests Phalcon\Cache\Adapter\* :: has() * diff --git a/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php b/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php index df5d52163f7..4ac80a26ecf 100644 --- a/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php +++ b/tests/integration/Cache/Adapter/Libmemcached/GetSetCest.php @@ -16,7 +16,7 @@ use Codeception\Example; use IntegrationTester; use Phalcon\Cache\Adapter\Libmemcached; -use Phalcon\Cache\Exception as CacheException; +use Phalcon\Storage\Exception; use Phalcon\Storage\SerializerFactory; use Phalcon\Support\Exception as HelperException; use Phalcon\Tests\Fixtures\Traits\LibmemcachedTrait; @@ -36,9 +36,8 @@ class GetSetCest * @param IntegrationTester $I * @param Example $example * - * @throws CacheException * @throws HelperException - * + * @throws Exception * @author Phalcon Team * @since 2020-09-09 */ @@ -67,7 +66,7 @@ public function storageAdapterLibmemcachedGetSet(IntegrationTester $I, Example $ * * @param IntegrationTester $I * - * @throws CacheException + * @throws Exception * @throws HelperException * * @author Phalcon Team diff --git a/tests/integration/Cache/Cache/ConstructCest.php b/tests/integration/Cache/Cache/ConstructCest.php index bdecd1f3243..2665f6ae9f7 100644 --- a/tests/integration/Cache/Cache/ConstructCest.php +++ b/tests/integration/Cache/Cache/ConstructCest.php @@ -17,7 +17,7 @@ use Phalcon\Cache\AdapterFactory; use Phalcon\Cache\Cache; use Phalcon\Storage\SerializerFactory; -use Psr\SimpleCache\CacheInterface; +use Phalcon\Cache\CacheInterface; class ConstructCest { diff --git a/tests/integration/Cache/CacheFactory/LoadCest.php b/tests/integration/Cache/CacheFactory/LoadCest.php index d445c119944..6031b10bd2f 100644 --- a/tests/integration/Cache/CacheFactory/LoadCest.php +++ b/tests/integration/Cache/CacheFactory/LoadCest.php @@ -19,7 +19,7 @@ use Phalcon\Cache\CacheFactory; use Phalcon\Storage\SerializerFactory; use Phalcon\Tests\Fixtures\Traits\FactoryTrait; -use Psr\SimpleCache\CacheInterface; +use Phalcon\Cache\CacheInterface; class LoadCest { diff --git a/tests/integration/Cache/CacheFactory/NewInstanceCest.php b/tests/integration/Cache/CacheFactory/NewInstanceCest.php index f9304e3bea9..414b9660104 100644 --- a/tests/integration/Cache/CacheFactory/NewInstanceCest.php +++ b/tests/integration/Cache/CacheFactory/NewInstanceCest.php @@ -19,7 +19,7 @@ use Phalcon\Cache\CacheFactory; use Phalcon\Cache\Exception\Exception; use Phalcon\Storage\SerializerFactory; -use Psr\SimpleCache\CacheInterface; +use Phalcon\Cache\CacheInterface; use function uniqid; @@ -43,4 +43,29 @@ public function cacheCacheFactoryNewInstance(IntegrationTester $I) $I->assertInstanceOf(Cache::class, $adapter); $I->assertInstanceOf(CacheInterface::class, $adapter); } + + /** + * Tests Phalcon\Cache\CacheFactory :: newInstance() - exception + * + * @author Phalcon Team + * @since 2022-03-05 + */ + public function cacheCacheFactoryNewInstanceException(IntegrationTester $I) + { + $I->wantToTest('Cache\CacheFactory - newInstance() - exception'); + + $name = uniqid(); + $I->expectThrowable( + new Exception('Service ' . $name . ' is not registered'), + function () use ($name) { + $cacheFactory = new CacheFactory( + new AdapterFactory( + new SerializerFactory() + ) + ); + + $cacheFactory->newInstance($name); + } + ); + } } diff --git a/tests/integration/Forms/Element/GetAddValidatorsCest.php b/tests/integration/Forms/Element/GetAddValidatorsCest.php index 05b1ca41f8a..d94ffa367f0 100644 --- a/tests/integration/Forms/Element/GetAddValidatorsCest.php +++ b/tests/integration/Forms/Element/GetAddValidatorsCest.php @@ -16,7 +16,6 @@ use Codeception\Example; use IntegrationTester; use Phalcon\Filter\Validation\Validator\Alnum; -use Phalcon\Filter\Validation\Validator\Date as ValidatorDate; use Phalcon\Filter\Validation\Validator\Digit; use Phalcon\Filter\Validation\Validator\StringLength; use Phalcon\Forms\Element\Check; @@ -31,8 +30,6 @@ use Phalcon\Forms\Element\Submit; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Element\TextArea; -use Phalcon\Messages\Message; -use Phalcon\Messages\Messages; use function uniqid; diff --git a/tests/integration/Forms/Element/GetSetTagFactoryCest.php b/tests/integration/Forms/Element/GetSetTagFactoryCest.php index a87b1dddb4c..23d7152f709 100644 --- a/tests/integration/Forms/Element/GetSetTagFactoryCest.php +++ b/tests/integration/Forms/Element/GetSetTagFactoryCest.php @@ -14,14 +14,12 @@ namespace Phalcon\Tests\Integration\Forms\Element; use IntegrationTester; -use Phalcon\Di\Di; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Html\Escaper; use Phalcon\Html\TagFactory; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use function spl_object_hash; use function sprintf; use function uniqid; diff --git a/tests/integration/Forms/Element/RenderCest.php b/tests/integration/Forms/Element/RenderCest.php index af8861d97a4..11b2227b2ff 100644 --- a/tests/integration/Forms/Element/RenderCest.php +++ b/tests/integration/Forms/Element/RenderCest.php @@ -121,9 +121,9 @@ private function getExamples(): array [ "Numeric", Numeric::class, - '', + '', ['class' => 'alert alert-warning'], - '', + '', ], [ "Password", diff --git a/tests/integration/Forms/Form/GetAttributesCest.php b/tests/integration/Forms/Form/GetAttributesCest.php index 534c59de4a7..1877ed0aa59 100644 --- a/tests/integration/Forms/Form/GetAttributesCest.php +++ b/tests/integration/Forms/Form/GetAttributesCest.php @@ -16,8 +16,6 @@ use IntegrationTester; use Phalcon\Forms\Form; use Phalcon\Html\Attributes\AttributesInterface; -use Phalcon\Tag; -use Phalcon\Tests\Fixtures\Traits\DiTrait; use function method_exists; diff --git a/tests/integration/Forms/Form/GetMessagesCest.php b/tests/integration/Forms/Form/GetMessagesCest.php index 6841d721bd2..ceb3792a0fe 100644 --- a/tests/integration/Forms/Form/GetMessagesCest.php +++ b/tests/integration/Forms/Form/GetMessagesCest.php @@ -14,15 +14,13 @@ namespace Phalcon\Tests\Integration\Forms\Form; use IntegrationTester; +use Phalcon\Filter\Validation; +use Phalcon\Filter\Validation\Validator\PresenceOf; +use Phalcon\Filter\Validation\Validator\Regex; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Messages\Message; use Phalcon\Messages\Messages; -use Phalcon\Tag; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Filter\Validation; -use Phalcon\Filter\Validation\Validator\PresenceOf; -use Phalcon\Filter\Validation\Validator\Regex; class GetMessagesCest { @@ -34,9 +32,7 @@ class GetMessagesCest */ public function testGetElementMessagesFromForm(IntegrationTester $I) { - // First element $telephone = new Text('telephone'); - $telephone->addValidators( [ new PresenceOf( @@ -48,7 +44,6 @@ public function testGetElementMessagesFromForm(IntegrationTester $I) ); $customValidation = new Validation(); - $customValidation->add( 'telephone', new Regex( diff --git a/tests/integration/Forms/Form/GetSetTagFactoryCest.php b/tests/integration/Forms/Form/GetSetTagFactoryCest.php index eeb32c8591b..8514cc9971a 100644 --- a/tests/integration/Forms/Form/GetSetTagFactoryCest.php +++ b/tests/integration/Forms/Form/GetSetTagFactoryCest.php @@ -14,11 +14,9 @@ namespace Phalcon\Tests\Integration\Forms\Form; use IntegrationTester; -use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Html\Escaper; use Phalcon\Html\TagFactory; -use Phalcon\Tests\Fixtures\Traits\DiTrait; class GetSetTagFactoryCest { diff --git a/tests/integration/Forms/Form/HasMessagesForCest.php b/tests/integration/Forms/Form/HasMessagesForCest.php index 5986bdf881e..53a0e065c3f 100644 --- a/tests/integration/Forms/Form/HasMessagesForCest.php +++ b/tests/integration/Forms/Form/HasMessagesForCest.php @@ -14,13 +14,11 @@ namespace Phalcon\Tests\Integration\Forms\Form; use IntegrationTester; +use Phalcon\Filter\Validation\Validator\Regex; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Messages\Message; use Phalcon\Messages\Messages; -use Phalcon\Tag; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Filter\Validation\Validator\Regex; class HasMessagesForCest { @@ -32,9 +30,7 @@ class HasMessagesForCest */ public function testFormHasMessagesFor(IntegrationTester $I) { - // First element $telephone = new Text('telephone'); - $telephone->addValidators( [ new Regex( @@ -46,7 +42,6 @@ public function testFormHasMessagesFor(IntegrationTester $I) ] ); - // Second element $address = new Text('address'); $form = new Form(); diff --git a/tests/integration/Forms/Form/IsValidCest.php b/tests/integration/Forms/Form/IsValidCest.php index 6cb1b85d84a..3fef95ea093 100644 --- a/tests/integration/Forms/Form/IsValidCest.php +++ b/tests/integration/Forms/Form/IsValidCest.php @@ -14,16 +14,14 @@ namespace Phalcon\Tests\Integration\Forms\Form; use IntegrationTester; +use Phalcon\Filter\Validation; +use Phalcon\Filter\Validation\Validator\PresenceOf; +use Phalcon\Filter\Validation\Validator\Regex; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Messages\Message; use Phalcon\Messages\Messages; -use Phalcon\Tag; use Phalcon\Tests\Fixtures\Forms\ValidationForm; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Filter\Validation; -use Phalcon\Filter\Validation\Validator\PresenceOf; -use Phalcon\Filter\Validation\Validator\Regex; class IsValidCest { @@ -35,9 +33,7 @@ class IsValidCest */ public function testMergeValidators(IntegrationTester $I) { - // First element $telephone = new Text('telephone'); - $telephone->addValidators( [ new PresenceOf( @@ -49,7 +45,6 @@ public function testMergeValidators(IntegrationTester $I) ); $customValidation = new Validation(); - $customValidation->add( 'telephone', new Regex( diff --git a/tests/integration/Forms/Form/RenderCest.php b/tests/integration/Forms/Form/RenderCest.php index 98727bd677b..25dfd874857 100644 --- a/tests/integration/Forms/Form/RenderCest.php +++ b/tests/integration/Forms/Form/RenderCest.php @@ -18,8 +18,6 @@ use Phalcon\Forms\Form; use Phalcon\Html\Escaper; use Phalcon\Html\TagFactory; -use Phalcon\Tag; -use Phalcon\Tests\Fixtures\Traits\DiTrait; use stdClass; class RenderCest diff --git a/tests/integration/Forms/Form/SetValidationCest.php b/tests/integration/Forms/Form/SetValidationCest.php index 4876216c00e..06e4d45fec1 100644 --- a/tests/integration/Forms/Form/SetValidationCest.php +++ b/tests/integration/Forms/Form/SetValidationCest.php @@ -14,14 +14,12 @@ namespace Phalcon\Tests\Integration\Forms\Form; use IntegrationTester; +use Phalcon\Filter\Validation; +use Phalcon\Filter\Validation\Validator\Regex; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Form; use Phalcon\Messages\Message; use Phalcon\Messages\Messages; -use Phalcon\Tag; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Filter\Validation; -use Phalcon\Filter\Validation\Validator\Regex; /** * Class SetValidationCest diff --git a/tests/integration/Mvc/Router/HandleCest.php b/tests/integration/Mvc/Router/HandleCest.php index 18143ae98c0..72c6f372c87 100644 --- a/tests/integration/Mvc/Router/HandleCest.php +++ b/tests/integration/Mvc/Router/HandleCest.php @@ -136,11 +136,13 @@ public function mvcRouterHandleWithPlaceholders(IntegrationTester $I) '/admin/2020/october/21/456' ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); - $I->assertNull( + $I->assertSame( + '', $router->getNamespaceName() ); @@ -183,11 +185,13 @@ public function mvcRouterHandleWithPlaceholders(IntegrationTester $I) '/admin/2020/10/21/456' ); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); - $I->assertNull( + $I->assertSame( + '', $router->getNamespaceName() ); @@ -227,11 +231,13 @@ public function mvcRouterHandleShortSyntax(IntegrationTester $I) $router->handle('/about'); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); - $I->assertNull( + $I->assertSame( + '', $router->getNamespaceName() ); @@ -269,11 +275,13 @@ public function mvcRouterHandleShortSyntax(IntegrationTester $I) $router->getMatchedRoute() ); - $I->assertNull( + $I->assertSame( + '', $router->getControllerName() ); - $I->assertNull( + $I->assertSame( + '', $router->getActionName() ); @@ -290,11 +298,13 @@ public function mvcRouterHandleShortSyntax(IntegrationTester $I) $router->handle('/about'); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); - $I->assertNull( + $I->assertSame( + '', $router->getNamespaceName() ); @@ -331,11 +341,13 @@ public function mvcRouterHandleNumeric(IntegrationTester $I) $router->setDI($di); $router->handle('/12/34/56'); - $I->assertNull( + $I->assertSame( + '', $router->getModuleName() ); - $I->assertNull( + $I->assertSame( + '', $router->getNamespaceName() ); diff --git a/tests/integration/Session/Adapter/Libmemcached/CloseCest.php b/tests/integration/Session/Adapter/Libmemcached/CloseCest.php index 1c035ec83e8..67f195bc8bb 100644 --- a/tests/integration/Session/Adapter/Libmemcached/CloseCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/CloseCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class CloseCest { @@ -24,17 +23,17 @@ class CloseCest /** * Tests Phalcon\Session\Adapter\Libmemcached :: close() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedClose(IntegrationTester $I) { $I->wantToTest('Session\Adapter\Libmemcached - close()'); $adapter = $this->newService('sessionLibmemcached'); - - $I->assertTrue( - $adapter->close() - ); + $actual = $adapter->close(); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/ConstructCest.php b/tests/integration/Session/Adapter/Libmemcached/ConstructCest.php index ab04f037f8e..19fadfc00de 100644 --- a/tests/integration/Session/Adapter/Libmemcached/ConstructCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/ConstructCest.php @@ -27,8 +27,10 @@ class ConstructCest /** * Tests Phalcon\Session\Adapter\Libmemcached :: __construct() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedConstruct(IntegrationTester $I) { @@ -36,10 +38,8 @@ public function sessionAdapterLibmemcachedConstruct(IntegrationTester $I) $adapter = $this->newService('sessionLibmemcached'); - $I->assertInstanceOf( - SessionHandlerInterface::class, - $adapter - ); + $class = SessionHandlerInterface::class; + $I->assertInstanceOf($class, $adapter); } /** @@ -60,23 +60,21 @@ public function sessionAdapterLibmemcachedConstructWithPrefix(IntegrationTester $memcachedSession = new Libmemcached($factory, $options); - $I->assertTrue( - $memcachedSession->write( - 'my-session-prefixed-key', - 'test-data' - ) + $actual = $memcachedSession->write( + 'my-session-prefixed-key', + 'test-data' ); + $I->assertTrue($actual); + $memcachedStorage = $factory->newInstance('libmemcached', $options); - $I->assertEquals( - 'my-custom-prefix-', - $memcachedStorage->getPrefix() - ); + $expected = 'my-custom-prefix-'; + $actual = $memcachedStorage->getPrefix(); + $I->assertEquals($expected, $actual); - $I->assertEquals( - 'test-data', - $memcachedStorage->get('my-session-prefixed-key') - ); + $expected = 'test-data'; + $actual = $memcachedStorage->get('my-session-prefixed-key'); + $I->assertEquals($expected, $actual); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/DestroyCest.php b/tests/integration/Session/Adapter/Libmemcached/DestroyCest.php index 41fdb36ce0c..5cd6cde91bf 100644 --- a/tests/integration/Session/Adapter/Libmemcached/DestroyCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/DestroyCest.php @@ -15,8 +15,8 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; +use function serialize; use function uniqid; class DestroyCest @@ -26,8 +26,10 @@ class DestroyCest /** * Tests Phalcon\Session\Adapter\Libmemcached :: destroy() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedDestroy(IntegrationTester $I) { @@ -35,17 +37,18 @@ public function sessionAdapterLibmemcachedDestroy(IntegrationTester $I) $adapter = $this->newService('sessionLibmemcached'); - $value = uniqid(); + $value = uniqid(); + $key = 'sess-memc-test1'; + $actual = serialize($value); + + $I->haveInMemcached($key, $actual, 0); - $I->haveInLibmemcached( - 'sess-memc-test1', - serialize($value) - ); + $actual = serialize($value); + $I->seeInMemcached($key, $actual); - $I->assertTrue( - $adapter->destroy('test1') - ); + $actual = $adapter->destroy('test1'); + $I->assertTrue($actual); - $I->dontSeeInLibmemcached('sess-memc-test1'); + $I->dontSeeInMemcached($key); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/GcCest.php b/tests/integration/Session/Adapter/Libmemcached/GcCest.php index 9131bb7cd50..f3808c45b49 100644 --- a/tests/integration/Session/Adapter/Libmemcached/GcCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/GcCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function sleep; use function uniqid; @@ -27,8 +26,10 @@ class GcCest /** * Tests Phalcon\Session\Adapter\Libmemcached :: gc() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedGc(IntegrationTester $I) { @@ -38,15 +39,15 @@ public function sessionAdapterLibmemcachedGc(IntegrationTester $I) /** * Add two session keys */ - $I->haveInLibmemcached('sess-memc-gc_1', uniqid(), 1); - $I->haveInLibmemcached('sess-memc-gc_2', uniqid(), 1); + $I->haveInMemcached('sess-memc-gc_1', uniqid(), 1); + $I->haveInMemcached('sess-memc-gc_2', uniqid(), 1); /** * Sleep to make sure that the time expired */ sleep(2); $actual = $adapter->gc(1); $I->assertTrue($actual); - $I->dontSeeInLibmemcached('sess-memc-gc_1'); - $I->dontSeeInLibmemcached('sess-memc-gc_2'); + $I->dontSeeInMemcached('sess-memc-gc_1'); + $I->dontSeeInMemcached('sess-memc-gc_2'); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/OpenCest.php b/tests/integration/Session/Adapter/Libmemcached/OpenCest.php index 3abed6a85f8..1077f57a0aa 100644 --- a/tests/integration/Session/Adapter/Libmemcached/OpenCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/OpenCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class OpenCest { @@ -24,8 +23,10 @@ class OpenCest /** * Tests Phalcon\Session\Adapter\Libmemcached :: open() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedOpen(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterLibmemcachedOpen(IntegrationTester $I) $adapter = $this->newService('sessionLibmemcached'); - $I->assertTrue( - $adapter->open('test', 'test1') - ); + $actual = $adapter->open('test', 'test1'); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/ReadCest.php b/tests/integration/Session/Adapter/Libmemcached/ReadWriteCest.php similarity index 68% rename from tests/integration/Session/Adapter/Libmemcached/ReadCest.php rename to tests/integration/Session/Adapter/Libmemcached/ReadWriteCest.php index 2091db6a1a1..cb32ad1b469 100644 --- a/tests/integration/Session/Adapter/Libmemcached/ReadCest.php +++ b/tests/integration/Session/Adapter/Libmemcached/ReadWriteCest.php @@ -15,19 +15,20 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; -class ReadCest +class ReadWriteCest { use DiTrait; /** * Tests Phalcon\Session\Adapter\Libmemcached :: write() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterLibmemcachedRead(IntegrationTester $I) { @@ -37,17 +38,14 @@ public function sessionAdapterLibmemcachedRead(IntegrationTester $I) $value = uniqid(); - $I->haveInLibmemcached('sess-memc-test1', $value); + $adapter->write('test1', $value); - $I->assertEquals( - $value, - $adapter->read('test1') - ); + $actual = $adapter->read('test1'); + $I->assertEquals($value, $actual); - $I->removeFromLibmemcached('sess-memc-test1'); + $I->clearMemcache(); - $I->assertNotNull( - $adapter->read('test1') - ); + $actual = $adapter->read('test1'); + $I->assertNotNull($actual); } } diff --git a/tests/integration/Session/Adapter/Libmemcached/WriteCest.php b/tests/integration/Session/Adapter/Libmemcached/WriteCest.php deleted file mode 100644 index fb2e1d528f3..00000000000 --- a/tests/integration/Session/Adapter/Libmemcached/WriteCest.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Session\Adapter\Libmemcached; - -use IntegrationTester; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; - -use function uniqid; - -class WriteCest -{ - use DiTrait; - - /** - * Tests Phalcon\Session\Adapter\Libmemcached :: write() - * - * @author Phalcon Team - * @since 2018-11-13 - */ - public function sessionAdapterLibmemcachedWrite(IntegrationTester $I) - { - $I->wantToTest('Session\Adapter\Libmemcached - write()'); - - $adapter = $this->newService('sessionLibmemcached'); - $value = uniqid(); - $adapter->write('test1', $value); - - /** - * Serialize the value because the adapter does not have a serializer - */ - $I->seeInLibmemcached('sess-memc-test1', $value); - $I->removeFromLibmemcached('sess-memc-test1'); - } -} diff --git a/tests/integration/Session/Adapter/Noop/CloseCest.php b/tests/integration/Session/Adapter/Noop/CloseCest.php index 03b49df3299..dbdc75eaac7 100644 --- a/tests/integration/Session/Adapter/Noop/CloseCest.php +++ b/tests/integration/Session/Adapter/Noop/CloseCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class CloseCest { @@ -24,8 +23,10 @@ class CloseCest /** * Tests Phalcon\Session\Adapter\Noop :: close() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopClose(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterNoopClose(IntegrationTester $I) $adapter = $this->newService('sessionNoop'); - $I->assertTrue( - $adapter->close() - ); + $actual = $adapter->close(); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Noop/ConstructCest.php b/tests/integration/Session/Adapter/Noop/ConstructCest.php index 6c671032acb..a572f89e149 100644 --- a/tests/integration/Session/Adapter/Noop/ConstructCest.php +++ b/tests/integration/Session/Adapter/Noop/ConstructCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use SessionHandlerInterface; class ConstructCest @@ -25,8 +24,10 @@ class ConstructCest /** * Tests Phalcon\Session\Adapter\Noop :: __construct() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopConstruct(IntegrationTester $I) { @@ -34,9 +35,7 @@ public function sessionAdapterNoopConstruct(IntegrationTester $I) $adapter = $this->newService('sessionNoop'); - $I->assertInstanceOf( - SessionHandlerInterface::class, - $adapter - ); + $class = SessionHandlerInterface::class; + $I->assertInstanceOf($class, $adapter); } } diff --git a/tests/integration/Session/Adapter/Noop/DestroyCest.php b/tests/integration/Session/Adapter/Noop/DestroyCest.php index 2da2b62b3b6..016f9957a65 100644 --- a/tests/integration/Session/Adapter/Noop/DestroyCest.php +++ b/tests/integration/Session/Adapter/Noop/DestroyCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class DestroyCest { @@ -24,8 +23,10 @@ class DestroyCest /** * Tests Phalcon\Session\Adapter\Noop :: destroy() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopDestroy(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterNoopDestroy(IntegrationTester $I) $adapter = $this->newService('sessionNoop'); - $I->assertTrue( - $adapter->destroy('test1') - ); + $actual = $adapter->destroy('test1'); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Noop/GcCest.php b/tests/integration/Session/Adapter/Noop/GcCest.php index 93934ea75f9..d29d221cdfc 100644 --- a/tests/integration/Session/Adapter/Noop/GcCest.php +++ b/tests/integration/Session/Adapter/Noop/GcCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class GcCest { @@ -24,8 +23,10 @@ class GcCest /** * Tests Phalcon\Session\Adapter\Noop :: gc() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopGc(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterNoopGc(IntegrationTester $I) $adapter = $this->newService('sessionNoop'); - $I->assertTrue( - $adapter->gc(1) - ); + $actual = $adapter->gc(1); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Noop/OpenCest.php b/tests/integration/Session/Adapter/Noop/OpenCest.php index cd943fa6b11..02121e65fbd 100644 --- a/tests/integration/Session/Adapter/Noop/OpenCest.php +++ b/tests/integration/Session/Adapter/Noop/OpenCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class OpenCest { @@ -24,8 +23,10 @@ class OpenCest /** * Tests Phalcon\Session\Adapter\Noop :: open() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopOpen(IntegrationTester $I) { diff --git a/tests/integration/Session/Adapter/Noop/ReadCest.php b/tests/integration/Session/Adapter/Noop/ReadCest.php index c366ab9cb34..d2039f762d2 100644 --- a/tests/integration/Session/Adapter/Noop/ReadCest.php +++ b/tests/integration/Session/Adapter/Noop/ReadCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; @@ -26,8 +25,10 @@ class ReadCest /** * Tests Phalcon\Session\Adapter\Noop :: write() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopRead(IntegrationTester $I) { @@ -38,9 +39,8 @@ public function sessionAdapterNoopRead(IntegrationTester $I) $adapter->write('test1', $value); - $I->assertEquals( - '', - $adapter->read('test1') - ); + $expected = ''; + $actual = $adapter->read('test1'); + $I->assertEquals($expected, $actual); } } diff --git a/tests/integration/Session/Adapter/Noop/WriteCest.php b/tests/integration/Session/Adapter/Noop/WriteCest.php index 8bd21c5a031..6a5c883bfed 100644 --- a/tests/integration/Session/Adapter/Noop/WriteCest.php +++ b/tests/integration/Session/Adapter/Noop/WriteCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; @@ -26,8 +25,10 @@ class WriteCest /** * Tests Phalcon\Session\Adapter\Noop :: write() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterNoopWrite(IntegrationTester $I) { @@ -35,9 +36,7 @@ public function sessionAdapterNoopWrite(IntegrationTester $I) $adapter = $this->newService('sessionNoop'); - $adapter->write( - 'test1', - uniqid() - ); + $actual = $adapter->write('test1', uniqid()); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Redis/CloseCest.php b/tests/integration/Session/Adapter/Redis/CloseCest.php index 30039a78cd8..cca58660f0b 100644 --- a/tests/integration/Session/Adapter/Redis/CloseCest.php +++ b/tests/integration/Session/Adapter/Redis/CloseCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class CloseCest { @@ -24,8 +23,10 @@ class CloseCest /** * Tests Phalcon\Session\Adapter\Redis :: close() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisClose(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterRedisClose(IntegrationTester $I) $adapter = $this->newService('sessionRedis'); - $I->assertTrue( - $adapter->close() - ); + $actual = $adapter->close(); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Redis/ConstructCest.php b/tests/integration/Session/Adapter/Redis/ConstructCest.php index 54ef2b4d5e9..62e154dbfdb 100644 --- a/tests/integration/Session/Adapter/Redis/ConstructCest.php +++ b/tests/integration/Session/Adapter/Redis/ConstructCest.php @@ -27,8 +27,10 @@ class ConstructCest /** * Tests Phalcon\Session\Adapter\Redis :: __construct() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisConstruct(IntegrationTester $I) { @@ -36,10 +38,8 @@ public function sessionAdapterRedisConstruct(IntegrationTester $I) $adapter = $this->newService('sessionRedis'); - $I->assertInstanceOf( - SessionHandlerInterface::class, - $adapter - ); + $class = SessionHandlerInterface::class; + $I->assertInstanceOf($class, $adapter); } /** @@ -60,23 +60,21 @@ public function sessionAdapterRedisConstructWithPrefix(IntegrationTester $I) $redisSession = new Redis($factory, $options); - $I->assertTrue( - $redisSession->write( - 'my-session-prefixed-key', - 'test-data' - ) + $actual = $redisSession->write( + 'my-session-prefixed-key', + 'test-data' ); + $I->assertTrue($actual); + $redisStorage = $factory->newInstance('redis', $options); - $I->assertEquals( - 'my-custom-prefix-', - $redisStorage->getPrefix() - ); + $expected = 'my-custom-prefix-'; + $actual = $redisStorage->getPrefix(); + $I->assertEquals($expected, $actual); - $I->assertEquals( - 'test-data', - $redisStorage->get('my-session-prefixed-key') - ); + $expected = 'test-data'; + $actual = $redisStorage->get('my-session-prefixed-key'); + $I->assertEquals($expected, $actual); } } diff --git a/tests/integration/Session/Adapter/Redis/DestroyCest.php b/tests/integration/Session/Adapter/Redis/DestroyCest.php index 7a00094f0f1..915de50c937 100644 --- a/tests/integration/Session/Adapter/Redis/DestroyCest.php +++ b/tests/integration/Session/Adapter/Redis/DestroyCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; @@ -26,8 +25,10 @@ class DestroyCest /** * Tests Phalcon\Session\Adapter\Redis :: destroy() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisDestroy(IntegrationTester $I) { @@ -43,9 +44,8 @@ public function sessionAdapterRedisDestroy(IntegrationTester $I) serialize($value) ); - $I->assertTrue( - $adapter->destroy('test1') - ); + $actual = $adapter->destroy('test1'); + $I->assertTrue($actual); $I->dontSeeInRedis('sess-reds-test1'); } diff --git a/tests/integration/Session/Adapter/Redis/GcCest.php b/tests/integration/Session/Adapter/Redis/GcCest.php index 29e7c6e054c..1c27132e6bf 100644 --- a/tests/integration/Session/Adapter/Redis/GcCest.php +++ b/tests/integration/Session/Adapter/Redis/GcCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class GcCest { @@ -24,8 +23,10 @@ class GcCest /** * Tests Phalcon\Session\Adapter\Redis :: gc() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisGc(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterRedisGc(IntegrationTester $I) $adapter = $this->newService('sessionRedis'); - $I->assertTrue( - $adapter->gc(1) - ); + $actual = $adapter->gc(1); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Redis/OpenCest.php b/tests/integration/Session/Adapter/Redis/OpenCest.php index a7295f691f4..ba7e954665f 100644 --- a/tests/integration/Session/Adapter/Redis/OpenCest.php +++ b/tests/integration/Session/Adapter/Redis/OpenCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class OpenCest { @@ -24,8 +23,10 @@ class OpenCest /** * Tests Phalcon\Session\Adapter\Redis :: open() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisOpen(IntegrationTester $I) { @@ -33,8 +34,7 @@ public function sessionAdapterRedisOpen(IntegrationTester $I) $adapter = $this->newService('sessionRedis'); - $I->assertTrue( - $adapter->open('test', 'test1') - ); + $actual = $adapter->open('test', 'test1'); + $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Adapter/Redis/ReadCest.php b/tests/integration/Session/Adapter/Redis/ReadWriteCest.php similarity index 77% rename from tests/integration/Session/Adapter/Redis/ReadCest.php rename to tests/integration/Session/Adapter/Redis/ReadWriteCest.php index 20d456d0127..19b9038a8ed 100644 --- a/tests/integration/Session/Adapter/Redis/ReadCest.php +++ b/tests/integration/Session/Adapter/Redis/ReadWriteCest.php @@ -14,37 +14,39 @@ namespace Phalcon\Tests\Integration\Session\Adapter\Redis; use IntegrationTester; +use Phalcon\Session\Adapter\Redis; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; -class ReadCest +class ReadWriteCest { use DiTrait; /** * Tests Phalcon\Session\Adapter\Redis :: read() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterRedisRead(IntegrationTester $I) { $I->wantToTest('Session\Adapter\Redis - read()'); + /** @var Redis $adapter */ $adapter = $this->newService('sessionRedis'); $value = uniqid(); - $I->haveInRedis('string', 'sess-reds-test1', $value); + $adapter->write('test1', $value); $expected = $value; $actual = $adapter->read('test1'); $I->assertEquals($expected, $actual); $I->sendCommandToRedis('del', 'sess-reds-test1'); - $I->assertNotNull( - $adapter->read('test1') - ); + $actual = $adapter->read('test1'); + $I->assertNotNull($actual); } } diff --git a/tests/integration/Session/Adapter/Redis/WriteCest.php b/tests/integration/Session/Adapter/Redis/WriteCest.php deleted file mode 100644 index f3a3633bb5e..00000000000 --- a/tests/integration/Session/Adapter/Redis/WriteCest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Session\Adapter\Redis; - -use IntegrationTester; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; - -use function uniqid; - -class WriteCest -{ - use DiTrait; - - /** - * Tests Phalcon\Session\Adapter\Redis :: write() - * - * @author Phalcon Team - * @since 2018-11-13 - */ - public function sessionAdapterRedisWrite(IntegrationTester $I) - { - $I->wantToTest('Session\Adapter\Redis - write()'); - - $adapter = $this->newService('sessionRedis'); - $value = uniqid(); - $adapter->write('test1', $value); - - /** - * Serialize the value because the adapter does not have a serializer - */ - $expected = serialize($value); - $actual = $I->grabFromRedis('sess-reds-test1'); - $I->assertEquals($expected, $actual); - $I->sendCommandToRedis('del', 'sess-reds-test1'); - } -} diff --git a/tests/integration/Session/Adapter/Stream/CloseCest.php b/tests/integration/Session/Adapter/Stream/CloseCest.php index 1a8f7a5a611..c85ab18f9a1 100644 --- a/tests/integration/Session/Adapter/Stream/CloseCest.php +++ b/tests/integration/Session/Adapter/Stream/CloseCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class CloseCest { @@ -24,8 +23,10 @@ class CloseCest /** * Tests Phalcon\Session\Adapter\Stream :: close() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamClose(IntegrationTester $I) { diff --git a/tests/integration/Session/Adapter/Stream/ConstructCest.php b/tests/integration/Session/Adapter/Stream/ConstructCest.php index 141e66793b5..f3407310eed 100644 --- a/tests/integration/Session/Adapter/Stream/ConstructCest.php +++ b/tests/integration/Session/Adapter/Stream/ConstructCest.php @@ -13,9 +13,11 @@ namespace Phalcon\Tests\Integration\Session\Adapter\Stream; +use Codeception\Stub; use IntegrationTester; +use Phalcon\Session\Adapter\Stream as SessionStream; +use Phalcon\Session\Exception; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use SessionHandlerInterface; class ConstructCest @@ -25,8 +27,10 @@ class ConstructCest /** * Tests Phalcon\Session\Adapter\Stream :: __construct() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamConstruct(IntegrationTester $I) { @@ -36,4 +40,59 @@ public function sessionAdapterStreamConstruct(IntegrationTester $I) $class = SessionHandlerInterface::class; $I->assertInstanceOf($class, $adapter); } + + /** + * Tests Phalcon\Session\Adapter\Stream :: __construct() - empty session_path + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function sessionAdapterStreamConstructEmptySessionPath(IntegrationTester $I) + { + $I->wantToTest('Session\Adapter\Stream - __construct() - empty session path'); + + $I->expectThrowable( + new Exception('The session save path cannot be empty'), + function () { + $adapter = Stub::construct( + SessionStream::class, + [], + [ + 'phpIniGet' => '', + ] + ); + } + ); + } + + /** + * Tests Phalcon\Session\Adapter\Stream :: __construct() - not writable path + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function sessionAdapterStreamConstructNotWritablePath(IntegrationTester $I) + { + $I->wantToTest('Session\Adapter\Stream - __construct() - not writable path'); + + $path = ini_get('session.save_path'); + $I->expectThrowable( + new Exception( + 'The session save path [' . $path . '] is not writable' + ), + function () { + $adapter = Stub::construct( + SessionStream::class, + [], + [ + 'phpIsWritable' => false, + ] + ); + } + ); + } } diff --git a/tests/integration/Session/Adapter/Stream/DestroyCest.php b/tests/integration/Session/Adapter/Stream/DestroyCest.php index eb103fb235f..a4ffe9c6558 100644 --- a/tests/integration/Session/Adapter/Stream/DestroyCest.php +++ b/tests/integration/Session/Adapter/Stream/DestroyCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function cacheDir; use function uniqid; @@ -44,14 +43,10 @@ public function sessionAdapterStreamDestroy(IntegrationTester $I) uniqid() ); - $I->assertTrue( - $adapter->destroy('test1') - ); - - $I->amInPath( - cacheDir('sessions') - ); + $actual = $adapter->destroy('test1'); + $I->assertTrue($actual); + $I->amInPath(cacheDir('sessions')); $I->dontSeeFileFound('test1'); } } diff --git a/tests/integration/Session/Adapter/Stream/GcCest.php b/tests/integration/Session/Adapter/Stream/GcCest.php index 776f95d0e19..0d98e02ddf5 100644 --- a/tests/integration/Session/Adapter/Stream/GcCest.php +++ b/tests/integration/Session/Adapter/Stream/GcCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function cacheDir; use function file_put_contents; @@ -29,8 +28,10 @@ class GcCest /** * Tests Phalcon\Session\Adapter\Stream :: gc() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamGc(IntegrationTester $I) { @@ -41,28 +42,19 @@ public function sessionAdapterStreamGc(IntegrationTester $I) /** * Add two session files */ - $I->assertNotFalse( - file_put_contents( - cacheDir('sessions/gc_1'), - uniqid() - ) - ); + $actual = file_put_contents(cacheDir('sessions/gc_1'), uniqid()); + $I->assertNotFalse($actual); - $I->assertNotFalse( - file_put_contents( - cacheDir('sessions/gc_2'), - uniqid() - ) - ); + $actual = file_put_contents(cacheDir('sessions/gc_2'), uniqid()); + $I->assertNotFalse($actual); /** * Sleep to make sure that the time expired */ sleep(2); - $I->assertTrue( - $adapter->gc(1) - ); + $actual = $adapter->gc(1); + $I->assertTrue($actual); $I->dontSeeFileFound('gc_1', cacheDir('sessions')); $I->dontSeeFileFound('gc_2', cacheDir('sessions')); diff --git a/tests/integration/Session/Adapter/Stream/OpenCest.php b/tests/integration/Session/Adapter/Stream/OpenCest.php index b56574151c4..a6e9941b303 100644 --- a/tests/integration/Session/Adapter/Stream/OpenCest.php +++ b/tests/integration/Session/Adapter/Stream/OpenCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class OpenCest { @@ -25,8 +24,10 @@ class OpenCest /** * Tests Phalcon\Session\Adapter\Stream :: open() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamOpen(IntegrationTester $I) { @@ -34,19 +35,17 @@ public function sessionAdapterStreamOpen(IntegrationTester $I) $adapter = $this->newService('sessionStream'); - $I->assertTrue( - $adapter->open( - cacheDir('sessions'), - 'test1' - ) - ); + $actual = $adapter->open(cacheDir('sessions'), 'test1'); + $I->assertTrue($actual); } /** * Tests Phalcon\Session\Adapter\Stream :: open() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2019-08-06 + * @since 2020-09-09 */ public function issue14265(IntegrationTester $I) { @@ -54,9 +53,10 @@ public function issue14265(IntegrationTester $I) $session = new Manager(); $stream = $this->newService('sessionStream'); $session->setAdapter($stream); - $I->assertTrue( - $session->start() - ); + + $actual = $session->start(); + $I->assertTrue($actual); + $value = uniqid(); $stream->write('test1', $value); $I->amInPath(cacheDir('sessions')); diff --git a/tests/integration/Session/Adapter/Stream/ReadCest.php b/tests/integration/Session/Adapter/Stream/ReadCest.php index f10f858814b..d806a8ff35d 100644 --- a/tests/integration/Session/Adapter/Stream/ReadCest.php +++ b/tests/integration/Session/Adapter/Stream/ReadCest.php @@ -13,9 +13,9 @@ namespace Phalcon\Tests\Integration\Session\Adapter\Stream; +use Codeception\Stub; use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function cacheDir; use function uniqid; @@ -25,28 +25,54 @@ class ReadCest use DiTrait; /** - * Tests Phalcon\Session\Adapter\Stream :: write() + * Tests Phalcon\Session\Adapter\Stream :: read() + * + * @param IntegrationTester $I * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamRead(IntegrationTester $I) { - $I->wantToTest('Session\Adapter\Stream - write()'); + $I->wantToTest('Session\Adapter\Stream - read()'); $adapter = $this->newService('sessionStream'); $value = uniqid(); + $adapter->write('test1', $value); + + $actual = $adapter->read('test1'); + $I->assertEquals($value, $actual); + + $I->safeDeleteFile(cacheDir('sessions/test1')); + } + + /** + * Tests Phalcon\Session\Adapter\Stream :: read() - no data + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function sessionAdapterStreamReadNoData(IntegrationTester $I) + { + $I->wantToTest('Session\Adapter\Stream - read()'); + $adapter = $this->newService('sessionStream'); + + $value = uniqid(); $adapter->write('test1', $value); - $I->assertEquals( - $value, - $adapter->read('test1') + $mock = Stub::make( + $adapter, + [ + 'phpFileGetContents' => false, + ] ); + $actual = $mock->read('test1'); + $I->assertEmpty($actual); - $I->safeDeleteFile( - cacheDir('sessions/test1') - ); + $I->safeDeleteFile(cacheDir('sessions/test1')); } } diff --git a/tests/integration/Session/Adapter/Stream/WriteCest.php b/tests/integration/Session/Adapter/Stream/WriteCest.php index cc0b4577dbb..39f27fe886a 100644 --- a/tests/integration/Session/Adapter/Stream/WriteCest.php +++ b/tests/integration/Session/Adapter/Stream/WriteCest.php @@ -15,7 +15,6 @@ use IntegrationTester; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function cacheDir; use function uniqid; @@ -27,8 +26,10 @@ class WriteCest /** * Tests Phalcon\Session\Adapter\Stream :: write() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionAdapterStreamWrite(IntegrationTester $I) { diff --git a/tests/integration/Session/Bag/ClearCest.php b/tests/integration/Session/Bag/ClearCest.php index 9c8dc2dd46e..9872b1b74ca 100644 --- a/tests/integration/Session/Bag/ClearCest.php +++ b/tests/integration/Session/Bag/ClearCest.php @@ -17,44 +17,45 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class ClearCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class ClearCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: clear() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagClear(IntegrationTester $I) { $I->wantToTest('Session\Bag - clear()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); - $expected = $data; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $actual = $collection->toArray(); + $I->assertEquals($data, $actual); $collection->clear(); - $expected = 0; - $actual = $collection->count(); - $I->assertEquals($expected, $actual); + $actual = $collection->count(); + $I->assertEquals(0, $actual); } } diff --git a/tests/integration/Session/Bag/ConstructCest.php b/tests/integration/Session/Bag/ConstructCest.php index c92207c147c..dcade8b0f45 100644 --- a/tests/integration/Session/Bag/ConstructCest.php +++ b/tests/integration/Session/Bag/ConstructCest.php @@ -15,63 +15,34 @@ use IntegrationTester; use Phalcon\Session\Bag; -use Phalcon\Session\Exception; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class ConstructCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class ConstructCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - } - /** * Tests Phalcon\Session\Bag :: __construct() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagConstruct(IntegrationTester $I) { $I->wantToTest('Session\Bag - __construct()'); + $this->setNewFactoryDefault(); $this->setDiService('sessionStream'); - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $class = Bag::class; $I->assertInstanceOf($class, $collection); } - - /** - * Tests Phalcon\Session\Bag :: __construct() - exception - * - * @author Phalcon Team - * @since 2021-10-02 - */ - public function sessionBagConstructException(IntegrationTester $I) - { - $I->wantToTest('Session\Bag - __construct() - exception'); - - $I->expectThrowable( - new Exception( - "A dependency injection container is required to access the 'session' service" - ), - function () { - $collection = new Bag('BagTest'); - } - ); - - $container = $this->container; - - $I->expectThrowable( - new Exception( - "A dependency injection container is required to access the 'session' service" - ), - function () use ($container) { - $collection = new Bag('BagTest', $container); - } - ); - } } diff --git a/tests/integration/Session/Bag/CountCest.php b/tests/integration/Session/Bag/CountCest.php index 3127db6d340..f0f9cb4f56f 100644 --- a/tests/integration/Session/Bag/CountCest.php +++ b/tests/integration/Session/Bag/CountCest.php @@ -17,42 +17,40 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class CountCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class CountCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: count() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagCount(IntegrationTester $I) { $I->wantToTest('Session\Bag - count()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); - $expected = 3; - $actual = $collection->toArray(); - $I->assertCount($expected, $actual); - - $expected = 3; - $actual = $collection->count(); - $I->assertEquals($expected, $actual); + $I->assertCount(3, $collection->toArray()); + $I->assertEquals(3, $collection->count()); } } diff --git a/tests/integration/Session/Bag/GetCest.php b/tests/integration/Session/Bag/GetCest.php index df1d26a6161..4f4cb13a310 100644 --- a/tests/integration/Session/Bag/GetCest.php +++ b/tests/integration/Session/Bag/GetCest.php @@ -17,32 +17,35 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class GetCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class GetCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: get() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagGet(IntegrationTester $I) { $I->wantToTest('Session\Bag - get()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); $expected = 'four'; diff --git a/tests/integration/Session/Bag/GetIteratorCest.php b/tests/integration/Session/Bag/GetIteratorCest.php index ac4fac8f955..149cb02d08e 100644 --- a/tests/integration/Session/Bag/GetIteratorCest.php +++ b/tests/integration/Session/Bag/GetIteratorCest.php @@ -17,40 +17,40 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class GetIteratorCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class GetIteratorCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: getIterator() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagGetIterator(IntegrationTester $I) { $I->wantToTest('Session\Bag - getIterator()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); - + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); foreach ($collection as $key => $value) { - $expected = $data[$key]; - $actual = $collection[$key]; - $I->assertEquals($expected, $actual); + $I->assertEquals($data[$key], $collection[$key]); } } } diff --git a/tests/integration/Session/Bag/GetSetDICest.php b/tests/integration/Session/Bag/GetSetDICest.php index 94863990d5f..ca1954231e0 100644 --- a/tests/integration/Session/Bag/GetSetDICest.php +++ b/tests/integration/Session/Bag/GetSetDICest.php @@ -18,33 +18,40 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class GetSetDICest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class GetSetDICest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: getDI()/setDI() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagGetSetDI(IntegrationTester $I) { $I->wantToTest("Session\Bag - getDI()/setDI()"); - $container = new FactoryDefault(); - $sessionBag = new Bag('DiTest', $this->container); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); + $session = $this->container->get("session"); + $container = $this->container; + + $bag = new Bag($session, 'DiTest'); + $actual = $bag->getDI(); + $I->assertSame($container, $actual); - $sessionBag->setDI($container); + $container = new FactoryDefault(); + $bag->setDI($container); - $expected = $container; - $actual = $sessionBag->getDI(); - $I->assertEquals($expected, $actual); + $actual = $bag->getDI(); + $I->assertSame($container, $actual); } } diff --git a/tests/integration/Session/Bag/HasCest.php b/tests/integration/Session/Bag/HasCest.php index d039af0bbdf..5900bcc1eaa 100644 --- a/tests/integration/Session/Bag/HasCest.php +++ b/tests/integration/Session/Bag/HasCest.php @@ -17,32 +17,36 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class HasCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class HasCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: has() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagHas(IntegrationTester $I) { $I->wantToTest('Session\Bag - has()'); + + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); $actual = $collection->has('three'); @@ -51,19 +55,19 @@ public function sessionBagHas(IntegrationTester $I) $actual = $collection->has('THREE'); $I->assertTrue($actual); - $actual = $collection->has('unknown'); + $actual = $collection->has(uniqid()); $I->assertFalse($actual); $actual = isset($collection['three']); $I->assertTrue($actual); - $actual = isset($collection['unknown']); + $actual = isset($collection[uniqid()]); $I->assertFalse($actual); $actual = $collection->offsetExists('three'); $I->assertTrue($actual); - $actual = $collection->offsetExists('unknown'); + $actual = $collection->offsetExists(uniqid()); $I->assertFalse($actual); } } diff --git a/tests/integration/Session/Bag/InitCest.php b/tests/integration/Session/Bag/InitCest.php index e122c3fcf51..3091cc7f07b 100644 --- a/tests/integration/Session/Bag/InitCest.php +++ b/tests/integration/Session/Bag/InitCest.php @@ -17,43 +17,56 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use function var_dump; +use function uniqid; +/** + * Class InitCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class InitCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: init() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagInit(IntegrationTester $I) { $I->wantToTest('Session\Bag - init()'); + $store = $_SESSION ?? []; + + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); + + $name = uniqid(); + $_SESSION[$name] = [ + 'one' => 'two', + 'three' => 'four', + ]; + $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); - $expected = 0; + $collection = new Bag($this->container->get("session"), $name); + + $expected = 2; $actual = $collection->count(); $I->assertEquals($expected, $actual); $collection->init($data); + $actual = $collection->toArray(); + $I->assertEquals($data, $actual); - $expected = $data; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $_SESSION = $store; } } diff --git a/tests/integration/Session/Bag/InjectableCest.php b/tests/integration/Session/Bag/InjectableCest.php index 602843308c4..222acd34ce5 100644 --- a/tests/integration/Session/Bag/InjectableCest.php +++ b/tests/integration/Session/Bag/InjectableCest.php @@ -25,12 +25,6 @@ class InjectableCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: clear() * @@ -41,6 +35,9 @@ public function sessionBagClear(IntegrationTester $I) { $I->wantToTest('Session\Bag - injectable'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); + /** * Set a session bag */ @@ -49,7 +46,7 @@ public function sessionBagClear(IntegrationTester $I) 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); /** diff --git a/tests/integration/Session/Bag/JsonSerializeCest.php b/tests/integration/Session/Bag/JsonSerializeCest.php index 3850f38c125..d5c19e29544 100644 --- a/tests/integration/Session/Bag/JsonSerializeCest.php +++ b/tests/integration/Session/Bag/JsonSerializeCest.php @@ -17,37 +17,38 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class JsonSerializeCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class JsonSerializeCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: jsonSerialize() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagJsonSerialize(IntegrationTester $I) { $I->wantToTest('Session\Bag - jsonSerialize()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); - $collection->init($data); + $collection = new Bag($this->container->get("session"), 'BagTest'); - $expected = $data; - $actual = $collection->jsonSerialize(); - $I->assertEquals($expected, $actual); + $collection->init($data); + $I->assertEquals($data, $collection->jsonSerialize()); } } diff --git a/tests/integration/Session/Bag/RemoveCest.php b/tests/integration/Session/Bag/RemoveCest.php index 32bc0672848..53cef37c1c1 100644 --- a/tests/integration/Session/Bag/RemoveCest.php +++ b/tests/integration/Session/Bag/RemoveCest.php @@ -17,75 +17,70 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class RemoveCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class RemoveCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: remove() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagRemove(IntegrationTester $I) { $I->wantToTest('Session\Bag - remove()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); - $collection->init($data); + $collection = new Bag($this->container->get("session"), 'BagTest'); - $expected = $data; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $collection->init($data); + $I->assertEquals($data, $collection->toArray()); $collection->remove('five'); - $expected = [ 'one' => 'two', 'three' => 'four', ]; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($expected, $collection->toArray()); $collection->remove('FIVE'); - $expected = [ 'one' => 'two', 'three' => 'four', ]; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($expected, $collection->toArray()); $collection->init($data); + unset($collection['five']); $expected = [ 'one' => 'two', 'three' => 'four', ]; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($expected, $collection->toArray()); $collection->init($data); $collection->offsetUnset('five'); - $expected = [ 'one' => 'two', 'three' => 'four', ]; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($expected, $collection->toArray()); } } diff --git a/tests/integration/Session/Bag/SerializeCest.php b/tests/integration/Session/Bag/SerializeCest.php index a9d9d94643f..48eab65041d 100644 --- a/tests/integration/Session/Bag/SerializeCest.php +++ b/tests/integration/Session/Bag/SerializeCest.php @@ -17,32 +17,36 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class SerializeCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class SerializeCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: serialize() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagSerialize(IntegrationTester $I) { $I->wantToTest('Session\Bag - serialize()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); diff --git a/tests/integration/Session/Bag/SetCest.php b/tests/integration/Session/Bag/SetCest.php index d92171af964..e2c1b862ec0 100644 --- a/tests/integration/Session/Bag/SetCest.php +++ b/tests/integration/Session/Bag/SetCest.php @@ -17,49 +17,48 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class SetCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class SetCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: set() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagSet(IntegrationTester $I) { $I->wantToTest('Session\Bag - set()'); - $collection = new Bag('BagTest', $this->container); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->set('three', 'two'); - $expected = 'two'; $actual = $collection->get('three'); $I->assertEquals($expected, $actual); $collection->three = 'Phalcon'; - - $expected = 'Phalcon'; - $actual = $collection->get('three'); + $expected = 'Phalcon'; + $actual = $collection->get('three'); $I->assertEquals($expected, $actual); $collection->offsetSet('three', 123); - $expected = 123; $actual = $collection->get('three'); $I->assertEquals($expected, $actual); $collection['three'] = true; - - $actual = $collection->get('three'); + $actual = $collection->get('three'); $I->assertTrue($actual); } } diff --git a/tests/integration/Session/Bag/ToArrayCest.php b/tests/integration/Session/Bag/ToArrayCest.php index 0f7ef9faced..bdd45e42220 100644 --- a/tests/integration/Session/Bag/ToArrayCest.php +++ b/tests/integration/Session/Bag/ToArrayCest.php @@ -17,37 +17,37 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class ToArrayCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class ToArrayCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: toArray() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagToArray(IntegrationTester $I) { $I->wantToTest('Session\Bag - toArray()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->init($data); - - $expected = $data; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($data, $collection->toArray()); } } diff --git a/tests/integration/Session/Bag/ToJsonCest.php b/tests/integration/Session/Bag/ToJsonCest.php index a7470dcf1ab..6f70ec1e2e3 100644 --- a/tests/integration/Session/Bag/ToJsonCest.php +++ b/tests/integration/Session/Bag/ToJsonCest.php @@ -17,35 +17,38 @@ use Phalcon\Session\Bag; use Phalcon\Tests\Fixtures\Traits\DiTrait; +/** + * Class ToJsonCest + * + * @package Phalcon\Tests\Integration\Session\Bag + */ class ToJsonCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** * Tests Phalcon\Session\Bag :: toJson() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionBagToJson(IntegrationTester $I) { $I->wantToTest('Session\Bag - toJson()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; - $collection = new Bag('BagTest', $this->container); - $collection->init($data); + $collection = new Bag($this->container->get("session"), 'BagTest'); + $collection->init($data); $expected = json_encode($data); $actual = $collection->toJson(); $I->assertEquals($expected, $actual); diff --git a/tests/integration/Session/Bag/UnserializeCest.php b/tests/integration/Session/Bag/UnserializeCest.php index 7939b6dc4d1..1463f66f666 100644 --- a/tests/integration/Session/Bag/UnserializeCest.php +++ b/tests/integration/Session/Bag/UnserializeCest.php @@ -21,34 +21,30 @@ class UnserializeCest { use DiTrait; - public function _before(IntegrationTester $I) - { - $this->setNewFactoryDefault(); - $this->setDiService('sessionStream'); - } - /** - * Tests Phalcon\Session\Bag :: serialize() + * Tests Phalcon\Session\Bag :: unserialize() + * + * @param IntegrationTester $I * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ - public function sessionBagSerialize(IntegrationTester $I) + public function sessionBagUnserialize(IntegrationTester $I) { - $I->wantToTest('Session\Bag - serialize()'); + $I->wantToTest('Session\Bag - unserialize()'); + $this->setNewFactoryDefault(); + $this->setDiService('sessionStream'); $data = [ 'one' => 'two', 'three' => 'four', 'five' => 'six', ]; + $serialized = serialize($data); - $collection = new Bag('BagTest', $this->container); + $collection = new Bag($this->container->get("session"), 'BagTest'); $collection->unserialize($serialized); - - $expected = $data; - $actual = $collection->toArray(); - $I->assertEquals($expected, $actual); + $I->assertEquals($data, $collection->toArray()); } } diff --git a/tests/integration/Session/Manager/ExistsDestroyCest.php b/tests/integration/Session/Manager/ExistsDestroyCest.php index 70b20aa54a1..409481c14bf 100644 --- a/tests/integration/Session/Manager/ExistsDestroyCest.php +++ b/tests/integration/Session/Manager/ExistsDestroyCest.php @@ -30,8 +30,6 @@ class ExistsDestroyCest * @param IntegrationTester $I * @param Example $example * - * @throws \Phalcon\Storage\Exception - * * @author Phalcon Team * @since 2018-11-13 */ @@ -93,7 +91,7 @@ public function sessionManagerDestroySuperGlobal(IntegrationTester $I, Example $ $manager->set('test1', __METHOD__); $I->assertArrayHasKey('test1', $_SESSION); - $I->assertContains(__METHOD__, $_SESSION['test1']); + $I->assertStringContainsString(__METHOD__, $_SESSION['test1']); $manager->destroy(); $I->assertArrayNotHasKey('test1', $_SESSION); @@ -115,7 +113,7 @@ public function sessionManagerDestroySuperGlobal(IntegrationTester $I, Example $ * @throws \Phalcon\Storage\Exception * * @author Phalcon Team - * @since 2020-01-06 + * @since 2020-09-09 */ public function sessionManagerDestroySuperGlobalUniquid(IntegrationTester $I, Example $example) { @@ -142,7 +140,7 @@ public function sessionManagerDestroySuperGlobalUniquid(IntegrationTester $I, Ex $manager->set('test1', __METHOD__); $I->assertArrayHasKey('aaa#test1', $_SESSION); - $I->assertContains(__METHOD__, $_SESSION['aaa#test1']); + $I->assertStringContainsString(__METHOD__, $_SESSION['aaa#test1']); $manager->destroy(); $I->assertArrayNotHasKey('aaa#test1', $_SESSION); diff --git a/tests/integration/Session/Manager/GetSetAdapterCest.php b/tests/integration/Session/Manager/GetSetAdapterCest.php index ef4daf5a246..81279da3026 100644 --- a/tests/integration/Session/Manager/GetSetAdapterCest.php +++ b/tests/integration/Session/Manager/GetSetAdapterCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use SessionHandlerInterface; class GetSetAdapterCest @@ -26,8 +25,10 @@ class GetSetAdapterCest /** * Tests Phalcon\Session\Manager :: getAdapter()/setAdapter() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetAdapter(IntegrationTester $I) { diff --git a/tests/integration/Session/Manager/GetSetCest.php b/tests/integration/Session/Manager/GetSetCest.php index 0512f66f715..0efece02ca9 100644 --- a/tests/integration/Session/Manager/GetSetCest.php +++ b/tests/integration/Session/Manager/GetSetCest.php @@ -16,7 +16,8 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; + +use function uniqid; class GetSetCest { @@ -25,40 +26,48 @@ class GetSetCest /** * Tests Phalcon\Session\Manager :: get()/set() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSet(IntegrationTester $I) { $I->wantToTest('Session\Manager - get()/set()'); $manager = new Manager(); - - $files = $this->newService('sessionStream'); - + $files = $this->newService('sessionStream'); $manager->setAdapter($files); + $actual = $manager->get('test'); + $I->assertNull($actual); - $I->assertTrue( - $manager->start() - ); - + $actual = $manager->start(); + $I->assertTrue($actual); $expected = 'myval'; - $manager->set('test', $expected); - $I->assertEquals( - $expected, - $manager->get('test') - ); + $actual = $manager->get('test'); + $I->assertEquals($expected, $actual); + $actual = $manager->has('test'); + $I->assertTrue($actual); - $manager->destroy(); + $actual = $manager->get('test', null, true); + $I->assertEquals($expected, $actual); + + $actual = $manager->has('test'); + $I->assertFalse($actual); + $name = uniqid(); + $expected = $name; + $actual = $manager->get('test', $name); + $I->assertEquals($expected, $actual); + + $manager->destroy(); - $I->assertFalse( - $manager->exists() - ); + $actual = $manager->exists(); + $I->assertFalse($actual); } } diff --git a/tests/integration/Session/Manager/GetSetDICest.php b/tests/integration/Session/Manager/GetSetDICest.php index f991826f64b..4d590bf7ec8 100644 --- a/tests/integration/Session/Manager/GetSetDICest.php +++ b/tests/integration/Session/Manager/GetSetDICest.php @@ -17,16 +17,15 @@ use Phalcon\Di\FactoryDefault; use Phalcon\Session\Manager; -/** - * Class GetDICest - */ class GetSetDICest { /** * Tests Phalcon\Session\Manager :: getDI()/setDI() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetDI(IntegrationTester $I) { @@ -37,9 +36,7 @@ public function sessionManagerGetSetDI(IntegrationTester $I) $session->setDI($container); - $I->assertEquals( - $container, - $session->getDI() - ); + $actual = $session->getDI(); + $I->assertEquals($container, $actual); } } diff --git a/tests/integration/Session/Manager/GetSetIdCest.php b/tests/integration/Session/Manager/GetSetIdCest.php index dfb652b8f20..9d46bb9aa96 100644 --- a/tests/integration/Session/Manager/GetSetIdCest.php +++ b/tests/integration/Session/Manager/GetSetIdCest.php @@ -14,9 +14,9 @@ namespace Phalcon\Tests\Integration\Session\Manager; use IntegrationTester; +use Phalcon\Session\Exception; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; use function uniqid; @@ -27,34 +27,58 @@ class GetSetIdCest /** * Tests Phalcon\Session\Manager :: getId()/setId() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetId(IntegrationTester $I) { $I->wantToTest('Session\Manager - getId()/setId()'); $manager = new Manager(); - - $files = $this->newService('sessionStream'); - + $files = $this->newService('sessionStream'); $manager->setAdapter($files); - $I->assertEquals( - '', - $manager->getId() - ); - + $actual = $manager->getId(); + $I->assertEquals('', $actual); $id = uniqid(); - $manager->setId($id); - $I->assertEquals( - $id, - $manager->getId() - ); + $actual = $manager->getId(); + $I->assertEquals($id, $actual); $manager->destroy(); } + + /** + * Tests Phalcon\Session\Manager :: setId() - exception + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function sessionManagerSetIdException(IntegrationTester $I) + { + $I->wantToTest('Session\Manager - setId() - exception'); + + $I->expectThrowable( + new Exception( + 'The session has already been started. ' . + 'To change the id, use regenerateId()' + ), + function () { + $manager = new Manager(); + $files = $this->newService('sessionStream'); + $manager->setAdapter($files); + + $manager->start(); + + $id = uniqid(); + $manager->setId($id); + } + ); + } } diff --git a/tests/integration/Session/Manager/GetSetNameCest.php b/tests/integration/Session/Manager/GetSetNameCest.php index 376a28da010..a4ee4df9705 100644 --- a/tests/integration/Session/Manager/GetSetNameCest.php +++ b/tests/integration/Session/Manager/GetSetNameCest.php @@ -14,10 +14,9 @@ namespace Phalcon\Tests\Integration\Session\Manager; use IntegrationTester; -use InvalidArgumentException; +use Phalcon\Session\Exception; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; /** * Class GetSetNameCest @@ -29,8 +28,10 @@ class GetSetNameCest /** * Tests Phalcon\Session\Manager :: getName()/setName() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetName(IntegrationTester $I) { @@ -52,14 +53,16 @@ public function sessionManagerGetSetName(IntegrationTester $I) /** * Tests Phalcon\Session\Manager :: getName()/setName() - not valid name * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetNameNotValidName(IntegrationTester $I) { $I->wantToTest('Session\Manager - getName()/setName() - not valid name'); $I->expectThrowable( - new InvalidArgumentException('The name contains non alphanum characters'), + new Exception('The name contains non alphanum characters'), function () { $manager = new Manager(); $files = $this->newService('sessionStream'); @@ -73,8 +76,10 @@ function () { /** * Tests Phalcon\Session\Manager :: getName()/setName() - session started * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetNameSessionStarted(IntegrationTester $I) { @@ -87,7 +92,7 @@ public function sessionManagerGetNameSessionStarted(IntegrationTester $I) try { $manager->start(); $manager->setName('%-gga34'); - } catch (InvalidArgumentException $ex) { + } catch (Exception $ex) { $manager->destroy(); $valid = true; $expected = 'Cannot set session name after a session has started'; diff --git a/tests/integration/Session/Manager/GetSetOptionsCest.php b/tests/integration/Session/Manager/GetSetOptionsCest.php index c9458531295..ecb8ea269f5 100644 --- a/tests/integration/Session/Manager/GetSetOptionsCest.php +++ b/tests/integration/Session/Manager/GetSetOptionsCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class GetSetOptionsCest { @@ -25,8 +24,10 @@ class GetSetOptionsCest /** * Tests Phalcon\Session\Manager :: getOptions()/setOptions() - constructor * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetOptionsConstructor(IntegrationTester $I) { @@ -39,18 +40,17 @@ public function sessionManagerGetSetOptionsConstructor(IntegrationTester $I) $manager = new Manager($options); - - $I->assertEquals( - $options, - $manager->getOptions() - ); + $actual = $manager->getOptions(); + $I->assertEquals($options, $actual); } /** * Tests Phalcon\Session\Manager :: getOptions()/setOptions() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerGetSetOptions(IntegrationTester $I) { @@ -62,7 +62,6 @@ public function sessionManagerGetSetOptions(IntegrationTester $I) ]; $manager = new Manager($options); - $options = [ 'test3' => 'option3', ]; @@ -70,9 +69,7 @@ public function sessionManagerGetSetOptions(IntegrationTester $I) $manager->setOptions($options); - $I->assertEquals( - $options, - $manager->getOptions() - ); + $actual = $manager->getOptions(); + $I->assertEquals($options, $actual); } } diff --git a/tests/integration/Session/Manager/HasCest.php b/tests/integration/Session/Manager/HasCest.php index 5464d67f074..9f5c02dc9a5 100644 --- a/tests/integration/Session/Manager/HasCest.php +++ b/tests/integration/Session/Manager/HasCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class HasCest { @@ -25,8 +24,10 @@ class HasCest /** * Tests Phalcon\Session\Manager :: has() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerHas(IntegrationTester $I) { @@ -38,24 +39,23 @@ public function sessionManagerHas(IntegrationTester $I) $manager->setAdapter($files); - $I->assertTrue( - $manager->start() - ); + $actual = $manager->has('test'); + $I->assertFalse($actual); + + $actual = $manager->start(); + $I->assertTrue($actual); - $I->assertFalse( - $manager->has('test') - ); + $actual = $manager->has('test'); + $I->assertFalse($actual); $manager->set('test', 'myval'); - $I->assertTrue( - $manager->has('test') - ); + $actual = $manager->has('test'); + $I->assertTrue($actual); $manager->destroy(); - $I->assertFalse( - $manager->exists() - ); + $actual = $manager->exists(); + $I->assertFalse($actual); } } diff --git a/tests/integration/Session/Manager/RegenerateIdCest.php b/tests/integration/Session/Manager/RegenerateIdCest.php index 9d0da11db24..a8fa5041fb2 100644 --- a/tests/integration/Session/Manager/RegenerateIdCest.php +++ b/tests/integration/Session/Manager/RegenerateIdCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class RegenerateIdCest { @@ -25,8 +24,10 @@ class RegenerateIdCest /** * Tests Phalcon\Session\Manager :: regenerateId() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerRegenerateId(IntegrationTester $I) { diff --git a/tests/integration/Session/Manager/RemoveCest.php b/tests/integration/Session/Manager/RemoveCest.php index 06414ea6932..ad470a971f1 100644 --- a/tests/integration/Session/Manager/RemoveCest.php +++ b/tests/integration/Session/Manager/RemoveCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class RemoveCest { @@ -25,8 +24,10 @@ class RemoveCest /** * Tests Phalcon\Session\Manager :: remove() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerRemove(IntegrationTester $I) { diff --git a/tests/integration/Session/Manager/StartCest.php b/tests/integration/Session/Manager/StartCest.php new file mode 100644 index 00000000000..9522eb5690a --- /dev/null +++ b/tests/integration/Session/Manager/StartCest.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Integration\Session\Manager; + +use Codeception\Stub; +use IntegrationTester; +use Phalcon\Session\Manager; +use Phalcon\Tests\Fixtures\Traits\DiTrait; + +/** + * Class StartCest + * + * @package Phalcon\Tests\Integration\Session\Manager + */ +class StartCest +{ + use DiTrait; + + /** + * Tests Phalcon\Session\Manager :: start() - headers sent + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function sessionManagerStartHeadersSent(IntegrationTester $I) + { + $I->wantToTest('Session\Manager - start() - headers sent'); + $manager = new Manager(); + $files = $this->newService('sessionStream'); + $manager->setAdapter($files); + + $mock = Stub::make( + $manager, + [ + 'phpHeadersSent' => true, + ] + ); + + $actual = $mock->start(); + $I->assertFalse($actual); + + $manager->destroy(); + } +} diff --git a/tests/integration/Session/Manager/StatusCest.php b/tests/integration/Session/Manager/StatusCest.php index 66298c2e1d0..151de120e75 100644 --- a/tests/integration/Session/Manager/StatusCest.php +++ b/tests/integration/Session/Manager/StatusCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class StatusCest { @@ -25,8 +24,10 @@ class StatusCest /** * Tests Phalcon\Session\Manager :: status() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerStatus(IntegrationTester $I) { diff --git a/tests/integration/Session/Manager/UnderscoreGetSetCest.php b/tests/integration/Session/Manager/UnderscoreGetSetCest.php index 83cec84ec7a..9bbc9c47765 100644 --- a/tests/integration/Session/Manager/UnderscoreGetSetCest.php +++ b/tests/integration/Session/Manager/UnderscoreGetSetCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class UnderscoreGetSetCest { @@ -25,8 +24,10 @@ class UnderscoreGetSetCest /** * Tests Phalcon\Session\Manager :: __get()/__set() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerUnderscoreGetSet(IntegrationTester $I) { @@ -38,22 +39,17 @@ public function sessionManagerUnderscoreGetSet(IntegrationTester $I) $manager->setAdapter($files); - $I->assertTrue( - $manager->start() - ); + $actual = $manager->start(); + $I->assertTrue($actual); $expected = 'myval'; $manager->test = $expected; - $I->assertEquals( - $expected, - $manager->test - ); + $I->assertEquals($expected, $manager->test); $manager->destroy(); - $I->assertFalse( - $manager->exists() - ); + $actual = $manager->exists(); + $I->assertFalse($actual); } } diff --git a/tests/integration/Session/Manager/UnderscoreIssetCest.php b/tests/integration/Session/Manager/UnderscoreIssetCest.php index 26fed8193d1..6e9c1793875 100644 --- a/tests/integration/Session/Manager/UnderscoreIssetCest.php +++ b/tests/integration/Session/Manager/UnderscoreIssetCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class UnderscoreIssetCest { @@ -25,8 +24,10 @@ class UnderscoreIssetCest /** * Tests Phalcon\Session\Manager :: __isset() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerUnderscoreIsset(IntegrationTester $I) { diff --git a/tests/integration/Session/Manager/UnderscoreUnsetCest.php b/tests/integration/Session/Manager/UnderscoreUnsetCest.php index 855e7e3019d..e6f25cbadc7 100644 --- a/tests/integration/Session/Manager/UnderscoreUnsetCest.php +++ b/tests/integration/Session/Manager/UnderscoreUnsetCest.php @@ -16,7 +16,6 @@ use IntegrationTester; use Phalcon\Session\Manager; use Phalcon\Tests\Fixtures\Traits\DiTrait; -use Phalcon\Tests\Fixtures\Traits\SessionTrait; class UnderscoreUnsetCest { @@ -25,8 +24,10 @@ class UnderscoreUnsetCest /** * Tests Phalcon\Session\Manager :: __unset() * + * @param IntegrationTester $I + * * @author Phalcon Team - * @since 2018-11-13 + * @since 2020-09-09 */ public function sessionManagerUnderscoreUnset(IntegrationTester $I) { diff --git a/tests/integration/Storage/Adapter/Apcu/GetKeysCest.php b/tests/integration/Storage/Adapter/Apcu/GetKeysCest.php deleted file mode 100644 index 5db0325bb68..00000000000 --- a/tests/integration/Storage/Adapter/Apcu/GetKeysCest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Apcu; - -use Codeception\Stub; -use IntegrationTester; -use Phalcon\Storage\Adapter\Apcu; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception; -use Phalcon\Tests\Fixtures\Traits\ApcuTrait; - -class GetKeysCest -{ - use ApcuTrait; - - /** - * Tests Phalcon\Storage\Adapter\Apcu :: getKeys() - * - * @param IntegrationTester $I - * - * @throws Exception - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterApcuGetKeys(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Apcu - getKeys()'); - - $serializer = new SerializerFactory(); - $adapter = new Apcu($serializer); - - $I->assertTrue($adapter->clear()); - - $adapter->set('key-1', 'test'); - $adapter->set('key-2', 'test'); - $adapter->set('one-1', 'test'); - $adapter->set('one-2', 'test'); - - $I->assertTrue($adapter->has('key-1')); - $I->assertTrue($adapter->has('key-2')); - $I->assertTrue($adapter->has('one-1')); - $I->assertTrue($adapter->has('one-2')); - - $expected = [ - 'ph-apcu-key-1', - 'ph-apcu-key-2', - 'ph-apcu-one-1', - 'ph-apcu-one-2', - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'ph-apcu-one-1', - 'ph-apcu-one-2', - ]; - $actual = $adapter->getKeys("one"); - sort($actual); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Apcu/GetSetCest.php b/tests/integration/Storage/Adapter/Apcu/GetSetCest.php deleted file mode 100644 index 08e8c2667b3..00000000000 --- a/tests/integration/Storage/Adapter/Apcu/GetSetCest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Apcu; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Adapter\Apcu; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception; -use Phalcon\Tests\Fixtures\Traits\ApcuTrait; -use stdClass; - -class GetSetCest -{ - use ApcuTrait; - - /** - * Tests Phalcon\Storage\Adapter\Apcu :: get()/set() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws Exception - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterApcuGetSet(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Adapter\Apcu - get()/set() - ' . $example[0]); - - $serializer = new SerializerFactory(); - $adapter = new Apcu($serializer); - - $key = uniqid(); - - $result = $adapter->set($key, $example[1]); - $I->assertTrue($result); - - $expected = $example[1]; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - /** - * @return array - */ - private function getExamples(): array - { - return [ - [ - 'string', - 'random string', - ], - [ - 'integer', - 123456, - ], - [ - 'float', - 123.456, - ], - [ - 'boolean', - true, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Adapter/ClearCest.php b/tests/integration/Storage/Adapter/ClearCest.php index dabb61be159..5f3e6813c5c 100644 --- a/tests/integration/Storage/Adapter/ClearCest.php +++ b/tests/integration/Storage/Adapter/ClearCest.php @@ -14,13 +14,17 @@ namespace Phalcon\Tests\Integration\Storage\Adapter; use Codeception\Example; +use Codeception\Stub; use IntegrationTester; use Phalcon\Storage\Adapter\Apcu; use Phalcon\Storage\Adapter\Libmemcached; use Phalcon\Storage\Adapter\Memory; use Phalcon\Storage\Adapter\Redis; use Phalcon\Storage\Adapter\Stream; +use Phalcon\Storage\Exception as StorageException; use Phalcon\Storage\SerializerFactory; +use Phalcon\Support\Exception; +use Phalcon\Support\Exception as HelperException; use function getOptionsLibmemcached; use function getOptionsRedis; @@ -29,6 +33,133 @@ class ClearCest { + /** + * Tests Phalcon\Storage\Adapter\Apcu :: clear() - iterator error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuClearIteratorError(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Apcu - clear() - iterator error'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer, + ], + [ + 'phpApcuIterator' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Adapter\Apcu :: clear() - delete error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuClearDeleteError(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Apcu - clear() - delete error'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer, + ], + [ + 'phpApcuDelete' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Adapter\Stream :: clear() - cannot delete file + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamClearCannotDeleteFile(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - clear() - cannot delete file'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpUnlink' => false, + ] + ); + + $key1 = uniqid(); + $key2 = uniqid(); + $adapter->set($key1, 'test'); + $actual = $adapter->has($key1); + $I->assertTrue($actual); + + $adapter->set($key2, 'test'); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + + $actual = $adapter->clear(); + $I->assertFalse($actual); + + $I->safeDeleteDirectory(outputDir('ph-strm')); + } + /** * Tests Phalcon\Storage\Adapter\* :: clear() * diff --git a/tests/integration/Storage/Adapter/ConstructCest.php b/tests/integration/Storage/Adapter/ConstructCest.php index e8c7961d67f..2e4645e3f80 100644 --- a/tests/integration/Storage/Adapter/ConstructCest.php +++ b/tests/integration/Storage/Adapter/ConstructCest.php @@ -61,10 +61,10 @@ function () { * * @param IntegrationTester $I * - * @author Phalcon Team + * @throws SupportException * @since 2020-09-09 * - * @throws SupportException + * @author Phalcon Team */ public function storageAdapterLibmemcachedConstructEmptyOptions(IntegrationTester $I) { @@ -84,7 +84,7 @@ public function storageAdapterLibmemcachedConstructEmptyOptions(IntegrationTeste ], ]; $actual = $adapter->getOptions(); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); } /** @@ -111,16 +111,16 @@ public function storageAdapterLibmemcachedConstructGetTtl(IntegrationTester $I) $expected = 3600; $actual = $adapter->getTtl(null); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); $expected = 20; $actual = $adapter->getTtl(20); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); $time = new DateInterval('PT5S'); $expected = 5; $actual = $adapter->getTtl($time); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); } /** diff --git a/tests/integration/Storage/Adapter/DecrementCest.php b/tests/integration/Storage/Adapter/DecrementCest.php index bc697d63634..26997f39d38 100644 --- a/tests/integration/Storage/Adapter/DecrementCest.php +++ b/tests/integration/Storage/Adapter/DecrementCest.php @@ -88,6 +88,51 @@ public function storageAdapterClear(IntegrationTester $I, Example $example) } } + /** + * Tests Phalcon\Storage\Adapter\Redis :: decrement() + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterRedisDecrement(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Redis - decrement()'); + + $I->checkExtensionIsLoaded('redis'); + + $serializer = new SerializerFactory(); + $adapter = new Redis($serializer, getOptionsRedis()); + + $key = uniqid(); + $expected = 100; + $actual = $adapter->increment($key, 100); + $I->assertEquals($expected, $actual); + + $expected = 99; + $actual = $adapter->decrement($key); + $I->assertEquals($expected, $actual); + + $actual = $adapter->get($key); + $I->assertEquals($expected, $actual); + + $expected = 90; + $actual = $adapter->decrement($key, 9); + $I->assertEquals($expected, $actual); + + $actual = $adapter->get($key); + $I->assertEquals($expected, $actual); + + /** + * unknown key + */ + $key = uniqid(); + $expected = -9; + $actual = $adapter->decrement($key, 9); + $I->assertEquals($expected, $actual); + } + /** * @return array[] */ @@ -115,13 +160,6 @@ private function getExamples(): array 'extension' => '', 'unknown' => false, ], -// [ -// 'className' => 'Redis', -// 'class' => Redis::class, -// 'options' => getOptionsRedis(), -// 'extension' => 'redis', -// 'unknown' => 1, -// ], [ 'className' => 'Stream', 'class' => Stream::class, diff --git a/tests/integration/Storage/Adapter/Stream/GetSetCest.php b/tests/integration/Storage/Adapter/ExceptionsCest.php similarity index 51% rename from tests/integration/Storage/Adapter/Stream/GetSetCest.php rename to tests/integration/Storage/Adapter/ExceptionsCest.php index c5f71ef258e..2eaebd40314 100644 --- a/tests/integration/Storage/Adapter/Stream/GetSetCest.php +++ b/tests/integration/Storage/Adapter/ExceptionsCest.php @@ -11,103 +11,90 @@ declare(strict_types=1); -namespace Phalcon\Tests\Integration\Storage\Adapter\Stream; +namespace Phalcon\Tests\Integration\Storage\Adapter; use IntegrationTester; +use Phalcon\Storage\Adapter\Redis; use Phalcon\Storage\Adapter\Stream; use Phalcon\Storage\Exception as StorageException; use Phalcon\Storage\SerializerFactory; use Phalcon\Support\Exception as HelperException; -use stdClass; +use function array_merge; use function file_put_contents; +use function getOptionsRedis; use function is_dir; use function mkdir; use function outputDir; use function sleep; +use function uniqid; -class GetSetCest +class ExceptionsCest { /** - * Tests Phalcon\Storage\Adapter\Stream :: set() + * Tests Phalcon\Storage\Adapter\Redis :: get() - wrong index * * @param IntegrationTester $I * - * @throws HelperException - * @throws StorageException - * * @author Phalcon Team * @since 2020-09-09 */ - public function storageAdapterStreamSet(IntegrationTester $I) + public function storageAdapterRedisGetSetWrongIndex(IntegrationTester $I) { - $I->wantToTest('Storage\Adapter\Stream - set()'); - - $serializer = new SerializerFactory(); - $adapter = new Stream( - $serializer, - [ - 'storageDir' => outputDir(), - ] + $I->wantToTest('Storage\Adapter\Redis - get()/set() - wrong index'); + + $I->checkExtensionIsLoaded('redis'); + + $I->expectThrowable( + new StorageException('Redis server selected database failed'), + function () { + $serializer = new SerializerFactory(); + $adapter = new Redis( + $serializer, + array_merge( + getOptionsRedis(), + [ + 'index' => 99, + ] + ) + ); + + $adapter->get('test'); + } ); - - $data = 'Phalcon Framework'; - $actual = $adapter->set('test-key', $data); - $I->assertTrue($actual); - - $target = outputDir() . 'ph-strm/te/st/-k/'; - $I->amInPath($target); - $I->openFile('test-key'); - $expected = 's:3:"ttl";i:3600;s:7:"content";s:25:"s:17:"Phalcon Framework";";}'; - - $I->seeInThisFile($expected); - $I->safeDeleteFile($target . 'test-key'); } /** - * Tests Phalcon\Storage\Adapter\Stream :: get() + * Tests Phalcon\Storage\Adapter\Redis :: get() - failed auth * * @param IntegrationTester $I * - * @throws HelperException - * @throws StorageException - * * @author Phalcon Team * @since 2020-09-09 */ - public function storageAdapterStreamGet(IntegrationTester $I) + public function storageAdapterRedisGetSetFailedAuth(IntegrationTester $I) { - $I->wantToTest('Storage\Adapter\Stream - get()'); - - $serializer = new SerializerFactory(); - $adapter = new Stream( - $serializer, - [ - 'storageDir' => outputDir(), - ] + $I->wantToTest('Storage\Adapter\Redis - get()/set() - failed auth'); + + $I->checkExtensionIsLoaded('redis'); + + $I->expectThrowable( + new StorageException('Failed to authenticate with the Redis server'), + function () { + $serializer = new SerializerFactory(); + $adapter = new Redis( + $serializer, + array_merge( + getOptionsRedis(), + [ + 'auth' => 'something', + ] + ) + ); + + $adapter->get('test'); + } ); - - $target = outputDir() . 'ph-strm/te/st/-k/'; - $data = 'Phalcon Framework'; - $actual = $adapter->set('test-key', $data); - $I->assertTrue($actual); - - $expected = 'Phalcon Framework'; - $actual = $adapter->get('test-key'); - $I->assertNotNull($actual); - $I->assertEquals($expected, $actual); - - $expected = new stdClass(); - $expected->one = 'two'; - $expected->three = 'four'; - - $actual = $adapter->set('test-key', $expected); - $I->assertTrue($actual); - - $actual = $adapter->get('test-key'); - $I->assertEquals($expected, $actual); - - $I->safeDeleteFile($target . 'test-key'); } /** @@ -141,7 +128,7 @@ public function storageAdapterStreamGetErrors(IntegrationTester $I) // Unknown key $expected = 'test'; $actual = $adapter->get(uniqid(), 'test'); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); // Invalid stored object $actual = file_put_contents( @@ -152,7 +139,7 @@ public function storageAdapterStreamGetErrors(IntegrationTester $I) $expected = 'test'; $actual = $adapter->get('test-key', 'test'); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); // Expiry $data = 'Phalcon Framework'; @@ -164,7 +151,7 @@ public function storageAdapterStreamGetErrors(IntegrationTester $I) $expected = 'test'; $actual = $adapter->get('test-key', 'test'); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); $I->safeDeleteFile($target . 'test-key'); } diff --git a/tests/integration/Storage/Adapter/GetKeysCest.php b/tests/integration/Storage/Adapter/GetKeysCest.php new file mode 100644 index 00000000000..80e054eed50 --- /dev/null +++ b/tests/integration/Storage/Adapter/GetKeysCest.php @@ -0,0 +1,400 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Integration\Storage\Adapter; + +use Codeception\Stub; +use IntegrationTester; +use Phalcon\Storage\Adapter\AdapterInterface; +use Phalcon\Storage\Adapter\Apcu; +use Phalcon\Storage\Adapter\Libmemcached; +use Phalcon\Storage\Adapter\Memory; +use Phalcon\Storage\Adapter\Redis; +use Phalcon\Storage\Adapter\Stream; +use Phalcon\Storage\Exception as StorageException; +use Phalcon\Storage\SerializerFactory; +use Phalcon\Support\Exception; +use Phalcon\Support\Exception as HelperException; + +use function getOptionsLibmemcached; +use function getOptionsRedis; +use function outputDir; +use function phpversion; +use function uniqid; +use function version_compare; + +class GetKeysCest +{ + /** + * Tests Phalcon\Storage\Adapter\Apcu :: getKeys() + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuGetKeys(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Apcu - getKeys()'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = new Apcu($serializer); + + $I->assertTrue($adapter->clear()); + + $this->runTest($adapter, $I, 'ph-apcu-'); + } + + /** + * Tests Phalcon\Storage\Adapter\Apcu :: getKeys() - iterator error + * + * @param IntegrationTester $I + * + * @throws Exception + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterApcuGetKeysIteratorError(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Apcu - getKeys() - iterator error'); + + $I->checkExtensionIsLoaded('apcu'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Apcu::class, + [ + $serializer, + ], + [ + 'phpApcuIterator' => false, + ] + ); + + $this->setupTest($adapter, $I); + + $actual = $adapter->getKeys(); + $I->assertIsArray($actual); + $I->assertEmpty($actual); + } + + /** + * Tests Phalcon\Storage\Adapter\Libmemcached :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterLibmemcachedGetKeys(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Libmemcached - getKeys()'); + + $I->checkExtensionIsLoaded('memcached'); + + $serializer = new SerializerFactory(); + $adapter = new Libmemcached( + $serializer, + getOptionsLibmemcached() + ); + + $memcachedServerVersions = $adapter->getAdapter() + ->getVersion() + ; + $memcachedExtensionVersion = phpversion('memcached'); + + foreach ($memcachedServerVersions as $memcachedServerVersion) { + // https://www.php.net/manual/en/memcached.getallkeys.php#123793 + // https://bugs.launchpad.net/libmemcached/+bug/1534062 + if ( + version_compare($memcachedServerVersion, '1.4.23', '>=') && + version_compare($memcachedExtensionVersion, '3.0.1', '<') + ) { + $I->skipTest( + 'getAllKeys() does not work in certain Memcached versions' + ); + } + + // https://github.com/php-memcached-dev/php-memcached/issues/367 + if (version_compare($memcachedServerVersion, '1.5.0', '>=')) { + $I->skipTest( + 'getAllKeys() does not work in certain Memcached versions' + ); + } + } + + $I->assertTrue($adapter->clear()); + + $this->runTest($adapter, $I, 'ph-memc-'); + } + + /** + * Tests Phalcon\Storage\Adapter\Memory :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterMemoryGetKeys(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Memory - getKeys()'); + + $serializer = new SerializerFactory(); + $adapter = new Memory($serializer); + + $I->assertTrue($adapter->clear()); + + $this->runTest($adapter, $I, 'ph-memo-'); + } + + /** + * Tests Phalcon\Storage\Adapter\Redis :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterRedisGetKeys(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Redis - getKeys()'); + + $I->checkExtensionIsLoaded('redis'); + + $serializer = new SerializerFactory(); + $adapter = new Redis($serializer, getOptionsRedis()); + + $I->assertTrue($adapter->clear()); + + $this->runTest($adapter, $I, 'ph-reds-'); + } + + /** + * Tests Phalcon\Storage\Adapter\Stream :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamGetKeys(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - getKeys()'); + + $serializer = new SerializerFactory(); + $adapter = new Stream( + $serializer, + [ + 'storageDir' => outputDir(), + ] + ); + + $I->assertTrue($adapter->clear()); + + $this->runTest($adapter, $I, 'ph-strm'); + + $key1 = uniqid('key'); + $key2 = uniqid('key'); + $key3 = uniqid('one'); + $key4 = uniqid('one'); + + $I->safeDeleteDirectory(outputDir('ph-strm')); + } + + /** + * Tests Phalcon\Storage\Adapter\Stream :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author ekmst + * @since 2020-09-09 + * @issue cphalcon/#14190 + */ + public function storageAdapterStreamGetKeysIssue14190(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - getKeys() - issue 14190'); + + $serializer = new SerializerFactory(); + $adapter = new Stream( + $serializer, + [ + 'storageDir' => outputDir(), + 'prefix' => 'basePrefix-', + ] + ); + + $adapter->clear(); + + $actual = $adapter->set('key', 'test'); + $I->assertNotFalse($actual); + $actual = $adapter->set('key1', 'test'); + $I->assertNotFalse($actual); + + $expected = [ + 'basePrefix-key', + 'basePrefix-key1', + ]; + + $actual = $adapter->getKeys(); + sort($actual); + + $I->assertSame($expected, $actual); + + foreach ($expected as $key) { + $actual = $adapter->delete($key); + $I->assertTrue($actual); + } + + $I->safeDeleteDirectory(outputDir('basePrefix-')); + } + + /** + * Tests Phalcon\Storage\Adapter\Stream :: getKeys() + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author ekmst + * @since 2020-09-09 + * @issue cphalcon/#14190 + */ + public function storageAdapterStreamGetKeysPrefix(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - getKeys() - prefix'); + + $serializer = new SerializerFactory(); + $adapter = new Stream( + $serializer, + [ + 'storageDir' => outputDir(), + 'prefix' => 'pref-', + ] + ); + + $actual = $adapter->clear(); + $I->assertTrue($actual); + $actual = $adapter->getKeys(); + $I->assertEmpty($actual); + + $actual = $adapter->set('key', 'test'); + $I->assertNotFalse($actual); + $actual = $adapter->set('key1', 'test'); + $I->assertNotFalse($actual); + $actual = $adapter->set('somekey', 'test'); + $I->assertNotFalse($actual); + $actual = $adapter->set('somekey1', 'test'); + $I->assertNotFalse($actual); + + $expected = [ + 'pref-key', + 'pref-key1', + 'pref-somekey', + 'pref-somekey1', + ]; + $actual = $adapter->getKeys(); + sort($actual); + $I->assertSame($expected, $actual); + + $expected = [ + 'pref-somekey', + 'pref-somekey1', + ]; + + $actual = $adapter->getKeys('so'); + sort($actual); + $I->assertSame($expected, $actual); + + $actual = $adapter->clear(); + $I->assertTrue($actual); + + $I->safeDeleteDirectory(outputDir('pref-')); + } + + private function runTest( + AdapterInterface $adapter, + IntegrationTester $I, + string $prefix + ): void { + [$key1, $key2, $key3, $key4] = $this->setupTest($adapter, $I); + + $expected = [ + $prefix . $key1, + $prefix . $key2, + $prefix . $key3, + $prefix . $key4, + ]; + $actual = $adapter->getKeys(); + sort($actual); + $I->assertSame($expected, $actual); + + $expected = [ + $prefix . $key3, + $prefix . $key4, + ]; + $actual = $adapter->getKeys("one"); + sort($actual); + $I->assertSame($expected, $actual); + } + + private function setupTest( + AdapterInterface $adapter, + IntegrationTester $I + ): array { + $key1 = uniqid('key'); + $key2 = uniqid('key'); + $key3 = uniqid('one'); + $key4 = uniqid('one'); + + $result = $adapter->set($key1, 'test'); + $I->assertNotFalse($result); + $result = $adapter->set($key2, 'test'); + $I->assertNotFalse($result); + $result = $adapter->set($key3, 'test'); + $I->assertNotFalse($result); + $result = $adapter->set($key4, 'test'); + $I->assertNotFalse($result); + + $actual = $adapter->has($key1); + $I->assertTrue($actual); + $actual = $adapter->has($key2); + $I->assertTrue($actual); + $actual = $adapter->has($key3); + $I->assertTrue($actual); + $actual = $adapter->has($key4); + $I->assertTrue($actual); + + return [$key1, $key2, $key3, $key4]; + } +} diff --git a/tests/integration/Storage/Adapter/GetPrefixCest.php b/tests/integration/Storage/Adapter/GetPrefixCest.php index da98fbeeb56..433f6013d0a 100644 --- a/tests/integration/Storage/Adapter/GetPrefixCest.php +++ b/tests/integration/Storage/Adapter/GetPrefixCest.php @@ -60,7 +60,7 @@ public function storageAdapterGetSetPrefix(IntegrationTester $I, Example $exampl $expected = $example['expected']; $actual = $adapter->getPrefix(); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); } private function getExamples(): array diff --git a/tests/integration/Storage/Adapter/GetSetCest.php b/tests/integration/Storage/Adapter/GetSetCest.php index 913630d3002..4aa73f14699 100644 --- a/tests/integration/Storage/Adapter/GetSetCest.php +++ b/tests/integration/Storage/Adapter/GetSetCest.php @@ -15,15 +15,15 @@ use Codeception\Example; use IntegrationTester; -use Memcached as NativeMemcached; use Phalcon\Storage\Adapter\Apcu; use Phalcon\Storage\Adapter\Libmemcached; use Phalcon\Storage\Adapter\Memory; use Phalcon\Storage\Adapter\Redis; use Phalcon\Storage\Adapter\Stream; use Phalcon\Storage\SerializerFactory; -use Redis as NativeRedis; +use stdClass; +use function array_merge; use function getOptionsLibmemcached; use function getOptionsRedis; use function outputDir; @@ -40,19 +40,23 @@ class GetSetCest * @author Phalcon Team * @since 2020-09-09 */ - public function storageAdapterGetSetWithZeroTtl(IntegrationTester $I, Example $example) + public function storageAdapterGetSet(IntegrationTester $I, Example $example) { + $className = $example[0]; + $label = $example[1]; + $extension = $example[2]; + $class = $example[3]; + $options = $example[4]; + $value = $example[5]; + $I->wantToTest( sprintf( - 'Storage\Adapter\%s - get()/set()', - $example['className'] + 'Storage\Adapter\%s - get()/set() - %s', + $className, + $label ) ); - $extension = $example['extension']; - $class = $example['class']; - $options = $example['options']; - if (!empty($extension)) { $I->checkExtensionIsLoaded($extension); } @@ -60,9 +64,9 @@ public function storageAdapterGetSetWithZeroTtl(IntegrationTester $I, Example $e $serializer = new SerializerFactory(); $adapter = new $class($serializer, $options); - $key = uniqid(); + $key = uniqid('k-'); - $result = $adapter->set($key, "test"); + $result = $adapter->set($key, $value); $I->assertTrue($result); $result = $adapter->has($key); @@ -71,7 +75,7 @@ public function storageAdapterGetSetWithZeroTtl(IntegrationTester $I, Example $e /** * This will issue delete */ - $result = $adapter->set($key, "test", 0); + $result = $adapter->set($key, $value, 0); $I->assertTrue($result); $result = $adapter->has($key); @@ -85,44 +89,337 @@ private function getExamples(): array { return [ [ - 'className' => 'Apcu', - 'class' => Apcu::class, - 'options' => [], - 'expected' => null, - 'extension' => 'apcu', + 'Apcu', + 'null', + 'apcu', + Apcu::class, + [], + null, + ], + [ + 'Apcu', + 'true', + 'apcu', + Apcu::class, + [], + true, + ], + [ + 'Apcu', + 'false', + 'apcu', + Apcu::class, + [], + false, + ], + [ + 'Apcu', + 'integer', + 'apcu', + Apcu::class, + [], + 123456, + ], + [ + 'Apcu', + 'float', + 'apcu', + Apcu::class, + [], + 123.456, + ], + [ + 'Apcu', + 'string', + 'apcu', + Apcu::class, + [], + uniqid(), + ], + [ + 'Apcu', + 'object', + 'apcu', + Apcu::class, + [], + new stdClass(), + ], + [ + 'Libmemcached', + 'null', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + null, + ], + [ + 'Libmemcached', + 'true', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + true, + ], + [ + 'Libmemcached', + 'false', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + false, + ], + [ + 'Libmemcached', + 'integer', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + 123456, + ], + [ + 'Libmemcached', + 'float', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + 123.456, + ], + [ + 'Libmemcached', + 'string', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + uniqid(), + ], + [ + 'Libmemcached', + 'object', + 'memcached', + Libmemcached::class, + getOptionsLibmemcached(), + new stdClass(), + ], + [ + 'Libmemcached', + 'custom serializer', + 'memcached', + Libmemcached::class, + array_merge( + getOptionsLibmemcached(), + [ + 'defaultSerializer' => 'Base64', + ] + ), + uniqid(), + ], + [ + 'Memory', + 'null', + '', + Memory::class, + [], + null, + ], + [ + 'Memory', + 'true', + '', + Memory::class, + [], + true, + ], + [ + 'Memory', + 'false', + '', + Memory::class, + [], + false, + ], + [ + 'Memory', + 'integer', + '', + Memory::class, + [], + 123456, + ], + [ + 'Memory', + 'float', + '', + Memory::class, + [], + 123.456, ], [ - 'className' => 'Libmemcached', - 'class' => Libmemcached::class, - 'options' => getOptionsLibmemcached(), - 'expected' => NativeMemcached::class, - 'extension' => 'memcached', + 'Memory', + 'string', + '', + Memory::class, + [], + uniqid(), ], [ - 'className' => 'Memory', - 'label' => 'default', - 'class' => Memory::class, - 'options' => [], - 'expected' => null, - 'extension' => '', + 'Memory', + 'object', + '', + Memory::class, + [], + new stdClass(), ], [ - 'className' => 'Redis', - 'label' => 'default', - 'class' => Redis::class, - 'options' => getOptionsRedis(), - 'expected' => NativeRedis::class, - 'extension' => 'redis', + 'Redis', + 'null', + 'redis', + Redis::class, + getOptionsRedis(), + null, + ], + [ + 'Redis', + 'true', + 'redis', + Redis::class, + getOptionsRedis(), + true, + ], + [ + 'Redis', + 'false', + 'redis', + Redis::class, + getOptionsRedis(), + false, + ], + [ + 'Redis', + 'integer', + 'redis', + Redis::class, + getOptionsRedis(), + 123456, + ], + [ + 'Redis', + 'float', + 'redis', + Redis::class, + getOptionsRedis(), + 123.456, + ], + [ + 'Redis', + 'string', + 'redis', + Redis::class, + getOptionsRedis(), + uniqid(), + ], + [ + 'Redis', + 'object', + 'redis', + Redis::class, + getOptionsRedis(), + new stdClass(), + ], + [ + 'Redis', + 'custom serializer', + 'redis', + Redis::class, + array_merge( + getOptionsRedis(), + [ + 'defaultSerializer' => 'Base64', + ] + ), + uniqid(), + ], + [ + 'Redis', + 'persistent', + 'redis', + Redis::class, + array_merge( + getOptionsRedis(), + [ + 'persistent' => true, + ] + ), + uniqid(), + ], + [ + 'Stream', + 'null', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + null, + ], + [ + 'Stream', + 'true', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + true, + ], + [ + 'Stream', + 'false', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + false, + ], + [ + 'Stream', + 'integer', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + 123456, + ], + [ + 'Stream', + 'float', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + 123.456, + ], + [ + 'Stream', + 'string', + '', + Stream::class, + [ + 'storageDir' => outputDir(), + ], + uniqid(), ], [ - 'className' => 'Stream', - 'label' => 'default', - 'class' => Stream::class, - 'options' => [ + 'Stream', + 'object', + '', + Stream::class, + [ 'storageDir' => outputDir(), ], - 'expected' => null, - 'extension' => '', + new stdClass(), ], ]; } diff --git a/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php b/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php index 38816b97bcd..523450fc54f 100644 --- a/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php +++ b/tests/integration/Storage/Adapter/GetSetDefaultSerializerCest.php @@ -59,12 +59,12 @@ public function storageAdapterGetSetDefaultSerializer(IntegrationTester $I, Exam $expected = 'php'; $actual = $adapter->getDefaultSerializer(); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); $adapter->setDefaultSerializer('Base64'); $expected = 'base64'; $actual = $adapter->getDefaultSerializer(); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); } /** diff --git a/tests/integration/Storage/Adapter/GetSetForeverCest.php b/tests/integration/Storage/Adapter/GetSetForeverCest.php index cbd844108c4..db09e58645d 100644 --- a/tests/integration/Storage/Adapter/GetSetForeverCest.php +++ b/tests/integration/Storage/Adapter/GetSetForeverCest.php @@ -29,7 +29,6 @@ use function outputDir; use function sprintf; use function uniqid; -use function usleep; class GetSetForeverCest { diff --git a/tests/integration/Storage/Adapter/HasCest.php b/tests/integration/Storage/Adapter/HasCest.php index ce4ba6349d3..f72a3cbf6ca 100644 --- a/tests/integration/Storage/Adapter/HasCest.php +++ b/tests/integration/Storage/Adapter/HasCest.php @@ -14,13 +14,16 @@ namespace Phalcon\Tests\Integration\Storage\Adapter; use Codeception\Example; +use Codeception\Stub; use IntegrationTester; use Phalcon\Storage\Adapter\Apcu; use Phalcon\Storage\Adapter\Libmemcached; use Phalcon\Storage\Adapter\Memory; use Phalcon\Storage\Adapter\Redis; use Phalcon\Storage\Adapter\Stream; +use Phalcon\Storage\Exception as StorageException; use Phalcon\Storage\SerializerFactory; +use Phalcon\Support\Exception as HelperException; use function getOptionsLibmemcached; use function getOptionsRedis; @@ -30,6 +33,80 @@ class HasCest { + /** + * Tests Phalcon\Storage\Adapter\Stream :: has() - cannot open file + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamHasCannotOpenFile(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - has() - cannot open file'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpFopen' => false, + ] + ); + + $key = uniqid(); + $actual = $adapter->set($key, 'test'); + $I->assertTrue($actual); + + $actual = $adapter->has($key); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Adapter\Stream :: has() - empty payload + * + * @param IntegrationTester $I + * + * @throws HelperException + * @throws StorageException + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterStreamHasEmptyPayload(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Stream - has() - empty payload'); + + $serializer = new SerializerFactory(); + $adapter = Stub::construct( + Stream::class, + [ + $serializer, + [ + 'storageDir' => outputDir(), + ], + ], + [ + 'phpFileGetContents' => false, + ] + ); + + $key = uniqid(); + $actual = $adapter->set($key, 'test'); + $I->assertTrue($actual); + + $actual = $adapter->has($key); + $I->assertFalse($actual); + } + /** * Tests Phalcon\Storage\Adapter\* :: has() * diff --git a/tests/integration/Storage/Adapter/IncrementCest.php b/tests/integration/Storage/Adapter/IncrementCest.php index 43331a3c17c..2e08c4d7d97 100644 --- a/tests/integration/Storage/Adapter/IncrementCest.php +++ b/tests/integration/Storage/Adapter/IncrementCest.php @@ -37,7 +37,7 @@ class IncrementCest * @author Phalcon Team * @since 2020-09-09 */ - public function storageAdapterClear(IntegrationTester $I, Example $example) + public function storageAdapterIncrement(IntegrationTester $I, Example $example) { $I->wantToTest( sprintf( @@ -61,6 +61,58 @@ public function storageAdapterClear(IntegrationTester $I, Example $example) $result = $adapter->set($key, 1); $I->assertTrue($result); + $expected = 2; + $actual = $adapter->increment($key); + $I->assertSame($expected, $actual); + + $actual = $adapter->get($key); + $I->assertSame($expected, $actual); + + $expected = 20; + $actual = $adapter->increment($key, 18); + $I->assertSame($expected, $actual); + + $actual = $adapter->get($key); + $I->assertSame($expected, $actual); + + /** + * unknown key + */ + $key = uniqid(); + $expected = $example['unknown']; + $actual = $adapter->increment($key); + $I->assertSame($expected, $actual); + + if ('Stream' === $example['className']) { + $I->safeDeleteDirectory(outputDir('ph-strm')); + } + } + + /** + * Tests Phalcon\Storage\Adapter\Redis :: increment() + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageAdapterRedisIncrement(IntegrationTester $I) + { + $I->wantToTest('Storage\Adapter\Redis - increment()'); + + $I->checkExtensionIsLoaded('redis'); + + $serializer = new SerializerFactory(); + $adapter = new Redis($serializer, getOptionsRedis()); + + $key = uniqid(); + $expected = 1; + $actual = $adapter->increment($key, 1); + $I->assertEquals($expected, $actual); + + $actual = $adapter->get($key); + $I->assertEquals($expected, $actual); + $expected = 2; $actual = $adapter->increment($key); $I->assertEquals($expected, $actual); @@ -79,9 +131,9 @@ public function storageAdapterClear(IntegrationTester $I, Example $example) * unknown key */ $key = uniqid(); - $expected = $example['unknown']; + $expected = 1; $actual = $adapter->increment($key); - $I->assertEquals($expected, $actual); + $I->assertSame($expected, $actual); } /** @@ -111,13 +163,6 @@ private function getExamples(): array 'extension' => '', 'unknown' => false, ], -// [ -// 'className' => 'Redis', -// 'class' => Redis::class, -// 'options' => getOptionsRedis(), -// 'extension' => 'redis', -// 'unknown' => 1, -// ], [ 'className' => 'Stream', 'class' => Stream::class, diff --git a/tests/integration/Storage/Adapter/Libmemcached/GetKeysCest.php b/tests/integration/Storage/Adapter/Libmemcached/GetKeysCest.php deleted file mode 100644 index 9ecf3d6f18d..00000000000 --- a/tests/integration/Storage/Adapter/Libmemcached/GetKeysCest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Libmemcached; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Libmemcached; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\LibmemcachedTrait; - -use function getOptionsLibmemcached; - -class GetKeysCest -{ - use LibmemcachedTrait; - - /** - * Tests Phalcon\Storage\Adapter\Libmemcached :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterLibmemcachedGetKeys(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Libmemcached - getKeys()'); - - $serializer = new SerializerFactory(); - $adapter = new Libmemcached( - $serializer, - getOptionsLibmemcached() - ); - - $memcachedServerVersions = $adapter->getAdapter() - ->getVersion(); - $memcachedExtensionVersion = phpversion('memcached'); - - foreach ($memcachedServerVersions as $server => $memcachedServerVersion) { - // https://www.php.net/manual/en/memcached.getallkeys.php#123793 - // https://bugs.launchpad.net/libmemcached/+bug/1534062 - if ( - version_compare($memcachedServerVersion, '1.4.23', '>=') && - version_compare($memcachedExtensionVersion, '3.0.1', '<') - ) { - $I->skipTest( - 'getAllKeys() does not work in certain Memcached versions' - ); - } - - // https://github.com/php-memcached-dev/php-memcached/issues/367 - if (version_compare($memcachedServerVersion, '1.5.0', '>=')) { - $I->skipTest( - 'getAllKeys() does not work in certain Memcached versions' - ); - } - } - - $I->assertTrue($adapter->clear()); - - $adapter->set('key-1', 'test'); - $adapter->set('key-2', 'test'); - $adapter->set('one-1', 'test'); - $adapter->set('one-2', 'test'); - - $actual = $adapter->has('key-1'); - $I->assertTrue($actual); - $actual = $adapter->has('key-2'); - $I->assertTrue($actual); - $actual = $adapter->has('one-1'); - $I->assertTrue($actual); - $actual = $adapter->has('one-2'); - $I->assertTrue($actual); - - $expected = [ - 'ph-memc-key-1', - 'ph-memc-key-2', - 'ph-memc-one-1', - 'ph-memc-one-2', - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'ph-memc-one-1', - 'ph-memc-one-2', - ]; - $actual = $adapter->getKeys("one"); - sort($actual); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Libmemcached/GetSetCest.php b/tests/integration/Storage/Adapter/Libmemcached/GetSetCest.php deleted file mode 100644 index 87c61560552..00000000000 --- a/tests/integration/Storage/Adapter/Libmemcached/GetSetCest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Libmemcached; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Adapter\Libmemcached; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\LibmemcachedTrait; -use stdClass; - -use function getOptionsLibmemcached; - -class GetSetCest -{ - use LibmemcachedTrait; - - /** - * Tests Phalcon\Storage\Adapter\Libmemcached :: get()/set() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws StorageException - * @throws HelperException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterLibmemcachedGetSet(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Adapter\Libmemcached - get()/set() - ' . $example[0]); - - $serializer = new SerializerFactory(); - $adapter = new Libmemcached( - $serializer, - getOptionsLibmemcached() - ); - - $key = uniqid(); - $actual = $adapter->set($key, $example[1]); - $I->assertTrue($actual); - - $expected = $example[1]; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Adapter\Libmemcached :: get()/set() - custom - * serializer - * - * @param IntegrationTester $I - * - * @throws StorageException - * @throws HelperException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterLibmemcachedGetSetCustomSerializer(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Libmemcached - get()/set() - custom serializer'); - - $serializer = new SerializerFactory(); - $adapter = new Libmemcached( - $serializer, - array_merge( - getOptionsLibmemcached(), - [ - 'defaultSerializer' => 'Base64', - ] - ) - ); - - $key = uniqid(); - $source = 'Phalcon Framework'; - $actual = $adapter->set($key, $source); - $I->assertTrue($actual); - - $expected = $source; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'string', - 'random string', - ], - [ - 'integer', - 123456, - ], - [ - 'float', - 123.456, - ], - [ - 'boolean true', - true, - ], - [ - 'boolean false', - false, - ], - [ - 'null', - null, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Adapter/Memory/GetKeysCest.php b/tests/integration/Storage/Adapter/Memory/GetKeysCest.php deleted file mode 100644 index 1a62c40215e..00000000000 --- a/tests/integration/Storage/Adapter/Memory/GetKeysCest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Memory; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Memory; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; - -class GetKeysCest -{ - /** - * Tests Phalcon\Storage\Adapter\Memory :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterMemoryGetKeys(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Memory - getKeys()'); - - $serializer = new SerializerFactory(); - $adapter = new Memory($serializer); - - $I->assertTrue($adapter->clear()); - - $adapter->set('key-1', 'test'); - $adapter->set('key-2', 'test'); - $adapter->set('one-1', 'test'); - $adapter->set('one-2', 'test'); - - $actual = $adapter->has('key-1'); - $I->assertTrue($actual); - $actual = $adapter->has('key-2'); - $I->assertTrue($actual); - $actual = $adapter->has('one-1'); - $I->assertTrue($actual); - $actual = $adapter->has('one-2'); - $I->assertTrue($actual); - - $expected = [ - 'ph-memo-key-1', - 'ph-memo-key-2', - 'ph-memo-one-1', - 'ph-memo-one-2', - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'ph-memo-one-1', - 'ph-memo-one-2', - ]; - $actual = $adapter->getKeys("one"); - sort($actual); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Memory/GetSetCest.php b/tests/integration/Storage/Adapter/Memory/GetSetCest.php deleted file mode 100644 index 4d69371d5be..00000000000 --- a/tests/integration/Storage/Adapter/Memory/GetSetCest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Memory; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Adapter\Memory; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use stdClass; - -class GetSetCest -{ - /** - * Tests Phalcon\Storage\Adapter\Memory :: get() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws HelperException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterMemoryGetSet(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Adapter\Memory - get()/set() - ' . $example[0]); - - $serializer = new SerializerFactory(); - $adapter = new Memory($serializer); - - $key = uniqid(); - - $result = $adapter->set($key, $example[1]); - $I->assertTrue($result); - - $expected = $example[1]; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'string', - 'random string', - ], - [ - 'integer', - 123456, - ], - [ - 'float', - 123.456, - ], - [ - 'boolean', - true, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Adapter/Redis/DecrementCest.php b/tests/integration/Storage/Adapter/Redis/DecrementCest.php deleted file mode 100644 index 78ca359cfdf..00000000000 --- a/tests/integration/Storage/Adapter/Redis/DecrementCest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Redis; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Redis; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\RedisTrait; - -use function getOptionsRedis; -use function uniqid; - -class DecrementCest -{ - use RedisTrait; - - /** - * Tests Phalcon\Storage\Adapter\Redis :: decrement() - * - * @param IntegrationTester $I - * - * @throws StorageException - * @throws HelperException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisDecrement(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - decrement()'); - - $serializer = new SerializerFactory(); - $adapter = new Redis($serializer, getOptionsRedis()); - - $key = uniqid(); - $expected = 100; - $actual = $adapter->increment($key, 100); - $I->assertEquals($expected, $actual); - - $expected = 99; - $actual = $adapter->decrement($key); - $I->assertEquals($expected, $actual); - - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - - $expected = 90; - $actual = $adapter->decrement($key, 9); - $I->assertEquals($expected, $actual); - - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - - /** - * unknown key - */ - $key = uniqid(); - $expected = -9; - $actual = $adapter->decrement($key, 9); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Redis/GetKeysCest.php b/tests/integration/Storage/Adapter/Redis/GetKeysCest.php deleted file mode 100644 index e656fc040f2..00000000000 --- a/tests/integration/Storage/Adapter/Redis/GetKeysCest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Redis; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Redis; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\RedisTrait; - -use function getOptionsRedis; - -class GetKeysCest -{ - use RedisTrait; - - /** - * Tests Phalcon\Storage\Adapter\Redis :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetKeys(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - getKeys()'); - - $serializer = new SerializerFactory(); - $adapter = new Redis($serializer, getOptionsRedis()); - - $I->assertTrue($adapter->clear()); - - $adapter->set('key-1', 'test'); - $adapter->set('key-2', 'test'); - $adapter->set('one-1', 'test'); - $adapter->set('one-2', 'test'); - - $actual = $adapter->has('key-1'); - $I->assertTrue($actual); - $actual = $adapter->has('key-2'); - $I->assertTrue($actual); - $actual = $adapter->has('one-1'); - $I->assertTrue($actual); - $actual = $adapter->has('one-2'); - $I->assertTrue($actual); - - $expected = [ - 'ph-reds-key-1', - 'ph-reds-key-2', - 'ph-reds-one-1', - 'ph-reds-one-2', - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'ph-reds-one-1', - 'ph-reds-one-2', - ]; - $actual = $adapter->getKeys("one"); - sort($actual); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Redis/GetSetCest.php b/tests/integration/Storage/Adapter/Redis/GetSetCest.php deleted file mode 100644 index ea222fdb8d8..00000000000 --- a/tests/integration/Storage/Adapter/Redis/GetSetCest.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Redis; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Adapter\Redis; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\RedisTrait; -use stdClass; - -use function array_merge; -use function getOptionsRedis; -use function uniqid; - -class GetSetCest -{ - use RedisTrait; - - /** - * Tests Phalcon\Storage\Adapter\Redis :: get() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetSet(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Adapter\Redis - get()/set() - ' . $example[0]); - - $serializer = new SerializerFactory(); - $adapter = new Redis($serializer, getOptionsRedis()); - - $key = uniqid(); - $actual = $adapter->set($key, $example[1]); - $I->assertTrue($actual); - - $expected = $example[1]; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Adapter\Redis :: get() - persistent - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetSetPersistent(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - get()/set() - persistent'); - - $serializer = new SerializerFactory(); - $adapter = new Redis( - $serializer, - array_merge( - getOptionsRedis(), - [ - 'persistent' => true, - ] - ) - ); - - $key = uniqid(); - $actual = $adapter->set($key, 'test'); - $I->assertTrue($actual); - - $expected = 'test'; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Adapter\Redis :: get() - wrong index - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetSetWrongIndex(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - get()/set() - wrong index'); - - $I->expectThrowable( - new StorageException('Redis server selected database failed'), - function () { - $serializer = new SerializerFactory(); - $adapter = new Redis( - $serializer, - array_merge( - getOptionsRedis(), - [ - 'index' => 99, - ] - ) - ); - - $adapter->get('test'); - } - ); - } - - /** - * Tests Phalcon\Storage\Adapter\Redis :: get() - failed auth - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetSetFailedAuth(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - get()/set() - failed auth'); - - $I->expectThrowable( - new StorageException('Failed to authenticate with the Redis server'), - function () { - $serializer = new SerializerFactory(); - $adapter = new Redis( - $serializer, - array_merge( - getOptionsRedis(), - [ - 'auth' => 'something', - ] - ) - ); - - $adapter->get('test'); - } - ); - } - - /** - * Tests Phalcon\Storage\Adapter\Redis :: get()/set() - custom serializer - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisGetSetCustomSerializer(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - get()/set() - custom serializer'); - - $serializer = new SerializerFactory(); - $adapter = new Redis( - $serializer, - array_merge( - getOptionsRedis(), - [ - 'defaultSerializer' => 'Base64', - ] - ) - ); - - $key = uniqid(); - $source = 'Phalcon Framework'; - - $actual = $adapter->set($key, $source); - $I->assertTrue($actual); - - $expected = $source; - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'string', - 'random string', - ], - [ - 'integer', - 123456, - ], - [ - 'float', - 123.456, - ], - [ - 'boolean', - true, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Adapter/Redis/IncrementCest.php b/tests/integration/Storage/Adapter/Redis/IncrementCest.php deleted file mode 100644 index c25f9b5b1ea..00000000000 --- a/tests/integration/Storage/Adapter/Redis/IncrementCest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Redis; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Redis; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; -use Phalcon\Tests\Fixtures\Traits\RedisTrait; - -use function getOptionsRedis; -use function uniqid; - -class IncrementCest -{ - use RedisTrait; - - /** - * Tests Phalcon\Storage\Adapter\Redis :: increment() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterRedisIncrement(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Redis - increment()'); - - $serializer = new SerializerFactory(); - $adapter = new Redis($serializer, getOptionsRedis()); - - $key = uniqid(); - $expected = 1; - $actual = $adapter->increment($key, 1); - $I->assertEquals($expected, $actual); - - $expected = 2; - $actual = $adapter->increment($key); - $I->assertEquals($expected, $actual); - - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - - $expected = 10; - $actual = $adapter->increment($key, 8); - $I->assertEquals($expected, $actual); - - $actual = $adapter->get($key); - $I->assertEquals($expected, $actual); - - /** - * unknown key - */ - $key = uniqid(); - $expected = 1; - $actual = $adapter->increment($key); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Adapter/Stream/GetKeysCest.php b/tests/integration/Storage/Adapter/Stream/GetKeysCest.php deleted file mode 100644 index 9e97f53ad6d..00000000000 --- a/tests/integration/Storage/Adapter/Stream/GetKeysCest.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Adapter\Stream; - -use IntegrationTester; -use Phalcon\Storage\Adapter\Stream; -use Phalcon\Storage\Exception as StorageException; -use Phalcon\Storage\SerializerFactory; -use Phalcon\Support\Exception as HelperException; - -use function outputDir; -use function sort; -use function uniqid; - -class GetKeysCest -{ - /** - * Tests Phalcon\Storage\Adapter\Stream :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageAdapterStreamGetKeys(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Stream - getKeys()'); - - $serializer = new SerializerFactory(); - $adapter = new Stream( - $serializer, - [ - 'storageDir' => outputDir(), - ] - ); - - $I->assertTrue($adapter->clear()); - - $key1 = uniqid('key'); - $key2 = uniqid('key'); - $key3 = uniqid('one'); - $key4 = uniqid('one'); - - $result = $adapter->set($key1, 'test'); - $I->assertNotFalse($result); - $result = $adapter->set($key2, 'test'); - $I->assertNotFalse($result); - $result = $adapter->set($key3, 'test'); - $I->assertNotFalse($result); - $result = $adapter->set($key4, 'test'); - $I->assertNotFalse($result); - - $I->assertTrue($adapter->has($key1)); - $I->assertTrue($adapter->has($key2)); - $I->assertTrue($adapter->has($key3)); - $I->assertTrue($adapter->has($key4)); - - $expected = [ - 'ph-strm' . $key1, - 'ph-strm' . $key2, - 'ph-strm' . $key3, - 'ph-strm' . $key4, - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'ph-strm' . $key3, - 'ph-strm' . $key4, - ]; - $actual = $adapter->getKeys("one"); - sort($actual); - $I->assertEquals($expected, $actual); - - $I->safeDeleteDirectory(outputDir('ph-strm')); - } - - /** - * Tests Phalcon\Storage\Adapter\Stream :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author ekmst - * @since 2020-09-09 - * @issue cphalcon/#14190 - */ - public function storageAdapterStreamGetKeysIssue14190(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Stream - getKeys() - issue 14190'); - - $serializer = new SerializerFactory(); - $adapter = new Stream( - $serializer, - [ - 'storageDir' => outputDir(), - 'prefix' => 'basePrefix-', - ] - ); - - $adapter->clear(); - - $actual = $adapter->set('key', 'test'); - $I->assertNotFalse($actual); - $actual = $adapter->set('key1', 'test'); - $I->assertNotFalse($actual); - - $expected = [ - 'basePrefix-key', - 'basePrefix-key1', - ]; - - $actual = $adapter->getKeys(); - sort($actual); - - $I->assertEquals($expected, $actual); - - foreach ($expected as $key) { - $actual = $adapter->delete($key); - $I->assertTrue($actual); - } - - $I->safeDeleteDirectory(outputDir('basePrefix-')); - } - - /** - * Tests Phalcon\Storage\Adapter\Stream :: getKeys() - * - * @param IntegrationTester $I - * - * @throws HelperException - * @throws StorageException - * - * @author ekmst - * @since 2020-09-09 - * @issue cphalcon/#14190 - */ - public function storageAdapterStreamGetKeysPrefix(IntegrationTester $I) - { - $I->wantToTest('Storage\Adapter\Stream - getKeys() - prefix'); - - $serializer = new SerializerFactory(); - $adapter = new Stream( - $serializer, - [ - 'storageDir' => outputDir(), - 'prefix' => 'pref-', - ] - ); - - $actual = $adapter->clear(); - $I->assertTrue($actual); - $actual = $adapter->getKeys(); - $I->assertEmpty($actual); - - $actual = $adapter->set('key', 'test'); - $I->assertNotFalse($actual); - $actual = $adapter->set('key1', 'test'); - $I->assertNotFalse($actual); - $actual = $adapter->set('somekey', 'test'); - $I->assertNotFalse($actual); - $actual = $adapter->set('somekey1', 'test'); - $I->assertNotFalse($actual); - - $expected = [ - 'pref-key', - 'pref-key1', - 'pref-somekey', - 'pref-somekey1', - ]; - $actual = $adapter->getKeys(); - sort($actual); - $I->assertEquals($expected, $actual); - - $expected = [ - 'pref-somekey', - 'pref-somekey1', - ]; - - $actual = $adapter->getKeys('so'); - sort($actual); - $I->assertEquals($expected, $actual); - - $actual = $adapter->clear(); - $I->assertTrue($actual); - - $I->safeDeleteDirectory(outputDir('pref-')); - } -} diff --git a/tests/integration/Storage/Serializer/Base64/GetDataCest.php b/tests/integration/Storage/Serializer/Base64/GetDataCest.php deleted file mode 100644 index bcf66a774ab..00000000000 --- a/tests/integration/Storage/Serializer/Base64/GetDataCest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Base64; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Base64; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Base64 :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64GetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - getData()'); - - $data = ['Phalcon Framework']; - $serializer = new Base64($data); - - $I->assertEquals( - $data, - $serializer->getData() - ); - } -} diff --git a/tests/integration/Storage/Serializer/Base64/SerializeCest.php b/tests/integration/Storage/Serializer/Base64/SerializeCest.php deleted file mode 100644 index 7cadcdfcb20..00000000000 --- a/tests/integration/Storage/Serializer/Base64/SerializeCest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Base64; - -use IntegrationTester; -use InvalidArgumentException; -use Phalcon\Storage\Serializer\Base64; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Base64 :: serialize() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64Serialize(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - serialize()'); - - $data = 'Phalcon Framework'; - $serializer = new Base64($data); - - $I->assertEquals( - base64_encode($data), - $serializer->serialize() - ); - } - - /** - * Tests Phalcon\Storage\Serializer\Base64 :: serialize() - exception - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64SerializeException(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - serialize() - exception'); - $I->expectThrowable( - new InvalidArgumentException( - 'Data for the serializer must of type string' - ), - function () { - $serializer = new Base64(1234); - $serializer->serialize(); - } - ); - } -} diff --git a/tests/integration/Storage/Serializer/Base64/SetDataCest.php b/tests/integration/Storage/Serializer/Base64/SetDataCest.php deleted file mode 100644 index 9d004d1b9a0..00000000000 --- a/tests/integration/Storage/Serializer/Base64/SetDataCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Base64; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Base64; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Base64 :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64SetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - setData()'); - - $data = ['Phalcon Framework']; - $serializer = new Base64(); - - $I->assertNull( - $serializer->getData() - ); - - $serializer->setData($data); - - $I->assertEquals( - $data, - $serializer->getData() - ); - } -} diff --git a/tests/integration/Storage/Serializer/Base64/UnserializeCest.php b/tests/integration/Storage/Serializer/Base64/UnserializeCest.php deleted file mode 100644 index c266bada6ec..00000000000 --- a/tests/integration/Storage/Serializer/Base64/UnserializeCest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Base64; - -use IntegrationTester; -use InvalidArgumentException; -use Phalcon\Storage\Serializer\Base64; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Base64 :: unserialize() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64Unserialize(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - unserialize()'); - - $data = 'Phalcon Framework'; - $serializer = new Base64($data); - $serialized = base64_encode($data); - $serializer->unserialize($serialized); - - $I->assertEquals( - $data, - $serializer->getData() - ); - } - - /** - * Tests Phalcon\Storage\Serializer\Base64 :: serialize() - exception - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerBase64SerializeException(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Base64 - unserialize() - exception'); - $I->expectThrowable( - new InvalidArgumentException( - 'Data for the unserializer must of type string' - ), - function () { - $serializer = new Base64(); - $serializer->unserialize(1234); - } - ); - } -} diff --git a/tests/integration/Storage/Serializer/ExceptionsCest.php b/tests/integration/Storage/Serializer/ExceptionsCest.php new file mode 100644 index 00000000000..b188ed92626 --- /dev/null +++ b/tests/integration/Storage/Serializer/ExceptionsCest.php @@ -0,0 +1,326 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Integration\Storage\Serializer; + +use Codeception\Stub; +use Error; +use IntegrationTester; +use InvalidArgumentException; +use Phalcon\Storage\Serializer\Base64; +use Phalcon\Storage\Serializer\Igbinary; +use Phalcon\Storage\Serializer\Json; +use Phalcon\Storage\Serializer\Msgpack; +use Phalcon\Storage\Serializer\Php; +use Phalcon\Support\Collection; +use stdClass; +use TypeError; + +use function json_encode; +use function trigger_error; + +use const E_WARNING; + +class ExceptionsCest +{ + /** + * Tests Phalcon\Storage\Serializer\Base64 :: serialize() - exception + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerBase64SerializeException(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Base64 - serialize() - exception'); + + $I->expectThrowable( + new InvalidArgumentException( + 'Data for the serializer must of type string' + ), + function () { + $serializer = new Base64(1234); + $serializer->serialize(); + } + ); + } + + /** + * Tests Phalcon\Storage\Serializer\Base64 :: unserialize() - exception + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerBase64UnserializeException(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Base64 - unserialize() - exception'); + + $I->expectThrowable( + new InvalidArgumentException( + 'Data for the unserializer must of type string' + ), + function () { + $serializer = new Base64(); + $serializer->unserialize(1234); + } + ); + } + + /** + * Tests Phalcon\Storage\Serializer\Base64 :: unserialize() - fail empty + * string + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2022-02-24 + */ + public function storageSerializerBase64UnserializeFailReturnsEmptyString(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Base64 - unserialize() - fail returns empty string'); + + $serializer = Stub::make( + Base64::class, + [ + 'phpBase64Decode' => false, + ] + ); + + $actual = $serializer->unserialize("Phalcon Framework"); + $I->assertEmpty($actual); + + $actual = $serializer->isSuccess(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Serializer\Igbinary :: serialize() - fail empty + * string + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2022-02-24 + */ + public function storageSerializerIgbinarySerializeFailReturnsEmptyString(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Igbinary - serialize() - fail returns empty string'); + + $serializer = Stub::make( + Igbinary::class, + [ + 'phpIgbinarySerialize' => null, + ] + ); + + $serializer->setData('Phalcon Framework'); + $actual = $serializer->serialize(); + $I->assertEmpty($actual); + + $actual = $serializer->isSuccess(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Serializer\Igbinary :: unserialize() - fail empty + * string + * + * @param IntegrationTester $I + * + * @throws \Exception + * @author Phalcon Team + * @since 2022-02-24 + */ + public function storageSerializerIgbinaryUnserializeFailReturnsEmptyString(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Igbinary - unserialize() - fail returns empty string'); + + $serializer = Stub::make( + Igbinary::class, + [ + 'phpIgbinaryUnserialize' => false, + ] + ); + + $actual = $serializer->unserialize("Phalcon Framework"); + $I->assertEmpty($actual); + + $actual = $serializer->isSuccess(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Serializer\Igbinary :: unserialize() - fail warning + * string + * + * @param IntegrationTester $I + * + * @throws \Exception + * @since 2022-02-24 + * @author Phalcon Team + */ + public function storageSerializerIgbinaryUnserializeFailWarning(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Igbinary - unserialize() - fail warning'); + + $serializer = Stub::make( + Igbinary::class, + [ + 'phpIgbinaryUnserialize' => function () { + trigger_error('Unserialize Error', E_WARNING); + }, + ] + ); + + $actual = $serializer->unserialize("Phalcon Framework"); + $I->assertEmpty($actual); + + $actual = $serializer->isSuccess(); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Storage\Serializer\Json :: serialize() - object + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerJsonSerializeObject(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Json - serialize() - object'); + + $collection1 = new Collection(); + $collection1->set('one', 'two'); + $collection2 = new Collection(); + $collection2->set('three', 'four'); + $collection2->set('object', $collection1); + + $serializer = new Json($collection2); + + $data = [ + 'three' => 'four', + 'object' => [ + 'one' => 'two', + ], + ]; + $expected = json_encode($data); + $actual = $serializer->serialize(); + $I->assertSame($expected, $actual); + } + + /** + * Tests Phalcon\Storage\Serializer\Json :: serialize() - error + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerJsonSerializeError(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Json - serialize() - error'); + + $I->expectThrowable( + new InvalidArgumentException( + "Data for the JSON serializer cannot be of type 'object' " . + "without implementing 'JsonSerializable'" + ), + function () { + $example = new stdClass(); + $example->one = 'two'; + + $serializer = new Json($example); + $serializer->serialize(); + } + ); + } + + /** + * Tests Phalcon\Storage\Serializer\Msgpack :: unserialize() - error + * + * @param IntegrationTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerMsgpackUnserializeError(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Msgpack - unserialize() - error'); + $serializer = new Msgpack(); + + $serialized = '??hello?messagepack"'; + $serializer->unserialize($serialized); + + $I->assertEmpty($serializer->getData()); + } + + /** + * Tests Phalcon\Storage\Serializer\Php :: unserialize() - error not string + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerPhpUnserializeErrorNotString(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Php - unserialize() - error not string'); + + if (version_compare(PHP_VERSION, '8.0.0', '<')) { + $I->expectThrowable( + new Error( + 'Object of class stdClass could not be converted to string' + ), + function () { + $serializer = new Php(); + + $serialized = new stdClass(); + $serializer->unserialize($serialized); + } + ); + } else { + $I->expectThrowable( + new TypeError( + 'Phalcon\Storage\Serializer\Php::phpUnserialize(): ' . + 'Argument #1 ($data) must be of type string, stdClass given' + ), + function () { + $serializer = new Php(); + + $serialized = new stdClass(); + $serializer->unserialize($serialized); + } + ); + } + } + + /** + * Tests Phalcon\Storage\Serializer\Php :: unserialize() - error + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function storageSerializerPhpUnserializeError(IntegrationTester $I) + { + $I->wantToTest('Storage\Serializer\Php - unserialize() - error'); + $serializer = new Php(); + + $serialized = '{??hello?unserialize"'; + $serializer->unserialize($serialized); + + $I->assertEmpty($serializer->getData()); + } +} diff --git a/tests/integration/Storage/Serializer/GetSetDataCest.php b/tests/integration/Storage/Serializer/GetSetDataCest.php new file mode 100644 index 00000000000..d80f334c2d6 --- /dev/null +++ b/tests/integration/Storage/Serializer/GetSetDataCest.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Integration\Storage\Serializer; + +use Codeception\Example; +use IntegrationTester; +use Phalcon\Storage\Serializer\Base64; +use Phalcon\Storage\Serializer\Igbinary; +use Phalcon\Storage\Serializer\Json; +use Phalcon\Storage\Serializer\Msgpack; +use Phalcon\Storage\Serializer\None; +use Phalcon\Storage\Serializer\Php; + +class GetSetDataCest +{ + /** + * Tests Phalcon\Storage\Serializer\ :: getData()/setData() + * + * @dataProvider getExamples + * + * @param IntegrationTester $I + * @param Example $example + * + * @author Phalcon Team + * @since 2022-02-24 + */ + public function storageSerializerGetSetData( + IntegrationTester $I, + Example $example + ) { + $I->wantToTest('Storage\Serializer\\' . $example[0] . ' - getData()/setData()'); + + $data = ['Phalcon Framework']; + $class = $example[1]; + $serializer = new $class(); + + $actual = $serializer->getData(); + $I->assertNull($actual); + + $serializer->setData($data); + + $expected = $data; + $actual = $serializer->getData(); + $I->assertSame($expected, $actual); + } + + /** + * @return array + */ + private function getExamples(): array + { + return [ + [ + 'Base64', + Base64::class, + ], + [ + 'Igbinary', + Igbinary::class, + ], + [ + 'Json', + Json::class, + ], + [ + 'Msgpack', + Msgpack::class, + ], + [ + 'None', + None::class, + ], + [ + 'Php', + Php::class, + ], + ]; + } +} diff --git a/tests/integration/Storage/Serializer/Igbinary/GetDataCest.php b/tests/integration/Storage/Serializer/Igbinary/GetDataCest.php deleted file mode 100644 index 1ab0c08a45b..00000000000 --- a/tests/integration/Storage/Serializer/Igbinary/GetDataCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Igbinary; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Igbinary; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Igbinary :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerIgbinaryGetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Igbinary - getData()'); - $data = ['Phalcon Framework']; - $serializer = new Igbinary($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Igbinary/SerializeCest.php b/tests/integration/Storage/Serializer/Igbinary/SerializeCest.php deleted file mode 100644 index 406915ba401..00000000000 --- a/tests/integration/Storage/Serializer/Igbinary/SerializeCest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Igbinary; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\Igbinary; -use stdClass; - -use function igbinary_serialize; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Igbinary :: serialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerIgbinarySerialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Igbinary - serialize() - ' . $example[0]); - - $serializer = new Igbinary($example[1]); - - $expected = $example[2]; - - $I->assertEquals( - $expected, - $serializer->serialize() - ); - } - - private function getExamples(): array - { - return [ - [ - 'null', - null, - null, - ], - [ - 'true', - true, - true, - ], - [ - 'false', - false, - false, - ], - [ - 'integer', - 1234, - 1234, - ], - [ - 'float', - 1.234, - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - igbinary_serialize('Phalcon Framework'), - ], - [ - 'array', - ['Phalcon Framework'], - igbinary_serialize(['Phalcon Framework']), - ], - [ - 'object', - new stdClass(), - igbinary_serialize(new stdClass()), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Igbinary/SetDataCest.php b/tests/integration/Storage/Serializer/Igbinary/SetDataCest.php deleted file mode 100644 index f065f33245a..00000000000 --- a/tests/integration/Storage/Serializer/Igbinary/SetDataCest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Igbinary; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Igbinary; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Igbinary :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerIgbinarySetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Igbinary - setData()'); - $data = ['Phalcon Framework']; - $serializer = new Igbinary(); - - $actual = $serializer->getData(); - $I->assertNull($actual); - - $serializer->setData($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Igbinary/UnserializeCest.php b/tests/integration/Storage/Serializer/Igbinary/UnserializeCest.php deleted file mode 100644 index 2a1eed956c8..00000000000 --- a/tests/integration/Storage/Serializer/Igbinary/UnserializeCest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Igbinary; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\Igbinary; -use stdClass; - -use function igbinary_serialize; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Igbinary :: unserialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerIgbinaryUnserialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Igbinary - unserialize() - ' . $example[0]); - $serializer = new Igbinary(); - $serialized = igbinary_serialize($example[1]); - $serializer->unserialize($serialized); - - $expected = $example[1]; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Serializer\Igbinary :: unserialize() - error - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerIgbinaryUnserializeError(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Igbinary - unserialize() - error'); - $serializer = new Igbinary(); - $serializer->unserialize('[DATA]'); - - $actual = $serializer->getData(); - $I->assertNull($actual); - } - - private function getExamples(): array - { - return [ - [ - 'integer', - 1234, - ], - [ - 'float', - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - ], - [ - 'array', - ['Phalcon Framework'], - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Json/GetDataCest.php b/tests/integration/Storage/Serializer/Json/GetDataCest.php deleted file mode 100644 index 3b0efe435eb..00000000000 --- a/tests/integration/Storage/Serializer/Json/GetDataCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Json; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Json; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Json :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonGetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Json - getData()'); - $data = ['Phalcon Framework']; - $serializer = new Json($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Json/SerializeCest.php b/tests/integration/Storage/Serializer/Json/SerializeCest.php deleted file mode 100644 index e7dcf6f8d74..00000000000 --- a/tests/integration/Storage/Serializer/Json/SerializeCest.php +++ /dev/null @@ -1,152 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Json; - -use Codeception\Example; -use IntegrationTester; -use InvalidArgumentException; -use JsonException; -use Phalcon\Storage\Serializer\Json; -use Phalcon\Support\Collection; -use stdClass; - -use function json_encode; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Json :: serialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws JsonException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonSerialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Json - serialize() - ' . $example[0]); - $serializer = new Json($example[1]); - - $expected = $example[2]; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Serializer\Json :: serialize() - object - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonSerializeObject(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Json - serialize() - object'); - - $collection1 = new Collection(); - $collection1->set('one', 'two'); - $collection2 = new Collection(); - $collection2->set('three', 'four'); - $collection2->set('object', $collection1); - - $serializer = new Json($collection2); - - $data = [ - 'three' => 'four', - 'object' => [ - 'one' => 'two', - ], - ]; - $expected = json_encode($data); - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Serializer\Json :: serialize() - error - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonSerializeError(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Json - serialize() - error'); - - $I->expectThrowable( - new InvalidArgumentException( - "Data for the JSON serializer cannot be of type 'object' " . - "without implementing 'JsonSerializable'" - ), - function () { - $example = new stdClass(); - $example->one = 'two'; - - $serializer = new Json($example); - $actual = $serializer->serialize(); - } - ); - } - - /** - * @return array - */ - private function getExamples(): array - { - return [ - [ - 'null', - null, - null, - ], - [ - 'true', - true, - true, - ], - [ - 'false', - false, - false, - ], - [ - 'integer', - 1234, - 1234, - ], - [ - 'float', - 1.234, - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - '"Phalcon Framework"', - ], - [ - 'array', - ['Phalcon Framework'], - '["Phalcon Framework"]', - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Json/SetDataCest.php b/tests/integration/Storage/Serializer/Json/SetDataCest.php deleted file mode 100644 index 8ea7f7c97fb..00000000000 --- a/tests/integration/Storage/Serializer/Json/SetDataCest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Json; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Json; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Json :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonSetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Json - setData()'); - $data = ['Phalcon Framework']; - $serializer = new Json(); - - $actual = $serializer->getData(); - $I->assertNull($actual); - - $serializer->setData($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Json/UnserializeCest.php b/tests/integration/Storage/Serializer/Json/UnserializeCest.php deleted file mode 100644 index 845128664d1..00000000000 --- a/tests/integration/Storage/Serializer/Json/UnserializeCest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Json; - -use Codeception\Example; -use IntegrationTester; -use JsonException; -use Phalcon\Storage\Serializer\Json; -use stdClass; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Json :: unserialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @throws JsonException - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerJsonUnserialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Json - unserialize() - ' . $example[0]); - $serializer = new Json(); - $serialized = json_encode($example[1]); - $serializer->unserialize($serialized); - - $expected = $example[1]; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'null', - null, - ], - [ - 'true', - true, - ], - [ - 'false', - false, - ], - [ - 'integer', - 1234, - ], - [ - 'float', - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - ], - [ - 'array', - ['Phalcon Framework'], - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Msgpack/GetDataCest.php b/tests/integration/Storage/Serializer/Msgpack/GetDataCest.php deleted file mode 100644 index 034dc3a27df..00000000000 --- a/tests/integration/Storage/Serializer/Msgpack/GetDataCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Msgpack; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Msgpack; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Msgpack :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerMsgpackGetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Msgpack - getData()'); - $data = ['Phalcon Framework']; - $serializer = new Msgpack($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Msgpack/SerializeCest.php b/tests/integration/Storage/Serializer/Msgpack/SerializeCest.php deleted file mode 100644 index c3bf0a287de..00000000000 --- a/tests/integration/Storage/Serializer/Msgpack/SerializeCest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Msgpack; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Msgpack; -use stdClass; - -use function msgpack_pack; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Msgpack :: serialize() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerMsgpackSerialize(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Msgpack - serialize()'); - - // null - $source = null; - $serializer = new Msgpack($source); - $expected = null; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // true - $source = true; - $serializer = new Msgpack($source); - $expected = true; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // false - $source = false; - $serializer = new Msgpack($source); - $expected = false; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // integer - $source = 1234; - $serializer = new Msgpack($source); - $expected = 1234; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // float - $source = 1.234; - $serializer = new Msgpack($source); - $expected = 1.234; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // string - $source = 'Phalcon Framework'; - $serializer = new Msgpack($source); - $expected = msgpack_pack('Phalcon Framework'); - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // array', - $source = ['Phalcon Framework']; - $serializer = new Msgpack($source); - $expected = msgpack_pack(['Phalcon Framework']); - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - - // object - $source = new stdClass(); - $serializer = new Msgpack($source); - $expected = msgpack_pack(new stdClass()); - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Msgpack/SetDataCest.php b/tests/integration/Storage/Serializer/Msgpack/SetDataCest.php deleted file mode 100644 index 8f220ef0aa4..00000000000 --- a/tests/integration/Storage/Serializer/Msgpack/SetDataCest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Msgpack; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Msgpack; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Msgpack :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerMsgpackSetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Msgpack - setData()'); - $data = ['Phalcon Framework']; - $serializer = new Msgpack(); - - $actual = $serializer->getData(); - $I->assertNull($actual); - - $serializer->setData($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Msgpack/UnserializeCest.php b/tests/integration/Storage/Serializer/Msgpack/UnserializeCest.php deleted file mode 100644 index ed78dc1a852..00000000000 --- a/tests/integration/Storage/Serializer/Msgpack/UnserializeCest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Msgpack; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\Msgpack; -use stdClass; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Msgpack :: unserialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerMsgpackUnserialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Msgpack - unserialize() - ' . $example[0]); - $serializer = new Msgpack(); - $serialized = msgpack_pack($example[1]); - $serializer->unserialize($serialized); - - $expected = $example[1]; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Serializer\Msgpack :: unserialize() - error - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerMsgpackUnserializeError(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Msgpack - unserialize() - error'); - $serializer = new Msgpack(); - - $serialized = '??hello?messagepack"'; - $serializer->unserialize($serialized); - - $I->assertEmpty($serializer->getData()); - } - - private function getExamples(): array - { - return [ - [ - 'integer', - 1234, - ], - [ - 'float', - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - ], - [ - 'array', - ['Phalcon Framework'], - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/None/GetDataCest.php b/tests/integration/Storage/Serializer/None/GetDataCest.php deleted file mode 100644 index 25d6c00cb8f..00000000000 --- a/tests/integration/Storage/Serializer/None/GetDataCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\None; - -use IntegrationTester; -use Phalcon\Storage\Serializer\None; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\None :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerNoneGetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\None - getData()'); - $data = ['Phalcon Framework']; - $serializer = new None($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/None/SerializeCest.php b/tests/integration/Storage/Serializer/None/SerializeCest.php deleted file mode 100644 index 2123f7b51e3..00000000000 --- a/tests/integration/Storage/Serializer/None/SerializeCest.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\None; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\None; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\None :: serialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerNoneSerialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\None - serialize()'); - $serializer = new None($example[1]); - - $expected = $example[2]; - $actual = $serializer->serialize(); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'null', - null, - null, - ], - [ - 'true', - true, - true, - ], - [ - 'false', - false, - false, - ], - [ - 'integer', - 1234, - 1234, - ], - [ - 'float', - 1.234, - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - 'Phalcon Framework', - ], - [ - 'array', - ['Phalcon Framework'], - ["Phalcon Framework"], - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/None/SetDataCest.php b/tests/integration/Storage/Serializer/None/SetDataCest.php deleted file mode 100644 index 93c77126149..00000000000 --- a/tests/integration/Storage/Serializer/None/SetDataCest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\None; - -use IntegrationTester; -use Phalcon\Storage\Serializer\None; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\None :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerNoneSetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\None - setData()'); - $data = ['Phalcon Framework']; - $serializer = new None(); - - $actual = $serializer->getData(); - $I->assertNull($actual); - - $serializer->setData($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/None/UnserializeCest.php b/tests/integration/Storage/Serializer/None/UnserializeCest.php deleted file mode 100644 index 17a94f12db5..00000000000 --- a/tests/integration/Storage/Serializer/None/UnserializeCest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\None; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\None; -use stdClass; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\None :: unserialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerNoneUnserialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\None - unserialize() - ' . $example[0]); - $serializer = new None(); - $serialized = $example[1]; - $serializer->unserialize($serialized); - - $expected = $example[1]; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'integer', - 1234, - ], - [ - 'float', - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - ], - [ - 'array', - ['Phalcon Framework'], - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Php/GetDataCest.php b/tests/integration/Storage/Serializer/Php/GetDataCest.php deleted file mode 100644 index 73aaf3c63e4..00000000000 --- a/tests/integration/Storage/Serializer/Php/GetDataCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Php; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Php; - -class GetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Php :: getData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpGetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Php - getData()'); - $data = ['Phalcon Framework']; - $serializer = new Php($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Php/SerializeCest.php b/tests/integration/Storage/Serializer/Php/SerializeCest.php deleted file mode 100644 index d82fda4c3e9..00000000000 --- a/tests/integration/Storage/Serializer/Php/SerializeCest.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Php; - -use Codeception\Example; -use IntegrationTester; -use Phalcon\Storage\Serializer\Php; -use stdClass; - -use function serialize; - -class SerializeCest -{ - /** - * Tests Phalcon\Storage\Serializer\Php :: serialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpSerialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Serializer\Php - serialize() - ' . $example[0]); - - $serializer = new Php($example[1]); - - $expected = $example[2]; - $actual = $serializer->serialize(); - - $I->assertEquals($expected, $actual); - } - - private function getExamples(): array - { - return [ - [ - 'null', - null, - null, - ], - [ - 'true', - true, - true, - ], - [ - 'false', - false, - false, - ], - [ - 'integer', - 1234, - 1234, - ], - [ - 'float', - 1.234, - 1.234, - ], - [ - 'string', - 'Phalcon Framework', - serialize('Phalcon Framework'), - ], - [ - 'array', - ['Phalcon Framework'], - serialize(['Phalcon Framework']), - ], - [ - 'object', - new stdClass(), - serialize(new stdClass()), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/Php/SetDataCest.php b/tests/integration/Storage/Serializer/Php/SetDataCest.php deleted file mode 100644 index fdfe0798ea8..00000000000 --- a/tests/integration/Storage/Serializer/Php/SetDataCest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Php; - -use IntegrationTester; -use Phalcon\Storage\Serializer\Php; - -class SetDataCest -{ - /** - * Tests Phalcon\Storage\Serializer\Php :: setData() - * - * @param IntegrationTester $I - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpSetData(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Php - setData()'); - $data = ['Phalcon Framework']; - $serializer = new Php(); - - $actual = $serializer->getData(); - $I->assertNull($actual); - - $serializer->setData($data); - - $expected = $data; - $actual = $serializer->getData(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/integration/Storage/Serializer/Php/UnserializeCest.php b/tests/integration/Storage/Serializer/Php/UnserializeCest.php deleted file mode 100644 index d43dc9eb5e6..00000000000 --- a/tests/integration/Storage/Serializer/Php/UnserializeCest.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Integration\Storage\Serializer\Php; - -use Codeception\Example; -use IntegrationTester; -use InvalidArgumentException; -use Phalcon\Storage\Serializer\Php; -use stdClass; - -use function serialize; - -class UnserializeCest -{ - /** - * Tests Phalcon\Storage\Unserializer\Php :: unserialize() - * - * @dataProvider getExamples - * - * @param IntegrationTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpUnserialize(IntegrationTester $I, Example $example) - { - $I->wantToTest('Storage\Unserializer\Php - unserialize() - ' . $example[0]); - - $serializer = new Php(); - - - $serializer->unserialize($example[2]); - - $expected = $example[1]; - $actual = $serializer->getData(); - - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Storage\Serializer\Php :: unserialize() - error not string - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpUnserializeErrorNotString(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Php - unserialize() - error not string'); - $I->expectThrowable( - new InvalidArgumentException( - 'Data for the unserializer must of type string' - ), - function () { - $serializer = new Php(); - - $serialized = new stdClass(); - $serializer->unserialize($serialized); - } - ); - } - - /** - * Tests Phalcon\Storage\Serializer\Php :: unserialize() - error - * - * @author Phalcon Team - * @since 2020-09-09 - */ - public function storageSerializerPhpUnserializeError(IntegrationTester $I) - { - $I->wantToTest('Storage\Serializer\Php - unserialize() - error'); - $serializer = new Php(); - - $serialized = '{??hello?unserialize"'; - $serializer->unserialize($serialized); - - $I->assertEmpty($serializer->getData()); - } - - private function getExamples(): array - { - return [ - [ - 'null', - null, - serialize(null), - ], - [ - 'true', - true, - serialize(true), - ], - [ - 'false', - false, - serialize(false), - ], - [ - 'integer', - 1234, - serialize(1234), - ], - [ - 'float', - 1.234, - serialize(1.234), - ], - [ - 'string', - 'Phalcon Framework', - serialize('Phalcon Framework'), - ], - [ - 'array', - ['Phalcon Framework'], - serialize(['Phalcon Framework']), - ], - [ - 'object', - new stdClass(), - serialize(new stdClass()), - ], - ]; - } -} diff --git a/tests/integration/Storage/Serializer/SerializeUnserializeCest.php b/tests/integration/Storage/Serializer/SerializeUnserializeCest.php new file mode 100644 index 00000000000..8bbd9730734 --- /dev/null +++ b/tests/integration/Storage/Serializer/SerializeUnserializeCest.php @@ -0,0 +1,432 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Integration\Storage\Serializer; + +use Codeception\Example; +use IntegrationTester; +use Phalcon\Storage\Serializer\Base64; +use Phalcon\Storage\Serializer\Igbinary; +use Phalcon\Storage\Serializer\Json; +use Phalcon\Storage\Serializer\MemcachedIgbinary; +use Phalcon\Storage\Serializer\MemcachedJson; +use Phalcon\Storage\Serializer\MemcachedPhp; +use Phalcon\Storage\Serializer\Msgpack; +use Phalcon\Storage\Serializer\None; +use Phalcon\Storage\Serializer\Php; +use Phalcon\Storage\Serializer\RedisIgbinary; +use Phalcon\Storage\Serializer\RedisJson; +use Phalcon\Storage\Serializer\RedisMsgpack; +use Phalcon\Storage\Serializer\RedisNone; +use Phalcon\Storage\Serializer\RedisPhp; +use stdClass; + +use function igbinary_serialize; +use function json_encode; +use function serialize; + +class SerializeUnserializeCest +{ + private const TEXT = 'Phalcon Framework'; + + /** + * Tests Phalcon\Storage\Serializer\Igbinary :: serialize() + * + * @dataProvider getExamples + * + * @param IntegrationTester $I + * @param Example $example + * + * @author Phalcon Team + * @since 2022-02-24 + */ + public function storageSerializerSerializeUnserialize( + IntegrationTester $I, + Example $example + ) { + + $label = $example[0]; + $type = $example[1]; + $class = $example[2]; + $data = $example[3]; + $expected = $example[4]; + + $I->wantToTest( + 'Storage\Serializer\\' . $label . ' - serialize()/unserialize() - ' . $type + ); + + $serializer = new $class($data); + $serialized = $serializer->serialize(); + + $actual = $serialized; + $I->assertSame($expected, $actual); + + $serializer = new $class(); + $serializer->unserialize($serialized); + + /** + * assertEquals here because stdClass will not refer to the same + * object when unserialized + */ + $expected = $data; + $actual = $serializer->getData(); + $I->assertEquals($expected, $actual); + } + + /** + * @return array[] + */ + private function getExamples(): array + { + $stdClass = new stdClass(); + + return [ + [ + 'Base64', + 'string', + Base64::class, + self::TEXT, + base64_encode(self::TEXT), + ], + [ + 'Igbinary', + 'null', + Igbinary::class, + null, + null, + ], + [ + 'Igbinary', + 'true', + Igbinary::class, + true, + true, + ], + [ + 'Igbinary', + 'false', + Igbinary::class, + false, + false, + ], + [ + 'Igbinary', + 'integer', + Igbinary::class, + 1234, + 1234, + ], + [ + 'Igbinary', + 'float', + Igbinary::class, + 1.234, + 1.234, + ], + [ + 'Igbinary', + 'string', + Igbinary::class, + self::TEXT, + igbinary_serialize(self::TEXT), + ], + [ + 'Igbinary', + 'array', + Igbinary::class, + [self::TEXT], + igbinary_serialize([self::TEXT]), + ], + [ + 'Igbinary', + 'object', + Igbinary::class, + $stdClass, + igbinary_serialize($stdClass), + ], + [ + 'Json', + 'null', + Json::class, + null, + null, + ], + [ + 'Json', + 'true', + Json::class, + true, + true, + ], + [ + 'Json', + 'false', + Json::class, + false, + false, + ], + [ + 'Json', + 'integer', + Json::class, + 1234, + 1234, + ], + [ + 'Json', + 'float', + Json::class, + 1.234, + 1.234, + ], + [ + 'Json', + 'string', + Json::class, + self::TEXT, + json_encode(self::TEXT), + ], + [ + 'Json', + 'array', + Json::class, + [self::TEXT], + json_encode([self::TEXT]), + ], + [ + 'MemcachedIgbinary', + 'null', + MemcachedIgbinary::class, + null, + null, + ], + [ + 'MemcachedJson', + 'null', + MemcachedJson::class, + null, + null, + ], + [ + 'MemcachedPhp', + 'null', + MemcachedPhp::class, + null, + null, + ], + [ + 'Msgpack', + 'null', + Msgpack::class, + null, + null, + ], + [ + 'Msgpack', + 'true', + Msgpack::class, + true, + true, + ], + [ + 'Msgpack', + 'false', + Msgpack::class, + false, + false, + ], + [ + 'Msgpack', + 'integer', + Msgpack::class, + 1234, + 1234, + ], + [ + 'Msgpack', + 'float', + Msgpack::class, + 1.234, + 1.234, + ], + [ + 'Msgpack', + 'string', + Msgpack::class, + self::TEXT, + msgpack_pack(self::TEXT), + ], + [ + 'Msgpack', + 'array', + Msgpack::class, + [self::TEXT], + msgpack_pack([self::TEXT]), + ], + [ + 'Msgpack', + 'object', + Msgpack::class, + $stdClass, + msgpack_pack($stdClass), + ], + [ + 'None', + 'null', + None::class, + null, + null, + ], + [ + 'None', + 'true', + None::class, + true, + true, + ], + [ + 'None', + 'false', + None::class, + false, + false, + ], + [ + 'None', + 'integer', + None::class, + 1234, + 1234, + ], + [ + 'None', + 'float', + None::class, + 1.234, + 1.234, + ], + [ + 'None', + 'string', + None::class, + self::TEXT, + self::TEXT, + ], + [ + 'None', + 'array', + None::class, + [self::TEXT], + [self::TEXT], + ], + [ + 'None', + 'object', + None::class, + $stdClass, + $stdClass, + ], + [ + 'Php', + 'null', + Php::class, + null, + null, + ], + [ + 'Php', + 'true', + Php::class, + true, + true, + ], + [ + 'Php', + 'false', + Php::class, + false, + false, + ], + [ + 'Php', + 'integer', + Php::class, + 1234, + 1234, + ], + [ + 'Php', + 'float', + Php::class, + 1.234, + 1.234, + ], + [ + 'Php', + 'string', + Php::class, + self::TEXT, + serialize(self::TEXT), + ], + [ + 'Php', + 'array', + Php::class, + [self::TEXT], + serialize([self::TEXT]), + ], + [ + 'Php', + 'object', + Php::class, + $stdClass, + serialize($stdClass), + ], + [ + 'RedisIgbinary', + 'null', + RedisIgbinary::class, + null, + null, + ], + [ + 'RedisJson', + 'null', + RedisJson::class, + null, + null, + ], + [ + 'RedisMsgpack', + 'null', + RedisMsgpack::class, + null, + null, + ], + [ + 'RedisNone', + 'null', + RedisNone::class, + null, + null, + ], + [ + 'RedisPhp', + 'null', + RedisPhp::class, + null, + null, + ], + ]; + } +} diff --git a/tests/integration/Storage/SerializerFactory/NewInstanceCest.php b/tests/integration/Storage/SerializerFactory/NewInstanceCest.php index 477a58efc65..2cc2d97dc44 100644 --- a/tests/integration/Storage/SerializerFactory/NewInstanceCest.php +++ b/tests/integration/Storage/SerializerFactory/NewInstanceCest.php @@ -19,9 +19,17 @@ use Phalcon\Storage\Serializer\Base64; use Phalcon\Storage\Serializer\Igbinary; use Phalcon\Storage\Serializer\Json; +use Phalcon\Storage\Serializer\MemcachedIgbinary; +use Phalcon\Storage\Serializer\MemcachedJson; +use Phalcon\Storage\Serializer\MemcachedPhp; use Phalcon\Storage\Serializer\Msgpack; use Phalcon\Storage\Serializer\None; use Phalcon\Storage\Serializer\Php; +use Phalcon\Storage\Serializer\RedisIgbinary; +use Phalcon\Storage\Serializer\RedisJson; +use Phalcon\Storage\Serializer\RedisMsgpack; +use Phalcon\Storage\Serializer\RedisNone; +use Phalcon\Storage\Serializer\RedisPhp; use Phalcon\Storage\SerializerFactory; use function uniqid; @@ -48,10 +56,8 @@ public function storageSerializerFactoryNewInstance(IntegrationTester $I, Exampl $factory = new SerializerFactory(); $service = $factory->newInstance($example[0]); - $I->assertInstanceOf( - $example[1], - $service - ); + $expected = $example[1]; + $I->assertInstanceOf($expected, $service); } /** @@ -85,9 +91,17 @@ private function getExamples(): array ['base64', Base64::class], ['igbinary', Igbinary::class], ['json', Json::class], + ['memcached_igbinary', MemcachedIgbinary::class], + ['memcached_json', MemcachedJson::class], + ['memcached_php', MemcachedPhp::class], ['msgpack', Msgpack::class], ['none', None::class], ['php', Php::class], + ['redis_igbinary', RedisIgbinary::class], + ['redis_json', RedisJson::class], + ['redis_msgpack', RedisMsgpack::class], + ['redis_none', RedisNone::class], + ['redis_php', RedisPhp::class], ]; } } diff --git a/tests/integration/Validation/Validator/Confirmation/ValidateCest.php b/tests/integration/Validation/Validator/Confirmation/ValidateCest.php index 8ac72435d77..f5e749484e4 100644 --- a/tests/integration/Validation/Validator/Confirmation/ValidateCest.php +++ b/tests/integration/Validation/Validator/Confirmation/ValidateCest.php @@ -288,21 +288,21 @@ public function filterValidationValidatorConfirmationValidateEmptyValues(Integra $messages->count() ); + if (version_compare(PHP_VERSION, '8.1.0', '<')) { + $messages = $validation->validate( + [ + 'password' => null, + 'password2' => 'test123', + ] + ); - $messages = $validation->validate( - [ - 'password' => null, - 'password2' => 'test123', - ] - ); - - $I->assertEquals( - 1, - $messages->count() - ); - - $I->assertEquals($expected, $messages); + $I->assertEquals( + 1, + $messages->count() + ); + $I->assertEquals($expected, $messages); + } $validation = new Validation(); @@ -328,19 +328,20 @@ public function filterValidationValidatorConfirmationValidateEmptyValues(Integra $messages->count() ); + if (version_compare(PHP_VERSION, '8.1.0', '<')) { + $messages = $validation->validate( + [ + 'password' => null, + 'password2' => 'test123', + ] + ); - $messages = $validation->validate( - [ - 'password' => null, - 'password2' => 'test123', - ] - ); - - $I->assertEquals( - 1, - $messages->count() - ); + $I->assertEquals( + 1, + $messages->count() + ); - $I->assertEquals($expected, $messages); + $I->assertEquals($expected, $messages); + } } } diff --git a/tests/run-syntax-tests.sh b/tests/run-syntax-tests.sh index 7cc69668afd..88d531c3501 100755 --- a/tests/run-syntax-tests.sh +++ b/tests/run-syntax-tests.sh @@ -29,7 +29,6 @@ php ./ext/run-tests.php \ -d "report_memleaks=1" \ -d "report_zend_debug=0" \ -d "zend.assertions=1" \ - -d "extension=psr.so" \ -d "extension=$(pwd)/ext/modules/phalcon.so" \ -d extension_dir="$($(phpenv which php-config) --extension-dir)" \ -p "$TEST_PHP_EXECUTABLE" \ diff --git a/tests/unit/Annotations/Reader/ParseCest.php b/tests/unit/Annotations/Reader/ParseCest.php index 1bde7500749..87e49793129 100644 --- a/tests/unit/Annotations/Reader/ParseCest.php +++ b/tests/unit/Annotations/Reader/ParseCest.php @@ -195,6 +195,12 @@ public function testReaderParse(UnitTester $I) $I->assertEquals('key3', $parsing['class'][8]['arguments'][0]['expr']['items'][2]['name']); $I->assertEquals(308, $parsing['class'][8]['arguments'][0]['expr']['items'][2]['expr']['type']); + // Constants + $I->assertTrue(isset($parsing['constants'])); + $I->assertCount(1, $parsing['constants']); + $I->assertFalse(isset($parsing['constants']['TEST_CONST2'])); + $I->assertEquals('Simple', $parsing['constants']['TEST_CONST1'][0]['name']); + // Properties $I->assertTrue(isset($parsing['properties'])); $I->assertCount(3, $parsing['properties']); diff --git a/tests/unit/Annotations/ReflectionCest.php b/tests/unit/Annotations/ReflectionCest.php index af523f54ac3..6aa95e85869 100644 --- a/tests/unit/Annotations/ReflectionCest.php +++ b/tests/unit/Annotations/ReflectionCest.php @@ -45,6 +45,16 @@ public function testClassAnnotations(UnitTester $I) $reader->parse('TestClass') ); + $constantsAnnotations = $reflection->getConstantsAnnotations(); + $I->assertIsArray($constantsAnnotations); + + $annotations = $constantsAnnotations['TEST_CONST1']; + $I->assertInstanceOf( + Collection::class, + $annotations + ); + $I->assertTrue($annotations->has('Simple')); + $methodsAnnotations = $reflection->getMethodsAnnotations(); $I->assertIsArray($methodsAnnotations); diff --git a/tests/unit/Application/GetSetDefaultModuleCest.php b/tests/unit/Application/GetSetDefaultModuleCest.php index e11e4a61442..46b4ed12adf 100644 --- a/tests/unit/Application/GetSetDefaultModuleCest.php +++ b/tests/unit/Application/GetSetDefaultModuleCest.php @@ -38,7 +38,7 @@ public function applicationGetSetDefaultModule(UnitTester $I) $application = new ApplicationFixture(); $actual = $application->getDefaultModule(); - $I->assertNull($actual); + $I->assertSame('', $actual); $application->setDefaultModule('admin'); $expected = 'admin'; diff --git a/tests/unit/Container/ConstructCest.php b/tests/unit/Container/ConstructCest.php deleted file mode 100644 index a26a5ed30b6..00000000000 --- a/tests/unit/Container/ConstructCest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Container; - -use Phalcon\Container\Container; -use Phalcon\Di\Di; -use Psr\Container\ContainerInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Container :: __construct() - * - * @author Phalcon Team - * @since 2018-11-13 - */ - public function containerConstruct(UnitTester $I) - { - $I->wantToTest('Container - __construct()'); - - $container = new Di(); - $actual = new Container($container); - - $I->assertInstanceOf(ContainerInterface::class, $actual); - } -} diff --git a/tests/unit/Container/GetCest.php b/tests/unit/Container/GetCest.php deleted file mode 100644 index ff04b6e6b91..00000000000 --- a/tests/unit/Container/GetCest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Container; - -use Phalcon\Container\Container; -use Phalcon\Html\Escaper; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use UnitTester; - -use function spl_object_hash; - -class GetCest -{ - use DiTrait; - - /** - * Tests Phalcon\Container :: get() - * - * @author Phalcon Team - * @since 2018-11-13 - */ - public function containerGet(UnitTester $I) - { - $I->wantToTest('Container - get()'); - - $this->newDi(); - - $escaper = new Escaper(); - $this->container->setShared('test', $escaper); - $this->setDiService('escaper'); - - $container = new Container($this->container); - $containerEscaper = $container->get('test'); - - $I->assertInstanceOf(Escaper::class, $containerEscaper); - - $diEscaper = $this->container->getShared('test'); - - $expected = spl_object_hash($escaper); - $actual = spl_object_hash($diEscaper); - $I->assertEquals($expected, $actual); - - $expected = spl_object_hash($diEscaper); - $actual = spl_object_hash($containerEscaper); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Container/HasCest.php b/tests/unit/Container/HasCest.php deleted file mode 100644 index f8f6c77d367..00000000000 --- a/tests/unit/Container/HasCest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Container; - -use Phalcon\Container\Container; -use Phalcon\Tests\Fixtures\Traits\DiTrait; -use UnitTester; - -class HasCest -{ - use DiTrait; - - /** - * Tests Phalcon\Container :: has() - * - * @author Phalcon Team - * @since 2018-11-13 - */ - public function containerHas(UnitTester $I) - { - $I->wantToTest('Container - has()'); - - $this->newDi(); - $this->setDiService('filter'); - - $container = new Container($this->container); - - $actual = $container->has('filter'); - $I->assertTrue($actual); - } -} diff --git a/tests/unit/Di/InitializationAwareCest.php b/tests/unit/Di/InitializationAwareCest.php new file mode 100644 index 00000000000..a1ce38f5541 --- /dev/null +++ b/tests/unit/Di/InitializationAwareCest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Unit\Di; + +use Phalcon\Di\Di; +use Phalcon\Tests\Fixtures\Di\InitializationAwareComponent; +use UnitTester; + +/** + * Class InitializationAwareCest + * + * @package Phalcon\Tests\Unit\Di + */ +class InitializationAwareCest +{ + /** + * Tests Phalcon\Di\Di :: initialization aware interface + * + * @param UnitTester $I + * + * @author Phalcon Team + * @since 2019-09-09 + */ + public function diInitializationAware(UnitTester $I) + { + $I->wantToTest('Di - initialization aware interface'); + + $di = new Di(); + + $I->assertEquals(true, $di->get(InitializationAwareComponent::class)->isInitialized()); + } +} diff --git a/tests/unit/Encryption/Crypt/IsValidDecryptLengthCest.php b/tests/unit/Encryption/Crypt/IsValidDecryptLengthCest.php new file mode 100644 index 00000000000..6d88d891bf7 --- /dev/null +++ b/tests/unit/Encryption/Crypt/IsValidDecryptLengthCest.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the + * LICENSE.txt file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Unit\Encryption\Crypt; + +use Codeception\Stub; +use Phalcon\Encryption\Crypt; +use UnitTester; + +use function uniqid; + +class IsValidDecryptLengthCest +{ + /** + * Tests Phalcon\Encryption\Crypt :: isValidDecryptLength() + * + * @param UnitTester $I + * + * @author Phalcon Team + * @since 2022-02-09 + */ + public function cryptGetSetKey(UnitTester $I) + { + $I->wantToTest('Crypt - isValidDecryptLength()'); + + $crypt = new Crypt(); + $crypt->setKey('1234'); + + $input = uniqid(); + $encrypted = $crypt->encrypt($input); + + $actual = $crypt->isValidDecryptLength($encrypted); + $I->assertTrue($actual); + + $actual = $crypt->isValidDecryptLength('text'); + $I->assertFalse($actual); + } + + /** + * Tests Phalcon\Encryption\Crypt :: isValidDecryptLength() - false length + * + * @param UnitTester $I + * + * @author Phalcon Team + * @since 2022-02-09 + */ + public function cryptGetSetKeyFalseLength(UnitTester $I) + { + $I->wantToTest('Crypt - isValidDecryptLength()'); + + $crypt = Stub::make( + Crypt::class, + [ + 'phpOpensslCipherIvLength' => false, + ] + ); + $crypt->setKey('1234'); + + $actual = $crypt->isValidDecryptLength('text'); + $I->assertFalse($actual); + } +} diff --git a/tests/unit/Html/Helper/Input/UnderscoreInvokeCest.php b/tests/unit/Html/Helper/Input/UnderscoreInvokeCest.php index 6c89d139c1d..205d4548fd4 100644 --- a/tests/unit/Html/Helper/Input/UnderscoreInvokeCest.php +++ b/tests/unit/Html/Helper/Input/UnderscoreInvokeCest.php @@ -196,7 +196,7 @@ private function getClasses(): array 'hidden' => ['inputHidden', Hidden::class], 'image' => ['inputImage', Image::class], 'month' => ['inputMonth', Month::class], - 'numeric' => ['inputNumeric', Numeric::class], + 'number' => ['inputNumeric', Numeric::class], 'password' => ['inputPassword', Password::class], 'range' => ['inputRange', Range::class], 'search' => ['inputSearch', Search::class], diff --git a/tests/unit/Html/Link/EvolvableLink/ConstructCest.php b/tests/unit/Html/Link/EvolvableLink/ConstructCest.php index 4dd9d4252a8..d653c475752 100644 --- a/tests/unit/Html/Link/EvolvableLink/ConstructCest.php +++ b/tests/unit/Html/Link/EvolvableLink/ConstructCest.php @@ -14,7 +14,7 @@ namespace Phalcon\Tests\Unit\Html\Link\EvolvableLink; use Phalcon\Html\Link\EvolvableLink; -use Psr\Link\EvolvableLinkInterface; +use Phalcon\Html\Link\Interfaces\EvolvableLinkInterface; use UnitTester; /** diff --git a/tests/unit/Html/Link/EvolvableLinkProvider/ConstructCest.php b/tests/unit/Html/Link/EvolvableLinkProvider/ConstructCest.php index af6f1154344..3dbb76574e9 100644 --- a/tests/unit/Html/Link/EvolvableLinkProvider/ConstructCest.php +++ b/tests/unit/Html/Link/EvolvableLinkProvider/ConstructCest.php @@ -14,7 +14,7 @@ namespace Phalcon\Tests\Unit\Html\Link\EvolvableLinkProvider; use Phalcon\Html\Link\EvolvableLinkProvider; -use Psr\Link\EvolvableLinkProviderInterface; +use Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface; use UnitTester; /** diff --git a/tests/unit/Html/Link/Link/ConstructCest.php b/tests/unit/Html/Link/Link/ConstructCest.php index e4c13026a04..08a8f1ac844 100644 --- a/tests/unit/Html/Link/Link/ConstructCest.php +++ b/tests/unit/Html/Link/Link/ConstructCest.php @@ -14,7 +14,7 @@ namespace Phalcon\Tests\Unit\Html\Link\Link; use Phalcon\Html\Link\Link; -use Psr\Link\LinkInterface; +use Phalcon\Html\Link\Interfaces\LinkInterface; use UnitTester; /** diff --git a/tests/unit/Html/Link/LinkProvider/ConstructCest.php b/tests/unit/Html/Link/LinkProvider/ConstructCest.php index 86db49414e9..905378fb057 100644 --- a/tests/unit/Html/Link/LinkProvider/ConstructCest.php +++ b/tests/unit/Html/Link/LinkProvider/ConstructCest.php @@ -15,7 +15,7 @@ use Phalcon\Html\Link\Link; use Phalcon\Html\Link\LinkProvider; -use Psr\Link\LinkProviderInterface; +use Phalcon\Html\Link\Interfaces\LinkProviderInterface; use UnitTester; /** diff --git a/tests/unit/Http/Message/Request/ConstructCest.php b/tests/unit/Http/Message/Request/ConstructCest.php deleted file mode 100644 index b2a47b70569..00000000000 --- a/tests/unit/Http/Message/Request/ConstructCest.php +++ /dev/null @@ -1,135 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Request; -use Psr\Http\Message\RequestInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Request :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct()'); - - $request = new Request(); - - $I->assertInstanceOf( - RequestInterface::class, - $request - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: __construct() - body exception - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstructExceptionBody(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct() - exception body'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid stream passed as a parameter' - ), - function () { - $request = new Request('GET', null, false); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: __construct() - exception uri - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstructExceptionUri(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct() - exception uri'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid uri passed as a parameter' - ), - function () { - $request = new Request('GET', false); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: __construct() - exception headers - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstructExceptionHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct() - exception headers'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Headers needs to be either an array or instance of Phalcon\Support\Collection' - ), - function () { - $request = new Request( - 'GET', - '', - 'php://memory', - false - ); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: __construct() - headers with host - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstructHeadersWithHost(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct() - headers with host'); - - $request = new Request( - 'GET', - 'https://dev.phalcon.ld:8080/action', - 'php://memory', - [ - 'Host' => ['test.phalcon.ld'], - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ] - ); - - $expected = [ - 'Host' => ['dev.phalcon.ld:8080'], - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/Request/GetBodyCest.php b/tests/unit/Http/Message/Request/GetBodyCest.php deleted file mode 100644 index af14566bd55..00000000000 --- a/tests/unit/Http/Message/Request/GetBodyCest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class GetBodyCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getBody() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetBody(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getBody()'); - - $fileName = dataDir('/assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $request = new Request('GET', null, $stream); - - $I->openFile($fileName); - - $I->assertStringEqualsFile($fileName, $request->getBody()); - } - - /** - * Tests Phalcon\Http\Message\Request :: getBody() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetBodyEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getBody() - empty'); - - $request = new Request(); - - $I->assertInstanceOf( - Stream::class, - $request->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetHeaderCest.php b/tests/unit/Http/Message/Request/GetHeaderCest.php deleted file mode 100644 index 5112cf9dd9e..00000000000 --- a/tests/unit/Http/Message/Request/GetHeaderCest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class GetHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeader()'); - - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - - $request = new Request( - 'GET', - null, - 'php://memory', - $data - ); - - $expected = ['text/html']; - - $I->assertEquals( - $expected, - $request->getHeader('accept') - ); - - - $I->assertEquals( - $expected, - $request->getHeader('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeaderEmptyHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeader() - empty headers'); - - $request = new Request(); - - $I->assertEquals( - [], - $request->getHeader('empty') - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetHeaderLineCest.php b/tests/unit/Http/Message/Request/GetHeaderLineCest.php deleted file mode 100644 index e0666e13bf2..00000000000 --- a/tests/unit/Http/Message/Request/GetHeaderLineCest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class GetHeaderLineCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getHeaderLine() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeaderLine(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeaderLine()'); - - $data = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - - $request = new Request( - 'GET', - null, - 'php://memory', - $data - ); - - $expected = 'text/html,text/json'; - - $I->assertEquals( - $expected, - $request->getHeaderLine('accept') - ); - - $I->assertEquals( - $expected, - $request->getHeaderLine('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getHeaderLine() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeaderLineEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeaderLine() - empty'); - - $request = new Request(); - - $I->assertEquals( - '', - $request->getHeaderLine('accept') - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetHeadersCest.php b/tests/unit/Http/Message/Request/GetHeadersCest.php deleted file mode 100644 index 91bbdfa02d7..00000000000 --- a/tests/unit/Http/Message/Request/GetHeadersCest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Support\Collection; -use Phalcon\Http\Message\Request; -use UnitTester; - -class GetHeadersCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getHeaders() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeaders()'); - - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - - $request = new Request( - 'GET', - null, - 'php://memory', - $data - ); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getHeaders() - collection - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeadersCollection(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeaders()'); - - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - - $headers = new Collection($data); - - $request = new Request( - 'GET', - null, - 'php://memory', - $headers - ); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getHeaders() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetHeadersEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getHeaders() - empty'); - - $request = new Request(); - - $I->assertEquals( - [], - $request->getHeaders() - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetMethodCest.php b/tests/unit/Http/Message/Request/GetMethodCest.php deleted file mode 100644 index 5f77ed94171..00000000000 --- a/tests/unit/Http/Message/Request/GetMethodCest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use InvalidArgumentException; -use Phalcon\Http\Message\Request; -use UnitTester; - -class GetMethodCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getMethod() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetMethod(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getMethod()'); - - $request = new Request('POST'); - - $I->assertEquals( - 'POST', - $request->getMethod() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getMethod() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetMethodEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getMethod() - empty'); - - $request = new Request(); - - $I->assertEquals( - 'GET', - $request->getMethod() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: getMethod() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetMethodWxception(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getMethod() - exception'); - - $I->expectThrowable( - new InvalidArgumentException('Invalid or unsupported method UNKNOWN'), - function () { - $request = new Request('UNKNOWN'); - } - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetProtocolVersionCest.php b/tests/unit/Http/Message/Request/GetProtocolVersionCest.php deleted file mode 100644 index 88257723231..00000000000 --- a/tests/unit/Http/Message/Request/GetProtocolVersionCest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class GetProtocolVersionCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getProtocolVersion() - * - * @author Phalcon Team - * @since 2019-03-05 - */ - public function httpMessageRequestGetProtocolVersion(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getProtocolVersion()'); - - $request = new Request(); - - $I->assertEquals( - '1.1', - $request->getProtocolVersion() - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetRequestTargetCest.php b/tests/unit/Http/Message/Request/GetRequestTargetCest.php deleted file mode 100644 index 86a6af4c4e5..00000000000 --- a/tests/unit/Http/Message/Request/GetRequestTargetCest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetRequestTargetCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getRequestTarget() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetRequestTarget(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getRequestTarget()'); - - $uri = new Uri('https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'); - $request = new Request('GET', $uri); - - $I->assertEquals( - '/action?param=value', - $request->getRequestTarget() - ); - } -} diff --git a/tests/unit/Http/Message/Request/GetUriCest.php b/tests/unit/Http/Message/Request/GetUriCest.php deleted file mode 100644 index 3d5e3d44509..00000000000 --- a/tests/unit/Http/Message/Request/GetUriCest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetUriCest -{ - /** - * Tests Phalcon\Http\Message\Request :: getUri() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestGetUri(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - getUri()'); - - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - - $uri = new Uri($query); - - $request = new Request('GET', $uri); - - $I->assertEquals( - $uri, - $request->getUri() - ); - } -} diff --git a/tests/unit/Http/Message/Request/HasHeaderCest.php b/tests/unit/Http/Message/Request/HasHeaderCest.php deleted file mode 100644 index 1921f70670d..00000000000 --- a/tests/unit/Http/Message/Request/HasHeaderCest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class HasHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Request :: hasHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestHasHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - hasHeader()'); - - $data = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - - $request = new Request('GET', null, 'php://input', $data); - - $I->assertTrue( - $request->hasHeader('accept') - ); - - $I->assertTrue( - $request->hasHeader('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: hasHeader() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestHasHeaderEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - hasHeader() - empty'); - - $request = new Request(); - - $I->assertFalse( - $request->hasHeader('empty') - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithAddedHeaderCest.php b/tests/unit/Http/Message/Request/WithAddedHeaderCest.php deleted file mode 100644 index 210cfd29709..00000000000 --- a/tests/unit/Http/Message/Request/WithAddedHeaderCest.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithAddedHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withAddedHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithAddedHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withAddedHeader()'); - - $data = [ - 'Accept' => ['text/html'], - ]; - - $request = new Request('GET', null, 'php://memory', $data); - - $newInstance = $request->withAddedHeader( - 'Cache-Control', - [ - 'max-age=0', - ] - ); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $newInstance->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withAddedHeader() - string value - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithAddedHeaderStringValue(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withAddedHeader() - string value'); - - $data = [ - 'Accept' => ['text/html'], - ]; - - $request = new Request('GET', null, 'php://memory', $data); - - $newInstance = $request->withAddedHeader( - 'Cache-Control', - 'max-age=0' - ); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $newInstance->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withAddedHeader() - empty value - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithAddedHeaderEmptyValue(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withAddedHeader() - empty value'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid header value: must be a string or ' . - 'array of strings; cannot be an empty array' - ), - function () { - $request = new Request(); - - $newInstance = $request->withAddedHeader( - 'Cache-Control', - [] - ); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withAddedHeader() - merge - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithAddedHeaderMerge(UnitTester $I) - { - $data = [ - 'Accept' => ['text/html'], - ]; - - $request = new Request('GET', null, 'php://input', $data); - - $newInstance = $request->withAddedHeader( - 'Accept', - [ - 'text/json', - ] - ); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => [ - 'text/html', - ], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - - $expected = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - - $I->assertEquals( - $expected, - $newInstance->getHeaders() - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithBodyCest.php b/tests/unit/Http/Message/Request/WithBodyCest.php deleted file mode 100644 index 155dded0d52..00000000000 --- a/tests/unit/Http/Message/Request/WithBodyCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class WithBodyCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withBody() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithBody(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Request - withBody()'); - - $fileName = dataDir('/assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $request = new Request(); - - $newInstance = $request->withBody($stream); - - $I->assertNotEquals($request, $newInstance); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $newInstance->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithHeaderCest.php b/tests/unit/Http/Message/Request/WithHeaderCest.php deleted file mode 100644 index 9724e2f1a6e..00000000000 --- a/tests/unit/Http/Message/Request/WithHeaderCest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Codeception\Example; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withHeader()'); - - $data = [ - 'Accept' => ['text/html'], - ]; - - $request = new Request('GET', null, 'php://memory', $data); - - $newInstance = $request->withHeader( - 'Cache-Control', - [ - 'max-age=0', - ] - ); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $newInstance->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withHeader() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithHeaderException(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withHeader() value'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid header name Cache Control' - ), - function () { - $request = new Request(); - - $newInstance = $request->withHeader( - 'Cache Control', - [ - 'max-age=0', - ] - ); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withHeader() - exception value - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithHeaderExceptionValue(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Request - withHeader() - exception value ' . $example[0]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid header value' - ), - function () use ($example) { - $request = new Request(); - - $newInstance = $request->withHeader( - 'Cache-Control', - [ - $example[1], - ] - ); - } - ); - } - - - private function getExamples(): array - { - return [ - ['not numeric or string', true], - ['invalid\r\n', "some \r\n"], - ['invalid\r', "some \r"], - ['invalid\n', "some \n"], - ]; - } -} diff --git a/tests/unit/Http/Message/Request/WithMethodCest.php b/tests/unit/Http/Message/Request/WithMethodCest.php deleted file mode 100644 index 2dba1853661..00000000000 --- a/tests/unit/Http/Message/Request/WithMethodCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithMethodCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withMethod() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithMethod(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withMethod()'); - - $request = new Request(); - - $newInstance = $request->withMethod('POST'); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - 'GET', - $request->getMethod() - ); - - $I->assertEquals( - 'POST', - $newInstance->getMethod() - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithProtocolVersionCest.php b/tests/unit/Http/Message/Request/WithProtocolVersionCest.php deleted file mode 100644 index 838a1db49a7..00000000000 --- a/tests/unit/Http/Message/Request/WithProtocolVersionCest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithProtocolVersionCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withProtocolVersion() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithProtocolVersion(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withProtocolVersion()'); - - $request = new Request(); - - $newInstance = $request->withProtocolVersion('2.0'); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - '1.1', - $request->getProtocolVersion() - ); - - $I->assertEquals( - '2.0', - $newInstance->getProtocolVersion() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withProtocolVersion() - - * unsupported protocol - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithProtocolVersionEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withProtocolVersion() - unsupported protocol'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid protocol value' - ), - function () { - $request = new Request(); - - $newInstance = $request->withProtocolVersion(''); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withProtocolVersion() - empty - * protocol - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithProtocolVersionUnsupported(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withProtocolVersion() - empty protocol'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Unsupported protocol 4.0' - ), - function () { - $request = new Request(); - - $newInstance = $request->withProtocolVersion('4.0'); - } - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithRequestTargetCest.php b/tests/unit/Http/Message/Request/WithRequestTargetCest.php deleted file mode 100644 index 692ced07628..00000000000 --- a/tests/unit/Http/Message/Request/WithRequestTargetCest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithRequestTargetCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withRequestTarget() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithRequestTarget(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withRequestTarget()'); - - $request = new Request(); - - $newInstance = $request->withRequestTarget('/test'); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - '/', - $request->getRequestTarget() - ); - - $I->assertEquals( - '/test', - $newInstance->getRequestTarget() - ); - } - - /** - * Tests Phalcon\Http\Message\Request :: withRequestTarget() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithRequestTargetException(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withRequestTarget() - exception'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid request target: cannot contain whitespace' - ), - function () { - $request = new Request(); - - $newInstance = $request->withRequestTarget('/te st'); - } - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithUriCest.php b/tests/unit/Http/Message/Request/WithUriCest.php deleted file mode 100644 index 6ca47ac93b4..00000000000 --- a/tests/unit/Http/Message/Request/WithUriCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithUriCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withUri() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithUri(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withUri()'); - - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - - $uri = new Uri($query); - - $request = new Request(); - - $newInstance = $request->withUri($uri); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - $uri, - $newInstance->getUri() - ); - } -} diff --git a/tests/unit/Http/Message/Request/WithoutHeaderCest.php b/tests/unit/Http/Message/Request/WithoutHeaderCest.php deleted file mode 100644 index 7f03df714df..00000000000 --- a/tests/unit/Http/Message/Request/WithoutHeaderCest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Request; - -use Phalcon\Http\Message\Request; -use UnitTester; - -class WithoutHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Request :: withoutHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestWithoutHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - withoutHeader()'); - - $data = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $request = new Request('GET', null, 'php://memory', $data); - - $newInstance = $request->withoutHeader('Accept'); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $request->getHeaders() - ); - - $expected = [ - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $newInstance->getHeaders() - ); - } -} diff --git a/tests/unit/Http/Message/RequestFactory/ConstructCest.php b/tests/unit/Http/Message/RequestFactory/ConstructCest.php deleted file mode 100644 index 9db8f601155..00000000000 --- a/tests/unit/Http/Message/RequestFactory/ConstructCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\RequestFactory; - -use Phalcon\Http\Message\Request; -use Psr\Http\Message\RequestInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Request :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageRequestConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Request - __construct()'); - - $request = new Request(); - - $I->assertInstanceOf( - RequestInterface::class, - $request - ); - } -} diff --git a/tests/unit/Http/Message/RequestFactory/CreateRequestCest.php b/tests/unit/Http/Message/RequestFactory/CreateRequestCest.php deleted file mode 100644 index 128f57e79c4..00000000000 --- a/tests/unit/Http/Message/RequestFactory/CreateRequestCest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\RequestFactory; - -use Phalcon\Http\Message\RequestFactory; -use Psr\Http\Message\RequestInterface; -use UnitTester; - -class CreateRequestCest -{ - /** - * Tests Phalcon\Http\Message\RequestFactory :: createRequest() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageRequestFactoryCreateRequest(UnitTester $I) - { - $I->wantToTest('Http\Message\RequestFactory - createRequest()'); - - $factory = new RequestFactory(); - - $request = $factory->createRequest('GET', 'https://dev.phalcon.ld'); - - $I->assertInstanceOf( - RequestInterface::class, - $request - ); - } -} diff --git a/tests/unit/Http/Message/Response/ConstructCest.php b/tests/unit/Http/Message/Response/ConstructCest.php deleted file mode 100644 index f1ebba2f57c..00000000000 --- a/tests/unit/Http/Message/Response/ConstructCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use Psr\Http\Message\ResponseInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Response :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageResponseConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - __construct()'); - - $response = new Response(); - - $I->assertInstanceOf( - ResponseInterface::class, - $response - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetBodyCest.php b/tests/unit/Http/Message/Response/GetBodyCest.php deleted file mode 100644 index c8ccdb29e9e..00000000000 --- a/tests/unit/Http/Message/Response/GetBodyCest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class GetBodyCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getBody() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetBody(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Response - getBody()'); - - $fileName = dataDir('/assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $response = new Response($stream); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $response->getBody() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getBody() - empty - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetBodyEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getBody() - empty'); - - $response = new Response(); - - $I->assertInstanceOf( - Stream::class, - $response->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetHeaderCest.php b/tests/unit/Http/Message/Response/GetHeaderCest.php deleted file mode 100644 index 6fd62939ea2..00000000000 --- a/tests/unit/Http/Message/Response/GetHeaderCest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeader()'); - - $data = [ - 'cache-control' => ['max-age=0'], - 'accept' => ['text/html'], - ]; - - $response = new Response('php://memory', 200, $data); - - $expected = ['text/html']; - - $I->assertEquals( - $expected, - $response->getHeader('accept') - ); - - - $I->assertEquals( - $expected, - $response->getHeader('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeaderEmptyHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeader() - empty headers'); - - $response = new Response(); - - $I->assertEquals( - [], - $response->getHeader('empty') - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetHeaderLineCest.php b/tests/unit/Http/Message/Response/GetHeaderLineCest.php deleted file mode 100644 index 021c04eb8ae..00000000000 --- a/tests/unit/Http/Message/Response/GetHeaderLineCest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetHeaderLineCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getHeaderLine() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeaderLine(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeaderLine()'); - - $data = [ - 'accept' => [ - 'text/html', - 'text/json', - ], - ]; - - $response = new Response('php://memory', 200, $data); - - $expected = 'text/html,text/json'; - - $I->assertEquals( - $expected, - $response->getHeaderLine('accept') - ); - - $I->assertEquals( - $expected, - $response->getHeaderLine('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getHeaderLine() - empty - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeaderLineEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeaderLine() - empty'); - - $response = new Response(); - - $I->assertEquals( - '', - $response->getHeaderLine('accept') - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetHeadersCest.php b/tests/unit/Http/Message/Response/GetHeadersCest.php deleted file mode 100644 index 98e3ea0dddd..00000000000 --- a/tests/unit/Http/Message/Response/GetHeadersCest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetHeadersCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getHeaders() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeaders()'); - - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - - $response = new Response('php://memory', 200, $data); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - - $I->assertEquals( - $expected, - $response->getHeaders() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getHeaders() - empty - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetHeadersEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getHeaders() - empty'); - - $response = new Response(); - - $I->assertEquals( - [], - $response->getHeaders() - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetProtocolVersionCest.php b/tests/unit/Http/Message/Response/GetProtocolVersionCest.php deleted file mode 100644 index 048a14cda85..00000000000 --- a/tests/unit/Http/Message/Response/GetProtocolVersionCest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetProtocolVersionCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getProtocolVersion() - * - * @author Phalcon Team - * @since 2019-03-05 - */ - public function httpMessageResponseGetProtocolVersion(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getProtocolVersion()'); - - $response = new Response(); - - $I->assertEquals( - '1.1', - $response->getProtocolVersion() - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetReasonPhraseCest.php b/tests/unit/Http/Message/Response/GetReasonPhraseCest.php deleted file mode 100644 index eeda62736f6..00000000000 --- a/tests/unit/Http/Message/Response/GetReasonPhraseCest.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetReasonPhraseCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getReasonPhrase() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetReasonPhrase(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getReasonPhrase()'); - - $response = new Response(); - - $I->assertEquals( - 'OK', - $response->getReasonPhrase() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getReasonPhrase() - other port - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetReasonPhraseOtherPort(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getReasonPhrase() - other port'); - - $response = new Response('php://memory', 420); - - $I->assertEquals( - 'Method Failure', - $response->getReasonPhrase() - ); - } -} diff --git a/tests/unit/Http/Message/Response/GetStatusCodeCest.php b/tests/unit/Http/Message/Response/GetStatusCodeCest.php deleted file mode 100644 index 3565ce21206..00000000000 --- a/tests/unit/Http/Message/Response/GetStatusCodeCest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use InvalidArgumentException; -use Phalcon\Http\Message\Response; -use UnitTester; - -class GetStatusCodeCest -{ - /** - * Tests Phalcon\Http\Message\Response :: getStatusCode() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetStatusCode(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getStatusCode()'); - - $response = new Response(); - - $I->assertEquals( - 200, - $response->getStatusCode() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: getStatusCode() - exception - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseGetStatusCodeException(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - getStatusCode() - exception'); - - $I->expectThrowable( - new InvalidArgumentException( - "Invalid status code '847', (allowed values 100-599)" - ), - function () { - $response = new Response('php://memory', 847); - } - ); - } -} diff --git a/tests/unit/Http/Message/Response/HasHeaderCest.php b/tests/unit/Http/Message/Response/HasHeaderCest.php deleted file mode 100644 index c9713a120da..00000000000 --- a/tests/unit/Http/Message/Response/HasHeaderCest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class HasHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Response :: hasHeader() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseHasHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - hasHeader()'); - - $data = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - - $response = new Response('php://memory', 200, $data); - - $I->assertTrue( - $response->hasHeader('accept') - ); - - $I->assertTrue( - $response->hasHeader('aCCepT') - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: hasHeader() - empty - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseHasHeaderEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - hasHeader() - empty'); - - $response = new Response(); - - $I->assertFalse( - $response->hasHeader('empty') - ); - } -} diff --git a/tests/unit/Http/Message/Response/WithAddedHeaderCest.php b/tests/unit/Http/Message/Response/WithAddedHeaderCest.php deleted file mode 100644 index af1b54a3731..00000000000 --- a/tests/unit/Http/Message/Response/WithAddedHeaderCest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class WithAddedHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withAddedHeader() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithAddedHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withAddedHeader()'); - $data = [ - 'Accept' => ['text/html'], - ]; - $response = new Response('php://memory', 200, $data); - $newInstance = $response->withAddedHeader('Cache-Control', ['max-age=0']); - - $I->assertNotEquals($response, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $response->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Response :: withAddedHeader() - merge - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithAddedHeaderMerge(UnitTester $I) - { - $data = [ - 'Accept' => ['text/html'], - ]; - $response = new Response('php://memory', 200, $data); - $newInstance = $response->withAddedHeader('Accept', ['text/json']); - - $I->assertNotEquals($response, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $response->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html', 'text/json'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/Response/WithBodyCest.php b/tests/unit/Http/Message/Response/WithBodyCest.php deleted file mode 100644 index ef5a827fffe..00000000000 --- a/tests/unit/Http/Message/Response/WithBodyCest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class WithBodyCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withBody() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithBody(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Response - withBody()'); - $fileName = dataDir('/assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - $response = new Response(); - - $newInstance = $response->withBody($stream); - - $I->assertNotEquals($response, $newInstance); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $newInstance->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/Response/WithHeaderCest.php b/tests/unit/Http/Message/Response/WithHeaderCest.php deleted file mode 100644 index 731653668f8..00000000000 --- a/tests/unit/Http/Message/Response/WithHeaderCest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class WithHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withHeader() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withHeader()'); - $data = [ - 'Accept' => ['text/html'], - ]; - $response = new Response('php://memory', 200, $data); - $newInstance = $response->withHeader('Cache-Control', ['max-age=0']); - - $I->assertNotEquals($response, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $response->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/Response/WithProtocolVersionCest.php b/tests/unit/Http/Message/Response/WithProtocolVersionCest.php deleted file mode 100644 index 2004b709e00..00000000000 --- a/tests/unit/Http/Message/Response/WithProtocolVersionCest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use InvalidArgumentException; -use Phalcon\Http\Message\Response; -use UnitTester; - -class WithProtocolVersionCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withProtocolVersion() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithProtocolVersion(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withProtocolVersion()'); - $response = new Response(); - $newInstance = $response->withProtocolVersion('2.0'); - - $I->assertNotEquals($response, $newInstance); - - $expected = '1.1'; - $actual = $response->getProtocolVersion(); - $I->assertEquals($expected, $actual); - - $expected = '2.0'; - $actual = $newInstance->getProtocolVersion(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Response :: withProtocolVersion() - exception - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithProtocolVersionException(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withProtocolVersion() - exception'); - $I->expectThrowable( - new InvalidArgumentException('Unsupported protocol 1.2'), - function () { - $response = new Response(); - $response->withProtocolVersion('1.2'); - } - ); - } -} diff --git a/tests/unit/Http/Message/Response/WithStatusCest.php b/tests/unit/Http/Message/Response/WithStatusCest.php deleted file mode 100644 index e480ee96ba0..00000000000 --- a/tests/unit/Http/Message/Response/WithStatusCest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Response; -use UnitTester; - -class WithStatusCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withStatus() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithStatus(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withStatus()'); - - $code = 420; - $response = new Response(); - $newInstance = $response->withStatus($code); - - $I->assertNotEquals($response, $newInstance); - - $I->assertEquals( - $code, - $newInstance->getStatusCode() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: withStatus() - other reason - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithStatusOtherReason(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withStatus() - other reason'); - - $code = 420; - $reason = 'Phalcon Response'; - $response = new Response(); - $newInstance = $response->withStatus($code, $reason); - - $I->assertNotEquals($response, $newInstance); - - $I->assertEquals( - $code, - $newInstance->getStatusCode() - ); - - $I->assertEquals( - $reason, - $newInstance->getReasonPhrase() - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: withStatus() - exception invalid - * code - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithStatusExceptionInvalidCode(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withStatus() - exception invalid code'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid status code; it must be an integer or string' - ), - function () { - $response = new Response(); - $newInstance = $response->withStatus(true, ''); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Response :: withStatus() - exception invalid - * phrase - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithStatusExceptionInvalidPhrase(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withStatus() - exception invalid phrase'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid response reason' - ), - function () { - $response = new Response(); - $newInstance = $response->withStatus(200, true); - } - ); - } -} diff --git a/tests/unit/Http/Message/Response/WithoutHeaderCest.php b/tests/unit/Http/Message/Response/WithoutHeaderCest.php deleted file mode 100644 index 4a50c37d538..00000000000 --- a/tests/unit/Http/Message/Response/WithoutHeaderCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Response; - -use Phalcon\Http\Message\Response; -use UnitTester; - -class WithoutHeaderCest -{ - /** - * Tests Phalcon\Http\Message\Response :: withoutHeader() - * - * @author Phalcon Team - * @since 2019-03-09 - */ - public function httpMessageResponseWithoutHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - withoutHeader()'); - $data = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $response = new Response('php://memory', 200, $data); - $newInstance = $response->withoutHeader('Accept'); - - $I->assertNotEquals($response, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $response->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ResponseFactory/ConstructCest.php b/tests/unit/Http/Message/ResponseFactory/ConstructCest.php deleted file mode 100644 index 016899a57cf..00000000000 --- a/tests/unit/Http/Message/ResponseFactory/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ResponseFactory; - -use Phalcon\Http\Message\Response; -use Psr\Http\Message\ResponseInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Response :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageResponseConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Response - __construct()'); - $response = new Response(); - $class = ResponseInterface::class; - $I->assertInstanceOf($class, $response); - } -} diff --git a/tests/unit/Http/Message/ResponseFactory/CreateResponseCest.php b/tests/unit/Http/Message/ResponseFactory/CreateResponseCest.php deleted file mode 100644 index c8d03f18de7..00000000000 --- a/tests/unit/Http/Message/ResponseFactory/CreateResponseCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ResponseFactory; - -use Phalcon\Http\Message\ResponseFactory; -use Psr\Http\Message\ResponseInterface; -use UnitTester; - -class CreateResponseCest -{ - /** - * Tests Phalcon\Http\Message\ResponseFactory :: createResponse() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageResponseFactoryCreateResponse(UnitTester $I) - { - $I->wantToTest('Http\Message\ResponseFactory - createResponse()'); - $factory = new ResponseFactory(); - $response = $factory->createResponse(); - $class = ResponseInterface::class; - $I->assertInstanceOf($class, $response); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/ConstructCest.php b/tests/unit/Http/Message/ServerRequest/ConstructCest.php deleted file mode 100644 index 7e8455ea34e..00000000000 --- a/tests/unit/Http/Message/ServerRequest/ConstructCest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\Uri; -use Psr\Http\Message\ServerRequestInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageServerRequestConstructCest(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - __construct()'); - - $request = new ServerRequest(); - - $I->assertInstanceOf( - ServerRequestInterface::class, - $request - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: __construct() - * - * @author cq-z <64899484@qq.com> - * @since 2019-06-02 - */ - public function httpMessageServerRequestConstructIssues14151(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - __construct()'); - - $request = new ServerRequest( - 'GET', - new Uri(), - [], - 'php://input', - [ - 'host' => ['127.0.0.1'], - ] - ); - - $expected = ['127.0.0.1']; - - $I->assertEquals( - $expected, - $request->getHeader('host') - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetAttributeCest.php b/tests/unit/Http/Message/ServerRequest/GetAttributeCest.php deleted file mode 100644 index 0e165ac27e3..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetAttributeCest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetAttributeCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getAttribute() - * - * @author Phalcon Team - * @since 2019-02-11 - */ - public function httpMessageServerRequestGetAttribute(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getAttribute()'); - - $request = (new ServerRequest()) - ->withAttribute('one', 'two') - ->withAttribute('three', 'four') - ; - - $I->assertEquals( - 'two', - $request->getAttribute('one') - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getAttribute() - unknown - * - * @author Phalcon Team - * @since 2019-02-11 - */ - public function httpMessageServerRequestGetAttributeUnknown(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getAttribute() - unknown'); - - $request = (new ServerRequest()) - ->withAttribute('one', 'two') - ->withAttribute('three', 'four') - ; - - $I->assertEquals( - '', - $request->getAttribute('unknown') - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetAttributesCest.php b/tests/unit/Http/Message/ServerRequest/GetAttributesCest.php deleted file mode 100644 index 44d3689d9e9..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetAttributesCest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetAttributesCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getAttributes() - * - * @author Phalcon Team - * @since 2019-02-11 - */ - public function httpMessageServerRequestGetAttributes(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getAttributes()'); - - $request = (new ServerRequest()) - ->withAttribute('one', 'two') - ->withAttribute('three', 'four') - ; - - $expected = [ - 'one' => 'two', - 'three' => 'four', - ]; - - $I->assertEquals( - $expected, - $request->getAttributes() - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getAttributes() - empty - * - * @author Phalcon Team - * @since 2019-02-11 - */ - public function httpMessageServerRequestGetAttributesEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getAttributes() - empty'); - - $request = new ServerRequest(); - - $I->assertEmpty( - $request->getAttributes() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetBodyCest.php b/tests/unit/Http/Message/ServerRequest/GetBodyCest.php deleted file mode 100644 index 66768044170..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetBodyCest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class GetBodyCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getBody() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetBody(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\ServerRequest - getBody()'); - - $fileName = dataDir('/assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - $request = new ServerRequest('GET', null, [], $stream); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $request->getBody() - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getBody() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetBodyEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getBody() - empty'); - - $request = new ServerRequest(); - - $I->assertInstanceOf( - Stream\Input::class, - $request->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetCookieParamsCest.php b/tests/unit/Http/Message/ServerRequest/GetCookieParamsCest.php deleted file mode 100644 index 07091dfb2c2..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetCookieParamsCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetCookieParamsCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getCookieParams() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetCookieParams(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getCookieParams()'); - $cookies = ['one' => 'two']; - $request = new ServerRequest('GET', null, [], 'php://input', [], $cookies); - - $expected = $cookies; - $actual = $request->getCookieParams(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getCookieParams() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetCookieParamsEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getCookieParams() - empty'); - $request = new ServerRequest(); - - $actual = $request->getCookieParams(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetHeaderCest.php b/tests/unit/Http/Message/ServerRequest/GetHeaderCest.php deleted file mode 100644 index 00b56d9d608..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetHeaderCest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetHeaderCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeader()'); - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - - $expected = ['text/html']; - $actual = $request->getHeader('accept'); - $I->assertEquals($expected, $actual); - - $actual = $request->getHeader('aCCepT'); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeader() - empty headers - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeaderEmptyHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeader() - empty headers'); - $request = new ServerRequest(); - - $expected = []; - $actual = $request->getHeader('empty'); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetHeaderLineCest.php b/tests/unit/Http/Message/ServerRequest/GetHeaderLineCest.php deleted file mode 100644 index bbc5aaf6e67..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetHeaderLineCest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetHeaderLineCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeaderLine() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeaderLine(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeaderLine()'); - $data = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - - $expected = 'text/html,text/json'; - $actual = $request->getHeaderLine('accept'); - $I->assertEquals($expected, $actual); - - $actual = $request->getHeaderLine('aCCepT'); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeaderLine() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeaderLineEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeaderLine() - empty'); - $request = new ServerRequest(); - - $expected = ''; - $actual = $request->getHeaderLine('accept'); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetHeadersCest.php b/tests/unit/Http/Message/ServerRequest/GetHeadersCest.php deleted file mode 100644 index 12915ce9f80..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetHeadersCest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Support\Collection; -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetHeadersCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeaders() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeaders(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeaders()'); - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeaders() - collection - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeadersCollection(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeaders() - collection'); - $data = [ - 'Cache-Control' => ['max-age=0'], - 'Accept' => ['text/html'], - ]; - $headers = new Collection($data); - $request = new ServerRequest('GET', null, [], 'php://input', $headers); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getHeaders() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetHeadersEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getHeaders() - empty'); - $request = new ServerRequest(); - - $expected = []; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetMethodCest.php b/tests/unit/Http/Message/ServerRequest/GetMethodCest.php deleted file mode 100644 index e2f0eba44cb..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetMethodCest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use InvalidArgumentException; -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetMethodCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getMethod() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetMethod(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getMethod()'); - $request = new ServerRequest('POST'); - - $expected = 'POST'; - $actual = $request->getMethod(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getMethod() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetMethodEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getMethod() - empty'); - $request = new ServerRequest(); - - $expected = 'GET'; - $actual = $request->getMethod(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getMethod() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetMethodWxception(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getMethod() - exception'); - $I->expectThrowable( - new InvalidArgumentException('Invalid or unsupported method UNKNOWN'), - function () { - $request = new ServerRequest('UNKNOWN'); - } - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetParsedBodyCest.php b/tests/unit/Http/Message/ServerRequest/GetParsedBodyCest.php deleted file mode 100644 index 479fc0eeea0..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetParsedBodyCest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetParsedBodyCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getParsedBody() - * - * @author Phalcon Team - * @since 2019-03-05 - */ - public function httpMessageServerRequestGetParsedBody(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getParsedBody()'); - $request = new ServerRequest( - 'GET', - null, - [], - 'php://input', - [], - [], - [], - [], - 'something' - ); - - $expected = 'something'; - $actual = $request->getParsedBody(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getParsedBody() - empty - * - * @author Phalcon Team - * @since 2019-03-05 - */ - public function httpMessageServerRequestGetParsedBodyEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getParsedBody() - empty'); - $request = new ServerRequest(); - - $expected = ''; - $actual = $request->getParsedBody(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetProtocolVersionCest.php b/tests/unit/Http/Message/ServerRequest/GetProtocolVersionCest.php deleted file mode 100644 index f3e81d2e54a..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetProtocolVersionCest.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetProtocolVersionCest -{ -// /** -// * Tests Phalcon\Http\Message\ServerRequest :: getProtocolVersion() -// * -// * @author Phalcon Team -// * @since 2019-03-05 -// */ -// public function httpMessageServerRequestGetProtocolVersion(UnitTester $I) -// { -// $I->wantToTest('Http\Message\ServerRequest - getProtocolVersion()'); -// $request = new ServerRequest( -// 'GET', -// null, -// [], -// 'php://input', -// [], -// [], -// [], -// [], -// null, -// '2.0' -// ); -// -// $expected = '2.0'; -// $actual = $request->getProtocolVersion(); -// $I->assertEquals($expected, $actual); -// } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getProtocolVersion() - empty - * - * @author Phalcon Team - * @since 2019-03-05 - */ - public function httpMessageServerRequestGetProtocolVersionEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getProtocolVersion() - empty'); - $request = new ServerRequest(); - - $expected = '1.1'; - $actual = $request->getProtocolVersion(); - $I->assertEquals($expected, $actual); - } -// -// /** -// * Tests Phalcon\Http\Message\ServerRequest :: getProtocolVersion() - -// * exception -// * -// * @author Phalcon Team -// * @since 2019-03-05 -// */ -// public function httpMessageServerRequestGetProtocolVersionException(UnitTester $I) -// { -// $I->wantToTest('Http\Message\ServerRequest - getProtocolVersion() - exception'); -// $I->expectThrowable( -// new InvalidArgumentException('Unsupported protocol 1.2'), -// function () { -// $request = new ServerRequest( -// 'GET', -// null, -// [], -// 'php://input', -// [], -// [], -// [], -// [], -// null, -// '1.2' -// ); -// } -// ); -// } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetQueryParamsCest.php b/tests/unit/Http/Message/ServerRequest/GetQueryParamsCest.php deleted file mode 100644 index 9a017420337..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetQueryParamsCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetQueryParamsCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getQueryParams() - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestGetQueryParams(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getQueryParams()'); - $params = ['one' => 'two']; - $request = new ServerRequest('GET', null, [], 'php://input', [], [], $params); - - $expected = $params; - $actual = $request->getQueryParams(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getQueryParams() - empty - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestGetQueryParamsEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getQueryParams() - empty'); - $request = new ServerRequest(); - - $actual = $request->getQueryParams(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetRequestTargetCest.php b/tests/unit/Http/Message/ServerRequest/GetRequestTargetCest.php deleted file mode 100644 index 7a1a242fba5..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetRequestTargetCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetRequestTargetCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getRequestTarget() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetRequestTarget(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getRequestTarget()'); - $request = new ServerRequest(); - - $expected = '/'; - $actual = $request->getRequestTarget(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetServerParamsCest.php b/tests/unit/Http/Message/ServerRequest/GetServerParamsCest.php deleted file mode 100644 index c69b73cbd0a..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetServerParamsCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class GetServerParamsCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getServerParams() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetServerParams(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getServerParams()'); - $params = ['one' => 'two']; - $request = new ServerRequest('GET', null, $params); - - $expected = $params; - $actual = $request->getServerParams(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getServerParams() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetServerParamsEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getServerParams() - empty'); - $request = new ServerRequest(); - - $actual = $request->getServerParams(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetUploadedFilesCest.php b/tests/unit/Http/Message/ServerRequest/GetUploadedFilesCest.php deleted file mode 100644 index 7c9e196581d..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetUploadedFilesCest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use InvalidArgumentException; -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class GetUploadedFilesCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getUploadedFiles() - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestGetUploadedFiles(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getUploadedFiles()'); - $files = [ - new UploadedFile('php://memory', 0), - new UploadedFile('php://memory', 0), - ]; - $request = new ServerRequest( - 'GET', - null, - [], - 'php://input', - [], - [], - [], - $files - ); - - $expected = $files; - $actual = $request->getUploadedFiles(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getUploadedFiles() - empty - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestGetUploadedFilesEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getUploadedFiles() - empty'); - $request = new ServerRequest(); - - $actual = $request->getUploadedFiles(); - $I->assertEmpty($actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: getUploadedFiles() - - * exception - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestGetUploadedFilesException(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getUploadedFiles() - exception'); - $I->expectThrowable( - new InvalidArgumentException('Invalid uploaded file'), - function () use ($I) { - $files = [ - 'something-else', - ]; - $request = new ServerRequest( - 'GET', - null, - [], - 'php://input', - [], - [], - [], - $files - ); - - $actual = $request->getUploadedFiles(); - } - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/GetUriCest.php b/tests/unit/Http/Message/ServerRequest/GetUriCest.php deleted file mode 100644 index 97bf2379066..00000000000 --- a/tests/unit/Http/Message/ServerRequest/GetUriCest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetUriCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: getUri() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestGetUri(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - getUri()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - $request = new ServerRequest('GET', $uri); - - $expected = $uri; - $actual = $request->getUri(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/HasHeaderCest.php b/tests/unit/Http/Message/ServerRequest/HasHeaderCest.php deleted file mode 100644 index 2b2f1bdce84..00000000000 --- a/tests/unit/Http/Message/ServerRequest/HasHeaderCest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class HasHeaderCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: hasHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestHasHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - hasHeader()'); - $data = [ - 'Accept' => [ - 'text/html', - 'text/json', - ], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - - $actual = $request->hasHeader('accept'); - $I->assertTrue($actual); - - $actual = $request->hasHeader('aCCepT'); - $I->assertTrue($actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: hasHeader() - empty - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestHasHeaderEmpty(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - hasHeader() - empty'); - $request = new ServerRequest(); - - $actual = $request->hasHeader('empty'); - $I->assertFalse($actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithAddedHeaderCest.php b/tests/unit/Http/Message/ServerRequest/WithAddedHeaderCest.php deleted file mode 100644 index 869ed06034c..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithAddedHeaderCest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithAddedHeaderCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withAddedHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithAddedHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withAddedHeader()'); - $data = [ - 'Accept' => ['text/html'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - $newInstance = $request->withAddedHeader('Cache-Control', ['max-age=0']); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: withAddedHeader() - merge - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithAddedHeaderMerge(UnitTester $I) - { - $data = [ - 'Accept' => ['text/html'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - $newInstance = $request->withAddedHeader('Accept', ['text/json']); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html', 'text/json'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithAttributeCest.php b/tests/unit/Http/Message/ServerRequest/WithAttributeCest.php deleted file mode 100644 index 7069d625465..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithAttributeCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithAttributeCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withAttribute() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithAttribute(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withAttribute()'); - $request = new ServerRequest(); - $newInstance = $request->withAttribute('one', 'two'); - - $I->assertNotEquals($request, $newInstance); - $I->assertEquals('two', $newInstance->getAttribute('one')); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithBodyCest.php b/tests/unit/Http/Message/ServerRequest/WithBodyCest.php deleted file mode 100644 index 33b1de9ff92..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithBodyCest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\Stream; -use UnitTester; - -class WithBodyCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withBody() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithBody(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\ServerRequest - withBody()'); - - $fileName = dataDir('/assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - $request = new ServerRequest(); - - $newInstance = $request->withBody($stream); - - $I->assertNotEquals($request, $newInstance); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $newInstance->getBody() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithCookieParamsCest.php b/tests/unit/Http/Message/ServerRequest/WithCookieParamsCest.php deleted file mode 100644 index ba28ed1969f..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithCookieParamsCest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithCookieParamsCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withCookieParams() - * - * @author Phalcon Team - * @since 2019-03-03 - */ - public function httpMessageServerRequestWithCookieParams(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withCookieParams()'); - - $request = new ServerRequest(); - - $newInstance = $request->withCookieParams( - [ - 'one' => 'two', - ] - ); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - [ - 'one' => 'two', - ], - $newInstance->getCookieParams() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithHeaderCest.php b/tests/unit/Http/Message/ServerRequest/WithHeaderCest.php deleted file mode 100644 index 97c52c69b3e..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithHeaderCest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithHeaderCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withHeader()'); - $data = [ - 'Accept' => ['text/html'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - $newInstance = $request->withHeader('Cache-Control', ['max-age=0']); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithMethodCest.php b/tests/unit/Http/Message/ServerRequest/WithMethodCest.php deleted file mode 100644 index ffd072f3b96..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithMethodCest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithMethodCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withMethod() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithMethod(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withMethod()'); - $request = new ServerRequest(); - $newInstance = $request->withMethod('POST'); - - $I->assertNotEquals($request, $newInstance); - - $expected = 'GET'; - $actual = $request->getMethod(); - $I->assertEquals($expected, $actual); - - $expected = 'POST'; - $actual = $newInstance->getMethod(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithParsedBodyCest.php b/tests/unit/Http/Message/ServerRequest/WithParsedBodyCest.php deleted file mode 100644 index c84f0cdf58d..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithParsedBodyCest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithParsedBodyCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withParsedBody() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithParsedBody(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withParsedBody()'); - $request = new ServerRequest(); - $newInstance = $request->withParsedBody('something'); - - $I->assertNotEquals($request, $newInstance); - - $expected = null; - $actual = $request->getParsedBody(); - $I->assertEquals($expected, $actual); - - $expected = 'something'; - $actual = $newInstance->getParsedBody(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithProtocolVersionCest.php b/tests/unit/Http/Message/ServerRequest/WithProtocolVersionCest.php deleted file mode 100644 index cd7db29d47f..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithProtocolVersionCest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithProtocolVersionCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withProtocolVersion() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithProtocolVersion(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withProtocolVersion()'); - $request = new ServerRequest(); - $newInstance = $request->withProtocolVersion('2.0'); - - $I->assertNotEquals($request, $newInstance); - - $expected = '1.1'; - $actual = $request->getProtocolVersion(); - $I->assertEquals($expected, $actual); - - $expected = '2.0'; - $actual = $newInstance->getProtocolVersion(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithQueryParamsCest.php b/tests/unit/Http/Message/ServerRequest/WithQueryParamsCest.php deleted file mode 100644 index a833eeb81b3..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithQueryParamsCest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithQueryParamsCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withQueryParams() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithQueryParams(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withQueryParams()'); - - $request = new ServerRequest(); - - $newInstance = $request->withQueryParams( - [ - 'one' => 'two', - ] - ); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - [ - 'one' => 'two', - ], - $newInstance->getQueryParams() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithRequestTargetCest.php b/tests/unit/Http/Message/ServerRequest/WithRequestTargetCest.php deleted file mode 100644 index fb92ed1a4d3..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithRequestTargetCest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithRequestTargetCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withRequestTarget() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithRequestTarget(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withRequestTarget()'); - $request = new ServerRequest(); - $newInstance = $request->withRequestTarget('/test'); - - $I->assertNotEquals($request, $newInstance); - - $expected = '/'; - $actual = $request->getRequestTarget(); - $I->assertEquals($expected, $actual); - - $expected = '/test'; - $actual = $newInstance->getRequestTarget(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithUploadedFilesCest.php b/tests/unit/Http/Message/ServerRequest/WithUploadedFilesCest.php deleted file mode 100644 index 839870e7a04..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithUploadedFilesCest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use InvalidArgumentException; -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class WithUploadedFilesCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withUploadedFiles() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithUploadedFiles(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withUploadedFiles()'); - $files = [ - new UploadedFile('php://memory', 0), - [ - new UploadedFile('php://memory', 0), - ], - ]; - $request = new ServerRequest(); - $newInstance = $request->withUploadedFiles($files); - $I->assertNotEquals($request, $newInstance); - - $expected = $files; - $actual = $newInstance->getUploadedFiles(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequest :: withUploadedFiles() - - * exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithUploadedFilesException(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withUploadedFiles() - exception'); - $I->expectThrowable( - new InvalidArgumentException('Invalid uploaded file'), - function () use ($I) { - $files = [ - 'something-else', - ]; - $request = new ServerRequest(); - $newInstance = $request->withUploadedFiles($files); - } - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithUriCest.php b/tests/unit/Http/Message/ServerRequest/WithUriCest.php deleted file mode 100644 index aceb3d02d8a..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithUriCest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithUriCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withUri() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithUri(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withUri()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $request = new ServerRequest(); - $newInstance = $request->withUri($uri); - $I->assertNotEquals($request, $newInstance); - - $expected = $uri; - $actual = $newInstance->getUri(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithoutAttributeCest.php b/tests/unit/Http/Message/ServerRequest/WithoutAttributeCest.php deleted file mode 100644 index 140131df826..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithoutAttributeCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithoutAttributeCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withoutAttribute() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithoutAttribute(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withoutAttribute()'); - - $request = (new ServerRequest()) - ->withAttribute('one', 'two') - ->withAttribute('three', 'four') - ; - - $newInstance = $request->withoutAttribute('one'); - - $I->assertNotEquals($request, $newInstance); - - $I->assertEquals( - [ - 'three' => 'four', - ], - $newInstance->getAttributes() - ); - } -} diff --git a/tests/unit/Http/Message/ServerRequest/WithoutHeaderCest.php b/tests/unit/Http/Message/ServerRequest/WithoutHeaderCest.php deleted file mode 100644 index cf3612d62e3..00000000000 --- a/tests/unit/Http/Message/ServerRequest/WithoutHeaderCest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequest; - -use Phalcon\Http\Message\ServerRequest; -use UnitTester; - -class WithoutHeaderCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequest :: withoutHeader() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageServerRequestWithoutHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequest - withoutHeader()'); - $data = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $request = new ServerRequest('GET', null, [], 'php://input', $data); - $newInstance = $request->withoutHeader('Accept'); - - $I->assertNotEquals($request, $newInstance); - - $expected = [ - 'Accept' => ['text/html'], - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - - $expected = [ - 'Cache-Control' => ['max-age=0'], - ]; - $actual = $newInstance->getHeaders(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/ServerRequestFactory/ConstructCest.php b/tests/unit/Http/Message/ServerRequestFactory/ConstructCest.php deleted file mode 100644 index 6691b9d445b..00000000000 --- a/tests/unit/Http/Message/ServerRequestFactory/ConstructCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequestFactory; - -use Phalcon\Http\Message\ServerRequestFactory; -use Psr\Http\Message\ServerRequestFactoryInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpServerRequestFactoryConstruct(UnitTester $I) - { - $I->wantToTest('Http\ServerRequestFactory - __construct()'); - - $factory = new ServerRequestFactory(); - $class = ServerRequestFactoryInterface::class; - $I->assertInstanceOf($class, $factory); - } -} diff --git a/tests/unit/Http/Message/ServerRequestFactory/CreateServerRequestCest.php b/tests/unit/Http/Message/ServerRequestFactory/CreateServerRequestCest.php deleted file mode 100644 index 53796fadeb2..00000000000 --- a/tests/unit/Http/Message/ServerRequestFactory/CreateServerRequestCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequestFactory; - -use Phalcon\Http\Message\ServerRequestFactory; -use Psr\Http\Message\ServerRequestInterface; -use UnitTester; - -class CreateServerRequestCest -{ - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: createServerRequest() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryCreateServerRequest(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - createServerRequest()'); - - $factory = new ServerRequestFactory(); - $request = $factory->createServerRequest('GET', ''); - $class = ServerRequestInterface::class; - $I->assertInstanceOf($class, $request); - } -} diff --git a/tests/unit/Http/Message/ServerRequestFactory/LoadCest.php b/tests/unit/Http/Message/ServerRequestFactory/LoadCest.php deleted file mode 100644 index 23937d81ac0..00000000000 --- a/tests/unit/Http/Message/ServerRequestFactory/LoadCest.php +++ /dev/null @@ -1,803 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\ServerRequestFactory; - -use Codeception\Example; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\ServerRequestFactory; -use Phalcon\Http\Message\UploadedFile; -use Phalcon\Tests\Fixtures\Http\Message\ServerRequestFactoryFixture; -use Psr\Http\Message\ServerRequestInterface; -use UnitTester; - -/** - * Class LoadCest - * - * @package Phalcon\Tests\Unit\Http\Message\ServerRequestFactory - * - * @property array $storeCookie - * @property array $storeFiles - * @property array $storeGet - * @property array $storePost - * @property array $storeServer - */ -class LoadCest -{ - /** - * @var array - */ - private array $storeCookie = []; - - /** - * @var array - */ - private array $storeFiles = []; - - /** - * @var array - */ - private array $storeGet = []; - - /** - * @var array - */ - private array $storePost = []; - - /** - * @var array - */ - private array $storeServer = []; - - public function _before() - { - $this->storeCookie = $_COOKIE ?? []; - $this->storeFiles = $_FILES ?? []; - $this->storeGet = $_GET ?? []; - $this->storePost = $_POST ?? []; - $this->storeServer = $_SERVER ?? []; - - $_SERVER = []; - $_GET = []; - $_POST = []; - $_COOKIE = []; - $_FILES = []; - } - - public function _after() - { - $_COOKIE = $this->storeCookie; - $_FILES = $this->storeFiles; - $_GET = $this->storeGet; - $_POST = $this->storePost; - $_SERVER = $this->storeServer; - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoad(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load()'); - - $factory = new ServerRequestFactory(); - $request = $factory->load(); - - $I->assertInstanceOf(ServerRequestInterface::class, $request); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - header host - * prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadHeaderCookie(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - header cookie'); - - $server = [ - 'HTTP_COOKIE' => 'TESTSESS=face28e8-daae-10e0-a774-00000abbdf6c:3447789008; ' . - 'expires=Sun, 08-Nov-2020 00:00:00 UTC; ' . - 'Max-Age=63071999; ' . - 'path=/; ' . - 'domain=.phalcon.ld; ' . - 'secure; httponly', - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - - $expected = [ - 'TESTSESS' => 'face28e8-daae-10e0-a774-00000abbdf6c:3447789008', - 'expires' => 'Sun, 08-Nov-2020 00:00:00 UTC', - 'Max-Age' => '63071999', - 'path' => '/', - 'domain' => '.phalcon.ld', - 'secure' => '', - 'httponly' => '', - ]; - - $actual = $request->getCookieParams(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - header host - * prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadHeaderHost(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - header host'); - - $server = [ - 'HTTP_HOST' => 'dev.phalcon.ld:8080', - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - $uri = $request->getUri(); - - $I->assertEquals('dev.phalcon.ld', $uri->getHost()); - $I->assertEquals(8080, $uri->getPort()); - $I->assertEquals('/', $uri->getPath()); - $I->assertEquals('', $uri->getQuery()); - $I->assertEquals('', $uri->getFragment()); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - header host - * array prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadHeaderHostArray(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - header host array'); - - $server = [ - 'HTTP_HOST' => [ - 'dev.phalcon.ld', - 'test.phalcon.ld', - ], - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - $uri = $request->getUri(); - - $expected = 'dev.phalcon.ld,test.phalcon.ld'; - $actual = $uri->getHost(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - IIS path - * name/port prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadIisPath(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - IIS path'); - - $server = [ - 'IIS_WasUrlRewritten' => '1', - 'UNENCODED_URL' => '/action/reaction', - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - $uri = $request->getUri(); - - $expected = '/action/reaction'; - $actual = $uri->getPath(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - original - * path info name/port prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadOriginalPathInfo(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - original path info'); - - $server = [ - 'ORIG_PATH_INFO' => '/action/reaction', - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - $uri = $request->getUri(); - - $expected = '/action/reaction'; - $actual = $uri->getPath(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - server header - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadServerHeader(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - server header'); - - $server = [ - 'HTTP_HOST' => 'test.phalcon.ld', - ]; - - $factory = new ServerRequestFactoryFixture(); - $request = $factory->load($server); - - $expected = [ - 'host' => ['test.phalcon.ld'], - 'authorization' => ['Bearer'], - ]; - - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - server - * name/port prefixed - * - * @dataProvider getServerNameExamples - * - * @param UnitTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadServerNamePort(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - server name/port ' . $example[0]); - - $server = [ - 'REQUEST_URI' => $example[1], - 'QUERY_STRING' => $example[2], - 'SERVER_NAME' => $example[3], - 'SERVER_PORT' => $example[4], - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - $uri = $request->getUri(); - - $I->assertEquals($example[5], $uri->getHost()); - $I->assertEquals($example[6], $uri->getPort()); - $I->assertEquals($example[7], $uri->getPath()); - $I->assertEquals($example[8], $uri->getQuery()); - $I->assertEquals($example[9], $uri->getFragment()); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - server - * prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadServerPrefixed(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - server prefixed'); - - $server = [ - 'SIMPLE' => 'Some Cookie', - 'NO_OVERRIDE' => 'auth-token', - 'REDIRECT_NO_OVERRIDE' => 'token-auth', - 'REDIRECT_OVERRIDE' => 'override', - 'HTTP_AUTH' => 'letmein', - 'CONTENT_LENGTH' => 'UNSPECIFIED', - ]; - - $expected = [ - 'auth' => ['letmein'], - 'content-length' => ['UNSPECIFIED'], - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load($server); - - $actual = $request->getHeaders(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - files - * prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadFiles(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - files'); - - $uploadObject = new UploadedFile( - 'php://temp', - 0, - 0, - 'test2', - 'text/plain' - ); - - $files = [ - [ - 'tmp_name' => 'php://temp', - 'size' => 0, - 'error' => 0, - 'name' => 'test1', - 'type' => 'text/plain', - ], - $uploadObject, - [ - [ - 'tmp_name' => 'php://temp', - 'size' => 0, - 'error' => 0, - 'name' => 'test3', - 'type' => 'text/plain', - ], - ], - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load(null, null, null, null, $files); - - $actual = $request->getUploadedFiles(); - - /** @var UploadedFile $element */ - $element = $actual[0]; - $I->assertInstanceOf(UploadedFile::class, $element); - $I->assertEquals('test1', $element->getClientFilename()); - $I->assertEquals('text/plain', $element->getClientMediaType()); - - /** @var UploadedFile $element */ - $element = $actual[1]; - $I->assertInstanceOf(UploadedFile::class, $element); - $I->assertEquals($uploadObject, $element); - - /** @var UploadedFile $element */ - $element = $actual[2][0]; - $I->assertInstanceOf(UploadedFile::class, $element); - $I->assertEquals('test3', $element->getClientFilename()); - $I->assertEquals('text/plain', $element->getClientMediaType()); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - files - * exception prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadFilesException(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - files exception'); - - $I->expectThrowable( - new InvalidArgumentException( - 'The file array must contain tmp_name, size and error; ' . - 'one or more are missing' - ), - function () { - $files = [ - [ - 'tmp_name' => 'php://temp', - 'size' => 0, - 'name' => 'test1', - 'type' => 'text/plain', - ], - ]; - - $factory = new ServerRequestFactory(); - $request = $factory->load(null, null, null, null, $files); - } - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - scheme https - * prefixed - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadSchemeHttps(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - scheme https'); - - $factory = new ServerRequestFactory(); - $server = [ - 'HTTPS' => 'on', - ]; - - $request = $factory->load($server); - $uri = $request->getUri(); - $I->assertEquals('https', $uri->getScheme()); - - $server = [ - 'HTTPS' => 'off', - ]; - - $request = $factory->load($server); - $uri = $request->getUri(); - $expected = 'http'; - $actual = $uri->getScheme(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - constructor - * - * @dataProvider getConstructorExamples - * - * @param UnitTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadConstructor(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - constructor ' . $example[0]); - - $factory = new ServerRequestFactory(); - $request = $factory->load( - $example[1], - $example[2], - $example[3], - $example[4], - $example[5] - ); - - $I->assertInstanceOf(ServerRequestInterface::class, $request); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - constructor - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2021-04-05 - * @issue 15286 - */ - public function httpMessageServerRequestFactoryLoadConstructorFromSuperglobals(UnitTester $I) - { - $I->wantToTest( - 'Http\Message\ServerRequestFactory - load() - constructor from superglobals' - ); - - // Backup - $params = [ - 'REQUEST_TIME_FLOAT' => $this->storeServer['REQUEST_TIME_FLOAT'], - 'REQUEST_METHOD' => 'PUT', - 'one' => 'two', - ]; - - $_SERVER = $params; - - $factory = new ServerRequestFactory(); - $request = $factory->load(); - - $expected = 'PUT'; - $actual = $request->getMethod(); - $I->assertEquals($expected, $actual); - - $expected = $params; - $actual = $request->getServerParams(); - $I->assertEquals($expected, $actual); - - $I->assertInstanceOf(ServerRequestInterface::class, $request); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - constructor - * - empty superglobals - * - * @dataProvider getConstructorExamples - * - * @param UnitTester $I - * @param Example $example - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadConstructorEmptySuperglobals(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - constructor - empty superglobals ' . $example[0]); - - $factory = new ServerRequestFactory(); - $request = $factory->load( - $example[1], - $example[2], - $example[3], - $example[4], - $example[5] - ); - $I->assertInstanceOf(ServerRequestInterface::class, $request); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - protocol - * default - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadProtocolDefault(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - protocol default'); - - $factory = new ServerRequestFactory(); - - $request = $factory->load(); - $_SERVER = $this->storeServer; - - $expected = '1.1'; - $actual = $request->getProtocolVersion(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - protocol - * defined - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadProtocolDefined(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - protocol defined'); - - $factory = new ServerRequestFactory(); - $server = [ - 'SERVER_PROTOCOL' => 'HTTP/2.0', - ]; - - $request = $factory->load($server); - - $expected = '2.0'; - $actual = $request->getProtocolVersion(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - protocol - * error - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadProtocolError(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - protocol error'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Incorrect protocol value HTTX/4.5' - ), - function () { - $factory = new ServerRequestFactory(); - - $server = [ - 'SERVER_PROTOCOL' => 'HTTX/4.5', - ]; - - $request = $factory->load($server); - } - ); - } - - /** - * Tests Phalcon\Http\Message\ServerRequestFactory :: load() - protocol - * error unsupported - * - * @param UnitTester $I - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageServerRequestFactoryLoadProtocolErrorUnsupported(UnitTester $I) - { - $I->wantToTest('Http\Message\ServerRequestFactory - load() - protocol error unsupported'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Unsupported protocol HTTP/4.5' - ), - function () { - $factory = new ServerRequestFactory(); - - $server = [ - 'SERVER_PROTOCOL' => 'HTTP/4.5', - ]; - - $request = $factory->load($server); - } - ); - } - - /** - * @return array - */ - private function getConstructorExamples(): array - { - return [ - [ - 'empty', - null, - null, - null, - null, - null, - ], - [ - 'server', - ['one' => 'two'], - null, - null, - null, - null, - ], - [ - 'get', - null, - ['one' => 'two'], - null, - null, - null, - ], - [ - 'post', - null, - null, - ['one' => 'two'], - null, - null, - ], - [ - 'cookie', - null, - null, - null, - ['one' => 'two'], - null, - ], - [ - 'files', - null, - null, - null, - null, - ['one' => 'two'], - ], - ]; - } - - /** - * @return array - */ - private function getServerNameExamples(): array - { - return [ - [ - 'host', - 'http://dev.phalcon.ld', - '', - 'dev.phalcon.ld', - null, - 'dev.phalcon.ld', - null, - '', - '', - '', - ], - [ - 'host', - 'http://dev.phalcon.ld', - '', - 'dev.phalcon.ld', - 8080, - 'dev.phalcon.ld', - 8080, - '', - '', - '', - ], - [ - 'host', - 'http://dev.phalcon.ld/action/reaction', - '', - 'dev.phalcon.ld', - 8080, - 'dev.phalcon.ld', - 8080, - '/action/reaction', - '', - '', - ], - [ - 'host', - 'http://dev.phalcon.ld/action/reaction?one=two', - 'one=two', - 'dev.phalcon.ld', - 8080, - 'dev.phalcon.ld', - 8080, - '/action/reaction', - 'one=two', - '', - ], - [ - 'host', - 'http://dev.phalcon.ld/action/reaction?one=two#fragment', - 'one=two', - 'dev.phalcon.ld', - 8080, - 'dev.phalcon.ld', - 8080, - '/action/reaction', - 'one=two', - 'fragment', - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/CloseCest.php b/tests/unit/Http/Message/Stream/CloseCest.php deleted file mode 100644 index 1b70e90244e..00000000000 --- a/tests/unit/Http/Message/Stream/CloseCest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use UnitTester; - -use function is_resource; - -class CloseCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: close() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamClose(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - close()'); - - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - - $stream->close(); - - $I->assertFalse(is_resource($handle)); - } - - /** - * Tests Phalcon\Http\Message\Stream :: close() - detach - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamCloseDetach(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - close()'); - - $fileName = dataDir('assets/stream/mit.txt'); - - $handle = fopen($fileName, 'rb'); - - $stream = new Stream($handle); - - $stream->close(); - - $I->assertNull( - $stream->detach() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/ConstructCest.php b/tests/unit/Http/Message/Stream/ConstructCest.php deleted file mode 100644 index d33d62aa11f..00000000000 --- a/tests/unit/Http/Message/Stream/ConstructCest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Codeception\Example; -use Phalcon\Http\Message\Stream; -use Psr\Http\Message\StreamInterface; -use RuntimeException; -use stdClass; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageStreamConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - __construct()'); - - $request = new Stream('php://temp'); - - $I->assertInstanceOf( - StreamInterface::class, - $request - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: __construct() - exception - * - * @dataProvider getExceptionExamples - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpMessageStreamConstructException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - __construct() ' . $example[0]); - $I->expectThrowable( - new RuntimeException( - 'The stream provided is not valid ' . - '(string/resource) or could not be opened.' - ), - function () use ($example) { - $request = new Stream($example[1]); - } - ); - } - - private function getExceptionExamples(): array - { - return [ - [ - 'array', - ['array'], - ], - [ - 'boolean', - true, - ], - [ - 'float', - 123.45, - ], - [ - 'integer', - 123, - ], - [ - 'null', - null, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/DetachCest.php b/tests/unit/Http/Message/Stream/DetachCest.php deleted file mode 100644 index 6f4f50a6640..00000000000 --- a/tests/unit/Http/Message/Stream/DetachCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use UnitTester; - -class DetachCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: detach() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamDetach(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - detach()'); - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - - $actual = $stream->detach(); - $I->assertEquals($handle, $actual); - } -} diff --git a/tests/unit/Http/Message/Stream/EofCest.php b/tests/unit/Http/Message/Stream/EofCest.php deleted file mode 100644 index 1692c9f268d..00000000000 --- a/tests/unit/Http/Message/Stream/EofCest.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use UnitTester; - -class EofCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: eof() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamEof(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - eof()'); - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - while (true !== feof($handle)) { - fread($handle, 1024); - } - - $actual = $stream->eof(); - $I->assertTrue($actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: eof() - detached stream - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamEofDetached(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - eof() - detached stream'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - $stream->detach(); - - $actual = $stream->eof(); - $I->assertTrue($actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: eof() - not at eof - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamEofNotAtEof(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - eof() - not at eof'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - $stream->seek(10); - - $actual = $stream->eof(); - $I->assertFalse($actual); - } -} diff --git a/tests/unit/Http/Message/Stream/GetContentsCest.php b/tests/unit/Http/Message/Stream/GetContentsCest.php deleted file mode 100644 index 9314321e380..00000000000 --- a/tests/unit/Http/Message/Stream/GetContentsCest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use RuntimeException; -use UnitTester; - -class GetContentsCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: getContents() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetContents(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Stream - getContents()'); - - $fileName = dataDir('assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $I->openFile($fileName); - - $I->seeFileContentsEqual( - $stream->getContents() - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getContents() - from position - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetContentsFromPosition(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Stream - getContents() - from position'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - - $stream->seek(626); - $expected = 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ' - . 'KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ' - . 'WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ' - . 'PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ' - . 'OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ' - . 'OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ' - . 'OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ' - . 'SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' - . PHP_EOL; - $actual = $stream->getContents(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getContents() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetContentsException(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getContents() - exception'); - $I->expectThrowable( - new RuntimeException( - 'The resource is not readable.' - ), - function () { - $fileName = dataDir('assets/stream/mit-empty.txt'); - $stream = new Stream($fileName, 'wb'); - - $actual = $stream->getContents(); - } - ); - } -} diff --git a/tests/unit/Http/Message/Stream/GetMetadataCest.php b/tests/unit/Http/Message/Stream/GetMetadataCest.php deleted file mode 100644 index 6b73cb9eee1..00000000000 --- a/tests/unit/Http/Message/Stream/GetMetadataCest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Codeception\Example; -use Phalcon\Http\Message\Stream; -use Phalcon\Tests\Fixtures\Http\Message\StreamFixture; -use UnitTester; - -class GetMetadataCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: getMetadata() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetMetadata(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getMetadata()'); - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - - $expected = [ - 'timed_out' => false, - 'blocked' => true, - 'eof' => false, - 'wrapper_type' => 'plainfile', - 'stream_type' => 'STDIO', - 'mode' => 'rb', - 'unread_bytes' => 0, - 'seekable' => true, - 'uri' => $fileName, - ]; - - $actual = $stream->getMetadata(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getMetadata() - by key - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetMetadataByKey(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - getMetadata() - by key - ' . $example[0]); - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - - $actual = $stream->getMetadata($example[0]); - $I->assertEquals($example[1], $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getMetadata() - invalid handle - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetMetadataInvalidHandle(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getMetadata() - invalid handle'); - $stream = new StreamFixture('php://memory', 'rb'); - $stream->setHandle(null); - - $actual = $stream->getMetadata(); - $I->assertNull($actual); - } - - private function getExamples(): array - { - return [ - ['timed_out', false,], - ['blocked', true,], - ['eof', false,], - ['wrapper_type', 'plainfile',], - ['stream_type', 'STDIO',], - ['mode', 'rb',], - ['unread_bytes', 0,], - ['seekable', true,], - ['uri', dataDir('assets/stream/mit.txt'),], - ['unknown', [],], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/GetSizeCest.php b/tests/unit/Http/Message/Stream/GetSizeCest.php deleted file mode 100644 index 3a5f72e9791..00000000000 --- a/tests/unit/Http/Message/Stream/GetSizeCest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use Phalcon\Tests\Fixtures\Http\Message\StreamFixture; -use UnitTester; - -use function dataDir; - -class GetSizeCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: getSize() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetSize(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getSize()'); - $fileName = dataDir('assets/stream/mit.txt'); - $expected = filesize($fileName); - $stream = new Stream($fileName, 'rb'); - $actual = $stream->getSize(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getSize() - invalid stream - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetSizeInvalid(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getSize() - invalid'); - $stream = new Stream('php://memory', 'rb'); - $expected = 0; - $actual = $stream->getSize(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: getSize() - invalid handle - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamGetSizeInvalidHandle(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - getSize() - invalid'); - $stream = new StreamFixture('php://memory', 'rb'); - $stream->setHandle(null); - - $actual = $stream->getSize(); - $I->assertNull($actual); - } -} diff --git a/tests/unit/Http/Message/Stream/Input/ConstructCest.php b/tests/unit/Http/Message/Stream/Input/ConstructCest.php deleted file mode 100644 index 37e22812306..00000000000 --- a/tests/unit/Http/Message/Stream/Input/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Input; - -use Phalcon\Http\Message\Stream\Input; -use Psr\Http\Message\StreamInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Input :: __construct() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamInputConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Input - __construct()'); - $request = new Input(); - $class = StreamInterface::class; - $I->assertInstanceOf($class, $request); - } -} diff --git a/tests/unit/Http/Message/Stream/Input/IsReadableCest.php b/tests/unit/Http/Message/Stream/Input/IsReadableCest.php deleted file mode 100644 index f03330e0024..00000000000 --- a/tests/unit/Http/Message/Stream/Input/IsReadableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Input; - -use Phalcon\Http\Message\Stream\Input; -use UnitTester; - -class IsReadableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Input :: isReadable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamInputIsReadable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Input - isReadable()'); - - $stream = new Input(); - - $I->assertTrue( - $stream->isReadable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Input/IsSeekableCest.php b/tests/unit/Http/Message/Stream/Input/IsSeekableCest.php deleted file mode 100644 index 7e8332171c6..00000000000 --- a/tests/unit/Http/Message/Stream/Input/IsSeekableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Input; - -use Phalcon\Http\Message\Stream\Input; -use UnitTester; - -class IsSeekableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Input :: isSeekable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamInputIsSeekable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Input - isSeekable()'); - - $stream = new Input(); - - $I->assertTrue( - $stream->isSeekable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Input/IsWritableCest.php b/tests/unit/Http/Message/Stream/Input/IsWritableCest.php deleted file mode 100644 index e4a8111ca95..00000000000 --- a/tests/unit/Http/Message/Stream/Input/IsWritableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Input; - -use Phalcon\Http\Message\Stream\Input; -use UnitTester; - -class IsWritableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Input :: isWritable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamInputIsWritable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Input - isWritable()'); - - $stream = new Input(); - - $I->assertFalse( - $stream->isWritable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/IsReadableCest.php b/tests/unit/Http/Message/Stream/IsReadableCest.php deleted file mode 100644 index 10b39a6505f..00000000000 --- a/tests/unit/Http/Message/Stream/IsReadableCest.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Codeception\Example; -use Phalcon\Http\Message\Stream; -use UnitTester; - -use function logsDir; - -class IsReadableCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: isReadable() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsReadable(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - isReadable() - ' . $example[0]); - - $fileName = dataDir('assets/stream/mit-empty.txt'); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isReadable() - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: isReadable() - with "x" - * - * @dataProvider getExamplesX - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsReadableWithX(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - isReadable() with "x" - ' . $example[0]); - - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isReadable() - ); - } - - private function getExamplesX(): array - { - return [ - ['w', false], - ['wb', false], - ['w+', true], - ['w+b', true], - ['x', false], - ['xb', false], - ['x+', true], - ['x+b', true], - ]; - } - - private function getExamples(): array - { - return [ - ['a', false], - ['ab', false], - ['a+', true], - ['a+b', true], - ['c', false], - ['cb', false], - ['c+', true], - ['c+b', true], - ['r', true], - ['rb', true], - ['r+', true], - ['r+b', true], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/IsSeekableCest.php b/tests/unit/Http/Message/Stream/IsSeekableCest.php deleted file mode 100644 index f4545345127..00000000000 --- a/tests/unit/Http/Message/Stream/IsSeekableCest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Codeception\Example; -use Phalcon\Http\Message\Stream; -use UnitTester; - -use function logsDir; - -class IsSeekableCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: isSeekable() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsSeekable(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - isSeekable() - ' . $example[0]); - - $fileName = dataDir('assets/stream/mit-empty.txt'); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isSeekable() - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: isSeekable() - with "x" - * - * @dataProvider getExamplesX - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsSeekableWithX(UnitTester $I, Example $example) - { - $I->wantToTest( - 'Http\Message\Stream - isSeekable() with "x" - ' . $example[0] - ); - - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isSeekable() - ); - } - - private function getExamplesX(): array - { - return [ - ['wb', true], - ['w+', true], - ['w+b', true], - ['x', true], - ['xb', true], - ['x+', true], - ['x+b', true], - ]; - } - - private function getExamples(): array - { - return [ - ['a', true], - ['ab', true], - ['a+', true], - ['a+b', true], - ['c', true], - ['cb', true], - ['c+', true], - ['c+b', true], - ['r', true], - ['rb', true], - ['r+', true], - ['r+b', true], - ['w', true], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/IsWritableCest.php b/tests/unit/Http/Message/Stream/IsWritableCest.php deleted file mode 100644 index 50123a3fd88..00000000000 --- a/tests/unit/Http/Message/Stream/IsWritableCest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Codeception\Example; -use Phalcon\Http\Message\Stream; -use UnitTester; - -use function logsDir; - -class IsWritableCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: isWritable() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsWritable(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Stream - isWritable() - ' . $example[0]); - - $fileName = dataDir('assets/stream/mit-empty.txt'); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isWritable() - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: isWritable() - with "x" - * - * @dataProvider getExamplesX - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamIsWritableWithX(UnitTester $I, Example $example) - { - $I->wantToTest( - 'Http\Message\Stream - isWritable() with "x" - ' . $example[0] - ); - - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - - $stream = new Stream($fileName, $example[0]); - - $I->assertEquals( - $example[1], - $stream->isWritable() - ); - } - - private function getExamplesX(): array - { - return [ - ['w', true], - ['wb', true], - ['w+', true], - ['w+b', true], - ['x', true], - ['xb', true], - ['x+', true], - ['x+b', true], - ]; - } - - private function getExamples(): array - { - return [ - ['a', true], - ['ab', true], - ['a+', true], - ['a+b', true], - ['c', true], - ['cb', true], - ['c+', true], - ['c+b', true], - ['r', false], - ['rb', false], - ['r+', true], - ['r+b', true], - ]; - } -} diff --git a/tests/unit/Http/Message/Stream/Memory/ConstructCest.php b/tests/unit/Http/Message/Stream/Memory/ConstructCest.php deleted file mode 100644 index 815747e11b4..00000000000 --- a/tests/unit/Http/Message/Stream/Memory/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Memory; - -use Phalcon\Http\Message\Stream\Memory; -use Psr\Http\Message\StreamInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Memory :: __construct() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamMemoryConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Memory - __construct()'); - $request = new Memory(); - $class = StreamInterface::class; - $I->assertInstanceOf($class, $request); - } -} diff --git a/tests/unit/Http/Message/Stream/Memory/IsReadableCest.php b/tests/unit/Http/Message/Stream/Memory/IsReadableCest.php deleted file mode 100644 index feba36895eb..00000000000 --- a/tests/unit/Http/Message/Stream/Memory/IsReadableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Memory; - -use Phalcon\Http\Message\Stream\Memory; -use UnitTester; - -class IsReadableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Memory :: isReadable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamMemoryIsReadable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Memory - isReadable()'); - - $stream = new Memory(); - - $I->assertTrue( - $stream->isReadable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Memory/IsSeekableCest.php b/tests/unit/Http/Message/Stream/Memory/IsSeekableCest.php deleted file mode 100644 index 7de3c562160..00000000000 --- a/tests/unit/Http/Message/Stream/Memory/IsSeekableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Memory; - -use Phalcon\Http\Message\Stream\Memory; -use UnitTester; - -class IsSeekableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Memory :: isSeekable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamMemoryIsSeekable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Memory - isSeekable()'); - - $stream = new Memory(); - - $I->assertTrue( - $stream->isSeekable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Memory/IsWritableCest.php b/tests/unit/Http/Message/Stream/Memory/IsWritableCest.php deleted file mode 100644 index 153a221b98b..00000000000 --- a/tests/unit/Http/Message/Stream/Memory/IsWritableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Memory; - -use Phalcon\Http\Message\Stream\Memory; -use UnitTester; - -class IsWritableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Memory :: isWritable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamMemoryIsWritable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Memory - isWritable()'); - - $stream = new Memory('r+b'); - - $I->assertTrue( - $stream->isWritable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/ReadCest.php b/tests/unit/Http/Message/Stream/ReadCest.php deleted file mode 100644 index dc791c1e417..00000000000 --- a/tests/unit/Http/Message/Stream/ReadCest.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use RuntimeException; -use UnitTester; - -class ReadCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: read() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamRead(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Stream - read()'); - - $fileName = dataDir('assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $expected = 'The MIT License (MIT)' . PHP_EOL . PHP_EOL . 'Copyright (c) 2015-present, Phalcon PHP'; - $actual = $stream->read(62); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: read() - detached - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamReadDetached(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - read() - detached'); - - $I->expectThrowable( - new RuntimeException( - 'A valid resource is required.' - ), - function () { - $fileName = dataDir('assets/stream/mit.txt'); - - $stream = new Stream($fileName, 'rb'); - - $stream->detach(); - - $stream->read(10); - } - ); - } -} diff --git a/tests/unit/Http/Message/Stream/RewindCest.php b/tests/unit/Http/Message/Stream/RewindCest.php deleted file mode 100644 index a11a9d20924..00000000000 --- a/tests/unit/Http/Message/Stream/RewindCest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use RuntimeException; -use UnitTester; - -class RewindCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: rewind() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamRewind(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - rewind()'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName); - - $stream->seek(10); - $expected = 10; - $actual = $stream->tell(); - $I->assertEquals($expected, $actual); - - $stream->rewind(); - $expected = 0; - $actual = $stream->tell(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: rewind() - detached - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamRewindDetached(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - rewind() - detached'); - $I->expectThrowable( - new RuntimeException( - 'A valid resource is required.' - ), - function () { - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - $stream->detach(); - - $stream->rewind(); - } - ); - } -} diff --git a/tests/unit/Http/Message/Stream/SeekCest.php b/tests/unit/Http/Message/Stream/SeekCest.php deleted file mode 100644 index 948900180ee..00000000000 --- a/tests/unit/Http/Message/Stream/SeekCest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use Phalcon\Tests\Fixtures\Http\Message\StreamFixture; -use RuntimeException; -use UnitTester; - -class SeekCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: seek() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamSeek(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Stream - seek()'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - - $stream->seek(64); - $expected = 'Permission is hereby granted, free of charge, to any ' - . 'person obtaining a copy of this software and associated ' - . 'documentation files (the "Software"), to deal in the ' - . 'Software without restriction, including without limitation ' - . 'the rights to use, copy, modify, merge, publish, distribute, ' - . 'sublicense, and/or sell copies of the Software, and to permit ' - . 'persons to whom the Software is furnished to do so, subject ' - . 'to the following conditions:'; - $actual = $stream->read(432); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: seek() - after file size - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamSeekAfterFileSize(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - seek() - after file size'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - - $stream->seek(10240); - $expected = ''; - $actual = $stream->read(1); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: seek() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamSeekException(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - seek() - exception'); - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new StreamFixture($fileName, 'rb'); - - $I->expectThrowable( - new RuntimeException('The resource is not seekable.'), - function () use ($stream) { - $stream->seek(10240); - } - ); - } -} diff --git a/tests/unit/Http/Message/Stream/SetStreamCest.php b/tests/unit/Http/Message/Stream/SetStreamCest.php deleted file mode 100644 index 06df4286565..00000000000 --- a/tests/unit/Http/Message/Stream/SetStreamCest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use UnitTester; - -use function dataDir; - -class SetStreamCest -{ - /** - * Unit Tests Phalcon\Http\Message\Stream :: setStream() - * - * @author Phalcon Team - * @since 2019-05-25 - */ - public function httpMessageStreamSetStream(UnitTester $I) - { - if (PHP_OS_FAMILY === 'Windows') { - $I->markTestSkipped('Need to fix Windows new lines...'); - } - - $I->wantToTest('Http\Message\Stream - setStream()'); - - $fileName = dataDir('assets/stream/mit-empty.txt'); - $stream = new Stream($fileName, 'rb'); - - $actual = $stream->read(10); - $I->assertEmpty($actual); - - $fileName = dataDir('assets/stream/mit.txt'); - $stream->setStream($fileName, 'rb'); - - $stream->seek(64); - $expected = 'Permission is hereby granted, free of charge, to any ' - . 'person obtaining a copy of this software and associated ' - . 'documentation files (the "Software"), to deal in the ' - . 'Software without restriction, including without limitation ' - . 'the rights to use, copy, modify, merge, publish, distribute, ' - . 'sublicense, and/or sell copies of the Software, and to permit ' - . 'persons to whom the Software is furnished to do so, subject ' - . 'to the following conditions:'; - $actual = $stream->read(432); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/Stream/TellCest.php b/tests/unit/Http/Message/Stream/TellCest.php deleted file mode 100644 index 5f78b535741..00000000000 --- a/tests/unit/Http/Message/Stream/TellCest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use RuntimeException; -use UnitTester; - -class TellCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: tell() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamTell(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - tell()'); - $fileName = dataDir('assets/stream/mit.txt'); - $handle = fopen($fileName, 'rb'); - $stream = new Stream($handle); - - $expected = 274; - fseek($handle, $expected); - $actual = $stream->tell(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: tell() - detached - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamTellDetached(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - tell() - detached'); - $I->expectThrowable( - new RuntimeException( - 'A valid resource is required.' - ), - function () { - $fileName = dataDir('assets/stream/mit.txt'); - $stream = new Stream($fileName, 'rb'); - $stream->detach(); - - $stream->tell(); - } - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Temp/ConstructCest.php b/tests/unit/Http/Message/Stream/Temp/ConstructCest.php deleted file mode 100644 index 4bf63d003da..00000000000 --- a/tests/unit/Http/Message/Stream/Temp/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Temp; - -use Phalcon\Http\Message\Stream\Temp; -use Psr\Http\Message\StreamInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Temp :: __construct() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamTempConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Temp - __construct()'); - $request = new Temp(); - $class = StreamInterface::class; - $I->assertInstanceOf($class, $request); - } -} diff --git a/tests/unit/Http/Message/Stream/Temp/IsReadableCest.php b/tests/unit/Http/Message/Stream/Temp/IsReadableCest.php deleted file mode 100644 index 9aa1039350b..00000000000 --- a/tests/unit/Http/Message/Stream/Temp/IsReadableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Temp; - -use Phalcon\Http\Message\Stream\Temp; -use UnitTester; - -class IsReadableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Temp :: isReadable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamTempIsReadable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Temp - isReadable()'); - - $stream = new Temp(); - - $I->assertTrue( - $stream->isReadable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Temp/IsSeekableCest.php b/tests/unit/Http/Message/Stream/Temp/IsSeekableCest.php deleted file mode 100644 index 53ca931e681..00000000000 --- a/tests/unit/Http/Message/Stream/Temp/IsSeekableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Temp; - -use Phalcon\Http\Message\Stream\Temp; -use UnitTester; - -class IsSeekableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Temp :: isSeekable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamTempIsSeekable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Temp - isSeekable()'); - - $stream = new Temp(); - - $I->assertTrue( - $stream->isSeekable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/Temp/IsWritableCest.php b/tests/unit/Http/Message/Stream/Temp/IsWritableCest.php deleted file mode 100644 index d2919d6290e..00000000000 --- a/tests/unit/Http/Message/Stream/Temp/IsWritableCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream\Temp; - -use Phalcon\Http\Message\Stream\Temp; -use UnitTester; - -class IsWritableCest -{ - /** - * Tests Phalcon\Http\Message\Stream\Temp :: isWritable() - * - * @author Phalcon Team - * @since 2019-02-19 - */ - public function httpMessageStreamTempIsWritable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream\Temp - isWritable()'); - - $stream = new Temp('r+b'); - - $I->assertTrue( - $stream->isWritable() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/ToStringCest.php b/tests/unit/Http/Message/Stream/ToStringCest.php deleted file mode 100644 index 36af9546073..00000000000 --- a/tests/unit/Http/Message/Stream/ToStringCest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use UnitTester; - -class ToStringCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: __toString() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamToString(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - __toString()'); - - $fileName = dataDir('assets/stream/mit.txt'); - $expected = file_get_contents($fileName); - $stream = new Stream($fileName, 'rb'); - - $I->assertEquals( - $expected, - (string) $stream - ); - - $I->assertEquals( - $expected, - $stream->__toString() - ); - } -} diff --git a/tests/unit/Http/Message/Stream/WriteCest.php b/tests/unit/Http/Message/Stream/WriteCest.php deleted file mode 100644 index c68245f0e8a..00000000000 --- a/tests/unit/Http/Message/Stream/WriteCest.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Stream; - -use Phalcon\Http\Message\Stream; -use Phalcon\Tests\Fixtures\Http\Message\StreamFixture; -use RuntimeException; -use UnitTester; - -use function logsDir; - -class WriteCest -{ - /** - * Tests Phalcon\Http\Message\Stream :: write() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamWrite(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - write()'); - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - $stream = new Stream($fileName, 'wb'); - - $source = 'A well regulated Militia, being necessary to the security of a free State, ' - . 'the right of the people to keep and bear Arms, shall not be infringed.'; - $expected = strlen($source); - $actual = $stream->write($source); - $I->assertEquals($expected, $actual); - - $stream->close(); - - $stream = new Stream($fileName, 'rb'); - $expected = $source; - $actual = $stream->getContents(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Stream :: write() - detached - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamWriteDetached(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - write() - detached'); - $I->expectThrowable( - new RuntimeException( - 'A valid resource is required.' - ), - function () use ($I) { - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - $stream = new Stream($fileName, 'wb'); - $stream->detach(); - - $stream->write('abc'); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Stream :: write() - exception not writable - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamWriteNotWritable(UnitTester $I) - { - $I->wantToTest('Http\Message\Stream - write() - exception not writable'); - - $fileName = $I->getNewFileName(); - $fileName = logsDir($fileName); - $stream = new StreamFixture($fileName, 'wb'); - - $I->expectThrowable( - new RuntimeException( - 'The resource is not writable.' - ), - function () use ($stream) { - $stream->write('abc'); - } - ); - } -} diff --git a/tests/unit/Http/Message/StreamFactory/ConstructCest.php b/tests/unit/Http/Message/StreamFactory/ConstructCest.php deleted file mode 100644 index bf0d024a07f..00000000000 --- a/tests/unit/Http/Message/StreamFactory/ConstructCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\StreamFactory; - -use Phalcon\Http\Message\StreamFactory; -use Psr\Http\Message\StreamFactoryInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\StreamFactory :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpStreamFactoryConstruct(UnitTester $I) - { - $I->wantToTest('Http\StreamFactory - __construct()'); - - $factory = new StreamFactory(); - $class = StreamFactoryInterface::class; - $I->assertInstanceOf($class, $factory); - } -} diff --git a/tests/unit/Http/Message/StreamFactory/CreateStreamCest.php b/tests/unit/Http/Message/StreamFactory/CreateStreamCest.php deleted file mode 100644 index d89aca50fad..00000000000 --- a/tests/unit/Http/Message/StreamFactory/CreateStreamCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\StreamFactory; - -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\StreamFactory; -use UnitTester; - -class CreateStreamCest -{ - /** - * Tests Phalcon\Http\Message\StreamFactory :: createStream() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamFactoryCreateStream(UnitTester $I) - { - $I->wantToTest('Http\Message\StreamFactory - createStream()'); - - $fileName = dataDir('assets/stream/mit.txt'); - $contents = file_get_contents($fileName); - $factory = new StreamFactory(); - $stream = $factory->createStream($contents); - - $I->assertInstanceOf( - Stream::class, - $stream - ); - - $I->assertEquals( - $contents, - $stream->getContents() - ); - } -} diff --git a/tests/unit/Http/Message/StreamFactory/CreateStreamFromFileCest.php b/tests/unit/Http/Message/StreamFactory/CreateStreamFromFileCest.php deleted file mode 100644 index 888977d8a98..00000000000 --- a/tests/unit/Http/Message/StreamFactory/CreateStreamFromFileCest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\StreamFactory; - -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\StreamFactory; -use UnitTester; - -class CreateStreamFromFileCest -{ - /** - * Tests Phalcon\Http\Message\StreamFactory :: createStreamFromFile() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamFactoryCreateStreamFromFile(UnitTester $I) - { - $I->wantToTest('Http\Message\StreamFactory - createStreamFromFile()'); - - $fileName = dataDir('assets/stream/mit.txt'); - $expected = file_get_contents($fileName); - $factory = new StreamFactory(); - $stream = $factory->createStreamFromFile($fileName); - - $I->assertInstanceOf( - Stream::class, - $stream - ); - - $I->assertEquals( - $expected, - $stream->getContents() - ); - } -} diff --git a/tests/unit/Http/Message/StreamFactory/CreateStreamFromResourceCest.php b/tests/unit/Http/Message/StreamFactory/CreateStreamFromResourceCest.php deleted file mode 100644 index e005793ac5a..00000000000 --- a/tests/unit/Http/Message/StreamFactory/CreateStreamFromResourceCest.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\StreamFactory; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\StreamFactory; -use UnitTester; - -class CreateStreamFromResourceCest -{ - /** - * Tests Phalcon\Http\Message\StreamFactory :: createStreamFromResource() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamFactoryCreateStreamFromResource(UnitTester $I) - { - $I->wantToTest('Http\Message\StreamFactory - createStreamFromResource()'); - - $fileName = dataDir('assets/stream/mit.txt'); - $expected = file_get_contents($fileName); - $resource = fopen($fileName, 'r+b'); - $factory = new StreamFactory(); - $stream = $factory->createStreamFromResource($resource); - - $I->assertInstanceOf( - Stream::class, - $stream - ); - - $I->assertEquals( - $expected, - $stream->getContents() - ); - } - - /** - * Tests Phalcon\Http\Message\StreamFactory :: createStreamFromResource() - - * exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageStreamFactoryCreateStreamFromResourceException(UnitTester $I) - { - $I->wantToTest('Http\Message\StreamFactory - createStreamFromResource() - exception'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Invalid stream provided' - ), - function () { - $factory = new StreamFactory(); - - $stream = $factory->createStreamFromResource(false); - } - ); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/ConstructCest.php b/tests/unit/Http/Message/UploadedFile/ConstructCest.php deleted file mode 100644 index 913fda14195..00000000000 --- a/tests/unit/Http/Message/UploadedFile/ConstructCest.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Codeception\Example; -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\UploadedFile; -use Psr\Http\Message\UploadedFileInterface; -use stdClass; -use UnitTester; - -use function fopen; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: __construct() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - __construct()'); - - $stream = logsDir( - uniqid('test') - ); - - $file = new UploadedFile($stream, 100); - - $I->assertInstanceOf( - UploadedFileInterface::class, - $file - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: __construct() - $resource - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileConstructResource(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - __construct()'); - - $stream = logsDir( - uniqid('test') - ); - - $stream = fopen($stream, 'w+b'); - $file = new UploadedFile($stream, 100); - - $I->assertInstanceOf( - UploadedFileInterface::class, - $file - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: __construct() - stream - * exception - * - * @dataProvider getStreamExamples - * - * @author Phalcon Team - * @since 2019-02-18 - */ - public function httpMessageUploadedFileConstructStreamException(UnitTester $I, Example $example) - { - $I->wantToTest( - 'Http\Message\UploadedFile - __construct() - stream ' . $example[0] - ); - - $I->expectThrowable( - new InvalidArgumentException('Invalid stream or file passed'), - function () use ($example) { - $file = new UploadedFile($example[1], 100); - } - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: __construct() - error - * exception - * - * @author Phalcon Team - * @since 2019-02-18 - */ - public function httpMessageUploadedFileConstructErrorException(UnitTester $I) - { - $I->wantToTest( - 'Http\Message\UploadedFile - __construct() - error exception' - ); - - $I->expectThrowable( - new InvalidArgumentException('Invalid error. Must be one of the UPLOAD_ERR_* constants'), - function () { - $stream = logsDir( - uniqid('test') - ); - - $file = new UploadedFile($stream, 100, 100); - } - ); - } - - private function getStreamExamples(): array - { - return [ - [ - 'array', - ['array'], - ], - [ - 'boolean', - true, - ], - [ - 'float', - 123.45, - ], - [ - 'integer', - 123, - ], - [ - 'null', - null, - ], - [ - 'object', - new stdClass(), - ], - ]; - } -} diff --git a/tests/unit/Http/Message/UploadedFile/GetClientFilenameCest.php b/tests/unit/Http/Message/UploadedFile/GetClientFilenameCest.php deleted file mode 100644 index 2729e2f2f4a..00000000000 --- a/tests/unit/Http/Message/UploadedFile/GetClientFilenameCest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class GetClientFilenameCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: getClientFilename() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetClientFilename(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getClientFilename()'); - $file = new UploadedFile( - 'php://memory', - 0, - UPLOAD_ERR_OK, - 'phalcon.txt' - ); - - $expected = 'phalcon.txt'; - $actual = $file->getClientFilename(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/GetClientMediaTypeCest.php b/tests/unit/Http/Message/UploadedFile/GetClientMediaTypeCest.php deleted file mode 100644 index bb8d79c80c1..00000000000 --- a/tests/unit/Http/Message/UploadedFile/GetClientMediaTypeCest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class GetClientMediaTypeCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: getClientMediaType() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetClientMediaType(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getClientMediaType()'); - $file = new UploadedFile( - 'php://memory', - 0, - UPLOAD_ERR_OK, - 'phalcon.txt', - 'some-media-type' - ); - - $expected = 'some-media-type'; - $actual = $file->getClientMediaType(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/GetErrorCest.php b/tests/unit/Http/Message/UploadedFile/GetErrorCest.php deleted file mode 100644 index f53913df0a9..00000000000 --- a/tests/unit/Http/Message/UploadedFile/GetErrorCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class GetErrorCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: getError() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetError(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getError()'); - $file = new UploadedFile('php://memory', 100); - - $expected = UPLOAD_ERR_OK; - $actual = $file->getError(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/GetSizeCest.php b/tests/unit/Http/Message/UploadedFile/GetSizeCest.php deleted file mode 100644 index a6a1c5ef3c8..00000000000 --- a/tests/unit/Http/Message/UploadedFile/GetSizeCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -class GetSizeCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: getSize() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetSize(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getSize()'); - $file = new UploadedFile('php://memory', 100); - - $expected = 100; - $actual = $file->getSize(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/GetStreamCest.php b/tests/unit/Http/Message/UploadedFile/GetStreamCest.php deleted file mode 100644 index 7810f38e3d6..00000000000 --- a/tests/unit/Http/Message/UploadedFile/GetStreamCest.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\UploadedFile; -use Psr\Http\Message\StreamInterface; -use UnitTester; - -use function outputDir; - -use const UPLOAD_ERR_CANT_WRITE; - -class GetStreamCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: getStream() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetStream(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getStream()'); - $stream = new Stream('php://memory'); - $file = new UploadedFile( - $stream, - 0, - UPLOAD_ERR_OK, - 'phalcon.txt' - ); - - $expected = $stream; - $actual = $file->getStream(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: getStream() - string - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetStreamString(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getStream() - string'); - $file = new UploadedFile( - 'php://memory', - 0, - UPLOAD_ERR_OK, - 'phalcon.txt' - ); - - $actual = $file->getStream(); - $I->assertInstanceOf(StreamInterface::class, $actual); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: getStream() - exception - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetStreamException(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getStream() - exception'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Failed to write file to disk.' - ), - function () { - $stream = new Stream('php://memory'); - $file = new UploadedFile( - $stream, - 0, - UPLOAD_ERR_CANT_WRITE, - 'phalcon.txt' - ); - - $actual = $file->getStream(); - } - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: getStream() - exception - * already moved - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileGetStreamExceptionAlreadyMoved(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - getStream() - exception already moved'); - - $I->expectThrowable( - new InvalidArgumentException( - 'The file has already been moved to the target location' - ), - function () use ($I) { - $stream = new Stream('php://memory', 'w+b'); - $stream->write('Phalcon Framework'); - - $file = new UploadedFile($stream, 0); - $target = $I->getNewFileName(); - $target = outputDir( - 'tests/stream/' . $target - ); - - $file->moveTo($target); - $actual = $file->getStream(); - } - ); - } -} diff --git a/tests/unit/Http/Message/UploadedFile/MoveToCest.php b/tests/unit/Http/Message/UploadedFile/MoveToCest.php deleted file mode 100644 index af4c5750e1e..00000000000 --- a/tests/unit/Http/Message/UploadedFile/MoveToCest.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFile; - -use Phalcon\Http\Message\Exception\InvalidArgumentException; -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\UploadedFile; -use UnitTester; - -use function outputDir; - -class MoveToCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFile :: moveTo() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileMoveTo(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - moveTo()'); - - $stream = new Stream('php://memory', 'w+b'); - - $stream->write('Phalcon Framework'); - - $file = new UploadedFile($stream, 0); - $target = $I->getNewFileName(); - $target = outputDir( - 'tests/stream/' . $target - ); - - $file->moveTo($target); - $I->seeFileFound($target); - $I->openFile($target); - - $I->seeFileContentsEqual( - (string) $stream - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: moveTo() - upload error - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileMoveToUploadError(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - moveTo() - upload error'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Failed to write file to disk.' - ), - function () use ($I) { - $stream = new Stream('php://memory', 'w+b'); - - $stream->write('Phalcon Framework'); - - $target = $I->getNewFileName(); - - $target = outputDir( - 'tests/stream/' . $target - ); - - $file = new UploadedFile($stream, 0, UPLOAD_ERR_CANT_WRITE); - - $file->moveTo($target); - } - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: moveTo() - wrong path - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileMoveToWrongPath(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - moveTo() - wrong path'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Target folder is empty string, not a folder or not writable' - ), - function () use ($I) { - $stream = new Stream('php://memory', 'w+b'); - - $stream->write('Phalcon Framework'); - - $file = new UploadedFile($stream, 0); - - $file->moveTo(123); - } - ); - } - - /** - * Tests Phalcon\Http\Message\UploadedFile :: moveTo() - already moved - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileMoveToAlreadyMoved(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFile - moveTo() - already moved'); - - $I->expectThrowable( - new InvalidArgumentException( - 'File has already been moved' - ), - function () use ($I) { - $stream = new Stream('php://memory', 'w+b'); - - $stream->write('Phalcon Framework'); - - $file = new UploadedFile($stream, 0); - - $target = $I->getNewFileName(); - - $target = outputDir( - 'tests/stream/' . $target - ); - - $file->moveTo($target); - $file->moveTo($target); - } - ); - } -} diff --git a/tests/unit/Http/Message/UploadedFileFactory/ConstructCest.php b/tests/unit/Http/Message/UploadedFileFactory/ConstructCest.php deleted file mode 100644 index 3cae5b4d21a..00000000000 --- a/tests/unit/Http/Message/UploadedFileFactory/ConstructCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFileFactory; - -use Phalcon\Http\Message\UploadedFileFactory; -use Psr\Http\Message\UploadedFileFactoryInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\ServerUploadedFileFactory :: __construct() - * - * @author Phalcon Team - * @since 2019-02-08 - */ - public function httpUploadedFileFactoryConstruct(UnitTester $I) - { - $I->wantToTest('Http\UploadedFileFactory - __construct()'); - - $factory = new UploadedFileFactory(); - $class = UploadedFileFactoryInterface::class; - $I->assertInstanceOf($class, $factory); - } -} diff --git a/tests/unit/Http/Message/UploadedFileFactory/CreateUploadedFileCest.php b/tests/unit/Http/Message/UploadedFileFactory/CreateUploadedFileCest.php deleted file mode 100644 index 736531edec4..00000000000 --- a/tests/unit/Http/Message/UploadedFileFactory/CreateUploadedFileCest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UploadedFileFactory; - -use Phalcon\Http\Message\Stream; -use Phalcon\Http\Message\UploadedFileFactory; -use Psr\Http\Message\UploadedFileInterface; -use UnitTester; - -class CreateUploadedFileCest -{ - /** - * Tests Phalcon\Http\Message\UploadedFileFactory :: createUploadedFile() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpMessageUploadedFileFactoryCreateUploadedFile(UnitTester $I) - { - $I->wantToTest('Http\Message\UploadedFileFactory - createUploadedFile()'); - $factory = new UploadedFileFactory(); - $stream = new Stream('php://temp'); - $file = $factory->createUploadedFile($stream); - $class = UploadedFileInterface::class; - $I->assertInstanceOf($class, $file); - } -} diff --git a/tests/unit/Http/Message/Uri/ConstructCest.php b/tests/unit/Http/Message/Uri/ConstructCest.php deleted file mode 100644 index a48e4efa0c5..00000000000 --- a/tests/unit/Http/Message/Uri/ConstructCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use Psr\Http\Message\UriInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: __construct() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriConstruct(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - __construct()'); - - $uri = new Uri(); - $class = UriInterface::class; - $I->assertInstanceOf($class, $uri); - } -} diff --git a/tests/unit/Http/Message/Uri/GetAuthorityCest.php b/tests/unit/Http/Message/Uri/GetAuthorityCest.php deleted file mode 100644 index 07fafd04fcd..00000000000 --- a/tests/unit/Http/Message/Uri/GetAuthorityCest.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetAuthorityCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getAuthority() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetAuthority(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Uri - getAuthority()'); - - $uri = new Uri( - $example[1] - ); - - $I->assertEquals( - $example[2], - $uri->getAuthority() - ); - } - - - private function getExamples(): array - { - return [ - [ - 'empty', - '', - '', - ], - - [ - 'default', - 'https://dev.phalcon.ld', - 'dev.phalcon.ld', - ], - - [ - 'with user info', - 'https://phalcon:secret@dev.phalcon.ld', - 'phalcon:secret@dev.phalcon.ld', - ], - - [ - 'with port', - 'https://dev.phalcon.ld:8080', - 'dev.phalcon.ld:8080', - ], - - [ - 'full', - 'https://phalcon:secret@dev.phalcon.ld:8080', - 'phalcon:secret@dev.phalcon.ld:8080', - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/GetFragmentCest.php b/tests/unit/Http/Message/Uri/GetFragmentCest.php deleted file mode 100644 index 9f7e77cc6de..00000000000 --- a/tests/unit/Http/Message/Uri/GetFragmentCest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetFragmentCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getFragment() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetFragment(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getFragment()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'frag'; - $actual = $uri->getFragment(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getFragment() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetFragmentEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getFragment() - empty'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value'; - $uri = new Uri($query); - - $actual = $uri->getFragment(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetHostCest.php b/tests/unit/Http/Message/Uri/GetHostCest.php deleted file mode 100644 index f81f47f451a..00000000000 --- a/tests/unit/Http/Message/Uri/GetHostCest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetHostCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getHost() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetHost(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getHost()'); - - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'dev.phalcon.ld'; - $actual = $uri->getHost(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getHost() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetHostEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getHost() - empty'); - - $query = 'https://'; - $uri = new Uri($query); - - $actual = $uri->getHost(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetPathCest.php b/tests/unit/Http/Message/Uri/GetPathCest.php deleted file mode 100644 index 905bd2ffb7a..00000000000 --- a/tests/unit/Http/Message/Uri/GetPathCest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetPathCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getPath() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetPath(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getPath()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = '/action'; - $actual = $uri->getPath(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getPath() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetPathEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getPath() - empty'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080'; - $uri = new Uri($query); - - $actual = $uri->getPath(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetPortCest.php b/tests/unit/Http/Message/Uri/GetPortCest.php deleted file mode 100644 index fe3eed3c163..00000000000 --- a/tests/unit/Http/Message/Uri/GetPortCest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetPortCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getPort() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetPort(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getPort()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 8080; - $actual = $uri->getPort(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getPort() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetPortEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getPort() - empty'); - $query = 'https://phalcon:secret@dev.phalcon.ld/action?param=value'; - $uri = new Uri($query); - - $actual = $uri->getPort(); - $I->assertNull($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetQueryCest.php b/tests/unit/Http/Message/Uri/GetQueryCest.php deleted file mode 100644 index 24b0ba26f7a..00000000000 --- a/tests/unit/Http/Message/Uri/GetQueryCest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetQueryCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getQuery() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetQuery(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getQuery()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'param=value'; - $actual = $uri->getQuery(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getQuery() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetQueryEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getQuery() - empty'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action'; - $uri = new Uri($query); - - $actual = $uri->getQuery(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetSchemeCest.php b/tests/unit/Http/Message/Uri/GetSchemeCest.php deleted file mode 100644 index 457d78a6e4e..00000000000 --- a/tests/unit/Http/Message/Uri/GetSchemeCest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetSchemeCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getScheme() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetScheme(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getScheme()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'https'; - $actual = $uri->getScheme(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getScheme() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetSchemeEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getScheme() - empty'); - $query = '//phalcon:secret@dev.phalcon.ld:8080/action?param=value'; - $uri = new Uri($query); - - $actual = $uri->getScheme(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/GetUserInfoCest.php b/tests/unit/Http/Message/Uri/GetUserInfoCest.php deleted file mode 100644 index 705a8d56783..00000000000 --- a/tests/unit/Http/Message/Uri/GetUserInfoCest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class GetUserInfoCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: getUserInfo() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriGetUserInfo(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - getUserInfo()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'phalcon:secret'; - $actual = $uri->getUserInfo(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getUserInfo() - only user - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetUserInfoOnlyUser(UnitTester $I) - { - $I->wantToTest('Http\Uri - getUserInfo() - only user'); - $query = 'https://phalcon@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = 'phalcon'; - $actual = $uri->getUserInfo(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getUserInfo() - only pass - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetUserInfoOnlyPass(UnitTester $I) - { - $I->wantToTest('Http\Uri - getUserInfo() - only pass'); - $query = 'https://:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $expected = ':secret'; - $actual = $uri->getUserInfo(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: getUserInfo() - empty - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriGetUserInfoEmpty(UnitTester $I) - { - $I->wantToTest('Http\Uri - getUserInfo() - empty'); - $query = 'https://dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $actual = $uri->getUserInfo(); - $I->assertEmpty($actual); - } -} diff --git a/tests/unit/Http/Message/Uri/ToStringCest.php b/tests/unit/Http/Message/Uri/ToStringCest.php deleted file mode 100644 index a62205ecf20..00000000000 --- a/tests/unit/Http/Message/Uri/ToStringCest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Phalcon\Http\Message\Uri; -use UnitTester; - -class ToStringCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: __toString() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriToString(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - __toString()'); - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $I->assertEquals($query, (string) $uri); - } - - /** - * Tests Phalcon\Http\Message\Uri :: __toString() - path no lead slash - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriToStringPathNoLeadSlash(UnitTester $I) - { - $I->wantToTest('Http\Uri - __toString() - path no lead slash'); - $uri = new Uri('https://dev.phalcon.ld'); - - $newInstance = $uri->withPath('action/reaction'); - $expected = 'https://dev.phalcon.ld/action/reaction'; - $actual = $newInstance->__toString(); - $I->assertEquals($expected, $actual); - } - - /** - * Tests Phalcon\Http\Message\Uri :: __toString() - path many slashes - * - * @author Phalcon Team - * @since 2019-06-01 - */ - public function httpUriToStringPathManySlashes(UnitTester $I) - { - $I->wantToTest('Http\Uri - __toString() - path many slashes'); - $uri = new Uri('https://dev.phalcon.ld'); - - $newInstance = $uri->withPath('///action/reaction'); - $expected = 'https://dev.phalcon.ld/action/reaction'; - $actual = $newInstance->__toString(); - $I->assertEquals($expected, $actual); - } -} diff --git a/tests/unit/Http/Message/Uri/WithFragmentCest.php b/tests/unit/Http/Message/Uri/WithFragmentCest.php deleted file mode 100644 index ac96c7a9c55..00000000000 --- a/tests/unit/Http/Message/Uri/WithFragmentCest.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithFragmentCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withFragment() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithFragment(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - withFragment()'); - - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#%s'; - - $uri = new Uri( - sprintf($query, 'frag') - ); - - $newInstance = $uri->withFragment('newspaper'); - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - 'newspaper', - $newInstance->getFragment() - ); - - $I->assertEquals( - sprintf($query, 'newspaper'), - (string) $newInstance - ); - - $newInstance = $uri->withFragment('#newspaper'); - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - '%23newspaper', - $newInstance->getFragment() - ); - - $I->assertEquals( - sprintf($query, '%23newspaper'), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withFragment() - exception no string - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithFragmentException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withFragment() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withFragment($example[2]); - } - ); - } - - - private function getExamples(): array - { - return [ - ['NULL', 'null', null], - ['boolean', 'true', true], - ['boolean', 'false', false], - ['integer', 'number', 1234], - ['array', 'array', ['/action']], - ['stdClass', 'object', (object) ['/action']], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithHostCest.php b/tests/unit/Http/Message/Uri/WithHostCest.php deleted file mode 100644 index b8ba50b4707..00000000000 --- a/tests/unit/Http/Message/Uri/WithHostCest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithHostCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withHost() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithHost(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - withHost()'); - - $query = 'https://phalcon:secret@%s:8080/action?param=value#frag'; - - $uri = new Uri( - sprintf($query, 'dev.phalcon.ld') - ); - - $newInstance = $uri->withHost('prod.phalcon.ld'); - - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - 'prod.phalcon.ld', - $newInstance->getHost() - ); - - $I->assertEquals( - sprintf($query, 'prod.phalcon.ld'), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withHost() - exception no string - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithHostException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withHost() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withHost($example[2]); - } - ); - } - - - private function getExamples(): array - { - return [ - [ - 'NULL', - 'null', - null, - ], - [ - 'boolean', - 'true', - true, - ], - [ - 'boolean', - 'false', - false, - ], - [ - 'integer', - 'number', - 1234, - ], - [ - 'array', - 'array', - ['/action'], - ], - [ - 'stdClass', - 'object', - (object) ['/action'], - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithPathCest.php b/tests/unit/Http/Message/Uri/WithPathCest.php deleted file mode 100644 index 4c5a50f33ee..00000000000 --- a/tests/unit/Http/Message/Uri/WithPathCest.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithPathCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withPath() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithPath(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Uri - withPath() - ' . $example[0]); - - $query = 'https://dev.phalcon.ld%s'; - - $uri = new Uri( - sprintf($query, '/action') - ); - - $newInstance = $uri->withPath( - $example[1] - ); - - $I->assertNotEquals( - $uri, - $newInstance - ); - - $I->assertEquals( - $example[2], - $newInstance->getPath() - ); - - $I->assertEquals( - sprintf($query, $example[3]), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withPath() - exception query string - * - * @author Phalcon Team - * @since 2019-06-01 - */ - public function httpUriWithPathExceptionQueryString(UnitTester $I) - { - $I->wantToTest('Http\Uri - withPath() - exception - query string'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Path cannot contain a query string or fragment' - ), - function () { - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - $instance = $uri->withPath('/login?param=value'); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withPath() - exception query fragment - * - * @author Phalcon Team - * @since 2019-06-01 - */ - public function httpUriWithPathExceptionQueryFragment(UnitTester $I) - { - $I->wantToTest('Http\Uri - withPath() - exception - query fragment'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Path cannot contain a query string or fragment' - ), - function () { - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - $instance = $uri->withPath('/login#frag'); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withPath() - exception no string - * - * @dataProvider getExceptions - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithPathException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withPath() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - $instance = $uri->withPath($example[2]); - } - ); - } - - - private function getExamples(): array - { - return [ - ['empty', '', '', ''], - ['normal', '/login', '/login', '/login'], - ['double slash', '//login', '/login', '/login'], - ['no leading slash', 'login', 'login', '/login'], - ['garbled', '/l^ogin/si gh', '/l%5Eogin/si%20gh', '/l%5Eogin/si%20gh'], - ]; - } - - - private function getExceptions(): array - { - return [ - ['NULL', 'null', null], - ['boolean', 'true', true], - ['boolean', 'false', false], - ['integer', 'number', 1234], - ['array', 'array', ['/action']], - ['stdClass', 'object', (object) ['/action']], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithPortCest.php b/tests/unit/Http/Message/Uri/WithPortCest.php deleted file mode 100644 index 3018944824c..00000000000 --- a/tests/unit/Http/Message/Uri/WithPortCest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -use function sprintf; - -class WithPortCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withPort() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-06-01 - */ - public function httpMessageUriWithPort(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Uri - withPort() - ' . $example[0]); - - $query = 'https://phalcon:secret@dev.phalcon.ld:%s/action?param=value#frag'; - - $uri = new Uri( - sprintf($query, ':4300') - ); - - $newInstance = $uri->withPort($example[1]); - - $I->assertNotEquals( - $uri, - $newInstance - ); - - $I->assertEquals( - $example[2], - $newInstance->getPort() - ); - - $I->assertEquals( - sprintf($query, $example[3]), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withPort() - exception no string - * - * @dataProvider getExceptions - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithPortException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withPort() - ' . $example[0]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method expects ' . $example[2] - ), - function () use ($example) { - $query = 'https://phalcon:secret@dev.phalcon.ld%s/action?param=value#frag'; - - $uri = new Uri( - sprintf($query, ':4300') - ); - - $newInstance = $uri->withPort($example[1]); - } - ); - } - - - private function getExamples(): array - { - return [ - [ - 'null', - null, - null, - '', - ], - [ - 'int', - 8080, - 8080, - ':8080', - ], - [ - 'string-int', - '8080', - 8080, - ':8080', - ], - [ - 'http', - 80, - null, - '', - ], - [ - 'https', - 443, - null, - '', - ], - ]; - } - - - private function getExceptions(): array - { - return [ - ['port less than 1', -2, 'valid port (1-65535)'], - ['port more than max', 70000, 'valid port (1-65535)'], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithQueryCest.php b/tests/unit/Http/Message/Uri/WithQueryCest.php deleted file mode 100644 index d5dbcc09a6d..00000000000 --- a/tests/unit/Http/Message/Uri/WithQueryCest.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithQueryCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withQuery() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithQuery(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Uri - withQuery()'); - - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?%s#frag'; - $uri = new Uri(sprintf($query, 'param=value')); - - $newInstance = $uri->withQuery($example[1]); - - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - $example[2], - $newInstance->getQuery() - ); - - $I->assertEquals( - sprintf($query, $example[2]), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withQuery() - exception no string - * - * @dataProvider getExceptions - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithQueryException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withQuery() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withQuery($example[2]); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withQuery() - exception with fragment - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithQueryExceptionWithFragment(UnitTester $I) - { - $I->wantToTest('Http\Uri - withQuery() - exception - with fragment'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Query cannot contain a query fragment' - ), - function () { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withQuery('/login#frag'); - } - ); - } - - private function getExamples(): array - { - return [ - [ - 'key only', - 'p^aram', - 'p%5Earam', - ], - [ - 'key and value', - 'p^aram=valu`', - 'p%5Earam=valu%60', - ], - [ - 'key as array', - 'param[]', - 'param%5B%5D', - ], - [ - 'key as array and value', - 'param[]=valu`', - 'param%5B%5D=valu%60', - ], - [ - 'key with questionmark', - '?param=valu', - 'param=valu', - ], - [ - 'complex', - 'p^aram&all[]=va lu`&f<>=`bar', - 'p%5Earam&all%5B%5D=va%20lu%60&f%3C%3E=%60bar', - ], - ]; - } - - private function getExceptions(): array - { - return [ - [ - 'NULL', - 'null', - null, - ], - [ - 'boolean', - 'true', - true, - ], - [ - 'boolean', - 'false', - false, - ], - [ - 'integer', - 'number', - 1234, - ], - [ - 'array', - 'array', - ['/action'], - ], - [ - 'stdClass', - 'object', - (object) ['/action'], - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithSchemeCest.php b/tests/unit/Http/Message/Uri/WithSchemeCest.php deleted file mode 100644 index 7de5a194c6c..00000000000 --- a/tests/unit/Http/Message/Uri/WithSchemeCest.php +++ /dev/null @@ -1,140 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithSchemeCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withScheme() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithScheme(UnitTester $I) - { - $I->wantToTest('Http\Message\Uri - withScheme()'); - - $query = '%s://phalcon:secret@dev.phalcon.ld:8000/action?param=value#frag'; - - $uri = new Uri( - sprintf($query, 'https') - ); - - $newInstance = $uri->withScheme('http'); - - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - 'http', - $newInstance->getScheme() - ); - - $I->assertEquals( - sprintf($query, 'http'), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withScheme() - exception unsupported - * - * @author Phalcon Team - * @since 2019-06-01 - */ - public function httpUriWithSchemeExceptionUnsupported(UnitTester $I) - { - $I->wantToTest('Http\Uri - withScheme() - exception - unsupported'); - - $I->expectThrowable( - new InvalidArgumentException( - 'Unsupported scheme [ftp]. Scheme must be one of [http, https]' - ), - function () { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withScheme('ftp'); - } - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withScheme() - exception no string - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithSchemeException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withScheme() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $uri = new Uri( - 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag' - ); - - $instance = $uri->withScheme($example[2]); - } - ); - } - - - private function getExamples(): array - { - return [ - [ - 'NULL', - 'null', - null, - ], - [ - 'boolean', - 'true', - true, - ], - [ - 'boolean', - 'false', - false, - ], - [ - 'integer', - 'number', - 1234, - ], - [ - 'array', - 'array', - ['/action'], - ], - [ - 'stdClass', - 'object', - (object) ['/action'], - ], - ]; - } -} diff --git a/tests/unit/Http/Message/Uri/WithUserInfoCest.php b/tests/unit/Http/Message/Uri/WithUserInfoCest.php deleted file mode 100644 index 192d8f9738f..00000000000 --- a/tests/unit/Http/Message/Uri/WithUserInfoCest.php +++ /dev/null @@ -1,152 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\Uri; - -use Codeception\Example; -use InvalidArgumentException; -use Phalcon\Http\Message\Uri; -use UnitTester; - -class WithUserInfoCest -{ - /** - * Tests Phalcon\Http\Message\Uri :: withUserInfo() - * - * @dataProvider getExamples - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriWithUserInfo(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Message\Uri - withUserInfo()'); - - $query = 'https://%s@dev.phalcon.ld:8080/action?param=value#frag'; - - $uri = new Uri( - sprintf($query, 'zephir:module') - ); - - $newInstance = $uri->withUserInfo($example[1], $example[2]); - - $I->assertNotEquals($uri, $newInstance); - - $I->assertEquals( - $example[3], - $newInstance->getUserInfo() - ); - - $I->assertEquals( - sprintf($query, $example[3]), - (string) $newInstance - ); - } - - /** - * Tests Phalcon\Http\Message\Uri :: withUserInfo() - exception no string - * - * @dataProvider getExceptions - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriWithUserInfoException(UnitTester $I, Example $example) - { - $I->wantToTest('Http\Uri - withUserInfo() - exception - ' . $example[1]); - - $I->expectThrowable( - new InvalidArgumentException( - 'Method requires a string argument' - ), - function () use ($example) { - $query = 'https://phalcon:secret@dev.phalcon.ld:8080/action?param=value#frag'; - $uri = new Uri($query); - - $instance = $uri->withUserInfo($example[2]); - } - ); - } - - private function getExamples(): array - { - return [ - [ - 'valid', - 'phalcon', - 'secret', - 'phalcon:secret', - ], - [ - 'user only', - 'phalcon', - '', - 'phalcon', - ], - [ - 'email', - 'phalcon@secret', - 'secret@phalcon', - 'phalcon%40secret:secret%40phalcon', - ], - [ - 'email', - 'phalcon:secret', - 'secret:phalcon', - 'phalcon%3Asecret:secret%3Aphalcon', - ], - [ - 'percent', - 'phalcon%secret', - 'secret%phalcon', - 'phalcon%25secret:secret%25phalcon', - ], - ]; - } - - private function getExceptions(): array - { - return [ - [ - 'NULL', - 'null', - null, - ], - [ - 'boolean', - 'true', - true, - ], - [ - 'boolean', - 'false', - false, - ], - [ - 'integer', - 'number', - 1234, - ], - [ - 'array', - 'array', - ['/action'], - ], - [ - 'stdClass', - 'object', - (object) ['/action'], - ], - ]; - } -} diff --git a/tests/unit/Http/Message/UriFactory/ConstructCest.php b/tests/unit/Http/Message/UriFactory/ConstructCest.php deleted file mode 100644 index a06a9f7851b..00000000000 --- a/tests/unit/Http/Message/UriFactory/ConstructCest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UriFactory; - -use Phalcon\Http\Message\UriFactory; -use Psr\Http\Message\UriFactoryInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Message\UriFactory :: __construct() - * - * @author Phalcon Team - * @since 2019-02-07 - */ - public function httpUriFactoryConstruct(UnitTester $I) - { - $I->wantToTest('Http\UriFactory - __construct()'); - - $factory = new UriFactory(); - $class = UriFactoryInterface::class; - $I->assertInstanceOf($class, $factory); - } -} diff --git a/tests/unit/Http/Message/UriFactory/CreateUriCest.php b/tests/unit/Http/Message/UriFactory/CreateUriCest.php deleted file mode 100644 index f8e04698ae2..00000000000 --- a/tests/unit/Http/Message/UriFactory/CreateUriCest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Message\UriFactory; - -use Phalcon\Http\Message\UriFactory; -use Psr\Http\Message\UriInterface; -use UnitTester; - -class CreateUriCest -{ - /** - * Tests Phalcon\Http\Message\UriFactory :: createUri() - * - * @author Phalcon Team - * @since 2019-02-09 - */ - public function httpMessageUriFactoryCreateUri(UnitTester $I) - { - $I->wantToTest('Http\Message\UriFactory - createUri()'); - - $factory = new UriFactory(); - $uri = $factory->createUri(); - $class = UriInterface::class; - $I->assertInstanceOf($class, $uri); - } -} diff --git a/tests/unit/Http/Server/Middleware/ConstructCest.php b/tests/unit/Http/Server/Middleware/ConstructCest.php deleted file mode 100644 index 96c6c4a5dd9..00000000000 --- a/tests/unit/Http/Server/Middleware/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Server\Middleware; - -use Phalcon\Tests\Fixtures\Http\Server\MiddlewareFixture; -use Psr\Http\Server\MiddlewareInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Server\Middleware :: __construct() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpServerMiddlewareProcess(UnitTester $I) - { - $I->wantToTest('Http\Server\Middleware - __construct()'); - $handler = new MiddlewareFixture(); - $class = MiddlewareInterface::class; - $I->assertInstanceOf($class, $handler); - } -} diff --git a/tests/unit/Http/Server/Middleware/ProcessCest.php b/tests/unit/Http/Server/Middleware/ProcessCest.php deleted file mode 100644 index 5159142d3c9..00000000000 --- a/tests/unit/Http/Server/Middleware/ProcessCest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Server\Middleware; - -use UnitTester; - -class ProcessCest -{ - /** - * Tests Phalcon\Http\Server\Middleware :: process() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpServerMiddlewareProcess(UnitTester $I) - { - $I->wantToTest('Http\Server\Middleware - process()'); - $I->skipTest('Need implementation'); - } -} diff --git a/tests/unit/Http/Server/RequestHandler/ConstructCest.php b/tests/unit/Http/Server/RequestHandler/ConstructCest.php deleted file mode 100644 index e311bfc548b..00000000000 --- a/tests/unit/Http/Server/RequestHandler/ConstructCest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Server\RequestHandler; - -use Phalcon\Tests\Fixtures\Http\Server\RequestHandlerFixture; -use Psr\Http\Server\RequestHandlerInterface; -use UnitTester; - -class ConstructCest -{ - /** - * Tests Phalcon\Http\Server\RequestHandler :: __construct() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpServerRequestHandlerHandle(UnitTester $I) - { - $I->wantToTest('Http\Server\RequestHandler - __construct()'); - $handler = new RequestHandlerFixture(); - $class = RequestHandlerInterface::class; - $I->assertInstanceOf($class, $handler); - } -} diff --git a/tests/unit/Http/Server/RequestHandler/HandleCest.php b/tests/unit/Http/Server/RequestHandler/HandleCest.php deleted file mode 100644 index e3a6ab10f02..00000000000 --- a/tests/unit/Http/Server/RequestHandler/HandleCest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Phalcon\Tests\Unit\Http\Server\RequestHandler; - -use UnitTester; - -class HandleCest -{ - /** - * Tests Phalcon\Http\Server\RequestHandler :: handle() - * - * @author Phalcon Team - * @since 2019-02-10 - */ - public function httpServerRequestHandlerHandle(UnitTester $I) - { - $I->wantToTest('Http\Server\RequestHandler - handle()'); - $I->skipTest('Need implementation'); - } -} diff --git a/tests/unit/Logger/Logger/ConstructCest.php b/tests/unit/Logger/Logger/ConstructCest.php index c880d0e7416..daf0775dcc0 100644 --- a/tests/unit/Logger/Logger/ConstructCest.php +++ b/tests/unit/Logger/Logger/ConstructCest.php @@ -17,7 +17,7 @@ use Phalcon\Logger\Exception; use Phalcon\Logger\Formatter\Json; use Phalcon\Logger\Logger; -use Psr\Log\LoggerInterface; +use Phalcon\Logger\LoggerInterface; use UnitTester; class ConstructCest @@ -30,9 +30,9 @@ class ConstructCest * @author Phalcon Team * @since 2020-09-09 */ - public function loggerConstructImplementPsr(UnitTester $I) + public function loggerConstruct(UnitTester $I) { - $I->wantToTest('Logger - __construct() - implement PSR'); + $I->wantToTest('Logger - __construct()'); $logger = new Logger('my-logger'); $I->assertInstanceOf(LoggerInterface::class, $logger); diff --git a/tests/unit/Logger/LoggerFactory/LoadCest.php b/tests/unit/Logger/LoggerFactory/LoadCest.php index b95fad70986..209209d3ea5 100644 --- a/tests/unit/Logger/LoggerFactory/LoadCest.php +++ b/tests/unit/Logger/LoggerFactory/LoadCest.php @@ -18,8 +18,8 @@ use Phalcon\Logger\Exception as LoggerException; use Phalcon\Logger\Logger; use Phalcon\Logger\LoggerFactory; +use Phalcon\Logger\LoggerInterface; use Phalcon\Tests\Fixtures\Traits\FactoryTrait; -use Psr\Log\LoggerInterface; use UnitTester; class LoadCest diff --git a/tests/unit/Logger/LoggerFactory/NewInstanceCest.php b/tests/unit/Logger/LoggerFactory/NewInstanceCest.php index 9fab907ecf7..c617d7e8523 100644 --- a/tests/unit/Logger/LoggerFactory/NewInstanceCest.php +++ b/tests/unit/Logger/LoggerFactory/NewInstanceCest.php @@ -17,7 +17,7 @@ use Phalcon\Logger\AdapterFactory; use Phalcon\Logger\Logger; use Phalcon\Logger\LoggerFactory; -use Psr\Log\LoggerInterface; +use Phalcon\Logger\LoggerInterface; use UnitTester; use function logsDir; diff --git a/tests/unit/Translate/Adapter/Csv/ToArrayCest.php b/tests/unit/Translate/Adapter/Csv/ToArrayCest.php new file mode 100644 index 00000000000..7c3d469204a --- /dev/null +++ b/tests/unit/Translate/Adapter/Csv/ToArrayCest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Unit\Translate\Adapter\Csv; + +use Phalcon\Tests\Fixtures\Traits\TranslateCsvTrait; +use Phalcon\Translate\Adapter\Csv; +use Phalcon\Translate\InterpolatorFactory; +use UnitTester; + +class ToArrayCest +{ + use TranslateCsvTrait; + + /** + * Tests Phalcon\Translate\Adapter\Csv :: toArray() + * + * @param UnitTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function translateAdapterCsvToArray(UnitTester $I) + { + $I->wantToTest('Translate\Adapter\Csv - toArray()'); + + $language = $this->getCsvConfig()['en']; + $translator = new Csv(new InterpolatorFactory(), $language); + + $expected = [ + 'hi' => 'Hello', + 'bye' => 'Good Bye', + 'hello-key' => 'Hello %name%', + 'song-key' => 'This song is %song% (%artist%)', + ]; + $actual = $translator->toArray(); + $I->assertSame($expected, $actual); + } +} diff --git a/tests/unit/Translate/Adapter/NativeArray/ToArrayCest.php b/tests/unit/Translate/Adapter/NativeArray/ToArrayCest.php new file mode 100644 index 00000000000..4e4d9443576 --- /dev/null +++ b/tests/unit/Translate/Adapter/NativeArray/ToArrayCest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Phalcon\Tests\Unit\Translate\Adapter\NativeArray; + +use Phalcon\Tests\Fixtures\Traits\TranslateNativeArrayTrait; +use Phalcon\Translate\Adapter\NativeArray; +use Phalcon\Translate\InterpolatorFactory; +use UnitTester; + +class ToArrayCest +{ + use TranslateNativeArrayTrait; + + /** + * Tests Phalcon\Translate\Adapter\NativeArray :: toArray() + * + * @param UnitTester $I + * + * @author Phalcon Team + * @since 2020-09-09 + */ + public function translateAdapterNativeToArray(UnitTester $I) + { + $I->wantToTest('Translate\Adapter\NativeArray - toArray()'); + + $language = $this->getArrayConfig()['en']; + + $translator = new NativeArray( + new InterpolatorFactory(), + [ + 'content' => $language, + ] + ); + + $expected = $language; + $actual = $translator->toArray(); + $I->assertSame($expected, $actual); + } +}