From c59324125872e1eb5c267826663df23eed168fa6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 14 Feb 2015 11:24:21 +0100 Subject: php-pecl-varnish: 1.2.0 (test build, waiting for 1.2.1) --- REFLECTION | 287 +++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-varnish.spec | 52 ++++++--- varnish-upstream.patch | 101 +++++++++++++++++ 3 files changed, 424 insertions(+), 16 deletions(-) create mode 100644 REFLECTION create mode 100644 varnish-upstream.patch diff --git a/REFLECTION b/REFLECTION new file mode 100644 index 0000000..12e4a2c --- /dev/null +++ b/REFLECTION @@ -0,0 +1,287 @@ +Extension [ extension #153 varnish version 1.2.0 ] { + + - Dependencies { + Dependency [ hash (Required) ] + } + + - Constants [19] { + Constant [ integer VARNISH_STATUS_SYNTAX ] { 100 } + Constant [ integer VARNISH_STATUS_UNKNOWN ] { 101 } + Constant [ integer VARNISH_STATUS_UNIMPL ] { 102 } + Constant [ integer VARNISH_STATUS_TOOFEW ] { 104 } + Constant [ integer VARNISH_STATUS_TOOMANY ] { 105 } + Constant [ integer VARNISH_STATUS_PARAM ] { 106 } + Constant [ integer VARNISH_STATUS_AUTH ] { 107 } + Constant [ integer VARNISH_STATUS_OK ] { 200 } + Constant [ integer VARNISH_STATUS_CANT ] { 300 } + Constant [ integer VARNISH_STATUS_COMMS ] { 400 } + Constant [ integer VARNISH_STATUS_CLOSE ] { 500 } + Constant [ string VARNISH_CONFIG_IDENT ] { ident } + Constant [ string VARNISH_CONFIG_HOST ] { host } + Constant [ string VARNISH_CONFIG_PORT ] { port } + Constant [ string VARNISH_CONFIG_TIMEOUT ] { timeout } + Constant [ string VARNISH_CONFIG_SECRET ] { secret } + Constant [ string VARNISH_CONFIG_COMPAT ] { compat } + Constant [ integer VARNISH_COMPAT_2 ] { 2 } + Constant [ integer VARNISH_COMPAT_3 ] { 3 } + } + + - Classes [4] { + Class [ class VarnishAdmin ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [21] { + Method [ public method __construct ] { + } + + Method [ public method connect ] { + } + + Method [ public method auth ] { + } + + Method [ public method getParams ] { + } + + Method [ public method setParam ] { + } + + Method [ public method stop ] { + } + + Method [ public method start ] { + } + + Method [ public method banUrl ] { + } + + Method [ public method ban ] { + } + + Method [ public method isRunning ] { + } + + Method [ public method getPanic ] { + } + + Method [ public method clearPanic ] { + } + + Method [ public method setHost ] { + } + + Method [ public method setIdent ] { + } + + Method [ public method setTimeout ] { + } + + Method [ public method setPort ] { + } + + Method [ public method setSecret ] { + } + + Method [ public method setCompat ] { + } + + Method [ public method getVclList ] { + } + + Method [ public method vclUse ] { + } + + Method [ public method disconnect ] { + } + } + } + + Class [ class VarnishStat ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [1] { + Method [ public method __construct ] { + } + } + } + + Class [ class VarnishLog ] { + + - Constants [82] { + Constant [ integer TAG_Debug ] { 1 } + Constant [ integer TAG_Error ] { 2 } + Constant [ integer TAG_CLI ] { 3 } + Constant [ integer TAG_SessOpen ] { 4 } + Constant [ integer TAG_SessClose ] { 5 } + Constant [ integer TAG_BackendOpen ] { 6 } + Constant [ integer TAG_BackendReuse ] { 7 } + Constant [ integer TAG_BackendClose ] { 8 } + Constant [ integer TAG_HttpGarbage ] { 9 } + Constant [ integer TAG_Backend ] { 10 } + Constant [ integer TAG_Length ] { 11 } + Constant [ integer TAG_FetchError ] { 12 } + Constant [ integer TAG_ReqMethod ] { 13 } + Constant [ integer TAG_ReqURL ] { 14 } + Constant [ integer TAG_ReqProtocol ] { 15 } + Constant [ integer TAG_ReqStatus ] { 16 } + Constant [ integer TAG_ReqReason ] { 17 } + Constant [ integer TAG_ReqHeader ] { 18 } + Constant [ integer TAG_ReqUnset ] { 19 } + Constant [ integer TAG_ReqLost ] { 20 } + Constant [ integer TAG_RespMethod ] { 21 } + Constant [ integer TAG_RespURL ] { 22 } + Constant [ integer TAG_RespProtocol ] { 23 } + Constant [ integer TAG_RespStatus ] { 24 } + Constant [ integer TAG_RespReason ] { 25 } + Constant [ integer TAG_RespHeader ] { 26 } + Constant [ integer TAG_RespUnset ] { 27 } + Constant [ integer TAG_RespLost ] { 28 } + Constant [ integer TAG_BereqMethod ] { 29 } + Constant [ integer TAG_BereqURL ] { 30 } + Constant [ integer TAG_BereqProtocol ] { 31 } + Constant [ integer TAG_BereqStatus ] { 32 } + Constant [ integer TAG_BereqReason ] { 33 } + Constant [ integer TAG_BereqHeader ] { 34 } + Constant [ integer TAG_BereqUnset ] { 35 } + Constant [ integer TAG_BereqLost ] { 36 } + Constant [ integer TAG_BerespMethod ] { 37 } + Constant [ integer TAG_BerespURL ] { 38 } + Constant [ integer TAG_BerespProtocol ] { 39 } + Constant [ integer TAG_BerespStatus ] { 40 } + Constant [ integer TAG_BerespReason ] { 41 } + Constant [ integer TAG_BerespHeader ] { 42 } + Constant [ integer TAG_BerespUnset ] { 43 } + Constant [ integer TAG_BerespLost ] { 44 } + Constant [ integer TAG_ObjMethod ] { 45 } + Constant [ integer TAG_ObjURL ] { 46 } + Constant [ integer TAG_ObjProtocol ] { 47 } + Constant [ integer TAG_ObjStatus ] { 48 } + Constant [ integer TAG_ObjReason ] { 49 } + Constant [ integer TAG_ObjHeader ] { 50 } + Constant [ integer TAG_ObjUnset ] { 51 } + Constant [ integer TAG_ObjLost ] { 52 } + Constant [ integer TAG_BogoHeader ] { 53 } + Constant [ integer TAG_LostHeader ] { 54 } + Constant [ integer TAG_TTL ] { 55 } + Constant [ integer TAG_Fetch_Body ] { 56 } + Constant [ integer TAG_VCL_acl ] { 57 } + Constant [ integer TAG_VCL_call ] { 58 } + Constant [ integer TAG_VCL_trace ] { 59 } + Constant [ integer TAG_VCL_return ] { 60 } + Constant [ integer TAG_ReqStart ] { 61 } + Constant [ integer TAG_Hit ] { 62 } + Constant [ integer TAG_HitPass ] { 63 } + Constant [ integer TAG_ExpBan ] { 64 } + Constant [ integer TAG_ExpKill ] { 65 } + Constant [ integer TAG_WorkThread ] { 66 } + Constant [ integer TAG_ESI_xmlerror ] { 67 } + Constant [ integer TAG_Hash ] { 68 } + Constant [ integer TAG_Backend_health ] { 69 } + Constant [ integer TAG_VCL_Log ] { 70 } + Constant [ integer TAG_VCL_Error ] { 71 } + Constant [ integer TAG_Gzip ] { 72 } + Constant [ integer TAG_Link ] { 73 } + Constant [ integer TAG_Begin ] { 74 } + Constant [ integer TAG_End ] { 75 } + Constant [ integer TAG_VSL ] { 76 } + Constant [ integer TAG_Storage ] { 77 } + Constant [ integer TAG_Timestamp ] { 78 } + Constant [ integer TAG_ReqAcct ] { 79 } + Constant [ integer TAG_ESI_BodyBytes ] { 80 } + Constant [ integer TAG_PipeAcct ] { 81 } + Constant [ integer TAG_BereqAcct ] { 82 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [1] { + Method [ public method __construct ] { + } + } + } + + Class [ class VarnishException extends Exception ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [4] { + Property [ protected $message ] + Property [ protected $code ] + Property [ protected $file ] + Property [ protected $line ] + } + + - Methods [9] { + Method [ method __construct ] { + + - Parameters [3] { + Parameter #0 [ $message ] + Parameter #1 [ $code ] + Parameter #2 [ $previous ] + } + } + + Method [ final public method getMessage ] { + } + + Method [ final public method getCode ] { + } + + Method [ final public method getFile ] { + } + + Method [ final public method getLine ] { + } + + Method [ final public method getTrace ] { + } + + Method [ final public method getPrevious ] { + } + + Method [ final public method getTraceAsString ] { + } + + Method [ public method __toString ] { + } + } + } + } +} + diff --git a/php-pecl-varnish.spec b/php-pecl-varnish.spec index e3310a6..d0f00da 100644 --- a/php-pecl-varnish.spec +++ b/php-pecl-varnish.spec @@ -2,7 +2,7 @@ # # Copyright (c) 2013-2015 Remi Collet # License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/3.0/ +# http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # @@ -22,13 +22,18 @@ Summary: Varnish Cache bindings Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 1.1.1 -Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 1.2.0 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +# http://svn.php.net/viewvc?view=revision&revision=335941 +# http://svn.php.net/viewvc?view=revision&revision=335942 +# http://svn.php.net/viewvc?view=revision&revision=335943 +Patch0: %{pecl_name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{?scl_prefix}php-devel > 5.3 BuildRequires: %{?scl_prefix}php-pear @@ -39,8 +44,6 @@ BuildRequires: varnish-libs-devel > 3 BuildRequires: varnish %endif -Requires(post): %{__pecl} -Requires(postun): %{__pecl} Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} Requires: %{?scl_prefix}php-hash%{?_isa} @@ -72,6 +75,7 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version} %{?filter_setup} %endif + %description Varnish Cache is an open source, state of the art web application accelerator. @@ -83,7 +87,11 @@ through TCP socket or shared memory. %setup -q -c mv %{pecl_name}-%{version} NTS +# Don't install/register tests +sed -e 's/role="test"/role="src"/' -i package.xml + cd NTS +%patch0 -p3 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_VARNISH_VERSION/{s/.* "//;s/".*$//;p}' php_varnish.h) @@ -142,21 +150,26 @@ make -C ZTS \ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif -# Test & Documentation -for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i -done +# 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 -%post -%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +# 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 ] ; then +if [ $1 -eq 0 -a -x %{__pecl} ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi @@ -214,7 +227,7 @@ TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php || ret=1 +%{__php} -n run-tests.php --show-diff || ret=1 %if %{with_zts} cd ../ZTS @@ -229,7 +242,7 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php || ret=1 +%{__ztsphp} -n run-tests.php --show-diff || ret=1 %endif : Stop the test server @@ -249,8 +262,9 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc %{pecl_docdir}/%{pecl_name} -%doc %{pecl_testdir}/%{pecl_name} +%{?_licensedir:%license NTS/LICENSE} %{pecl_xmldir}/%{name}.xml + %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -261,6 +275,12 @@ rm -rf %{buildroot} %changelog +* Sat Feb 14 2015 Remi Collet - 1.2.0-1 +- Update to 1.2.0 +- don't install test suite +- drop runtime dependency on pear, new scriptlets +- add upstream build patches + * Tue Aug 26 2014 Remi Collet - 1.1.1-3 - allow SCL build @@ -280,4 +300,4 @@ rm -rf %{buildroot} - Add option --with tests to run upstream test suite * Mon Sep 30 2013 Remi Collet - 1.0.0-1 -- initial package +- initial package \ No newline at end of file diff --git a/varnish-upstream.patch b/varnish-upstream.patch new file mode 100644 index 0000000..e146a54 --- /dev/null +++ b/varnish-upstream.patch @@ -0,0 +1,101 @@ +--- pecl/varnish/trunk/varnish_lib.c 2015/02/13 21:33:27 335940 ++++ pecl/varnish/trunk/varnish_lib.c 2015/02/14 09:42:22 335941 +@@ -812,6 +812,13 @@ + return 0; + }/*}}}*/ + ++#if HAVE_VARNISHAPILIB >= 4 ++int ++php_varnish_snap_stats(zval *storage, const char *ident TSRMLS_DC) ++{/*{{{*/ ++ return 0; ++}/*}}}*/ ++#else + int + php_varnish_snap_stats(zval *storage, const char *ident TSRMLS_DC) + {/*{{{*/ +@@ -832,25 +839,21 @@ + return 0; + } + +-#if HAVE_VARNISHAPILIB >= 4 +- /* XXX use VSM_fantom */ +- vcm = VSC_Main(vd, NULL); +- +- return !VSC_Iter(vd, NULL, php_varnish_snap_stats_cb, storage); +-#else + vcm = VSC_Main(vd); + + return !VSC_Iter(vd, php_varnish_snap_stats_cb, storage); +-#endif + }/*}}}*/ ++#endif + +-#if HAVE_VARNISHAPILIB >=4 ++#if HAVE_VARNISHAPILIB >= 4 + int +-php_varnish_get_log(const struct VSL_data *vd, zval *line TSRMLS_DC) ++php_varnish_get_log(const struct VSM_data *vd, zval *line TSRMLS_DC) ++{/*{{{*/ ++ return 0; ++}/*}}}*/ + #else + int + php_varnish_get_log(const struct VSM_data *vd, zval *line TSRMLS_DC) +-#endif + {/*{{{*/ + uint32_t *p; + int i; +@@ -880,6 +883,7 @@ + + }/*}}}*/ + #endif ++#endif + + int + php_varnish_is_running(int sock, int *status, int tmo TSRMLS_DC) +--- pecl/varnish/trunk/varnish_lib.h 2015/02/13 21:33:27 335940 ++++ pecl/varnish/trunk/varnish_lib.h 2015/02/14 09:42:22 335941 +@@ -96,13 +96,8 @@ + php_varnish_clear_panic(int sock, int *status, int tmo TSRMLS_DC); + + #ifndef PHP_WIN32 +-#if HAVE_VARNISHAPILIB >=4 +-int +-php_varnish_get_log(const struct VSL_data *vd, zval *line TSRMLS_DC); +-#else + int + php_varnish_get_log(const struct VSM_data *vd, zval *line TSRMLS_DC); +-#endif + + void + php_varnish_log_get_tag_name(int index, char **ret, int *ret_len TSRMLS_DC); +--- pecl/varnish/trunk/varnish_lib.c 2015/02/14 09:42:22 335941 ++++ pecl/varnish/trunk/varnish_lib.c 2015/02/14 10:05:43 335942 +@@ -777,6 +777,7 @@ + }/*}}}*/ + + #ifndef PHP_WIN32 ++#if HAVE_VARNISHAPILIB < 4 + static int + php_varnish_snap_stats_cb(void *priv, const struct VSC_point const *pt) + {/*{{{*/ +@@ -811,6 +812,7 @@ + + return 0; + }/*}}}*/ ++#endif + + #if HAVE_VARNISHAPILIB >= 4 + int +--- pecl/varnish/trunk/varnish_lib.c 2015/02/14 10:05:43 335942 ++++ pecl/varnish/trunk/varnish_lib.c 2015/02/14 10:15:29 335943 +@@ -350,8 +350,6 @@ + char *t_arg, *t_start, *p, tmp_addr[41]; + #if HAVE_VARNISHAPILIB >= 4 + struct VSM_fantom vt; +-#else +- char *p; + #endif + + vsd = VSM_New(); -- cgit