Skip to content

Commit

Permalink
Merge branch '5.0.x' into #15343-improve-stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Apr 10, 2021
2 parents cd13a13 + 3b4bb88 commit 40758e7
Show file tree
Hide file tree
Showing 34 changed files with 669 additions and 277 deletions.
4 changes: 2 additions & 2 deletions .ci/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ function InitializeBuildVars {

function InitializeReleaseVars {
if ($Env:BUILD_TYPE -Match "nts-Win32") {
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:APPVEYOR_BUILD_VERSION}_nts"
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:APPVEYOR_BUILD_VERSION}_nts"

if ($Env:PLATFORM -eq 'x86') {
$Env:RELEASE_FOLDER = "Release"
} else {
$Env:RELEASE_FOLDER = "x64\Release"
}
} else {
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:APPVEYOR_BUILD_VERSION}"
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_${Env:VC_VERSION}_php${Env:PHP_VERSION}_${Env:APPVEYOR_BUILD_VERSION}"

if ($Env:PLATFORM -eq 'x86') {
$Env:RELEASE_FOLDER = "Release_TS"
Expand Down
2 changes: 1 addition & 1 deletion .ci/vsenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
) else "VC not found"

echo "------------- phpsdk-starter ---------------------------"
call "%PHP_SDK_PATH%\phpsdk-vs16-%PHP_ARCH%.bat"
call "%PHP_SDK_PATH%\phpsdk-%VC_VERSION%-%PHP_ARCH%.bat"

