Skip to content

Commit d6da8d8

Browse files
authored
Merge pull request #13795 from phalcon/4.0.x
v4.0.0-alpha.2
2 parents b7e3378 + f0c303e commit d6da8d8

File tree

2,494 files changed

+89022
-79037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,494 files changed

+89022
-79037
lines changed

.ci/appveyor.psm1

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This file is part of the Phalcon Framework.
2+
#
3+
# (c) Phalcon Team <[email protected]>
4+
#
5+
# For the full copyright and license information, please view
6+
# the LICENSE.txt file that was distributed with this source code.
7+
8+
function InitializeBuildVars {
9+
switch ($Env:VC_VERSION) {
10+
'14' {
11+
if (-not (Test-Path $Env:VS120COMNTOOLS)) {
12+
throw 'The VS120COMNTOOLS environment variable is not set. Check your MS VS installation'
13+
}
14+
$Env:VSCOMNTOOLS = $Env:VS120COMNTOOLS -replace '\\$', ''
15+
16+
break
17+
}
18+
'15' {
19+
if (-not (Test-Path $Env:VS140COMNTOOLS)) {
20+
throw 'The VS140COMNTOOLS environment variable is not set. Check your MS VS installation'
21+
}
22+
$Env:VSCOMNTOOLS = $Env:VS140COMNTOOLS -replace '\\$', ''
23+
break
24+
}
25+
default {
26+
throw 'This script is designed to run with MS VS 14/15. Check your MS VS installation'
27+
break
28+
}
29+
}
30+
31+
if ($Env:PLATFORM -eq 'x64') {
32+
$Env:ARCH = 'x86_amd64'
33+
} else {
34+
$Env:ARCH = 'x86'
35+
}
36+
37+
$SearchFilter = 'vcvarsall.bat'
38+
$SearchInFolder = "${Env:VSCOMNTOOLS}\..\..\"
39+
40+
$Env:VCVARSALL_FILE = Get-ChildItem -Path $SearchInFolder -Filter $SearchFilter -Recurse -ErrorAction SilentlyContinue |
41+
ForEach-Object { $_.FullName }
42+
}
43+
44+
function InitializeReleaseVars {
45+
if ($Env:BUILD_TYPE -Match "nts-Win32") {
46+
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_MINOR}_${Env:APPVEYOR_BUILD_VERSION}_nts"
47+
48+
if ($Env:PLATFORM -eq 'x86') {
49+
$Env:RELEASE_FOLDER = "Release"
50+
} else {
51+
$Env:RELEASE_FOLDER = "x64\Release"
52+
}
53+
} else {
54+
$Env:RELEASE_ZIPBALL = "phalcon_${Env:PLATFORM}_vc${Env:VC_VERSION}_php${Env:PHP_MINOR}_${Env:APPVEYOR_BUILD_VERSION}"
55+
56+
if ($Env:PLATFORM -eq 'x86') {
57+
$Env:RELEASE_FOLDER = "Release_TS"
58+
} else {
59+
$Env:RELEASE_FOLDER = "x64\Release_TS"
60+
}
61+
}
62+
63+
$Env:RELEASE_DLL_PATH = "${Env:APPVEYOR_BUILD_FOLDER}\build\php7\safe\${Env:RELEASE_FOLDER}\php_phalcon.dll"
64+
}

