Skip to content

Commit b56113a

Browse files
committed
Setup Appveyor build
1 parent 2adc5e1 commit b56113a

File tree

7 files changed

+721
-45
lines changed

7 files changed

+721
-45
lines changed

.travis.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,7 @@ cache:
4848
- $HOME/.composer/cache
4949

5050
install:
51-
- |
52-
cd $TRAVIS_BUILD_DIR/parser
53-
re2c -o scanner.c scanner.re
54-
${CC} lemon.c -o lemon
55-
./lemon -s parser.php5.lemon
56-
./lemon -s parser.php7.lemon
57-
echo "#include <php.h>" > parser.c
58-
echo "#if PHP_VERSION_ID < 70000" >> parser.c
59-
cat parser.php5.c >> parser.c
60-
echo "#else" >> parser.c
61-
cat parser.php7.c >> parser.c
62-
echo "#endif" >> parser.c
63-
cat base.c >> parser.c
64-
sed s/"\#line"/"\/\/"/g scanner.c > xx && mv -f xx scanner.c
65-
sed s/"#line"/"\/\/"/g parser.c > xx && mv -f xx parser.c
66-
cd $TRAVIS_BUILD_DIR
67-
- |
68-
$(phpenv which phpize)
69-
./configure --with-php-config=$(phpenv which php-config) --enable-zephir_parser
70-
make -j"$(getconf _NPROCESSORS_ONLN)"
71-
- make test
72-
- make install && phpenv config-add zephir_parser.ini
51+
- bash ./tests/ci/install-travis
7352

7453
before_install:
7554
- if [[ ! -z "${GH_TOKEN}" ]]; then composer config github-oauth.github.com ${GH_TOKEN}; echo "Configured Github token"; fi;

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Zephir Parser
22

33
[![Build Status](https://travis-ci.org/phalcon/php-zephir-parser.svg?branch=master)](https://travis-ci.org/phalcon/php-zephir-parser)
4+
[![Build status](https://ci.appveyor.com/api/projects/status/r4k8baw1iy54v2wt?svg=true)](https://ci.appveyor.com/project/sergeyklay/php-zephir-parser)
45

56
The Zephir Parser delivered as a C extension for the PHP language.
67

8+
Supported PHP versions:
9+
10+
- **5.4**
11+
- **5.5**
12+
- **5.6**
13+
- **7.0**
14+
- **7.1**
15+
- **7.2**
16+
717
## Get Started
818

919
### Linux
@@ -42,10 +52,7 @@ Follow these instructions to generate a binary extension for your platform:
4252
```bash
4353
git clone git://github.com/phalcon/php-zephir-parser.git
4454
cd php-zephir-parser
45-
bash ./build-linux
46-
47-
make -j"$(getconf _NPROCESSORS_ONLN)"
48-
sudo make install
55+
sudo ./install
4956
```
5057

5158
Add the extension to your php.ini:
@@ -54,7 +61,15 @@ Add the extension to your php.ini:
5461
extension=zephir_parser.so
5562
```
5663

57-
Finally, restart the web server.
64+
Finally, **restart the web server**.
65+
66+
## Advanced compilation
67+
68+
If you have specific php versions running (for example 7.2):
69+
70+
```bash
71+
sudo ./install --phpize /usr/bin/phpize7.2 --php-config /usr/bin/php-config7.2
72+
```
5873

5974
## Usage
6075

appveyor.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
clone_depth: 10
2+
3+
environment:
4+
PHP_VERSION: latest
5+
PHP_DEP_VER: 5.6
6+
PHP_SDK: c:\projects\php-sdk
7+
PHP_DEVPACK: c:\projects\php-devpack
8+
9+
matrix:
10+
- BUILD_PLATFORM: x86
11+
PHP_VC: 11
12+
platform: x86
13+
14+
os: Windows Server 2012 R2
15+
clone_folder: c:\projects\php-zephir-parser
16+
17+
matrix:
18+
fast_finish: true
19+
20+
install:
21+
- echo Setting PHP version...
22+
- appveyor DownloadFile http://windows.php.net/downloads/releases/sha1sum.txt
23+
- ps: >-
24+
If ($env:PHP_VERSION -Match "latest") {
25+
$env:PHP_VERSION=type sha1sum.txt | where { $_ -match "php-(5\.6\.\d+)-src" } | foreach { $matches[1] }
26+
$env:version='{build}-$(PHP_VERSION)'
27+
} Else {
28+
$env:version='{build}-$(PHP_VERSION)'
29+
}
30+
- echo Initializing Build...
31+
- cd %APPVEYOR_BUILD_FOLDER%
32+
- echo Preparing zephir win32 build...
33+
34+
- echo Downloading PHP source code [%PHP_VERSION%]
35+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-Win32-VC' + ${env:PHP_VC} + '-' + ${env:BUILD_PLATFORM} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php.zip')
36+
- cd ..
37+
- 'mkdir php && mv php.zip php\php.zip && cd php'
38+
- 7z.exe x php.zip | FIND /V "ing "
39+
- cd ..
40+
41+
- echo Downloading PHP-SDK
42+
- mkdir php-sdk && cd php-sdk
43+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php-sdk.zip')
44+
- '7z.exe x ..\php-sdk.zip | FIND /V "ing "'
45+
- cd ..
46+
47+
- echo Downloading PHP-Devel-Pack
48+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:PHP_VERSION} + '-Win32-VC' + ${env:PHP_VC} + '-' + ${env:BUILD_PLATFORM} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php-dev.zip')
49+
- 7z.exe x php-dev.zip | FIND /V "ing "
50+
- mv php-%PHP_VERSION%-devel-VC11-%BUILD_PLATFORM% php-devpack
51+
52+
- echo Building Zephir Parser
53+
- cd %APPVEYOR_BUILD_FOLDER%
54+
- 'cd parser'
55+
- 'copy %PHP_SDK%\bin\re2c.exe .\re2c.exe'
56+
- '"%VS110COMNTOOLS%\VsDevCmd" %BUILD_PLATFORM%'
57+
- cl lemon.c
58+
- del parser.c parser.h scanner.c
59+
- re2c -o scanner.c scanner.re
60+
- lemon -s parser.php5.lemon
61+
- type parser.php5.c > parser.c
62+
- type base.c >> parser.c
63+
64+
- echo Building PHP [%PHP_VERSION%]
65+
- '%PHP_SDK%\bin\phpsdk_setvars'
66+
- 'cd %APPVEYOR_BUILD_FOLDER%\..\php'
67+
- 'echo extension_dir=%APPVEYOR_BUILD_FOLDER%\..\php\ext > php.ini'
68+
- 'echo extension=php_openssl.dll >> php.ini'
69+
- 'echo extension=php_pdo_sqlite.dll >> php.ini'
70+
- 'echo extension=php_gmp.dll >> php.ini'
71+
- 'set PATH=%cd%;%PATH%'
72+
73+
build_script:
74+
- cd %APPVEYOR_BUILD_FOLDER%
75+
- '%PHP_DEVPACK%\\phpize'
76+
- configure --enable-zephir_parser
77+
- nmake
78+
79+
on_finish:
80+
- cd %APPVEYOR_BUILD_FOLDER%
81+
- ps: Push-AppveyorArtifact Release_TS\php_zephir_parser.dll
82+
83+
on_failure:
84+
- 'dir'
85+
- 'type compile-errors.log'
86+
- 'type compile.log'

0 commit comments

Comments
 (0)