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
22 changes: 12 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ dist: trusty

language: php

php:
- 7.1
- nightly
env:
global:
- NO_INTERACTION=1
- TEST_TIMEOUT=120

matrix:
allow_failures:
- php: nightly

env:
global:
- NO_INTERACTION=1
- TEST_TIMEOUT=120
matrix:
-
- TEST_PHP_ARGS=-m
include:
- php: 7.2
- php: 7.2
env: TEST_PHP_ARGS=-m

- php: nightly
# - php: nightly
# env: TEST_PHP_ARGS=-m

before_install:
- phpize && ./configure && make
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1)
project(php_ref)
project(php-ref)

# NOTE: This CMake file is just for syntax highlighting in CLion

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This extension adds [Soft Reference](https://en.wikipedia.org/wiki/Soft_referenc
data structures that require advanced referencing model.


**PHP >= 7.1 required**
**PHP >= 7.2 required.** The last version that supports PHP 7.1 is `v0.5.0`.

### PLEASE READ:

Expand Down Expand Up @@ -162,22 +162,17 @@ to add it to your project.
$ sudo add-apt-repository -y ppa:ondrej/php
$ sudo add-apt-repository -y ppa:pinepain/php
$ sudo apt-get update -y
$ sudo apt-get install -y php7.1 php-ref
$ sudo apt-get install -y php7.2 php-ref
$ php --ri ref

#### OS X (homebrew)

$ brew tap homebrew/devtoo
$ brew tap homebrew/dupes
$ brew tap homebrew/php
$ brew tap pinepain/devtools
$ brew install php71 php71-ref
$ brew install php php-ref
$ php --ri ref

### Windows

Windows builds can be found at [php-ref Appveyor build page](https://ci.appveyor.com/project/pinepain/php-ref).
Pick artifacts from build which match your platform (x86 or x64), PHP release.major version and thread safety (ZTS or NTS).

### Building from sources

git clone https://github.com/pinepain/php-ref.git
Expand All @@ -189,12 +184,12 @@ 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.1 from
You will need to copy the extension config to your php dir, here is example for Ubuntu with PHP 7.2 from
[Ondřej Surý's PPA for PHP](https://launchpad.net/~ondrej/+archive/ubuntu/php):

# sudo cp provision/php/ref.ini /etc/php/mods-available/
# sudo phpenmod -v ALL ref
# sudo service php7.1-fpm restart
# sudo service php7.2-fpm restart

You may also want to add php-ref extension as a [composer.json dependency](https://getcomposer.org/doc/02-libraries.md#platform-packages):

Expand Down
93 changes: 0 additions & 93 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ if test "$PHP_REF" != "no"; then
PHP_REF_FOUND_VERSION=`${PHP_CONFIG} --version`
PHP_REF_FOUND_VERNUM=`${PHP_CONFIG} --vernum`

if test "$PHP_REF_FOUND_VERNUM" -lt "70100"; then
AC_MSG_ERROR([not supported. PHP version >= 7.1 required (found $PHP_REF_FOUND_VERSION)])
if test "$PHP_REF_FOUND_VERNUM" -lt "70200"; then
AC_MSG_ERROR([not supported. PHP version >= 7.2 required (found $PHP_REF_FOUND_VERSION)])
else
AC_MSG_RESULT([supported ($PHP_REF_FOUND_VERSION)])
fi
Expand Down
5 changes: 3 additions & 2 deletions config.w32
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG_ENABLE("ref", "enable ref support", "no");
#ARG_ENABLE("ref", "enable ref support", "no");

if (PHP_REF != "no") {
EXTENSION("ref", "ref.c php_ref_notifier_exception.c php_ref_reference.c php_ref_functions.c", PHP_REF_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("ref", "ref.c", PHP_REF_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
}
``
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<dependencies>
<required>
<php>
<min>7.1.0</min>
<min>7.2.0</min>
</php>
<pearinstaller>
<min>1.4.0</min>
Expand Down
22 changes: 3 additions & 19 deletions php_ref.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand All @@ -26,9 +26,9 @@ extern zend_module_entry php_ref_module_entry;
#define PHP_REF_REVISION "dev"
#endif

#if PHP_VERSION_ID < 70100
#if PHP_VERSION_ID < 70200
// should never get her, but just in case
#error PHP >= 7.1 required
#error PHP >= 7.2 required
#endif

#define PHP_REF_NS "Ref"
Expand All @@ -42,22 +42,6 @@ extern zend_module_entry php_ref_module_entry;
#endif


// Add zend_type support (new since PHP 7.2)
#ifdef ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX
#define PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null)

#define PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null)
#else
#define PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, IS_OBJECT, #classname, allow_null)

#define PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, NULL, allow_null)
#endif


#ifdef ZTS
#include "TSRM.h"
#endif
Expand Down
40 changes: 20 additions & 20 deletions php_ref_functions.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -208,44 +208,44 @@ PHP_FUNCTION(is_obj_destructor_called)
}


PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_INFO(0, value)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(object_handle_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(object_handle_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(is_obj_destructor_called_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(is_obj_destructor_called_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, object, IS_OBJECT, 0)
ZEND_END_ARG_INFO()

const zend_function_entry php_ref_functions[] = {
Expand Down
2 changes: 1 addition & 1 deletion php_ref_functions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand Down
2 changes: 1 addition & 1 deletion php_ref_notifier_exception.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand Down
2 changes: 1 addition & 1 deletion php_ref_notifier_exception.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand Down
8 changes: 4 additions & 4 deletions php_ref_reference.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is part of the pinepain/php-ref PHP extension.
*
* Copyright (c) 2016-2017 Bogdan Padalko <pinepain@gmail.com>
* Copyright (c) 2016-2018 Bogdan Padalko <pinepain@gmail.com>
*
* Licensed under the MIT license: http://opensource.org/licenses/MIT
*
Expand Down Expand Up @@ -585,17 +585,17 @@ static PHP_METHOD(WeakReference, notifier)


ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, referent)
ZEND_ARG_TYPE_INFO(0, referent, IS_OBJECT, 0)
ZEND_ARG_CALLABLE_INFO(0, notify, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference_get, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_valid, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_valid, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()

PHP_REF_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_notifier, ZEND_SEND_BY_VAL, 0, IS_CALLABLE, 1)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_notifier, ZEND_SEND_BY_VAL, 0, IS_CALLABLE, 1)
ZEND_ARG_CALLABLE_INFO(0, notify, 1)
ZEND_END_ARG_INFO()

Expand Down
Loading