Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 compile test #15287

Merged
merged 94 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
63a7f5b
#15186 - Update PHP version in composer.json
Jeckerson Feb 9, 2021
359e6e2
#15186 - Add docker files for PHP8 local development
Jeckerson Feb 9, 2021
2b4f702
#15186 - Remove deprecated C code from optimizers
Jeckerson Feb 9, 2021
edf5bda
#15186 - Fix SanitizeMultipleCest test
Jeckerson Feb 9, 2021
6952903
#15186 - Re-generate ext/ folder
Jeckerson Feb 9, 2021
fde316b
#15186 - Update main CI config
Jeckerson Feb 10, 2021
36df02c
#15186 - Remove prestissimo installation
Jeckerson Feb 10, 2021
9eab604
#15186 - Generate build/php8 directory
Jeckerson Feb 10, 2021
569fc67
#15186 - Adapt main CI config for PHP8 runs
Jeckerson Feb 10, 2021
9c6daa9
#15186 - Bump versions in package.xml
Jeckerson Feb 10, 2021
90c9255
#15186 - Remove deprecated macro 'TSRMLS_D'
Jeckerson Feb 10, 2021
68ba392
#15186 - Update PHP version for build pecl
Jeckerson Feb 10, 2021
f4d9106
#15186 - Update build/php8/ directory
Jeckerson Feb 10, 2021
25cc342
#15186 - Add build files for PHP8
Jeckerson Feb 10, 2021
509bf3e
#15186 - Update build files for PHP8
Jeckerson Feb 10, 2021
282fd87
#15186 - Add --ignore-platform-reqs for composer
Jeckerson Feb 10, 2021
76f9a49
#15186 - Run all tests even if fail
Jeckerson Feb 10, 2021
cebfc9e
#15186 - Refactor PHP config files
Jeckerson Feb 10, 2021
d61b85d
#15186 - Remove 7.2 version from matrix
Jeckerson Feb 10, 2021
b14d9e8
#15186 - Remove '--ignore-platform-reqs' flag
Jeckerson Feb 10, 2021
4ca6a40
#15186 - Fix unit tests
Jeckerson Feb 10, 2021
9a1c7f9
#15186 - Add .ci/run-tests.sh script to run all tests
Jeckerson Feb 11, 2021
46f4f25
#15186 - Andd 7.3 and 7.4 docker files and update 8.0 docker file
Jeckerson Feb 11, 2021
d12e4ec
#15186 - Remove 7.3 docker image and its container
Jeckerson Feb 11, 2021
6faa9d9
#15186 - Fix max connection error
Jeckerson Feb 11, 2021
175b3bc
#15186 - Remove PHP 7.3 from matrix
Jeckerson Feb 11, 2021
da2475e
#15186 - Bump min PHP version in pecl package.xml
Jeckerson Feb 11, 2021
36d4cb6
#15186 - Add 'pecl install memcached'
Jeckerson Feb 11, 2021
35214e4
#15186 - Add pdo_mysql and pdo_pgsql extensions to PHP8 Dockerfile
Jeckerson Feb 11, 2021
87ee36c
#15186 - Fix messagesMessageConstructException() test
Jeckerson Feb 11, 2021
8432406
#15186 - Add disabling of Alphablending
Jeckerson Feb 11, 2021
ff5022a
#15186 - Fix return type of Model::average()
Jeckerson Feb 11, 2021
6a8136b
#15186 - Remove deprecated 'context' from set_error_handler()
Jeckerson Feb 11, 2021
0d546c5
#15186 - Adapt and fix tests
Jeckerson Feb 11, 2021
03e8c66
#15186 - Re-generate ext/phalcon directory
Jeckerson Feb 11, 2021
3c1e5de
#15186 - Add CHANGELOG-4.2.md
Jeckerson Feb 11, 2021
9e67794
#15186 - Fix httpResponseConstructWithIncorrectDataType() test
Jeckerson Feb 11, 2021
3ea708f
#15186 - Re-generate build/php8 directory
Jeckerson Feb 11, 2021
0217e42
#15186 - Re-generate build/php7 directory
Jeckerson Feb 11, 2021
f3d6dba
#15186 - Revert disabling of Alphablending
Jeckerson Feb 11, 2021
7e7ef79
#15186 - Add version check for set_error_handler() calls
Jeckerson Feb 12, 2021
6dde9a1
#15186 - Fix unit tests in PHP8
Jeckerson Mar 4, 2021
f0eda22
#15186 - Add "phalcon/ide-stubs" as dev requirement
Jeckerson Mar 4, 2021
a3aaf4d
#15186 - Optimize imports
Jeckerson Mar 5, 2021
78f9c61
#15186 - Bump ZEPHIR_VERSION to 0.13.0-alpha-3
Jeckerson Mar 5, 2021
6abf6ee
#15186 - Regenerate build/php8/ folder
Jeckerson Mar 5, 2021
920a518
#15186 - Add include of ext/standard/php_session.h
Jeckerson Mar 5, 2021
4e5f17f
#15186 - Fix path of php_session.h and add include of psr headers
Jeckerson Mar 5, 2021
eceb900
#15186 - Add 'psr' extension
Jeckerson Mar 5, 2021
a2aab90
#15186 - Fix code style [ci skip]
Jeckerson Mar 5, 2021
61b772c
Revert "#15186 - Add 'psr' extension"
Jeckerson Mar 5, 2021
f5a47e6
#15186 - Add 'pecl install psr'
Jeckerson Mar 5, 2021
ac2fe0c
Revert "#15186 - Add 'pecl install psr'"
Jeckerson Mar 5, 2021
bd12e36
#15186 - Add output of modules
Jeckerson Mar 5, 2021
db57f6f
#15186 - Add psr and phalcon extension in correct order
Jeckerson Mar 5, 2021
cf5862b
#15186 - Fix signature of Select::__construct()
Jeckerson Mar 5, 2021
831f61f
#15186 - Add pecl packages
Jeckerson Mar 5, 2021
f7c4e34
#15186 - Remove 'prestissimo'
Jeckerson Mar 5, 2021
3351f76
#15186 - Add memcached and yaml pecl extensions
Jeckerson Mar 5, 2021
58ec97f
#15186 - Bump PHALCON_VERSION to 4.2.0
Jeckerson Mar 5, 2021
7cc726c
#15186 - Update codecoverage.yml
Jeckerson Mar 5, 2021
3958472
#15186 - Update autoload-dev in composer.json
Jeckerson Mar 5, 2021
cf59a44
#15186 - Update composer.json
Jeckerson Mar 5, 2021
177ae37
#15186 - Fix Integartion tests
Jeckerson Mar 5, 2021
7d4f1a6
#15186 - Fix Database tests
Jeckerson Mar 5, 2021
5dc3f52
#15186 - Add sudo
Jeckerson Mar 5, 2021
18e6a6d
#15186 - Add PHP_PECL_PSR_PATH env for Windows build
Jeckerson Mar 5, 2021
015320f
#15186 - Add services for Mac builds and Integration Tests
Jeckerson Mar 5, 2021
81b5007
Revert "#15186 - Add services for Mac builds and Integration Tests"
Jeckerson Mar 5, 2021
5d4a2be
#15186 - Change version from '7.4' to '8.0'
Jeckerson Mar 5, 2021
24ffdb1
#15186 - Reformat code in tests
Jeckerson Mar 5, 2021
7b605bd
#15186 - Add extension ini values
Jeckerson Mar 6, 2021
b6f09aa
#15186 - Move installation of PSR near phalcon extension build
Jeckerson Mar 6, 2021
3770a37
#15186 - Bump Zephir version to 0.13.0-beta-1
Jeckerson Mar 7, 2021
5bafb49
#15186 - Add sudo
Jeckerson Mar 7, 2021
b97defa
Add PSR headers to CI
AlexNDRmac Mar 8, 2021
392b714
Use explicit ubuntu version
AlexNDRmac Mar 8, 2021
bbc02aa
Fix git clone command, desable other jobs [ci skip]
AlexNDRmac Mar 8, 2021
a7770a7
Amend disable unix CI [ci skip]
AlexNDRmac Mar 8, 2021
e46ef4b
test only on Windows [ci skip]
AlexNDRmac Mar 8, 2021
1973bcb
Revert disabled unix build
AlexNDRmac Mar 8, 2021
9231bdf
Fix CD path cmd
AlexNDRmac Mar 8, 2021
2873487
Move PSR headers install befor Phalcon build
AlexNDRmac Mar 8, 2021
cede05f
Use cms as shell for PSR headers install
AlexNDRmac Mar 8, 2021
b12750a
Fix visual studio prefix for php-devel pack
AlexNDRmac Mar 8, 2021
2f28535
Change configure command
AlexNDRmac Mar 8, 2021
2addab0
Replace build cmds to simple copy for PSR
AlexNDRmac Mar 9, 2021
55d7d95
#15186 - Add enabling of memcached for 7.4
Jeckerson Mar 13, 2021
3297596
Build PSR from sources
AlexNDRmac Mar 14, 2021
60fff28
Fix PSR path and configure options
AlexNDRmac Mar 14, 2021
dcea2f9
Split PSR build to parts
AlexNDRmac Mar 14, 2021
19ef12e
Revert to win 2106 image
AlexNDRmac Mar 14, 2021
fd58332
Fix pecl PSR set path
AlexNDRmac Mar 14, 2021
87f0942
Merge pull request #15329 from AlexNDRmac/bugfix/windows-ci
niden Mar 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .ci/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <team@phalcon.io>
#
# For the full copyright and license information, please view the
# LICENSE.txt file that was distributed with this source code.