echo "------------- phpsdk_setvars ---------------------------"
call "%PHP_SDK_PATH%\bin\phpsdk_setvars.bat"
Expand Down
27 changes: 23 additions & 4 deletions .ci/win-ci-tools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ function PrintBuildDetails {

function InitializeReleaseVars {
if ($env:BUILD_TYPE -Match "nts-Win32") {
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}_nts"
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_${env:VC_VERSION}_php${env:PHP_MINOR}_nts"

if ($env:PHP_ARCH -eq 'x86') {
$env:RELEASE_FOLDER = "Release"
} else {
$env:RELEASE_FOLDER = "x64\Release"
}
} else {
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_vc${env:VC_VERSION}_php${env:PHP_MINOR}"
$env:RELEASE_ZIPBALL = "${env:PACKAGE_PREFIX}_${env:PHP_ARCH}_${env:VC_VERSION}_php${env:PHP_MINOR}"

if ($env:PHP_ARCH -eq 'x86') {
$env:RELEASE_FOLDER = "Release_TS"
Expand All @@ -274,20 +274,39 @@ function InitializeReleaseVars {

$env:RELEASE_DLL_PATH = "${env:PHP_PECL_PATH}\phalcon\phalcon-${env:PHALCON_VERSION}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}"

Write-Output "RELEASE_FOLDER=${env:RELEASE_FOLDER}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "RELEASE_ZIPBALL=${env:RELEASE_ZIPBALL}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "RELEASE_DLL_PATH=${env:RELEASE_DLL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}

function EnablePhalconExtension {
if (-not (Test-Path env:RELEASE_DLL_PATH)) {
if (-not (Test-Path $env:RELEASE_DLL_PATH)) {
InitializeReleaseVars
}

if (-not (Test-Path "${env:RELEASE_DLL_PATH}")) {
if (-not (Test-Path ${env:RELEASE_DLL_PATH})) {
throw "Unable to locate extension path: ${env:RELEASE_DLL_PATH}"
}

Copy-Item "${env:RELEASE_DLL_PATH}" "${env:PHPROOT}\ext\${env:EXTENSION_FILE}"

Enable-PhpExtension -Extension "${env:EXTENSION_NAME}" -Path "${env:PHPROOT}"
}

function EnablePsrExtension {
if (-not (Test-Path $env:RELEASE_FOLDER)) {
InitializeReleaseVars
}

# C:\tools\pecl\psr\psr-1.0.1\x64\Release\php_psr.dll
$env:PSR_EXT_NAME = 'php_psr.dll'
$env:PSR_DLL_PATH = "${env:PHP_PECL_PATH}\psr\psr-${env:PSR_VERSION}\${env:RELEASE_FOLDER}\${env:PSR_EXT_NAME}"

if (-not (Test-Path ${env:PSR_DLL_PATH})) {
throw "Unable to locate extension path: ${env:PSR_DLL_PATH}"
}

Copy-Item "${env:PSR_DLL_PATH}" "${env:PHPROOT}\ext\${env:PSR_EXT_NAME}"

Enable-PhpExtension -Extension 'psr' -Path "${env:PHPROOT}"
}
64 changes: 42 additions & 22 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
run: pecl package-validate phalcon-pecl.tgz

- name: Upload Artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: 'phalcon-pecl'
path: phalcon-pecl.tgz
Expand Down Expand Up @@ -151,8 +151,7 @@ jobs:
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-

- name: Setup Composer Token
run: |
Expand All @@ -165,9 +164,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json, imagick, redis, igbinary, apcu, msgpack, memcached, yaml
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so
tools: pecl
extensions: mbstring, intl, json, imagick, redis, igbinary, apcu, msgpack, memcached, yaml

- name: Download Phalcon Pecl Package
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -323,8 +322,7 @@ jobs:
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-

- name: Download Phalcon Pecl Package
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -367,7 +365,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [windows-2016]
operating-system: [windows-2016, windows-2019]
php-versions: ['7.4', '8.0']
ts: [ts, nts]
include:
Expand All @@ -379,9 +377,13 @@ jobs:
vc_num: 'vs16'
arch: x64
build_type: Win32
exclude:
- operating-system: windows-2016
php-versions: '8.0'
- operating-system: windows-2019
php-versions: '7.4'

steps:

- name: Disable Git autocrlf
run: git config --global core.autocrlf false

Expand All @@ -396,17 +398,18 @@ jobs:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=C:\temp
tools: pecl
extensions: mbstring, intl, json, yaml, apcu, imagick, gd, redis, igbinary, sqlite3, msgpack
extensions: mbstring, intl, json, yaml, apcu, imagick, gd, redis, igbinary, sqlite3, msgpack, psr
env:
PHPTS: ${{ matrix.ts }}

- name: Setup Environment Variables
run: |
Write-Output "PHP_SDK_VERSION=2.2.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PSR_VERSION=1.0.1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_DEVPACK=C:\tools\php-devpack" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_SDK_PATH=C:\tools\php-sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_PECL_PATH=C:\tools\pecl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PSR_VERSION=1.0.1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# FIXME: phpversion() return 7.4.3 but windows.php.net has only 7.4.4
# We should parse the following file to get the correct version:
Expand All @@ -424,7 +427,7 @@ jobs:
Write-Output "PACKAGE_PREFIX=phalcon" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_NAME=phalcon" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_FILE=php_phalcon.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHALCON_VERSION=5.0.0alpha1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHALCON_VERSION=5.0.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHPTS=${{ matrix.ts }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
If ("${{ matrix.ts }}" -eq "nts") {
Write-Output "BUILD_TYPE=nts-${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand Down Expand Up @@ -453,8 +456,7 @@ jobs:
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-

- name: Download Phalcon Pecl Package
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -526,46 +528,53 @@ jobs:
nmake
nmake install
- name: Run phpize
- name: PSR extension | Inspecting Extension DLL File
run: |
Get-PhpExtension "${env:PHP_PECL_PATH}\psr\psr-${env:PSR_VERSION}\${env:RELEASE_FOLDER}\php_psr.dll"
- name: Phalcon | phpize
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
cd /d %PHP_PECL_PATH%\phalcon\phalcon-%PHALCON_VERSION%
phpize
- name: Configure Project
- name: Phalcon | Configure Project
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
cd /d %PHP_PECL_PATH%\phalcon\phalcon-%PHALCON_VERSION%
configure --enable-phalcon
configure --enable-phalcon --with-extra-libs=%PHP_PECL_PATH%\psr\psr-%PSR_VERSION%\%RELEASE_FOLDER%
- name: Build Project
- name: Phalcon | Build Project
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%;%PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
set PATH=%PATH%;%PHP_DEVPACK%;%PHP_PECL_PATH%\psr\psr-%PSR_VERSION%\%RELEASE_FOLDER%
cd /d %PHP_PECL_PATH%\phalcon\phalcon-%PHALCON_VERSION%
nmake
- name: Inspecting Phalcon Extension DLL File
run: Get-PhpExtension "${env:RELEASE_DLL_PATH}"
run: |
Get-PhpExtension "${env:RELEASE_DLL_PATH}"
- name: Upload Artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: ${{ env.RELEASE_ZIPBALL }}
path: ${{ env.RELEASE_DLL_PATH }}

- name: Enable Phalcon
- name: Enable Extensions
run: |
Import-Module .\.ci\win-ci-tools.psm1
EnablePsrExtension
EnablePhalconExtension
- name: Verify Install
run: php --ri phalcon

- name: Install Packages
run: composer install --prefer-dist
# TODO: Imagick isn't available for PHP8.0
run: composer install --prefer-dist --ignore-platform-reqs

- name: Setup Tests
run: |
Expand All @@ -577,3 +586,14 @@ jobs:

- name: Run CLI Tests
run: vendor/bin/codecept run --ext DotReporter cli

- name: Upload build artifacts after Failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: tools
path: |
C:\tools\pecl\
C:\tools\php\
C:\tools\php-*\
retention-days: 1
11 changes: 6 additions & 5 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl, json, imagick, apcu, yaml, redis, igbinary, msgpack
extensions: mbstring, intl, json, imagick, apcu, yaml, redis, igbinary, msgpack, psr
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so

- name: Common Settings
Expand Down Expand Up @@ -100,8 +100,7 @@ jobs:
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
restore-keys: ${{ runner.os }}-composer-

- name: Setup Composer Token
run: |
Expand All @@ -115,9 +114,11 @@ jobs:

- name: Generate C code
run: |
sudo pecl install psr
# sudo pecl install psr
$HOME/bin/zephir fullclean
$HOME/bin/zephir build
$HOME/bin/zephir generate
$HOME/bin/zephir compile
$HOME/bin/zephir install
sudo echo "extension=phalcon.so" >> /etc/php/8.0/cli/php.ini
- name: Verify Install
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: php
php:
- '7.4'
- '7.3'
- '7.2'

os: linux
dist: bionic
Expand Down Expand Up @@ -38,7 +36,7 @@ services:
env:
global:
- CC="gcc"
- ZEPHIR_VERSION="0.12.19"
- ZEPHIR_VERSION="0.13.1"
- ZEPHIR_PARSER_VERSION="v1.3.6"
- REPORT_COVERAGE=0
- PATH="${HOME}/.composer/vendor/bin:${PATH}"
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# [5.0.0](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0-alpha.1) (2020-03-31)
# [5.0.0-alpha.2](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0-alpha.2) (xxxx-xx-xx)

## Fixed
- Corrected the `Phalcon\Db\Profiler\Item` calculation for seconds; added `Item::getTotalElapsedNanoseconds()` and `Item::getTotalElapsedMilliseconds()` for more precision [#15249](https://github.com/phalcon/cphalcon/issues/15249)
- Corrected `Phalcon\Http\Message\ServerRequestFactory` to populate with superglobals [#15286](https://github.com/phalcon/cphalcon/issues/15286)

# [5.0.0-alpha.1](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0-alpha.1) (2020-03-31)

## Fixed
- Support for PHP 7.4 and PHP 8.0
Expand Down
1 change: 1 addition & 0 deletions build/_resource/config/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php7/32bits/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php7/64bits/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php7/safe/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php8/32bits/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php8/64bits/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
1 change: 1 addition & 0 deletions build/php8/safe/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ 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");
}
Loading

0 comments on commit 40758e7

Please sign in to comment.