.ci/install-prereqs.sh

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
# Ensure that this is being run inside a CI container
11+
if [ "${CI}" != "true" ];
12+
then
13+
>&2 echo "This script is designed to run inside a CI container only."
14+
>&2 echo "Aborting."
15+
exit 1
16+
fi
17+
18+
PHP_INI="$(phpenv root)/versions/$(phpenv version-name)/etc/php.ini"
19+
20+
: ${ZEPHIR_PARSER_VERSION:=master}
21+
22+
# {{{ Install latest APC(u)
23+
printf "\n" | pecl install --force apcu_bc 1> /dev/null
24+
# See https://pear.php.net/bugs/bug.php?id=21007
25+
awk '/extension.*apcu?\.so"?/{$0=""}1' "${PHP_INI}" > php.ini.patch && mv php.ini.patch "${PHP_INI}"
26+
cat <<EOT >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/apcu.ini
27+
[apc]
28+
extension = "apcu.so"
29+
extension = "apc.so"
30+
31+
apc.enabled = 1
32+
apc.enable_cli = 1
33+
EOT
34+
# }}}
35+
36+
# {{{ Install latest memcached
37+
printf "\n" | pecl install --force memcached 1> /dev/null
38+
echo 'extension="memcached.so"' > $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
39+
# }}}
40+
41+
# {{{ Install latest xdebug
42+
phpenv config-rm xdebug.ini 2>&1 >/dev/null || true
43+
if [[ "$PHP_VERNUM" -lt "70300" ]];
44+
then
45+
printf "\n" | pecl install --force xdebug 1> /dev/null
46+
awk '/zend_extension.*xdebug.so"?/{$0=""}1' "${PHP_INI}" > php.ini.patch && mv php.ini.patch "${PHP_INI}"
47+
echo 'zend_extension="xdebug.so"' > $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
48+
fi
49+
# }}}
50+
51+
# {{{ Install latest igbinary, imagick, psr and yaml
52+
printf "\n" | pecl install --force igbinary 1> /dev/null
53+
printf "\n" | pecl install --force imagick 1> /dev/null
54+
printf "\n" | pecl install --force psr 1> /dev/null
55+
printf "\n" | pecl install --force yaml 1> /dev/null
56+
# }}}
57+
58+
# {{{ install zephir_parser
59+
git clone -b "${ZEPHIR_PARSER_VERSION}" --depth 1 -q https://github.com/phalcon/php-zephir-parser
60+
cd php-zephir-parser
61+
$(phpenv which phpize)
62+
./configure --silent --with-php-config=$(phpenv which php-config) --enable-zephir_parser
63+
make --silent -j"$(getconf _NPROCESSORS_ONLN)"
64+
make --silent install
65+
echo 'extension="zephir_parser.so"' > "$(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/zephir_parser.ini"
66+
# }}}
67+
68+
# {{{ Install redis
69+
redis_ext=`$(phpenv which php-config) --extension-dir`/redis.so
70+
if [[ ! -f "${redis_ext}" ]];
71+
then
72+
printf "\n" | pecl install --force redis 1> /dev/null
73+
fi
74+
75+
if [[ "$(php -m | grep redis | wc -l)" = "0" ]] && [[ -f "${redis_ext}" ]];
76+
then
77+
echo 'extension="redis.so"' > "$(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/redis.ini"
78+
fi
79+
# }}}
80+
81+
# Local variables:
82+
# tab-width: 4
83+
# c-basic-offset: 4
84+
# End:
85+
# vim600: noet sw=4 ts=4 fdm=marker
86+
# vim<600: noet sw=4 ts=4

.ci/run-volt-tests.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
PROJECT_ROOT=$(cd "$(dirname $0)/../"; pwd -P)
11+
12+
export NO_INTERACTION=1
13+
export REPORT_EXIT_STATUS=1
14+
export TEST_PHP_EXECUTABLE=$(phpenv which php)
15+
export TEST_PHP_ARGS="--show-diff"
16+
17+
phpenv config-rm xdebug.ini 2>&1 >/dev/null || true
18+
19+
php ${PROJECT_ROOT}/ext/run-tests.php \
20+
-d "error_reporting=32767" \
21+
-d "display_errors=1" \
22+
-d "display_startup_errors=1" \
23+
-d "log_errors=0" \
24+
-d "report_memleaks=1" \
25+
-d "report_zend_debug=0" \
26+
-d "zend.assertions=1" \
27+
-d "extension=$(php-config --extension-dir)/psr.so" \
28+
-d "extension=${PROJECT_ROOT}/ext/modules/phalcon.so" \
29+
--offline \
30+
--show-diff \
31+
--set-timeout 120 \
32+
-n \
33+
-g "FAIL,XFAIL,SKIP,BORK,WARN,LEAK" \
34+
${PROJECT_ROOT}/tests/syntax

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ext/config.nice
2020
ext/config.status
2121
ext/config.sub
2222
ext/configure
23+
ext/configure.ac
2324
ext/configure.in
2425
ext/install-sh
2526
ext/libtool
@@ -48,10 +49,10 @@ autom4te.cache/
4849
/ide/
4950