php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql
41 changes: 24 additions & 17 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
- name: Setup Environment Variables
run: |
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.12.19" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.0-alpha-1" >> $GITHUB_ENV

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
extensions: mbstring, intl, json, psr
tools: pecl, prestissimo
tools: pecl

- name: Common Settings
run: |
Expand Down Expand Up @@ -73,14 +73,14 @@ jobs:
$HOME/bin/zephir generate
(cd build && php gen-build.php)

- name: Create Pecl Package
- name: Create Pecl Package (PHP 8)
id: pecl_create
run: |
cp build/php7/safe/config.w32 config.w32
cp build/php7/safe/phalcon.zep.c phalcon.zep.c
cp build/php7/safe/config.m4 config.m4
cp build/php7/safe/php_phalcon.h php_phalcon.h
cp build/php7/safe/phalcon.zep.h phalcon.zep.h
cp build/php8/safe/config.w32 config.w32
cp build/php8/safe/phalcon.zep.c phalcon.zep.c
cp build/php8/safe/config.m4 config.m4
cp build/php8/safe/php_phalcon.h php_phalcon.h
cp build/php8/safe/phalcon.zep.h phalcon.zep.h
pecl package
phalcon_package="`ls | grep phalcon-*tgz`"
mv $phalcon_package phalcon-pecl.tgz
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.3', '7.4', '8.0']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: pecl, prestissimo
tools: pecl
extensions: mbstring, intl, json, imagick

