Skip to content

Commit c9ce3df

Browse files
authored
Merge pull request #34 from phalcon/development
v1.1.2
2 parents 935c3fc + b06ffe4 commit c9ce3df

27 files changed

+198
-189
lines changed

.appveyor.yml

Lines changed: 146 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,229 +1,233 @@
1-
version: 1.1.1-{build}
1+
version: 1.1.2-{build}
22

3-
build: false
3+
#---------------------------------#
4+
# environment configuration #
5+
#---------------------------------#
6+
7+
# environment variables
48
environment:
59
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"
2210
- PHP_TARGET: 7.0
2311
PHP_VC: 14
2412
PHP_MAJOR: 7
25-
PHP_TYPE: "Win32"
13+
PHP_BUILD_TYPE: "Win32"
14+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
2615
- PHP_TARGET: 7.0
2716
PHP_VC: 14
2817
PHP_MAJOR: 7
29-
PHP_TYPE: "nts-Win32"
18+
PHP_BUILD_TYPE: "nts-Win32"
19+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
3020
- PHP_TARGET: 7.1
3121
PHP_VC: 14
3222
PHP_MAJOR: 7
33-
PHP_TYPE: "Win32"
23+
PHP_BUILD_TYPE: "Win32"
24+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
3425
- PHP_TARGET: 7.1
3526
PHP_VC: 14
3627
PHP_MAJOR: 7
37-
PHP_TYPE: "nts-Win32"
28+
PHP_BUILD_TYPE: "nts-Win32"
29+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
30+
- PHP_TARGET: 7.2
31+
PHP_VC: 15
32+
PHP_MAJOR: 7
33+
PHP_BUILD_TYPE: "Win32"
34+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
35+
- PHP_TARGET: 7.2
36+
PHP_VC: 15
37+
PHP_MAJOR: 7
38+
PHP_BUILD_TYPE: "nts-Win32"
39+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
40+
PHP_DIR: c:\projects\php
41+
PHP_SDK: c:\projects\php-sdk
42+
PHP_DEVPACK: c:\projects\php-devpack
43+
PHP_SDK_BINARY_TOOLS_VER: php-sdk-2.0.7
3844
NO_INTERACTION: 1
39-
PHP_SDK: c:\php-sdk
40-
PHP_DEVPACK: c:\php-devpack
45+
REPORT_EXIT_STATUS: 1
4146

47+
# this is how to allow failing jobs in the matrix
4248
matrix:
49+
# immediately finish build once one of the jobs fails
4350
fast_finish: true
44-
allow_failures:
45-
- platform: x64
4651

52+
# clone entire repository history if not defined
4753
clone_depth: 1
54+
55+
# clone directory
4856
clone_folder: c:\projects\parser
4957

50-
only_commits:
51-
message: /\[win build\]/
58+
#---------------------------------#
59+
# build configuration #
60+
#---------------------------------#
61+
62+
# build platform, i.e. x86, x64, AnyCPU
63+
platform:
64+
- x86
65+
- x64
5266

