diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | REFLECTION | 278 | ||||
-rw-r--r-- | php-pecl-ref.spec | 214 |
3 files changed, 496 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/REFLECTION b/REFLECTION new file mode 100644 index 0000000..a0cbf99 --- /dev/null +++ b/REFLECTION @@ -0,0 +1,278 @@ +Extension [ <persistent> extension #116 ref version 0.4.1 ] { + + - Functions { + Function [ <internal:ref> function Ref\refcounted ] { + + - Parameters [1] { + Parameter #0 [ <required> $value ] + } + - Return [ boolean ] + } + Function [ <internal:ref> function Ref\refcount ] { + + - Parameters [1] { + Parameter #0 [ <required> $value ] + } + - Return [ integer ] + } + Function [ <internal:ref> function Ref\softrefcounted ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ boolean ] + } + Function [ <internal:ref> function Ref\softrefcount ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ integer ] + } + Function [ <internal:ref> function Ref\softrefs ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ array ] + } + Function [ <internal:ref> function Ref\weakrefcounted ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ boolean ] + } + Function [ <internal:ref> function Ref\weakrefcount ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ integer ] + } + Function [ <internal:ref> function Ref\weakrefs ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ array ] + } + Function [ <internal:ref> function Ref\object_handle ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ integer ] + } + Function [ <internal:ref> function Ref\is_obj_destructor_called ] { + + - Parameters [1] { + Parameter #0 [ <required> $object ] + } + - Return [ boolean ] + } + } + + - Classes [4] { + Class [ <internal:ref> class Ref\NotifierException extends Exception implements Throwable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [5] { + Property [ <default> protected $message ] + Property [ <default> protected $code ] + Property [ <default> protected $file ] + Property [ <default> protected $line ] + Property [ <default> private $exceptions ] + } + + - Methods [11] { + Method [ <internal:ref, overwrites Exception, ctor> public method __construct ] { + + - Parameters [4] { + Parameter #0 [ <optional> $message ] + Parameter #1 [ <optional> $exceptions ] + Parameter #2 [ <optional> $code ] + Parameter #3 [ <optional> $previous ] + } + } + + Method [ <internal:ref> public method getExceptions ] { + + - Parameters [0] { + } + } + + Method [ <internal:Core, inherits Exception> public method __wakeup ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] { + } + } + } + + Class [ <internal:ref> abstract class Ref\AbstractReference ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [4] { + Method [ <internal:ref, ctor> public method __construct ] { + + - Parameters [2] { + Parameter #0 [ <required> $referent ] + Parameter #1 [ <optional> $notify ] + } + } + + Method [ <internal:ref> public method get ] { + + - Parameters [0] { + } + } + + Method [ <internal:ref> public method valid ] { + + - Parameters [0] { + } + - Return [ boolean ] + } + + Method [ <internal:ref> public method notifier ] { + + - Parameters [1] { + Parameter #0 [ <optional> $notify ] + } + } + } + } + + Class [ <internal:ref> class Ref\SoftReference extends Ref\AbstractReference ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [4] { + Method [ <internal:ref, inherits Ref\AbstractReference, ctor> public method __construct ] { + + - Parameters [2] { + Parameter #0 [ <required> $referent ] + Parameter #1 [ <optional> $notify ] + } + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method get ] { + + - Parameters [0] { + } + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method valid ] { + + - Parameters [0] { + } + - Return [ boolean ] + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method notifier ] { + + - Parameters [1] { + Parameter #0 [ <optional> $notify ] + } + } + } + } + + Class [ <internal:ref> class Ref\WeakReference extends Ref\AbstractReference ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [4] { + Method [ <internal:ref, inherits Ref\AbstractReference, ctor> public method __construct ] { + + - Parameters [2] { + Parameter #0 [ <required> $referent ] + Parameter #1 [ <optional> $notify ] + } + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method get ] { + + - Parameters [0] { + } + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method valid ] { + + - Parameters [0] { + } + - Return [ boolean ] + } + + Method [ <internal:ref, inherits Ref\AbstractReference> public method notifier ] { + + - Parameters [1] { + Parameter #0 [ <optional> $notify ] + } + } + } + } + } +} + diff --git a/php-pecl-ref.spec b/php-pecl-ref.spec new file mode 100644 index 0000000..ffd9516 --- /dev/null +++ b/php-pecl-ref.spec @@ -0,0 +1,214 @@ +# remirepo spec file for php-pecl-ref +# +# Copyright (c) 2017 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%if 0%{?scl:1} +%global sub_prefix %{scl_prefix} +%scl_package php-pecl-ref +%endif + +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} +%global with_tests 0%{!?_without_tests:1} +%global pecl_name ref +%global ini_name 40-%{pecl_name}.ini + +Summary: Soft and Weak references support in PHP +Name: %{?sub_prefix}php-pecl-%{pecl_name} +Version: 0.4.1 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +License: PHP +Group: Development/Languages +URL: http://pecl.php.net/package/%{pecl_name} + +BuildRequires: %{?scl_prefix}php-devel > 7 +BuildRequires: %{?scl_prefix}php-pear + +Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} +Requires: %{?scl_prefix}php(api) = %{php_core_api} +%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} + +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +%if "%{?scl_prefix}" != "%{?sub_prefix}" +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +%endif + +%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +# Other third party repo stuff +Obsoletes: php70u-pecl-%{pecl_name} <= %{version} +Obsoletes: php70w-pecl-%{pecl_name} <= %{version} +%if "%{php_version}" > "7.1" +Obsoletes: php71u-pecl-%{pecl_name} <= %{version} +Obsoletes: php71w-pecl-%{pecl_name} <= %{version} +%endif +%endif + +%if 0%{?fedora} < 20 && 0%{?rhel} < 7 +# Filter shared private +%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} +%{?filter_setup} +%endif + + +%description +This extension adds Soft and Weak references support to PHP 7 and may serve +as a ground for other data structures that require advanced referencing model. + +Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. + + +%prep +%setup -q -c +mv %{pecl_name}-%{version} NTS + +# Don't install/register tests +sed -e 's/role="test"/role="src"/' \ + %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -i package.xml + +cd NTS +# Sanity check, really often broken +extver=$(sed -n '/#define PHP_REF_VERSION/{s/.* "//;s/".*$//;p}' php_ref.h) +if test "x${extver}" != "x%{version}%{?versuf}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}%{?versuf}. + exit 1 +fi +cd .. + +%if %{with_zts} +# Duplicate source tree for NTS / ZTS build +cp -pr NTS ZTS +%endif + +# Create configuration file +cat << 'EOF' | tee %{ini_name} +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so +EOF + + +%build +cd NTS +%{_bindir}/phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/php-config + +make %{?_smp_mflags} + +%if %{with_zts} +cd ../ZTS +%{_bindir}/zts-phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/zts-php-config + +make %{?_smp_mflags} +%endif + + +%install +make -C NTS install INSTALL_ROOT=%{buildroot} + +# install config file +install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} + +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + +%if %{with_zts} +make -C ZTS install INSTALL_ROOT=%{buildroot} + +install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} +%endif + +# Documentation +for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + + +%if 0%{?fedora} < 24 +# when pear installed alone, after us +%triggerin -- %{?scl_prefix}php-pear +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi + +# posttrans as pear can be installed after us +%posttrans +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi + +%postun +if [ $1 -eq 0 -a -x %{__pecl} ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi +%endif + + +%check +cd NTS +: Minimal load test for NTS extension +%{__php} --no-php-ini \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +%if %{with_tests} +: Upstream test suite for NTS extension +TEST_PHP_EXECUTABLE=%{__php} \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{__php} -n run-tests.php --show-diff +%else +: Upstream test suite disabled +%endif + +%if %{with_zts} +cd ../ZTS +: Minimal load test for ZTS extension +%{__ztsphp} --no-php-ini \ + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +%if %{with_tests} +: Upstream test suite for ZTS extension +TEST_PHP_EXECUTABLE=%{__ztsphp} \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{__ztsphp} -n run-tests.php --show-diff +%else +: Upstream test suite disabled +%endif +%endif + + +%files +%{?_licensedir:%license NTS/LICENSE} +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml + +%config(noreplace) %{php_inidir}/%{ini_name} +%{php_extdir}/%{pecl_name}.so + +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/%{ini_name} +%{php_ztsextdir}/%{pecl_name}.so +%endif + + +%changelog +* Mon Jan 16 2017 Remi Collet <remi@fedoraproject.org> - 0.4.1-1 +- initial package, version 0.4.1 (stable) + |