- name: Download Phalcon Pecl Package
Expand All @@ -192,22 +192,26 @@ jobs:
vendor/bin/codecept build

- name: Run Unit Tests
if: always()
run: vendor/bin/codecept run --ext DotReporter unit

- name: Run CLI Tests
if: always()
run: vendor/bin/codecept run --ext DotReporter cli

- name: Run Integration Tests
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter integration

- name: Run Database Tests (Common)
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
DATA_MYSQL_USER: root
if: always()
run: vendor/bin/codecept run --ext DotReporter database -g common

- name: Run Database Tests (MySQL)
Expand All @@ -216,12 +220,14 @@ jobs:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
DATA_MYSQL_USER: root
run: vendor/bin/codecept run database --env mysql -g mysql
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql

- name: Run Database Tests (Sqlite)
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite

- name: Run Database Tests (Postgres)
Expand All @@ -230,6 +236,7 @@ jobs:
DATA_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql

# - name: Run Database Tests (SQL Server)
Expand All @@ -251,7 +258,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [macos-latest]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.3', '7.4', '8.0']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
Expand Down Expand Up @@ -361,14 +368,14 @@ jobs:
fail-fast: false
matrix:
operating-system: [windows-2016]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.3', '7.4', '8.0']
ts: [ts, nts]
include:
- php-versions: '7.2'
- php-versions: '7.3'
vc_num: '15'
arch: x64
build_type: Win32
- php-versions: '7.3'
- php-versions: '7.4'
vc_num: '15'
arch: x64
build_type: Win32
Expand All @@ -391,7 +398,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=C:\temp
tools: pecl, prestissimo
tools: pecl
extensions: mbstring, intl, json, yaml, apcu, psr, imagick, gd, redis, igbinary, sqlite3, msgpack
env:
PHPTS: ${{ matrix.ts }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ zephir-*.phar
boxfile.yml
composer.lock
php_test_results_*.txt
docker-compose.yml
build/gccarch
tests/_data/phalcon_test*
tests/_output/*
Expand Down
7 changes: 2 additions & 5 deletions build/_resource/Phalcon/Build/Generator/File/PhalconC.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,8 @@ protected function addLicense($fileHandler)
*/
protected function addStandardHeader($fileHandler)
{
if (PHP_MAJOR_VERSION == 5) {
$header = require $this->configDir . '/php5/phalcon_c_header.php';
} else {
$header = require $this->configDir . '/php7/phalcon_c_header.php';
}
$header = require $this->configDir . '/php' . PHP_MAJOR_VERSION . '/phalcon_c_header.php';

fwrite($fileHandler, PHP_EOL . $header . PHP_EOL);
}

Expand Down
12 changes: 6 additions & 6 deletions build/_resource/Phalcon/Build/Generator/Optimized.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ protected function getFilters()

// Pre-compute hash key for method checking
$result[] = array(
'regexp' => '/zephir_method_exists_ex\(([a-zA-Z0-9\_]+), SS\("([a-zA-Z\_\-]+)"\) TSRMLS_CC\)/',
'regexp' => '/zephir_method_exists_ex\(([a-zA-Z0-9\_]+), SS\("([a-zA-Z\_\-]+)"\)\)/',
'func' => function ($line, $matches, $hashFunc) {
$hash = $hashFunc($matches[2]);
return str_replace($matches[0], 'zephir_method_quick_exists_ex('.$matches[1].', SS("'.$matches[2].'"), '.$hash.' TSRMLS_CC)', $line);
return str_replace($matches[0], 'zephir_method_quick_exists_ex('.$matches[1].', SS("'.$matches[2].'"), '.$hash.')', $line);
}
);

// Pre-compute hash key for function checking
$result[] = array(
'regexp' => '/zephir_function_exists_ex\(SS\("([a-zA-Z\_\-]+)"\) TSRMLS_CC\)/',
'regexp' => '/zephir_function_exists_ex\(SS\("([a-zA-Z\_\-]+)"\)\)/',
'func' => function ($line, $matches, $hashFunc) {
$hash = $hashFunc($matches[1]);
return str_replace($matches[0], 'zephir_function_quick_exists_ex(SS("'.$matches[1].'"), '.$hash.' TSRMLS_CC)', $line);
return str_replace($matches[0], 'zephir_function_quick_exists_ex(SS("'.$matches[1].'"), '.$hash.')', $line);
}
);

Expand All @@ -140,10 +140,10 @@ protected function getFilters()
);

