Skip to content
This repository was archived by the owner on Jul 7, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# PHP Weak extension [![Build Status](https://travis-ci.org/pinepain/php-weak.svg)](https://travis-ci.org/pinepain/php-weak)
# PHP Weak extension

[![Build Status](https://travis-ci.org/pinepain/php-weak.svg)](https://travis-ci.org/pinepain/php-weak)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/7r07eydi6c3lj36a/branch/master?svg=true)](https://ci.appveyor.com/project/pinepain/php-weak)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/pinepain/php-weak/master/LICENSE)

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

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

# sudo cp provision/php/weak.ini /etc/php/mods-available/
# sudo phpenmod -v ALL weak
Expand Down
72 changes: 72 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
platform:
- x86
- x64

environment:
matrix:
- PHP_VERSION: 7.0.8
THREAD_SAFE: true
- PHP_VERSION: 7.0.8
THREAD_SAFE: false

PHP_SDK: c:\projects\php-sdk

matrix:
fast_finish: true

os: Windows Server 2012
clone_folder: c:\projects\php-sdk\php-weak-ci\vc14\x86\php\ext\weak

init:
- ps: |
# Determine thread safety and debug command arguments for PHP configuration
If ($env:THREAD_SAFE -Match "true") {
$env:ENABLE_DISABLE_THREAD_SAFETY="--enable-zts"
$env:TS_OR_NTS="ts"
$env:OUTDIR="Release_TS"
} Else {
$env:ENABLE_DISABLE_THREAD_SAFETY="--disable-zts"
$env:TS_OR_NTS="nts"
$env:OUTDIR="Release"
}

$env:PHP="$($env:PHP_VERSION.Substring(0, $env:PHP_VERSION.indexOf('.', 2)))"

$env:ARTIFACT_NAME="php_weak-$($env:PHP)-$($env:TS_OR_NTS)-vc14-$($env:PLATFORM).zip"

install:
- cd %PHP_SDK%
- curl -fSL -o php-sdk-binary-tools-20110915.zip 'http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip'
- 7z.exe x php-sdk-binary-tools-20110915.zip
- call bin\phpsdk_setvars.bat
- call bin\phpsdk_buildtree.bat php-weak-ci
- cd php-weak-ci\vc14\x86
- curl -fSL -o 'php-%PHP_VERSION%.tar.gz' 'http://us1.php.net/distributions/php-%PHP_VERSION%.tar.gz'
- ren php php-%PHP_VERSION%
- 7z.exe x php-%PHP_VERSION%.tar.gz -y
- 7z.exe x php-%PHP_VERSION%.tar -y | find /v "Extracting"
- cd php-%PHP_VERSION%
- mkdir %OUTDIR%

build_script:
- '"%VS140COMNTOOLS%\VsDevCmd" %PLATFORM%'
- set
- echo Building PHP [%PHP_VERSION%]
- '%PHP_SDK%\bin\phpsdk_setvars'
- buildconf
- configure --disable-all --enable-cli --enable-weak=shared %ENABLE_DISABLE_THREAD_SAFETY%
- nmake

after_build:
- cd %OUTDIR%
- dir
- dir ext
- dir ext\weak
- 7z a %ARTIFACT_NAME% php_weak.dll
- appveyor PushArtifact %ARTIFACT_NAME%

test_script:
- cd c:\projects\php-sdk\php-weak-ci\vc14\x86\php-%PHP_VERSION%
- set NO_INTERACTION=1
- set REPORT_EXIT_STATUS=1
- "%OUTDIR%\\php.exe run-tests.php -p %OUTDIR%\\php.exe ext/weak/tests/ -d extension=php_weak.dll -d extension_dir=%OUTDIR%\\"
4 changes: 4 additions & 0 deletions php_weak_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#include "php.h"

#ifdef ZTS
#include "TSRM.h"
#endif

extern const zend_function_entry php_weak_functions[];

#endif /* PHP_WEAK_FUNCTIONS_H */
Expand Down
4 changes: 4 additions & 0 deletions php_weak_reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#include "php.h"

#ifdef ZTS
#include "TSRM.h"
#endif

extern zend_class_entry *php_weak_reference_class_entry;


Expand Down