5051
.zephir/
52+
5153
boxfile.yml
5254
composer.lock
5355
php_test_results_*.txt
5456
docker-compose.yml
5557
build/gccarch
5658
tests/_cache
57-
.zephir/

.travis.yml

+75-40
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ sudo: false
22

33
language: php
44
php:
5-
- 'master'
5+
# PHP 7.4 does not ready yet
6+
# - 'master'
67
- '7.3'
78
- '7.2'
89

910
git:
1011
depth: 1
1112

12-
# TODO - Remove this when we go deploy this
13-
#branches:
14-
# only:
15-
# - master
16-
# - /^(4|5)\.\d+\.(\d+|x)$/
13+
branches:
14+
only:
15+
- master
16+
- /^(4|5)\.\d+\.(\d+|x)$/
17+
- /^T\d+-[a-zA-Z-]+/
1718

1819
addons:
1920
apt:
@@ -29,14 +30,14 @@ addons:
2930

3031
matrix:
3132
fast_finish: true
32-
allow_failures:
33-
- php: 'master'
33+
# PHP 7.4 does not ready yet
34+
# allow_failures:
35+
# - php: 'master'
3436

3537
cache:
3638
apt: true
3739
timeout: 604800
3840
directories:
39-
- ${HOME}/beanstalk
4041
- ${HOME}/.composer/cache
4142
- ${HOME}/pear
4243
- ${HOME}/.local/opt
@@ -50,55 +51,89 @@ services:
5051

5152
env:
5253
global:
53-
- secure: "eL8spffzdRIDAjdxG+OPJPeUCdpc/jVz6PEVYcs3z4nOnjsKDURm8cmBmGeyHMxvkdHZ6g0PO/srIKAYufZkjDCeK0vl7OBv6kNlGEuO3M7SUCAVX+J2OSg+hNlK467woxsPeMB19/vkC1HmytgpdAefFGtFp4+zsMT41YVupuA="
5454
- CC="gcc"
55-
- ZEPHIR_VERSION="0.11.8"
55+
- ZEPHIR_VERSION="0.11.9"
56+
- ZEPHIR_PARSER_VERSION="v1.2.0"
5657
- RE2C_VERSION="1.1.1"
57-
- REPORT_EXIT_STATUS=1
5858
- REPORT_COVERAGE=1
59-
- NO_INTERACTION=1
60-
- TEST_PHP_ARGS="--show-diff"
61-
- PATH="${HOME}/bin:${HOME}/.composer/vendor/bin:${PATH}"
59+
- PATH="${HOME}/.composer/vendor/bin:${PATH}"
6260
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
6361