5367
branches:
5468
only:
5569
- master
5670
- development
71+
72+
# scripts that are called at very beginning, before repo cloning
5773
init:
58-
- 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%
59-
- 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%
74+
- SET PATH=C:\Program Files (x86)\MSBuild\%PHP_VC%.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC\bin;%PHP_SDK%\bin;%PHP_DIR%\bin;%PHP_DIR%;%PATH%
6075
- SET ANSICON=121x90 (121x90)
61-
- ps: IF ($env:APPVEYOR_REPO_BRANCH -eq "development") {$env:APPVEYOR_CACHE_SKIP_SAVE = "true"}
62-
63-
os: Windows Server 2012 R2
64-
65-
platform:
66-
- x86
67-
- x64
68-
69-
install:
7076
# ==================================================
7177
- echo Setting PHP version...
7278
# ==================================================
73-
- ps: appveyor DownloadFile 'http://windows.php.net/downloads/releases/sha1sum.txt'
79+
- appveyor DownloadFile http://windows.php.net/downloads/releases/sha1sum.txt
7480
- ps: |
7581
$versions = type sha1sum.txt | where { $_ -match "php-(${env:PHP_TARGET}\.\d+)-src" } | foreach { $matches[1] }
7682
$version = $versions.Split(' ')[-1]
7783
$env:PHP_VERSION=${version}
78-
- ps: $env:PHP_PLATFORM="${env:PHP_SDK}\phpdev\vc${env:PHP_VC}\${env:PLATFORM}"
79-
- ps: $env:PHP_SRC="${env:PHP_PLATFORM}\php-${env:PHP_VERSION}-src"
84+
- cmd: rm sha1sum.txt
8085
- ps: >-
81-
If ($env:PLATFORM -eq 'x86') {
82-
If ($env:PHP_TYPE -Match "nts-Win32") {
83-
$env:RELEASE_FOLDER="Release"
84-
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
85-
} Else {
86-
$env:RELEASE_FOLDER="Release_TS"
87-
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
88-
}
89-
} else {
90-
If ($env:PHP_TYPE -Match "nts-Win32") {
91-
$env:RELEASE_FOLDER="x64\Release"
92-
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
93-
} Else {
94-
$env:RELEASE_FOLDER="x64\Release_TS"
95-
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
96-
}
97-
}
98-
If ($env:PHP_VC -eq '11') {
99-
$env:VSCOMNTOOLS=$env:VS110COMNTOOLS
100-
} elseif ($env:PHP_VC -eq '14') {
86+
If ($env:PHP_VC -eq '14') {
87+
$env:VSCOMNTOOLS=$env:VS120COMNTOOLS
88+
} elseif ($env:PHP_VC -eq '15') {
10189
$env:VSCOMNTOOLS=$env:VS140COMNTOOLS
10290
}
103-
If ($env:PLATFORM -eq 'x64') {
104-
$env:ARCH='x86_amd64'
105-
} Else {
106-
$env:ARCH='x86'
107-
}
108-
If ($env:PHP_TARGET -eq '5.5') {
109-
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/archives/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
91+
- ps: >-
92+
If ($env:PLATFORM -eq 'x86') {
93+
$env:ARCH='x86'
94+
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
95+
$env:RELEASE_FOLDER="Release"
96+
} Else {
97+
$env:RELEASE_FOLDER="Release_TS"
98+
}
11099
} Else {
111-
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
100+
$env:ARCH='x86_amd64'
101+
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
102+
$env:RELEASE_FOLDER="x64\Release"
103+
} Else {
104+
$env:RELEASE_FOLDER="x64\Release_TS"
105+
}
112106
}
113-
If ($env:PHP_TYPE -Match "nts-Win32") {
114-
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}-nts_${env:APPVEYOR_BUILD_VERSION}"
107+
- ps: >-
108+
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
109+
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}-nts_${env:APPVEYOR_BUILD_VERSION}"
115110
} Else {
116-
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}_${env:APPVEYOR_BUILD_VERSION}"
111+
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}_${env:APPVEYOR_BUILD_VERSION}"
117112
}
113+
- ps: $env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-${env:PHP_BUILD_TYPE}-vc${env:PHP_VC}-${env:PLATFORM}"
114+
115+
# scripts that run after cloning repository
116+
install:
118117
# ==================================================
119-
- echo Initializing Build
118+
# Install PHP SDK binary tools
120119
# ==================================================
121-
- mkdir %PHP_SDK% && cd %PHP_SDK%
122-
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', 'C:\php-sdk.zip')
123-
- 7z.exe x C:\php-sdk.zip | FIND /V "ing "
124-
- phpsdk_buildtree phpdev
125-
- ps: Rename-Item ${env:PHP_SDK}\phpdev\vc9 ${env:PHP_SDK}\phpdev\vc${env:PHP_VC}
126-
- mkdir %PHP_SRC%
120+
- ps: (new-object net.webclient).DownloadFile('https://github.com/OSTC/php-sdk-binary-tools/archive/' + ${env:PHP_SDK_BINARY_TOOLS_VER} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php-sdk-binary-tools-' + ${env:PHP_SDK_BINARY_TOOLS_VER} + '.zip')
121+
- 7z x -y php-sdk-binary-tools-%PHP_SDK_BINARY_TOOLS_VER%.zip -oC:\projects
122+
- move C:\projects\php-sdk-binary-tools-%PHP_SDK_BINARY_TOOLS_VER% %PHP_SDK%
127123
# ==================================================
128-
- echo Install PHP Dev pack
124+
# Downloading PHP source code
129125
# ==================================================
130-
- cd C:\
131-
- ps: >-
132-
If ($env:PHP_TYPE -Match "nts-Win32") {
133-
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-nts-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
134-
} Else {
135-
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
136-
}
126+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-' + ${env:PHP_BUILD_TYPE} + '-vc' + ${env:PHP_VC} + '-' + ${env:PLATFORM} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php.zip')
127+
- 'mkdir %PHP_DIR% && mv php.zip %PHP_DIR%\php.zip && cd %PHP_DIR%'
128+
- 7z.exe x php.zip | FIND /V "ing "
137129
# ==================================================
138-
- echo Downloading PHP Dev pack source code [http://windows.php.net/downloads/releases/php-devel-pack-%DEVEL_PACK_VERSION%.zip]
130+
# Install PHP Dev pack
139131
# ==================================================
140-
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:DEVEL_PACK_VERSION} + '.zip', 'C:\php-dev.zip')
132+
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:DEVEL_PACK_VERSION} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php-dev.zip')
133+
- cd %APPVEYOR_BUILD_FOLDER%
141134
- 7z.exe x php-dev.zip | FIND /V "ing "
142-
- ps: Rename-Item "php-${env:PHP_VERSION}-devel-VC${env:PHP_VC}-${env:PLATFORM}" C:\php-devpack
135+
- move %APPVEYOR_BUILD_FOLDER%\php-%PHP_VERSION%-devel-VC%PHP_VC%-%PLATFORM% %PHP_DEVPACK%
136+
137+
# to run custom scripts instead of automatic MSBuild
138+
build_script:
143139
# ==================================================
144-
- echo Downloading and preparing PHP source code
140+
# Initializing Build...
145141
# ==================================================
146-
- git clone -b PHP-%PHP_TARGET% --depth 1 https://github.com/php/php-src %PHP_SRC%
147-
- cd %PHP_PLATFORM%
148-
- ps: (new-object net.webclient).DownloadFile(${env:PHP_DEPS_URL}, 'C:\php-sdk-deps.7z')
149-
- 7z.exe x C:\php-sdk-deps.7z | FIND /V "ing "
150-
- cd %PHP_SDK%
151-
- phpsdk_setvars
142+
- cd %APPVEYOR_BUILD_FOLDER%
143+
- git submodule update --init --recursive
152144
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
153-
- vcvarsall %ARCH%
145+
- '"%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %ARCH%'
154146
# ==================================================
155-
- echo Preparing extension to build
147+
# Build Zephir Parser
156148
# ==================================================
157-
- mkdir %PHP_SRC%\ext\zephir_parser
158-
- xcopy /s /q c:\projects\parser\*.* %PHP_SRC%\ext\zephir_parser
159-
- cd %PHP_SRC%\ext\zephir_parser
149+
- cd %APPVEYOR_BUILD_FOLDER%
150+
- '%PHP_SDK%\bin\phpsdk_setvars'
160151
- cmd /c build-win32-php%PHP_MAJOR%.bat
161-
# ==================================================
162-
- echo Build PHP with enabled Zephir Parser
163-
# ==================================================
164-
- cd %PHP_SRC%
165-
- buildconf
166-
- configure %PHP_CONFIGURE_FLAGS%
152+
- '%PHP_DEVPACK%\phpize.bat'
153+
- configure --disable-all --enable-zephir_parser=shared
167154
- nmake 2> compile-errors.log 1> compile.log
168-
- echo extension=%PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll >> C:\Windows\php.ini
169-
- SET PATH=%PHP_SRC%\%RELEASE_FOLDER%;%PATH%
155+
- 'cd %PHP_DIR%'
156+
- 'echo extension_dir=%PHP_DIR%\ext > php.ini'
157+
- 'echo extension=%APPVEYOR_BUILD_FOLDER%\%RELEASE_FOLDER%\php_zephir_parser.dll >> php.ini'
170158
- php -v
171159
- php --ri "Zephir Parser"
172160