$result[] = array(
'regexp' => '/zephir_update_property_this\(this_ptr, SL\("([a-zA-Z0-9\_]+)"\), ([a-zA-Z0-9\_]+) TSRMLS_CC\)/',
'regexp' => '/zephir_update_property_this\(this_ptr, SL\("([a-zA-Z0-9\_]+)"\), ([a-zA-Z0-9\_]+)\)/',
'func' => function ($line, $matches, $hashFunc) {
$key = $hashFunc($matches[1]);
return str_replace($matches[0], 'zephir_update_property_this_quick(this_ptr, SL("'.$matches[1].'"), '.$matches[2].', '.$key.' TSRMLS_CC)', $line);
return str_replace($matches[0], 'zephir_update_property_this_quick(this_ptr, SL("'.$matches[1].'"), '.$matches[2].', '.$key.')', $line);
}
);

Expand Down
4 changes: 1 addition & 3 deletions build/_resource/config/phalcon_c_priority_files.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// These are priority files, their contents must be put into phalcon.c before any other source files

$files = [
return [
'phalcon/annotations/scanner.h',
'phalcon/annotations/annot.h',
'phalcon/mvc/model/orm.h',
Expand Down Expand Up @@ -61,5 +61,3 @@
'kernel/time.c',
'kernel/exit.c',
];

return $files;
10 changes: 5 additions & 5 deletions build/_resource/config/phalcon_c_skip_files.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
// These are the files that must not be added to phalcon.c
//

$skipFiles = array(
return [
// Included by phalcon.c header - see phalcon_c_header.php
'config.h',
'ext_config.h',
Expand All @@ -26,18 +25,19 @@
'phalcon/annotations/lemon.c',
'phalcon/annotations/parser.php5.c',
'phalcon/annotations/parser.php7.c',
'phalcon/annotations/parser.php8.c',

'phalcon/mvc/view/engine/volt/base.c',
'phalcon/mvc/view/engine/volt/lempar.c',
'phalcon/mvc/view/engine/volt/lemon.c',
'phalcon/mvc/view/engine/volt/parser.php5.c',
'phalcon/mvc/view/engine/volt/parser.php7.c',
'phalcon/mvc/view/engine/volt/parser.php8.c',

'phalcon/mvc/model/query/base.c',
'phalcon/mvc/model/query/lempar.c',
'phalcon/mvc/model/query/lemon.c',
'phalcon/mvc/model/query/parser.php5.c',
'phalcon/mvc/model/query/parser.php7.c',
);

return $skipFiles;
'phalcon/mvc/model/query/parser.php8.c',
];
69 changes: 69 additions & 0 deletions build/_resource/config/php8/phalcon_c_header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
// This is the header, which will be added to the start of generated phalcon.c file

return <<<HEADER
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <math.h>
#include <ctype.h>
#include <stdlib.h>

#include <main/php.h>

#define ZEPHIR_RELEASE 1
#define PHALCON_RELEASE 1

#include "php_phalcon.h"
#include "phalcon.zep.h"

#include <main/php_main.h>
#include <main/php_variables.h>
#include <main/php_streams.h>
#include <main/php_output.h>
#include <main/php_ini.h>
#include <main/SAPI.h>
#include <ext/standard/php_string.h>
#include <ext/standard/php_smart_string.h>
#include <ext/standard/info.h>
#include <ext/pdo/php_pdo_driver.h>
#include <ext/standard/file.h>
#include <ext/standard/php_filestat.h>
#include <ext/standard/php_rand.h>
#include <ext/standard/php_lcg.h>
#include <ext/standard/php_math.h>
#include <ext/standard/php_array.h>
#include <ext/standard/php_var.h>
#include <ext/standard/php_http.h>
#include <ext/standard/php_versioning.h>
#include <ext/standard/html.h>
#include <ext/standard/base64.h>
#include <ext/standard/md5.h>
#include <ext/standard/head.h>
#include <ext/standard/url.h>
#include <ext/standard/crc32.h>
#include <ext/hash/php_hash.h>
#include <ext/spl/spl_heap.h>
#include <ext/spl/spl_exceptions.h>
#include <ext/spl/spl_directory.h>
#include <ext/spl/spl_iterators.h>
#include <ext/date/php_date.h>
#include <ext/json/php_json.h>

#include <Zend/zend_API.h>
#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include <Zend/zend_execute.h>
#include <Zend/zend_extensions.h>
#include <Zend/zend_builtin_functions.h>
#include <Zend/zend_closures.h>
#include <Zend/zend_multiply.h>
#include <Zend/zend_generators.h>

HEADER;
54 changes: 54 additions & 0 deletions build/php8/32bits/config.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

PHP_ARG_ENABLE(phalcon, whether to enable phalcon, [ --enable-phalcon Enable Phalcon])

if test "$PHP_PHALCON" = "yes"; then

if ! test "x" = "x"; then
PHP_EVAL_LIBLINE(, PHALCON_SHARED_LIBADD)
fi

AC_DEFINE(HAVE_PHALCON, 1, [Whether you have Phalcon])
PHP_NEW_EXTENSION(phalcon, phalcon.zep.c, $ext_shared)
PHP_SUBST(PHALCON_SHARED_LIBADD)

old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $INCLUDES"

AC_CHECK_DECL(
[HAVE_BUNDLED_PCRE],
[
AC_CHECK_HEADERS(
[ext/pcre/php_pcre.h],
[
PHP_ADD_EXTENSION_DEP([phalcon], [pcre])
AC_DEFINE([ZEPHIR_USE_PHP_PCRE], [1], [Whether PHP pcre extension is present at compile time])
],
,
[[#include "main/php.h"]]
)
],
,
[[#include "php_config.h"]]
)

AC_CHECK_DECL(
[HAVE_JSON],
[
AC_CHECK_HEADERS(
[ext/json/php_json.h],
[
PHP_ADD_EXTENSION_DEP([phalcon], [json])
AC_DEFINE([ZEPHIR_USE_PHP_JSON], [1], [Whether PHP json extension is present at compile time])
],
,
[[#include "main/php.h"]]
)
],
,
[[#include "php_config.h"]]
)

CPPFLAGS=$old_CPPFLAGS

PHP_INSTALL_HEADERS([ext/phalcon], [php_phalcon.h])
fi
Loading