Skip to content

Commit 6c5a665

Browse files
authored
Merge pull request #1 from phalcon/development
1.0.1
2 parents 409e9e5 + 0d3ed1f commit 6c5a665

30 files changed

+792
-167
lines changed

.appveyor.yml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
version: 1.0.1-{build}
2+
3+
build: false
4+
environment:
5+
matrix:
6+
- PHP_TARGET: 5.5
7+
PHP_VC: 11
8+
PHP_MAJOR: 5
9+
PHP_TYPE: "Win32"
10+
- PHP_TARGET: 5.5
11+
PHP_VC: 11
12+
PHP_MAJOR: 5
13+
PHP_TYPE: "nts-Win32"
14+
- PHP_TARGET: 5.6
15+
PHP_VC: 11
16+
PHP_MAJOR: 5
17+
PHP_TYPE: "Win32"
18+
- PHP_TARGET: 5.6
19+
PHP_VC: 11
20+
PHP_MAJOR: 5
21+
PHP_TYPE: "nts-Win32"
22+
- PHP_TARGET: 7.0
23+
PHP_VC: 14
24+
PHP_MAJOR: 7
25+
PHP_TYPE: "Win32"
26+
- PHP_TARGET: 7.0
27+
PHP_VC: 14
28+
PHP_MAJOR: 7
29+
PHP_TYPE: "nts-Win32"
30+
- PHP_TARGET: 7.1
31+
PHP_VC: 14
32+
PHP_MAJOR: 7
33+
PHP_TYPE: "Win32"
34+
- PHP_TARGET: 7.1
35+
PHP_VC: 14
36+
PHP_MAJOR: 7
37+
PHP_TYPE: "nts-Win32"
38+
NO_INTERACTION: 1
39+
PHP_SDK: c:\php-sdk
40+
PHP_DEVPACK: c:\php-devpack
41+
42+
matrix:
43+
fast_finish: true
44+
allow_failures:
45+
- platform: x64
46+
47+
clone_depth: 1
48+
clone_folder: c:\projects\parser
49+
50+
branches:
51+
only:
52+
- master
53+
- development
54+
init:
55+
- SET PATH=C:\Program Files (x86)\MSBuild\%PHP_VC%.0\Bin;C:\Program Files\OpenSSL;C:\php;C:\php-sdk\bin;C:\php-devpack;%PATH%
56+
- SET PATH=C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC\bin;%PATH%
57+
- SET ANSICON=121x90 (121x90)
58+
59+
os: Windows Server 2012 R2
60+
platform:
61+
- x86
62+
- x64
63+
64+
install:
65+
# ==================================================
66+
- echo Setting PHP version...
67+
# ==================================================
68+
- ps: Start-FileDownload 'http://windows.php.net/downloads/releases/sha1sum.txt'
69+
- ps: $env:PHP_VERSION=type sha1sum.txt | where { $_ -match "php-(${env:PHP_TARGET}\.\d+)-src" } | foreach { $matches[1] }
70+
- ps: $env:PHP_PLATFORM="${env:PHP_SDK}\phpdev\vc${env:PHP_VC}\${env:PLATFORM}"
71+
- ps: $env:PHP_SRC="${env:PHP_PLATFORM}\php-${env:PHP_VERSION}-src"
72+
- ps: >-
73+
If ($env:PLATFORM -eq 'x86') {
74+
If ($env:PHP_TYPE -Match "nts-Win32") {
75+
$env:RELEASE_FOLDER="Release"
76+
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
77+
} Else {
78+
$env:RELEASE_FOLDER="Release_TS"
79+
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
80+
}
81+
} else {
82+
If ($env:PHP_TYPE -Match "nts-Win32") {
83+
$env:RELEASE_FOLDER="x64\Release"
84+
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
85+
} Else {
86+
$env:RELEASE_FOLDER="x64\Release_TS"
87+
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
88+
}
89+
}
90+
If ($env:PHP_VC -eq '11') {
91+
$env:VSCOMNTOOLS=$env:VS110COMNTOOLS
92+
} elseif ($env:PHP_VC -eq '14') {
93+
$env:VSCOMNTOOLS=$env:VS140COMNTOOLS
94+
}
95+
If ($env:PLATFORM -eq 'x64') {
96+
$env:ARCH='x86_amd64'
97+
} Else {
98+
$env:ARCH='x86'
99+
}
100+
If ($env:PHP_TARGET -eq '5.5') {
101+
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/archives/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
102+
} Else {
103+
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
104+
}
105+
# ==================================================
106+
- echo Initializing Build
107+
# ==================================================
108+
- mkdir %PHP_SDK% && cd %PHP_SDK%
109+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', 'C:\php-sdk.zip')
110+
- 7z.exe x C:\php-sdk.zip | FIND /V "ing "
111+
- phpsdk_buildtree phpdev
112+
- ps: Rename-Item ${env:PHP_SDK}\phpdev\vc9 ${env:PHP_SDK}\phpdev\vc${env:PHP_VC}
113+
- mkdir %PHP_SRC%
114+
# ==================================================
115+
- echo Install PHP Dev pack
116+
# ==================================================
117+
- cd C:\
118+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:PHP_VERSION} + '-Win32-VC' + ${env:PHP_VC} + '-' + ${env:PLATFORM} + '.zip', 'C:\php-dev.zip')
119+
- 7z.exe x php-dev.zip | FIND /V "ing "
120+
- ps: Rename-Item "php-${env:PHP_VERSION}-devel-VC${env:PHP_VC}-${env:PLATFORM}" C:\php-devpack
121+
# ==================================================
122+
- echo Downloading and preparing PHP source code
123+
# ==================================================
124+
- git clone -b PHP-%PHP_TARGET% --depth 1 https://github.com/php/php-src %PHP_SRC%
125+
- cd %PHP_PLATFORM%
126+
- ps: (new-object net.webclient).DownloadFile(${env:PHP_DEPS_URL}, 'C:\php-sdk-deps.7z')
127+
- 7z.exe x C:\php-sdk-deps.7z | FIND /V "ing "
128+
- cd %PHP_SDK%
129+
- phpsdk_setvars
130+
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
131+
- vcvarsall %ARCH%
132+
# ==================================================
133+
- echo Preparing extension to build
134+
# ==================================================
135+
- mkdir %PHP_SRC%\ext\zephir_parser
136+
- xcopy /s /q c:\projects\parser\*.* %PHP_SRC%\ext\zephir_parser
137+
- cd %PHP_SRC%\ext\zephir_parser
138+
- cmd /c build-win32-php%PHP_MAJOR%.bat
139+
# ==================================================
140+
- echo Build PHP with enabled Zephir Parser
141+
# ==================================================
142+
- cd %PHP_SRC%
143+
- buildconf
144+
- configure %PHP_CONFIGURE_FLAGS%
145+
- nmake 2> compile-errors.log 1> compile.log
146+
- echo extension=%PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll >> C:\Windows\php.ini
147+
- SET PATH=%PHP_SRC%\%RELEASE_FOLDER%;%PATH%
148+
- php -v
149+
- php --ri "Zephir Parser"
150+
151+
build_script:
152+
# ==================================================
153+
- echo Creating package to zip
154+
# ==================================================
155+
- mkdir %APPVEYOR_BUILD_FOLDER%\package
156+
- cd %APPVEYOR_BUILD_FOLDER%\package
157+
# dll
158+
- cp %PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll .\
159+
# docs
160+
- cp %APPVEYOR_BUILD_FOLDER%\LICENSE .\
161+
- cp %APPVEYOR_BUILD_FOLDER%\CREDITS .\
162+
- cp %APPVEYOR_BUILD_FOLDER%\VERSION .\
163+
- cp %APPVEYOR_BUILD_FOLDER%\CHANGELOG.md .\
164+
- cp %APPVEYOR_BUILD_FOLDER%\CONTRIBUTING.md .\
165+
- cp %APPVEYOR_BUILD_FOLDER%\README.md .\
166+
- cp %APPVEYOR_BUILD_FOLDER%\README.WIN32-BUILD-SYSTEM .\
167+
168+
after_build:
169+
# ==================================================
170+
- echo Collect artifacts and zip
171+
# ==================================================
172+
- cd %APPVEYOR_BUILD_FOLDER%\package
173+
- ps: 7z a zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_VERSION}_${env:APPVEYOR_BUILD_VERSION}.zip *.*
174+
- ps: mv *.zip ${env:APPVEYOR_BUILD_FOLDER}\
175+
176+
on_failure:
177+
- 'dir'
178+
- ps: >-
179+
if (Test-Path -Path ${env:PHP_SRC}\compile-errors.log) {
180+
type ${env:PHP_SRC}\compile-errors.log
181+
}
182+
183+
if (Test-Path -Path ${env:PHP_SRC}\compile.log) {
184+
type ${env:PHP_SRC}\compile.log
185+
}
186+
187+
if (Test-Path -Path ${env:PHP_SRC}\configure.js) {
188+
type ${env:PHP_SRC}\configure.js
189+
}
190+
191+
on_success:
192+
- 'dir'
193+
194+
artifacts:
195+
- path: '.\*.zip'
196+
type: zip
197+
name: ZephirParser
198+
199+
notifications:
200+
- provider: Email
201+
to:
202+
203+
subject: "Build Zephir Parser [{{status}}]"
204+
on_build_status_changed: true
205+

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ indent_style = space
1919