173-
build_script:
161+
# scripts to run after build
162+
after_build:
163+
- cd %APPVEYOR_BUILD_FOLDER%
164+
- mkdir %APPVEYOR_BUILD_FOLDER%\package
174165
# ==================================================
175-
- echo Creating package to zip
166+
- echo Convert *.md files to *.html
167+
# ==================================================
168+
- cinst pandoc
169+
- pandoc -v
170+
- cmd: for %%i in (*.md) do pandoc -f markdown -t html5 %%~ni.md > package/%%~ni.html
171+
# ==================================================
172+
- echo Collect artifacts and zip
176173
# ==================================================
177-
- mkdir %APPVEYOR_BUILD_FOLDER%\package
178174
- cd %APPVEYOR_BUILD_FOLDER%\package
179175
# dll
180-
- cp %PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll .\
176+
- copy %APPVEYOR_BUILD_FOLDER%\%RELEASE_FOLDER%\php_zephir_parser.dll .\
181177
# docs
178+
- 'echo Release date: %DATE% %TIME% > RELEASE.txt'
179+
- 'echo Release version: %APPVEYOR_BUILD_VERSION% >> RELEASE.txt'
180+
- 'echo Git commit: %APPVEYOR_REPO_COMMIT% >> RELEASE.txt'
181+
- 'echo Build type: %PHP_BUILD_TYPE% >> RELEASE.txt'
182+
- 'echo Platform: %PLATFORM% >> RELEASE.txt'
183+
- 'echo Target PHP version: %PHP_TARGET% >> RELEASE.txt'
184+
- 'echo Build worker image: %APPVEYOR_BUILD_WORKER_IMAGE% >> RELEASE.txt'
182185
- cp %APPVEYOR_BUILD_FOLDER%\LICENSE .\
183186
- cp %APPVEYOR_BUILD_FOLDER%\CREDITS .\
184187
- cp %APPVEYOR_BUILD_FOLDER%\VERSION .\
185-
- cp %APPVEYOR_BUILD_FOLDER%\CHANGELOG.md .\
186-
- cp %APPVEYOR_BUILD_FOLDER%\CONTRIBUTING.md .\
187-
- cp %APPVEYOR_BUILD_FOLDER%\README.md .\
188188
- cp %APPVEYOR_BUILD_FOLDER%\README.WIN32-BUILD-SYSTEM .\
189189
- cp %APPVEYOR_BUILD_FOLDER%\NO_WARRANTY .\
190-
191-
after_build:
192-
# ==================================================
193-
- echo Collect artifacts and zip
194-
# ==================================================
195-
- cd %APPVEYOR_BUILD_FOLDER%\package
196190
- 7z a %RELEASE_ZIPBALL%.zip *.*
197191
- mv %RELEASE_ZIPBALL%.zip %APPVEYOR_BUILD_FOLDER%\
198192