6462
before_install:
65-
- if [ ! -z "${GITHUB_TOKEN}" ]; then composer config github-oauth.github.com ${GITHUB_TOKEN}; echo "Add Github token"; fi
66-
- export PHP_MAJOR="$(php -r 'echo phpversion();' | cut -d '.' -f 1)"
67-
- export PHP_MINOR="$(php -r 'echo phpversion();' | cut -d '.' -f 2)"
68-
- export PHP_VERNUM="$(php-config --vernum)"
69-
- tests/_ci/pear-setup.sh
70-
- tests/_ci/setup-dbs.sh
71-
- source tests/_ci/environment
72-
- export $(cut -d= -f1 tests/_ci/environment)
73-
- wget --no-clobber -O $HOME/bin/zephir https://github.com/phalcon/zephir/releases/download/${ZEPHIR_VERSION}/zephir.phar
74-
- chmod +x $HOME/bin/zephir
63+
- |
64+
# General settings
65+
set -e
66+
stty cols 120
67+
ulimit -c unlimited -S || true
68+
69+
if [ ! -z "${GITHUB_TOKEN}" ]; then
70+
composer config github-oauth.github.com ${GITHUB_TOKEN}
71+
printf "Add GitHub token\n"
72+
fi
73+
74+
[ -d ~/bin ] || mkdir ~/bin
75+
76+
git config --global advice.detachedHead false
77+
78+
# Export tests environment variables
79+
source tests/_ci/environment
80+
export $(cut -d= -f1 tests/_ci/environment)
81+
82+
# Export build environment variables
83+
export PHP_MAJOR="$(php -r 'echo phpversion();' | cut -d '.' -f 1)"
84+
export PHP_MINOR="$(php -r 'echo phpversion();' | cut -d '.' -f 2)"
85+
export PHP_VERNUM="$(php-config --vernum)"
86+
export PHP_PEAR_PHP_BIN=$(phpenv which php)
7587
7688
install:
77-
- tests/_ci/install-prereqs.sh
89+
- tests/_ci/setup-dbs.sh
90+
- tests/_ci/pear-setup.sh
91+
- .ci/install-prereqs.sh
7892
- tests/_ci/install-re2c.sh
79-
- travis_retry composer install ${DEFAULT_COMPOSER_FLAGS}
80-
- travis_retry composer global require ${DEFAULT_COMPOSER_FLAGS} "phalcon/zephir:${ZEPHIR_VERSION}"
81-
- tests/_ci/build.sh
93+
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS
94+
- wget --no-clobber -O $HOME/bin/zephir https://github.com/phalcon/zephir/releases/download/${ZEPHIR_VERSION}/zephir.phar
95+
- chmod +x $HOME/bin/zephir
8296

8397
before_script:
84-
- ulimit -c unlimited -S || true
85-
- phpenv config-add tests/_ci/999-default.ini
98+
- |
99+
# Setting up Tavis' PHP
100+
echo 'variables_order = EGPCS' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
101+
echo 'session.save_path = "/tmp"' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
102+
echo 'opcache.enable_cli = 1' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
103+
104+
- tests/_ci/build.sh
86105

87106
script:
88-
- vendor/bin/phpcs
89-
- vendor/bin/codecept build
90-
# TODO: Add `cli' suite and refactor current cli-tests
91-
# - vendor/bin/codecept run -v
92-
- vendor/bin/codecept run -v -n tests/cli/
93-
- vendor/bin/codecept run -v -n tests/integration/
94-
- vendor/bin/codecept run -v -n tests/unit/
95-
- phpenv config-rm xdebug.ini || true
96-
- tests/_ci/volt-tests.sh
107+
# Does not ready to work PHP 7.3
108+
- if [ "$PHP_VERNUM" -ge "70300" ]; then phpenv config-rm xdebug.ini || true; fi
109+
110+
- vendor/bin/codecept build --quiet
111+
- vendor/bin/codecept run --ext DotReporter tests/cli/
112+
- vendor/bin/codecept run --ext DotReporter tests/integration/
113+
- vendor/bin/codecept run --ext DotReporter tests/unit/
114+
115+
- .ci/run-volt-tests.sh
116+
117+
jobs:
118+
include:
119+
- stage: Static Code Analysis
120+
php: 7.2
121+
env:
122+
- REPORT_COVERAGE=0
123+
install:
124+
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS --ignore-platform-reqs
125+
before_script:
126+
- phpenv config-rm xdebug.ini || true
127+
script:
128+
- vendor/bin/phpcs
97129

98130
after_failure:
99131
- tests/_ci/after-failure.sh
100132

101133
after_success:
134+
# Does not ready to work PHP 7.3
135+
- if [ "$PHP_VERNUM" -ge "70300" ]; then export REPORT_COVERAGE=0; fi
136+
102137
- tests/_ci/after-success.sh
103138

104139
notifications:

0 commit comments

Comments
 (0)