Skip to content
This repository was archived by the owner on Jul 7, 2018. It is now read-only.

Commit 17f5094

Browse files
authored
Merge pull request #11 from pinepain/win_support
Add appveyor support
2 parents b3d7523 + f4fafe2 commit 17f5094

4 files changed

Lines changed: 86 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# PHP Weak extension [![Build Status](https://travis-ci.org/pinepain/php-weak.svg)](https://travis-ci.org/pinepain/php-weak)
1+
# PHP Weak extension
2+
3+
[![Build Status](https://travis-ci.org/pinepain/php-weak.svg)](https://travis-ci.org/pinepain/php-weak)
4+
[![Windows Build status](https://ci.appveyor.com/api/projects/status/7r07eydi6c3lj36a/branch/master?svg=true)](https://ci.appveyor.com/project/pinepain/php-weak)
5+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/pinepain/php-weak/master/LICENSE)
26

37
This extension provides [weak references](https://en.wikipedia.org/wiki/Weak_reference) support for PHP 7 and serves
48
as a ground for other weak data structures.
@@ -132,7 +136,7 @@ To install extension globally run
132136
# sudo make install
133137

134138
You will need to copy the extension config to your php dir, here is example for Ubuntu with PHP 7 from
135-
[Ondřej Surý's PPA for PHP 7.0](https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0):
139+
[Ondřej Surý's PPA for PHP](https://launchpad.net/~ondrej/+archive/ubuntu/php):
136140

137141
# sudo cp provision/php/weak.ini /etc/php/mods-available/
138142
# sudo phpenmod -v ALL weak

appveyor.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
platform:
2+
- x86
3+
- x64
4+
5+
environment:
6+
matrix:
7+
- PHP_VERSION: 7.0.8
8+
THREAD_SAFE: true
9+
- PHP_VERSION: 7.0.8
10+
THREAD_SAFE: false
11+
12+
PHP_SDK: c:\projects\php-sdk
13+
14+
matrix:
15+
fast_finish: true
16+
17+
os: Windows Server 2012
18+
clone_folder: c:\projects\php-sdk\php-weak-ci\vc14\x86\php\ext\weak
19+
20+
init:
21+
- ps: |
22+
# Determine thread safety and debug command arguments for PHP configuration
23+
If ($env:THREAD_SAFE -Match "true") {
24+
$env:ENABLE_DISABLE_THREAD_SAFETY="--enable-zts"
25+
$env:TS_OR_NTS="ts"
26+
$env:OUTDIR="Release_TS"
27+
} Else {
28+
$env:ENABLE_DISABLE_THREAD_SAFETY="--disable-zts"
29+
$env:TS_OR_NTS="nts"
30+
$env:OUTDIR="Release"
31+
}
32+
33+
$env:PHP="$($env:PHP_VERSION.Substring(0, $env:PHP_VERSION.indexOf('.', 2)))"
34+
35+
$env:ARTIFACT_NAME="php_weak-$($env:PHP)-$($env:TS_OR_NTS)-vc14-$($env:PLATFORM).zip"
36+
37+
install:
38+
- cd %PHP_SDK%
39+
- curl -fSL -o php-sdk-binary-tools-20110915.zip 'http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip'
40+
- 7z.exe x php-sdk-binary-tools-20110915.zip
41+
- call bin\phpsdk_setvars.bat
42+
- call bin\phpsdk_buildtree.bat php-weak-ci
43+
- cd php-weak-ci\vc14\x86
44+
- curl -fSL -o 'php-%PHP_VERSION%.tar.gz' 'http://us1.php.net/distributions/php-%PHP_VERSION%.tar.gz'
45+
- ren php php-%PHP_VERSION%
46+
- 7z.exe x php-%PHP_VERSION%.tar.gz -y
47+
- 7z.exe x php-%PHP_VERSION%.tar -y | find /v "Extracting"
48+
- cd php-%PHP_VERSION%
49+
- mkdir %OUTDIR%
50+
51+
build_script:
52+
- '"%VS140COMNTOOLS%\VsDevCmd" %PLATFORM%'
53+
- set
54+
- echo Building PHP [%PHP_VERSION%]
55+
- '%PHP_SDK%\bin\phpsdk_setvars'
56+
- buildconf
57+
- configure --disable-all --enable-cli --enable-weak=shared %ENABLE_DISABLE_THREAD_SAFETY%
58+
- nmake
59+
60+
after_build:
61+
- cd %OUTDIR%
62+
- dir
63+
- dir ext
64+
- dir ext\weak
65+
- 7z a %ARTIFACT_NAME% php_weak.dll
66+
- appveyor PushArtifact %ARTIFACT_NAME%
67+
68+
test_script:
69+
- cd c:\projects\php-sdk\php-weak-ci\vc14\x86\php-%PHP_VERSION%
70+
- set NO_INTERACTION=1
71+
- set REPORT_EXIT_STATUS=1
72+
- "%OUTDIR%\\php.exe run-tests.php -p %OUTDIR%\\php.exe ext/weak/tests/ -d extension=php_weak.dll -d extension_dir=%OUTDIR%\\"

php_weak_functions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include "php.h"
1919

20+
#ifdef ZTS
21+
#include "TSRM.h"
22+
#endif
23+
2024
extern const zend_function_entry php_weak_functions[];
2125

2226
#endif /* PHP_WEAK_FUNCTIONS_H */

php_weak_reference.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include "php.h"
1919

20+
#ifdef ZTS
21+
#include "TSRM.h"
22+
#endif
23+
2024
extern zend_class_entry *php_weak_reference_class_entry;
2125

2226

0 commit comments

Comments
 (0)