2020
[*.md]
2121
indent_style = space
22+
23+
[*.xml]
24+
indent_style = space
25+
26+
[*.json]
27+
indent_style = space
28+
29+
[*.w32]
30+
indent_style = space

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.c linguist-language=C
2+
*.h linguist-language=C
3+
*.w32 linguist-language=JavaScript

.github/ISSUE_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
> Questions should go to https://forum.zephir-lang.com
2+
> Documentation issues should go to https://github.com/phalcon/zephir-docs
3+
4+
### Expected and Actual Behavior
5+
6+
> **Describe what you are trying to achieve and what goes wrong.**
7+
8+
> Provide output if related. Provide coredump if any. Use https://github.com/phalcon/cphalcon/wiki/Generating-a-backtrace as reference
9+
10+
```php
11+
// paste output here
12+
```
13+
> Provide minimal script to reproduce the issue
14+
15+
```php
16+
// paste code
17+
```
18+
### Details
19+
20+
* Zephir Parser version: (`php --ri "Zephir Parser""`)
21+
* PHP Version: (`php -v`)
22+
* Operating System:
23+
* Installation type: Compiling from source || installing via package manager
24+
* Compiller version (if any):
25+
* Zephir version (if any):
26+
* Other related info:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Hello!
2+
3+
* Type: bug fix | new feature | code quality | documentation
4+
* Link to issue:
5+
6+
**In raising this pull request, I confirm the following (please check boxes):**
7+
8+
- [ ] I have read and understood the [Contributing Guidelines](https://github.com/phalcon/php-zephir-parser/blob/master/CONTRIBUTING.md)?
9+
- [ ] I have checked that another pull request for this purpose does not exist.
10+
- [ ] I wrote some tests for this PR.
11+
12+
Small description of change:
13+
14+
Thanks

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ parser/parser.php5.out
5555
parser/parser.php7.c
5656
parser/parser.php7.h
5757
parser/parser.php7.out
58+
59+
vendor
60+
composer.lock

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dist: trusty
44
sudo: false
55

66
php:
7-
- 5.4
87
- 5.5
98
- 5.6
109
- 7.0
@@ -23,18 +22,18 @@ env:
2322
- LIBRARY_PATH="$TRAVIS_BUILD_DIR/build/lib":$LIBRARY_PATH
2423
- C_INCLUDE_PATH="$TRAVIS_BUILD_DIR/build/include"
2524
matrix:
26-
- CC="ccache gcc" CFLAGS="-g3 -O0 -fno-delete-null-pointer-checks -Wall -fvisibility=hidden"
27-
- CC="ccache clang" CFLAGS="-g3 -O0 -fcolor-diagnostics"
25+
- CC="ccache gcc" CFLAGS="-g3 -O0 -fno-delete-null-pointer-checks -Wall -std=gnu90 -fvisibility=hidden"
26+
- CC="ccache clang" CFLAGS="-g3 -O0 -fcolor-diagnostics -Wall -std=gnu90"
2827

2928
matrix:
3029
fast_finish: true
3130
allow_failures:
3231
- php: nightly
3332
include:
34-
- env: CC="ccache gcc" CFLAGS="-g3 -O0 -fno-delete-null-pointer-checks -Wall -fvisibility=hidden"
33+
- env: CC="ccache gcc" CFLAGS="-g3 -O0 -fno-delete-null-pointer-checks -Wall -std=gnu90 -fvisibility=hidden"
3534
php: nightly
3635
compiler: gcc
37-
- env: CC="ccache clang" CFLAGS="-g3 -O0 -fcolor-diagnostics"
36+
- env: CC="ccache clang" CFLAGS="-g3 -O0 -fcolor-diagnostics -Wall -std=gnu90"
3837
php: nightly
3938
compiler: clang
4039

@@ -49,12 +48,14 @@ cache:
4948

5049
install:
5150
- bash ./tests/ci/install-travis
51+
- composer --prefer-source install
5252

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

5656
script:
5757
- php --ri "Zephir Parser"
58+
- valgrind --read-var-info=yes --error-exitcode=1 --fullpath-after= --track-origins=yes --leak-check=full ./vendor/bin/phpunit -c phpunit.xml.dist --debug tests/
5859

5960
notifications:
6061
email:

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88

9+
## 1.0.1 - 2017-03-31
10+
### Added
11+
- Added script to build development version (Linux)
12+
- Added ability to compile extension for PHP 7 (Windows)
13+
- Added Windows manual (Windows)
14+
15+
### Changed
16+
- Optimize build to produce smaller module
17+
- Improved Win32 build by providing separated `bat` file (Windows)
18+
- Improved build and tests on Appveyor (Windows)
19+
20+
### Fixed
21+
- Fixed compiler warnings on build lemon
22+
- Removing unused structures
23+
- Removing unused variables
24+
925
## 1.0.0 - 2017-03-26
1026
### Added
1127
- Initial stable release

0 commit comments

Comments
 (0)