199-
on_failure:
200-
- 'dir'
201-
- ps: >-
202-
If (Test-Path -Path ${env:PHP_SRC}\compile-errors.log) {
203-
type ${env:PHP_SRC}\compile-errors.log
204-
}
193+
#---------------------------------#
194+
# artifacts configuration #
195+
#---------------------------------#
205196

206-
If (Test-Path -Path ${env:PHP_SRC}\compile.log) {
207-
type ${env:PHP_SRC}\compile.log
208-
}
197+
artifacts:
198+
# pushing a single file with environment variable in path and "Deployment name" specified
199+
- path: '.\$(RELEASE_ZIPBALL).zip'
200+
type: zip
201+
name: ZephirParser
209202

210-
If (Test-Path -Path ${env:PHP_SRC}\configure.js) {
211-
type ${env:PHP_SRC}\configure.js
212-
}
203+
#---------------------------------#
204+
# global handlers #
205+
#---------------------------------#
213206

214-
on_success:
215-
- 'dir'
216207

217208
# If you need to investigate worker on build finish uncomment this
218209
# to display Remote Desktop connection details and pause the build
219210
# until a special “lock” file on VM desktop is deleted
220211
#on_finish:
221212
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
222213

223-
artifacts:
224-
- path: '.\*.zip'
225-
type: zip
226-
name: ZephirParser
214+
on_success:
215+
- 'dir'
216+
217+
on_failure:
218+
- 'dir'
219+
- ps: >-
220+
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\compile-errors.log) {
221+
type ${env:APPVEYOR_BUILD_FOLDER}\compile-errors.log
222+
}
223+
224+
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\compile.log) {
225+
type ${env:APPVEYOR_BUILD_FOLDER}\compile.log
226+
}
227+
228+
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\configure.js) {
229+
type ${env:APPVEYOR_BUILD_FOLDER}\configure.js
230+
}
227231
228232
notifications:
229233
- provider: Email

.gitignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,7 @@ missing
3636
mkinstalldirs
3737
/modules
3838
run-tests.php
39-
tests/*/*.diff
40-
tests/*/*.out
41-
tests/*/*.php
42-
tests/*/*.exp
43-
tests/*/*.log
44-
tests/*/*.sh
45-
46-
# Tests
4739
php_test_results_*
48-
*.out
49-
*.exp
50-
*.diff
51-
*.php
5240

5341
# Parser files
5442
parser/lemon

0 commit comments

Comments
 (0)