From e4a99e4f0febd3de9511f17c0bc25da266ce63ce Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 28 Sep 2015 18:35:58 +0200 Subject: [PATCH] fix travis --- .travis.yml | 2 +- scripts/gen_travis_yml.php | 2 +- ....0-dev.ext.phar => propro-master.ext.phar} | 581 ++-- ...0.0-dev.ext.phar => raphf-master.ext.phar} | 2659 ++++++++++------- 4 files changed, 1962 insertions(+), 1282 deletions(-) rename travis/{propro-2.0.0-dev.ext.phar => propro-master.ext.phar} (97%) rename travis/{raphf-2.0.0-dev.ext.phar => raphf-master.ext.phar} (77%) diff --git a/.travis.yml b/.travis.yml index 1041fd7..d92482e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ env: before_script: - make -f travis/pecl/Makefile php - - make -f travis/pecl/Makefile pharext/raphf-2.0.0-dev pharext/propro-2.0.0-dev + - make -f travis/pecl/Makefile pharext/raphf-master pharext/propro-master script: - make -f travis/pecl/Makefile ext PECL=http diff --git a/scripts/gen_travis_yml.php b/scripts/gen_travis_yml.php index f336d43..4bb37b7 100755 --- a/scripts/gen_travis_yml.php +++ b/scripts/gen_travis_yml.php @@ -34,7 +34,7 @@ foreach ($env as $e) { before_script: - make -f travis/pecl/Makefile php - - make -f travis/pecl/Makefile pharext/raphf-2.0.0-dev pharext/propro-2.0.0-dev + - make -f travis/pecl/Makefile pharext/raphf-master pharext/propro-master script: - make -f travis/pecl/Makefile ext PECL=http diff --git a/travis/propro-2.0.0-dev.ext.phar b/travis/propro-master.ext.phar similarity index 97% rename from travis/propro-2.0.0-dev.ext.phar rename to travis/propro-master.ext.phar index 416405d..cae49e7 100755 --- a/travis/propro-2.0.0-dev.ext.phar +++ b/travis/propro-master.ext.phar @@ -472,7 +472,7 @@ $installer = new Installer(); $installer->run($argc, $argv); __HALT_COMPILER(); ?> -p6-a:7:{s:7:"version";s:5:"4.1.1";s:6:"header";s:49:"pharext v4.1.1 (c) Michael Wallner ";s:4:"date";s:10:"2015-09-28";s:4:"name";s:6:"propro";s:7:"release";s:9:"2.0.0-dev";s:7:"license";s:1345:"Copyright (c) 2013, Michael Wallner . +³8*a:7:{s:7:"version";s:5:"4.1.1";s:6:"header";s:49:"pharext v4.1.1 (c) Michael Wallner ";s:4:"date";s:10:"2015-09-28";s:4:"name";s:6:"propro";s:7:"release";s:6:"master";s:7:"license";s:1345:"Copyright (c) 2013, Michael Wallner . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -494,8 +494,9 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -";s:4:"type";s:9:"extension";}pharext/Archive.phpoh V4-ÔI¶pharext/Cli/Args/Help.phpÉ oh VÉ gX'¶pharext/Cli/Args.phpoh V?nö¶pharext/Cli/Command.phpk oh Vk d„aê¶pharext/Command.phpoh VÔm`Ͷpharext/Exception.phpcoh VcU†Ï{¶pharext/ExecCmd.phpoh V¹l”ʶpharext/Installer.php&oh V&ød&À¶pharext/License.php“oh V“îòE¶pharext/Metadata.php•oh V•¿Úž¶pharext/Openssl/PrivateKey.phpÁoh VÁ&æP¶pharext/Packager.phpÌ!oh VÌ!0<¶pharext/SourceDir/Basic.phpzoh Vz÷+Ôâ¶pharext/SourceDir/Git.phpZoh VZÉÎ\¶pharext/SourceDir/Pecl.phpøoh Vøãùжpharext/SourceDir.php½oh V½3·#¶pharext/Task/Activate.phpÜ oh VÜ I“¶pharext/Task/Askpass.phpUoh VU‡*¶ pharext/Task/BundleGenerator.php}oh V} ï`Y¶pharext/Task/Cleanup.phpoh VÉI€B¶pharext/Task/Configure.phpToh VT}Ëì¶pharext/Task/Extract.phppoh Vp[¨Û̶pharext/Task/GitClone.phpmoh Vmóyµ@¶pharext/Task/Make.phpªoh Vªœç6 ¶pharext/Task/PaxFixup.php¬oh V¬y⯶pharext/Task/PeclFixup.phpœoh Vœeùtš¶pharext/Task/PharBuild.phpâoh Vâζ0ɶpharext/Task/PharCompress.phpcoh Vc½³Ï¶pharext/Task/PharRename.phpäoh VäŠ[Þ˶pharext/Task/PharSign.php¨oh V¨Ûº¦i¶pharext/Task/PharStub.phpæoh VæY|­›¶pharext/Task/Phpize.phpoh Vù 2Ѷpharext/Task/StreamFetch.phpoh Vˆîs\¶pharext/Task.phpwoh Vw ÄIǶpharext/Tempdir.phpµoh Vµë–,¶pharext/Tempfile.phpoh V®ô¶pharext/Tempname.phptoh Vtžn<¶pharext/Updater.phpoh VžÏv¶pharext_installer.phpÝoh VÝŒÞq¶pharext_packager.phpboh VbîVÓ϶pharext_updater.phphoh Vh Êúj¶pharext_package.php2oh V2vSTÒ¶ package.xmlµoh VµÈjg¶CREDITSoh Vu÷BζLICENSEAoh VA¾¬Jþ¶Doxyfilea*oh Va*¯d¶ config.m4oh V k"¶ -config.w32Öoh VÖÈ5²¶ php_propro.hOoh VOG+™¶php_propro_api.hýoh Vý´ #•¶ php_propro.c08oh V08™ÿ^¶tests/001.phpt9oh V92Õ½A¶tests/002.phpt8oh V8L¶tests/003.phptïoh VïU8Ìå¶run($argc, $argv); __HALT_COMPILER(); - - - propro - pecl.php.net - Property proxy - A reusable split-off of pecl_http's property proxy API. - - Michael Wallner - mike - mike@php.net - yes - - 2013-12-05 - - 2.0.0-dev - 2.0.0 - - - stable - stable - - BSD, revised - - - - - - - - - - - - - - - - - - - - - - 7.0.0 - - - 1.4.0 - - - - propro - - - -proproCopyright (c) 2013, Michael Wallner . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Doxyfile 1.8.5 +package.xml merge=touch +php_propro.h merge=touch + +# / +*~ +/*.tgz +/.deps +/*.lo +/*.la +/config.[^wm]* +/configure* +/lib* +/ac*.m4 +/ltmain.sh +/install-sh +/Make* +/mk* +/missing +/.libs +/build +/include +/modules +/autom4te* +/.dep.inc +run-tests.php +propro# Doxyfile 1.8.5 #--------------------------------------------------------------------------- # Project related configuration options @@ -4651,195 +4589,131 @@ DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES -PHP_ARG_ENABLE(propro, whether to enable property proxy support, -[ --enable-propro Enable property proxy support]) - -if test "$PHP_PROPRO" != "no"; then - PHP_INSTALL_HEADERS(ext/propro, php_propro.h php_propro_api.h) - PHP_NEW_EXTENSION(propro, php_propro.c, $ext_shared) -fi - -ARG_ENABLE("propro", "for propro support", "no"); - -if (PHP_PROPRO == "yes") { - EXTENSION("propro", "php_propro.c"); - - AC_DEFINE("HAVE_PROPRO", 1); - PHP_INSTALL_HEADERS("ext/propro", "php_propro.h"); -} -/* - +--------------------------------------------------------------------+ - | PECL :: propro | - +--------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met. | - +--------------------------------------------------------------------+ - | Copyright (c) 2013 Michael Wallner | - +--------------------------------------------------------------------+ -*/ - -#ifndef PHP_PROPRO_H -#define PHP_PROPRO_H - -extern zend_module_entry propro_module_entry; -#define phpext_propro_ptr &propro_module_entry - -#define PHP_PROPRO_VERSION "2.0.0dev" - -#ifdef PHP_WIN32 -# define PHP_PROPRO_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_PROPRO_API extern __attribute__ ((visibility("default"))) -#else -# define PHP_PROPRO_API extern -#endif - -#ifdef ZTS -# include -#endif - -#define PHP_PROPRO_PTR(zo) (void*)(((char*)(zo))-(zo)->handlers->offset) +Copyright (c) 2013, Michael Wallner . +All rights reserved. -#endif /* PHP_PROPRO_H */ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ -/* - +--------------------------------------------------------------------+ - | PECL :: propro | - +--------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met. | - +--------------------------------------------------------------------+ - | Copyright (c) 2013 Michael Wallner | - +--------------------------------------------------------------------+ -*/ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# pecl/propro -#ifndef PHP_PROPRO_API_H -#define PHP_PROPRO_API_H +## About: -#include "php_propro.h" +The "Property Proxy" extension provides a fairly transparent proxy for internal object properties hidden in custom non-zval implementations. -/** - * The internal property proxy. - * - * Container for the object/array holding the proxied property. - */ -struct php_property_proxy { - /** The container holding the property */ - zval container; - /** The name of the proxied property */ - zend_string *member; -}; -typedef struct php_property_proxy php_property_proxy_t; +## Installation: -/** - * The userland object. - * - * Return an object instance of php\\PropertyProxy to make your C-struct - * member accessible by reference from PHP userland. - * - * Example: - * ~~~~~~~~~~{.c} - * static zval *my_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp) - * { - * zval *return_value; - * zend_string *member_name = zval_get_string(member); - * my_prophandler_t *handler = my_get_prophandler(member_name); - * - * if (!handler || type == BP_VAR_R || type == BP_VAR_IS) { - * return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp); - * - * if (handler) { - * handler->read(object, tmp); - * - * zval_ptr_dtor(return_value); - * ZVAL_COPY_VALUE(return_value, tmp); - * } - * } else { - * return_value = php_property_proxy_zval(object, member_name); - * } - * - * zend_string_release(member_name); - * - * return return_value; - * } - * ~~~~~~~~~~ - */ -struct php_property_proxy_object { - /** The actual property proxy */ - php_property_proxy_t *proxy; - /** Any parent property proxy object */ - zval parent; - /** The std zend_object */ - zend_object zo; -}; -typedef struct php_property_proxy_object php_property_proxy_object_t; +This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command: -/** - * Create a property proxy - * - * The property proxy will forward reads and writes to itself to the - * proxied property with name \a member_str of \a container. - * - * @param container the container holding the property - * @param member the name of the proxied property - * @return a new property proxy - */ -PHP_PROPRO_API php_property_proxy_t *php_property_proxy_init(zval *container, - zend_string *member); + # pecl install propro -/** - * Destroy and free a property proxy. - * - * The destruction of the property proxy object calls this. - * - * @param proxy a pointer to the allocated property proxy - */ -PHP_PROPRO_API void php_property_proxy_free(php_property_proxy_t **proxy); +Also, watch out for self-installing [pharext](https://github.com/m6w6/pharext) packages attached to [releases](https://github.com/m6w6/ext-propro/releases). -/** - * Get the zend_class_entry of php\\PropertyProxy - * @return the class entry pointer - */ -PHP_PROPRO_API zend_class_entry *php_property_proxy_get_class_entry(void); +## Internals: -/** - * Instantiate a new php\\PropertyProxy - * @param ce the property proxy or derived class entry - * @return the zend object - */ -PHP_PROPRO_API zend_object *php_property_proxy_object_new(zend_class_entry *ce); +> ***NOTE:*** + This extension mostly only provides infrastructure for other extensions. + See the [API docs here](http://m6w6.github.io/ext-propro/). -/** - * Instantiate a new php\\PropertyProxy with \a proxy - * @param ce the property proxy or derived class entry - * @param proxy the internal property proxy - * @return the property proxy - */ -PHP_PROPRO_API php_property_proxy_object_t *php_property_proxy_object_new_ex( - zend_class_entry *ce, php_property_proxy_t *proxy); +## Documentation -#endif /* PHP_PROPRO_API_H */ +Userland documentation can be found at https://mdref.m6w6.name/propro +PHP_ARG_ENABLE(propro, whether to enable property proxy support, +[ --enable-propro Enable property proxy support]) +if test "$PHP_PROPRO" != "no"; then + PHP_INSTALL_HEADERS(ext/propro, php_propro.h php_propro_api.h) + PHP_NEW_EXTENSION(propro, php_propro.c, $ext_shared) +fi + +ARG_ENABLE("propro", "for propro support", "no"); + +if (PHP_PROPRO == "yes") { + EXTENSION("propro", "php_propro.c"); + + AC_DEFINE("HAVE_PROPRO", 1); + PHP_INSTALL_HEADERS("ext/propro", "php_propro.h"); +} + + + propro + pecl.php.net + Property proxy + A reusable split-off of pecl_http's property proxy API. + + Michael Wallner + mike + mike@php.net + yes + + 2013-12-05 + + 2.0.0-dev + 2.0.0 + + + stable + stable + + BSD, revised + + + + + + + + + + + + + + + + + + + + + + 7.0.0 + + + 1.4.0 + + + + propro + + -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ /* +--------------------------------------------------------------------+ | PECL :: propro | @@ -5429,6 +5303,179 @@ ZEND_GET_MODULE(propro) #endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +/* + +--------------------------------------------------------------------+ + | PECL :: propro | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013 Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#ifndef PHP_PROPRO_H +#define PHP_PROPRO_H + +extern zend_module_entry propro_module_entry; +#define phpext_propro_ptr &propro_module_entry + +#define PHP_PROPRO_VERSION "2.0.0dev" + +#ifdef PHP_WIN32 +# define PHP_PROPRO_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_PROPRO_API extern __attribute__ ((visibility("default"))) +#else +# define PHP_PROPRO_API extern +#endif + +#ifdef ZTS +# include +#endif + +#define PHP_PROPRO_PTR(zo) (void*)(((char*)(zo))-(zo)->handlers->offset) + +#endif /* PHP_PROPRO_H */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +/* + +--------------------------------------------------------------------+ + | PECL :: propro | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013 Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#ifndef PHP_PROPRO_API_H +#define PHP_PROPRO_API_H + +#include "php_propro.h" + +/** + * The internal property proxy. + * + * Container for the object/array holding the proxied property. + */ +struct php_property_proxy { + /** The container holding the property */ + zval container; + /** The name of the proxied property */ + zend_string *member; +}; +typedef struct php_property_proxy php_property_proxy_t; + +/** + * The userland object. + * + * Return an object instance of php\\PropertyProxy to make your C-struct + * member accessible by reference from PHP userland. + * + * Example: + * ~~~~~~~~~~{.c} + * static zval *my_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp) + * { + * zval *return_value; + * zend_string *member_name = zval_get_string(member); + * my_prophandler_t *handler = my_get_prophandler(member_name); + * + * if (!handler || type == BP_VAR_R || type == BP_VAR_IS) { + * return_value = zend_get_std_object_handlers()->read_property(object, member, type, cache_slot, tmp); + * + * if (handler) { + * handler->read(object, tmp); + * + * zval_ptr_dtor(return_value); + * ZVAL_COPY_VALUE(return_value, tmp); + * } + * } else { + * return_value = php_property_proxy_zval(object, member_name); + * } + * + * zend_string_release(member_name); + * + * return return_value; + * } + * ~~~~~~~~~~ + */ +struct php_property_proxy_object { + /** The actual property proxy */ + php_property_proxy_t *proxy; + /** Any parent property proxy object */ + zval parent; + /** The std zend_object */ + zend_object zo; +}; +typedef struct php_property_proxy_object php_property_proxy_object_t; + +/** + * Create a property proxy + * + * The property proxy will forward reads and writes to itself to the + * proxied property with name \a member_str of \a container. + * + * @param container the container holding the property + * @param member the name of the proxied property + * @return a new property proxy + */ +PHP_PROPRO_API php_property_proxy_t *php_property_proxy_init(zval *container, + zend_string *member); + +/** + * Destroy and free a property proxy. + * + * The destruction of the property proxy object calls this. + * + * @param proxy a pointer to the allocated property proxy + */ +PHP_PROPRO_API void php_property_proxy_free(php_property_proxy_t **proxy); + +/** + * Get the zend_class_entry of php\\PropertyProxy + * @return the class entry pointer + */ +PHP_PROPRO_API zend_class_entry *php_property_proxy_get_class_entry(void); + +/** + * Instantiate a new php\\PropertyProxy + * @param ce the property proxy or derived class entry + * @return the zend object + */ +PHP_PROPRO_API zend_object *php_property_proxy_object_new(zend_class_entry *ce); + +/** + * Instantiate a new php\\PropertyProxy with \a proxy + * @param ce the property proxy or derived class entry + * @param proxy the internal property proxy + * @return the property proxy + */ +PHP_PROPRO_API php_property_proxy_object_t *php_property_proxy_object_new_ex( + zend_class_entry *ce, php_property_proxy_t *proxy); + +#endif /* PHP_PROPRO_API_H */ + + /* * Local variables: * tab-width: 4 @@ -5645,4 +5692,4 @@ object(t)#%d (1) { int(2) } } -===DONE===®,øÿÅmíPVð¼ÜòçcGBMB \ No newline at end of file +===DONE===žhz%Ý dþ¨éñ ÜRÃ`ǕýGBMB \ No newline at end of file diff --git a/travis/raphf-2.0.0-dev.ext.phar b/travis/raphf-master.ext.phar similarity index 77% rename from travis/raphf-2.0.0-dev.ext.phar rename to travis/raphf-master.ext.phar index ec4d0d4..e2433d4 100755 --- a/travis/raphf-2.0.0-dev.ext.phar +++ b/travis/raphf-master.ext.phar @@ -472,7 +472,7 @@ $installer = new Installer(); $installer->run($argc, $argv); __HALT_COMPILER(); ?> -¦7,a:7:{s:7:"version";s:5:"4.1.1";s:6:"header";s:49:"pharext v4.1.1 (c) Michael Wallner ";s:4:"date";s:10:"2015-09-28";s:4:"name";s:5:"raphf";s:7:"release";s:9:"2.0.0-dev";s:7:"license";s:1345:"Copyright (c) 2013, Michael Wallner . +…=)a:7:{s:7:"version";s:5:"4.1.1";s:6:"header";s:49:"pharext v4.1.1 (c) Michael Wallner ";s:4:"date";s:10:"2015-09-28";s:4:"name";s:5:"raphf";s:7:"release";s:6:"master";s:7:"license";s:1345:"Copyright (c) 2013, Michael Wallner . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -494,8 +494,11 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -";s:4:"type";s:9:"extension";}pharext/Archive.php”h V4-ÔI¶pharext/Cli/Args/Help.phpÉ ”h VÉ gX'¶pharext/Cli/Args.php”h V?nö¶pharext/Cli/Command.phpk ”h Vk d„aê¶pharext/Command.php”h VÔm`Ͷpharext/Exception.phpc”h VcU†Ï{¶pharext/ExecCmd.php”h V¹l”ʶpharext/Installer.php&”h V&ød&À¶pharext/License.php“”h V“îòE¶pharext/Metadata.php•”h V•¿Úž¶pharext/Openssl/PrivateKey.phpÁ”h VÁ&æP¶pharext/Packager.phpÌ!”h VÌ!0<¶pharext/SourceDir/Basic.phpz”h Vz÷+Ôâ¶pharext/SourceDir/Git.phpZ”h VZÉÎ\¶pharext/SourceDir/Pecl.phpø”h Vøãùжpharext/SourceDir.php½”h V½3·#¶pharext/Task/Activate.phpÜ ”h VÜ I“¶pharext/Task/Askpass.phpU”h VU‡*¶ pharext/Task/BundleGenerator.php}”h V} ï`Y¶pharext/Task/Cleanup.php”h VÉI€B¶pharext/Task/Configure.phpT”h VT}Ëì¶pharext/Task/Extract.phpp”h Vp[¨Û̶pharext/Task/GitClone.phpm”h Vmóyµ@¶pharext/Task/Make.phpª”h Vªœç6 ¶pharext/Task/PaxFixup.php¬”h V¬y⯶pharext/Task/PeclFixup.phpœ”h Vœeùtš¶pharext/Task/PharBuild.phpâ”h Vâζ0ɶpharext/Task/PharCompress.phpc”h Vc½³Ï¶pharext/Task/PharRename.phpä”h VäŠ[Þ˶pharext/Task/PharSign.php¨”h V¨Ûº¦i¶pharext/Task/PharStub.phpæ”h VæY|­›¶pharext/Task/Phpize.php”h Vù 2Ѷpharext/Task/StreamFetch.php”h Vˆîs\¶pharext/Task.phpw”h Vw ÄIǶpharext/Tempdir.phpµ”h Vµë–,¶pharext/Tempfile.php”h V®ô¶pharext/Tempname.phpt”h Vtžn<¶pharext/Updater.php”h VžÏv¶pharext_installer.phpÝ”h VÝŒÞq¶pharext_packager.phpb”h VbîVÓ϶pharext_updater.phph”h Vh Êúj¶pharext_package.php2”h V2vSTÒ¶ package.xml”h VL(—)¶CREDITS”h VCµ]²¶LICENSEA”h VA¾¬Jþ¶DoxyfileW,”h VW,Zΰ¶ config.m4$”h V$Åê@›¶ -config.w32Дh VÐýÍŽ¶ php_raphf.h”h Vb·Ò¶php_raphf_api.hˆ2”h Vˆ2J^V¶ php_raphf.cE”h VE™P¶tests/http001.phpt”h V *®¶tests/http002.phptL”h VL€ÔïS¶tests/http003.phpt^”h V^ˆp¶tests/http004.phpt[”h V[Y諶x¶ raphf.png|pók V|ps䙳¶tests/http001.phptók V *®¶tests/http002.phptLók VL€ÔïS¶tests/http003.phpt^ók V^ˆp¶tests/http004.phpt[ók V[Y諶tests/test.phpt¾ +ók V¾ +$àíY¶run($argc, $argv); __HALT_COMPILER(); - - - raphf - pecl.php.net - Resource and persistent handles factory - A reusable split-off of pecl_http's persistent handle and resource factory API. - - Michael Wallner - mike - mike@php.net - yes - - 2015-07-28 - - 2.0.0-dev - 2.0.0 - - - stable - stable - - BSD, revised - - - - - - - - - - - - - - - - - - - - - - - 7.0.0 - - - 1.4.0 - - - - raphf - - - +package.xml merge=touch +php_raphf.h merge=touch + +# / +*~ +/*.tgz +/.deps +/*.lo +/*.la +/config.[^mw]* +/configure* +/lib* +/ac*.m4 +/ltmain.sh +/install-sh +/Make* +/mk* +/missing +/.libs +/build +/include +/modules +/autom4te* +/.dep.inc +run-tests.php raphf Michael Wallner -Copyright (c) 2013, Michael Wallner . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Doxyfile 1.8.9.1 #--------------------------------------------------------------------------- @@ -4668,6 +4607,58 @@ DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES +Copyright (c) 2013, Michael Wallner . +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# pecl/raphf + +## About: + +The "Resource and Persistent Handle Factory" extension provides facilities to manage those in a convenient manner. + +## Installation: + +This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command: + + # pecl install raphf + +Also, watch out for self-installing [pharext](https://github.com/m6w6/pharext) packages attached to [releases](https://github.com/m6w6/ext-raphf/releases). + + +## INI Directives: + +* raphf.persistent_handle.limit = -1 + The per process/thread persistent handle limit. + +## Internals: + +> ***NOTE:*** + This extension mostly only provides infrastructure for other extensions. + See the [API docs here](http://m6w6.github.io/ext-raphf/). + +## Documentation: + +Userland documentation can be found at https://mdref.m6w6.name/raphf +* TTL PHP_ARG_ENABLE(raphf, whether to enable raphf support, [ --enable-raphf Enable resource and persistent handles factory support]) @@ -4685,6 +4676,71 @@ if (PHP_RAPHF == "yes") { AC_DEFINE("HAVE_RAPHF", 1); PHP_INSTALL_HEADERS("ext/raphf", "php_raphf.h"); } + + + raphf + pecl.php.net + Resource and persistent handles factory + A reusable split-off of pecl_http's persistent handle and resource factory API. + + Michael Wallner + mike + mike@php.net + yes + + 2015-07-28 + + 2.0.0-dev + 2.0.0 + + + stable + stable + + BSD, revised + + + + + + + + + + + + + + + + + + + + + + + 7.0.0 + + + 1.4.0 + + + + raphf + + + /* +--------------------------------------------------------------------+ | PECL :: raphf | @@ -4697,1147 +4753,1410 @@ if (PHP_RAPHF == "yes") { +--------------------------------------------------------------------+ */ -#ifndef PHP_RAPHF_H -#define PHP_RAPHF_H +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif -extern zend_module_entry raphf_module_entry; -#define phpext_raphf_ptr &raphf_module_entry +#include "php.h" +#include "php_ini.h" +#include "ext/standard/info.h" +#include "php_raphf.h" -#define PHP_RAPHF_VERSION "2.0.0dev" +#ifndef PHP_RAPHF_TEST +# define PHP_RAPHF_TEST 0 +#endif -#ifdef PHP_WIN32 -# define PHP_RAPHF_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_RAPHF_API extern __attribute__ ((visibility("default"))) +struct php_persistent_handle_globals { + ulong limit; + HashTable hash; +}; + +ZEND_BEGIN_MODULE_GLOBALS(raphf) + struct php_persistent_handle_globals persistent_handle; +ZEND_END_MODULE_GLOBALS(raphf) + +#ifdef ZTS +# define PHP_RAPHF_G ((zend_raphf_globals *) \ + (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(raphf_globals_id)]) #else -# define PHP_RAPHF_API extern +# define PHP_RAPHF_G (&raphf_globals) #endif -#ifdef ZTS -# include "TSRM.h" +ZEND_DECLARE_MODULE_GLOBALS(raphf) + +#ifndef PHP_RAPHF_DEBUG_PHANDLES +# define PHP_RAPHF_DEBUG_PHANDLES 0 +#endif +#if PHP_RAPHF_DEBUG_PHANDLES +# undef inline +# define inline #endif -#include "php_raphf_api.h" +php_resource_factory_t *php_resource_factory_init(php_resource_factory_t *f, + php_resource_factory_ops_t *fops, void *data, void (*dtor)(void *data)) +{ + if (!f) { + f = emalloc(sizeof(*f)); + } + memset(f, 0, sizeof(*f)); -#endif /* PHP_RAPHF_H */ + memcpy(&f->fops, fops, sizeof(*fops)); + f->data = data; + f->dtor = dtor; -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ -/* - +--------------------------------------------------------------------+ - | PECL :: raphf | - +--------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met. | - +--------------------------------------------------------------------+ - | Copyright (c) 2013, Michael Wallner | - +--------------------------------------------------------------------+ -*/ + f->refcount = 1; -#ifndef PHP_RAPHF_API_H -#define PHP_RAPHF_API_H + return f; +} -#include "php_raphf.h" +unsigned php_resource_factory_addref(php_resource_factory_t *rf) +{ + return ++rf->refcount; +} -/** - * A resource constructor. - * - * @param opaque is the \a data from php_persistent_handle_provide() - * @param init_arg is the \a init_arg from php_resource_factory_init() - * @return the created (persistent) handle - */ -typedef void *(*php_resource_factory_handle_ctor_t)(void *opaque, void *init_arg); +void php_resource_factory_dtor(php_resource_factory_t *f) +{ + if (!--f->refcount) { + if (f->dtor) { + f->dtor(f->data); + } + } +} -/** - * The copy constructor of a resource. - * - * @param opaque the factory's data - * @param handle the (persistent) handle to copy - */ -typedef void *(*php_resource_factory_handle_copy_t)(void *opaque, void *handle); +void php_resource_factory_free(php_resource_factory_t **f) +{ + if (*f) { + php_resource_factory_dtor(*f); + if (!(*f)->refcount) { + efree(*f); + *f = NULL; + } + } +} -/** - * The destructor of a resource. - * - * @param opaque the factory's data - * @param handle the handle to destroy - */ -typedef void (*php_resource_factory_handle_dtor_t)(void *opaque, void *handle); +void *php_resource_factory_handle_ctor(php_resource_factory_t *f, void *init_arg) +{ + if (f->fops.ctor) { + return f->fops.ctor(f->data, init_arg); + } + return NULL; +} -/** - * The resource ops consisting of a ctor, a copy ctor and a dtor. - * - * Define this ops and register them with php_persistent_handle_provide() - * in MINIT. - */ -typedef struct php_resource_factory_ops { - /** The resource constructor */ - php_resource_factory_handle_ctor_t ctor; - /** The resource's copy constructor */ - php_resource_factory_handle_copy_t copy; - /** The resource's destructor */ - php_resource_factory_handle_dtor_t dtor; -} php_resource_factory_ops_t; +void *php_resource_factory_handle_copy(php_resource_factory_t *f, void *handle) +{ + if (f->fops.copy) { + return f->fops.copy(f->data, handle); + } + return NULL; +} -/** - * The resource factory. - */ -typedef struct php_resource_factory { - /** The resource ops */ - php_resource_factory_ops_t fops; - /** Opaque user data */ - void *data; - /** User data destructor */ - void (*dtor)(void *data); - /** How often this factory is referenced */ - unsigned refcount; -} php_resource_factory_t; +void php_resource_factory_handle_dtor(php_resource_factory_t *f, void *handle) +{ + if (f->fops.dtor) { + f->fops.dtor(f->data, handle); + } +} -/** - * Initialize a resource factory. - * - * If you register a \a dtor for a resource factory used with a persistent - * handle provider, be sure to call php_persistent_handle_cleanup() for your - * registered provider in MSHUTDOWN, else the dtor will point to no longer - * available memory if the extension has already been unloaded. - * - * @param f the factory to initialize; if NULL allocated on the heap - * @param fops the resource ops to assign to the factory - * @param data opaque user data; may be NULL - * @param dtor a destructor for the data; may be NULL - * @return \a f or an allocated resource factory - */ -PHP_RAPHF_API php_resource_factory_t *php_resource_factory_init( - php_resource_factory_t *f, php_resource_factory_ops_t *fops, void *data, - void (*dtor)(void *data)); +php_resource_factory_t *php_persistent_handle_resource_factory_init( + php_resource_factory_t *a, php_persistent_handle_factory_t *pf) +{ + return php_resource_factory_init(a, + php_persistent_handle_get_resource_factory_ops(), pf, + (void(*)(void*)) php_persistent_handle_abandon); +} -/** - * Increase the refcount of the resource factory. - * - * @param rf the resource factory - * @return the new refcount - */ -PHP_RAPHF_API unsigned php_resource_factory_addref(php_resource_factory_t *rf); +zend_bool php_resource_factory_is_persistent(php_resource_factory_t *a) +{ + return a->dtor == (void(*)(void *)) php_persistent_handle_abandon; +} -/** - * Destroy the resource factory. - * - * If the factory's refcount reaches 0, the \a dtor for \a data is called. - * - * @param f the resource factory - */ -PHP_RAPHF_API void php_resource_factory_dtor(php_resource_factory_t *f); +static inline php_persistent_handle_list_t *php_persistent_handle_list_init( + php_persistent_handle_list_t *list) +{ + if (!list) { + list = pemalloc(sizeof(*list), 1); + } + list->used = 0; + zend_hash_init(&list->free, 0, NULL, NULL, 1); -/** - * Destroy and free the resource factory. - * - * Calls php_resource_factory_dtor() and frees \a f if the factory's refcount - * reached 0. - * - * @param f the resource factory - */ -PHP_RAPHF_API void php_resource_factory_free(php_resource_factory_t **f); + return list; +} -/** - * Construct a resource by the resource factory \a f - * - * @param f the resource factory - * @param init_arg for the resource constructor - * @return the new resource - */ -PHP_RAPHF_API void *php_resource_factory_handle_ctor(php_resource_factory_t *f, - void *init_arg); +static int php_persistent_handle_apply_stat(zval *p, int argc, va_list argv, + zend_hash_key *key) +{ + php_persistent_handle_list_t *list = Z_PTR_P(p); + zval zsubentry, *zentry = va_arg(argv, zval *); -/** - * Create a copy of the resource \a handle - * - * @param f the resource factory - * @param handle the resource to copy - * @return the copy - */ -PHP_RAPHF_API void *php_resource_factory_handle_copy(php_resource_factory_t *f, - void *handle); + array_init(&zsubentry); + add_assoc_long_ex(&zsubentry, ZEND_STRL("used"), list->used); + add_assoc_long_ex(&zsubentry, ZEND_STRL("free"), + zend_hash_num_elements(&list->free)); + if (key->key) { + add_assoc_zval_ex(zentry, key->key->val, key->key->len, &zsubentry); + } else { + add_index_zval(zentry, key->h, &zsubentry); + } + return ZEND_HASH_APPLY_KEEP; +} -/** - * Destroy (and free) the resource - * - * @param f the resource factory - * @param handle the resource to destroy - */ -PHP_RAPHF_API void php_resource_factory_handle_dtor(php_resource_factory_t *f, - void *handle); +static int php_persistent_handle_apply_statall(zval *p, int argc, va_list argv, + zend_hash_key *key) +{ + php_persistent_handle_provider_t *provider = Z_PTR_P(p); + HashTable *ht = va_arg(argv, HashTable *); + zval zentry; -/** - * Persistent handles storage - */ -typedef struct php_persistent_handle_list { - /** Storage of free resources */ - HashTable free; - /** Count of acquired resources */ - ulong used; -} php_persistent_handle_list_t; + array_init(&zentry); -/** - * Definition of a persistent handle provider. - * Holds a resource factory an a persistent handle list. - */ -typedef struct php_persistent_handle_provider { - /** - * The list of free handles. - * Hash of "ident" => array(handles) entries. Persistent handles are - * acquired out of this list. - */ - php_persistent_handle_list_t list; + zend_hash_apply_with_arguments(&provider->list.free, + php_persistent_handle_apply_stat, 1, &zentry); - /** - * The resource factory. - * New handles are created by this factory. - */ - php_resource_factory_t rf; -} php_persistent_handle_provider_t; + if (key->key) { + zend_hash_update(ht, key->key, &zentry); + } else { + zend_hash_index_update(ht, key->h, &zentry); + } -typedef struct php_persistent_handle_factory php_persistent_handle_factory_t; + return ZEND_HASH_APPLY_KEEP; +} -/** - * Wakeup the persistent handle on re-acquisition. - */ -typedef void (*php_persistent_handle_wakeup_t)( - php_persistent_handle_factory_t *f, void **handle); -/** - * Retire the persistent handle on release. - */ -typedef void (*php_persistent_handle_retire_t)( - php_persistent_handle_factory_t *f, void **handle); +static int php_persistent_handle_apply_cleanup_ex(zval *p, void *arg) +{ + php_resource_factory_t *rf = arg; + void *handle = Z_PTR_P(p); -/** - * Definition of a persistent handle factory. - * - * php_persistent_handle_concede() will return a pointer to a - * php_persistent_handle_factory if a provider for the \a name has - * been registered with php_persistent_handle_provide(). - */ -struct php_persistent_handle_factory { - /** The persistent handle provider */ - php_persistent_handle_provider_t *provider; - /** The persistent handle wakeup routine; may be NULL */ - php_persistent_handle_wakeup_t wakeup; - /** The persistent handle retire routine; may be NULL */ - php_persistent_handle_retire_t retire; +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "DESTROY: %p\n", handle); +#endif + php_resource_factory_handle_dtor(rf, handle); + return ZEND_HASH_APPLY_REMOVE; +} - /** The ident for which this factory manages resources */ - zend_string *ident; +static int php_persistent_handle_apply_cleanup(zval *p, void *arg) +{ + php_resource_factory_t *rf = arg; + php_persistent_handle_list_t *list = Z_PTR_P(p); - /** Whether it has to be free'd on php_persistent_handle_abandon() */ - unsigned free_on_abandon:1; -}; + zend_hash_apply_with_argument(&list->free, + php_persistent_handle_apply_cleanup_ex, rf); + if (list->used) { + return ZEND_HASH_APPLY_KEEP; + } + zend_hash_destroy(&list->free); +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "LSTFREE: %p\n", list); +#endif + pefree(list, 1); + return ZEND_HASH_APPLY_REMOVE; +} -/** - * Register a persistent handle provider in MINIT. - * - * Registers a factory provider for \a name_str with \a fops resource factory - * ops. Call this in your MINIT. - * - * A php_resource_factory will be created with \a fops, \a data and \a dtor - * and will be stored together with a php_persistent_handle_list in the global - * raphf hash. - * - * A php_persistent_handle_factory can then be retrieved by - * php_persistent_handle_concede() at runtime. - * - * @param name the provider name, e.g. "http\Client\Curl" - * @param fops the resource factory ops - * @param data opaque user data - * @param dtor \a data destructor - * @return SUCCESS/FAILURE - */ -PHP_RAPHF_API ZEND_RESULT_CODE php_persistent_handle_provide( - zend_string *name, php_resource_factory_ops_t *fops, - void *data, void (*dtor)(void *)); +static inline void php_persistent_handle_list_dtor( + php_persistent_handle_list_t *list, + php_persistent_handle_provider_t *provider) +{ +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "LSTDTOR: %p\n", list); +#endif + zend_hash_apply_with_argument(&list->free, + php_persistent_handle_apply_cleanup_ex, &provider->rf); + zend_hash_destroy(&list->free); +} -/** - * Retrieve a persistent handle factory at runtime. - * - * If a persistent handle provider has been registered for \a name, a new - * php_persistent_handle_factory creating resources in the \a ident - * namespace will be constructed. - * - * The wakeup routine \a wakeup and the retire routine \a retire will be - * assigned to the new php_persistent_handle_factory. - * - * @param a pointer to a factory; allocated on the heap if NULL - * @param name the provider name, e.g. "http\Client\Curl" - * @param ident the subsidiary namespace, e.g. "php.net:80" - * @param wakeup any persistent handle wakeup routine - * @param retire any persistent handle retire routine - * @return \a a or an allocated persistent handle factory - */ -PHP_RAPHF_API php_persistent_handle_factory_t *php_persistent_handle_concede( - php_persistent_handle_factory_t *a, - zend_string *name, zend_string *ident, - php_persistent_handle_wakeup_t wakeup, - php_persistent_handle_retire_t retire); +static inline void php_persistent_handle_list_free( + php_persistent_handle_list_t **list, + php_persistent_handle_provider_t *provider) +{ + php_persistent_handle_list_dtor(*list, provider); +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "LSTFREE: %p\n", *list); +#endif + pefree(*list, 1); + *list = NULL; +} -/** - * Abandon the persistent handle factory. - * - * Destroy a php_persistent_handle_factory created by - * php_persistent_handle_concede(). If the memory for the factory was allocated, - * it will automatically be free'd. - * - * @param a the persistent handle factory to destroy - */ -PHP_RAPHF_API void php_persistent_handle_abandon( - php_persistent_handle_factory_t *a); +static int php_persistent_handle_list_apply_dtor(zval *p, void *provider) +{ + php_persistent_handle_list_t *list = Z_PTR_P(p); -/** - * Acquire a persistent handle. - * - * That is, either re-use a resource from the free list or create a new handle. - * - * If a handle is acquired from the free list, the - * php_persistent_handle_factory::wakeup callback will be executed for that - * handle. - * - * @param a the persistent handle factory - * @param init_arg the \a init_arg for php_resource_factory_handle_ctor() - * @return the acquired resource - */ -PHP_RAPHF_API void *php_persistent_handle_acquire( - php_persistent_handle_factory_t *a, void *init_arg); + php_persistent_handle_list_free(&list, provider ); + ZVAL_PTR(p, NULL); + return ZEND_HASH_APPLY_REMOVE; +} -/** - * Release a persistent handle. - * - * That is, either put it back into the free list for later re-use or clean it - * up with php_resource_factory_handle_dtor(). - * - * If a handle is put back into the free list, the - * php_persistent_handle_factory::retire callback will be executed for that - * handle. - * - * @param a the persistent handle factory - * @param handle the handle to release - */ -PHP_RAPHF_API void php_persistent_handle_release( - php_persistent_handle_factory_t *a, void *handle); +static inline php_persistent_handle_list_t *php_persistent_handle_list_find( + php_persistent_handle_provider_t *provider, zend_string *ident) +{ + php_persistent_handle_list_t *list; + zval *zlist = zend_symtable_find(&provider->list.free, ident); -/** - * Copy a persistent handle. - * - * Let the underlying resource factory copy the \a handle. - * - * @param a the persistent handle factory - * @param handle the resource to accrete - */ -PHP_RAPHF_API void *php_persistent_handle_accrete( - php_persistent_handle_factory_t *a, void *handle); + if (zlist && (list = Z_PTR_P(zlist))) { +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "LSTFIND: %p\n", list); +#endif + return list; + } -/** - * Retrieve persistent handle resource factory ops. - * - * These ops can be used to mask a persistent handle factory as - * resource factory itself, so you can transparently use the - * resource factory API, both for persistent and non-persistent - * ressources. - * - * Example: - * ~~~~~~~~~~~~~~~{.c} - * php_resource_factory_t *create_my_rf(zend_string *persistent_id) - * { - * php_resource_factory_t *rf; - * - * if (persistent_id) { - * php_persistent_handle_factory_t *pf; - * php_resource_factory_ops_t *ops; - * zend_string *ns = zend_string_init("my", 2, 1); - * - * ops = php_persistent_handle_get_resource_factory_ops(); - * pf = php_persistent_handle_concede(NULL, ns, persistent_id, NULL, NULL); - * rf = php_persistent_handle_resource_factory_init(NULL, pf); - * zend_string_release(ns); - * } else { - * rf = php_resource_factory_init(NULL, &myops, NULL, NULL); - * } - * return rf; - * } - * ~~~~~~~~~~~~~~~ - */ -PHP_RAPHF_API php_resource_factory_ops_t * -php_persistent_handle_get_resource_factory_ops(void); + if ((list = php_persistent_handle_list_init(NULL))) { + zval p, *rv; + zend_string *id; -/** - * Create a resource factory for persistent handles. - * - * This will create a resource factory with persistent handle ops, which wraps - * the provided reource factory \a pf. - * - * @param a the persistent handle resource factory to initialize - * @param pf the resource factory to wrap - */ -PHP_RAPHF_API php_resource_factory_t * -php_persistent_handle_resource_factory_init(php_resource_factory_t *a, - php_persistent_handle_factory_t *pf); + ZVAL_PTR(&p, list); + id = zend_string_init(ident->val, ident->len, 1); + rv = zend_symtable_update(&provider->list.free, id, &p); + zend_string_release(id); -/** - * Check whether a resource factory is a persistent handle resource factory. - * - * @param a the resource factory to check - */ -PHP_RAPHF_API zend_bool php_resource_factory_is_persistent( - php_resource_factory_t *a); + if (rv) { +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "LSTFIND: %p (new)\n", list); +#endif + return list; + } + php_persistent_handle_list_free(&list, provider); + } -/** - * Clean persistent handles up. - * - * Destroy persistent handles of provider \a name and in subsidiary - * namespace \a ident. - * - * If \a name is NULL, all persistent handles of all providers with a - * matching \a ident will be cleaned up. - * - * If \a identr is NULL all persistent handles of the provider will be - * cleaned up. - * - * Ergo, if both, \a name and \a ident are NULL, then all - * persistent handles will be cleaned up. - * - * You must call this in MSHUTDOWN, if your resource factory ops hold a - * registered php_resource_factory::dtor, else the dtor will point to - * memory not any more available if the extension has already been unloaded. - * - * @param name the provider name; may be NULL - * @param ident the subsidiary namespace name; may be NULL - */ -PHP_RAPHF_API void php_persistent_handle_cleanup(zend_string *name, - zend_string *ident); + return NULL; +} -/** - * Retrieve statistics about the current process/thread's persistent handles. - * - * @return a HashTable like: - * ~~~~~~~~~~~~~~~ - * [ - * "name" => [ - * "ident" => [ - * "used" => 1, - * "free" => 0, - * ] - * ] - * ] - * ~~~~~~~~~~~~~~~ - */ -PHP_RAPHF_API HashTable *php_persistent_handle_statall(HashTable *ht); +static int php_persistent_handle_apply_cleanup_all(zval *p, int argc, + va_list argv, zend_hash_key *key) +{ + php_persistent_handle_provider_t *provider = Z_PTR_P(p); + zend_string *ident = va_arg(argv, zend_string *); + php_persistent_handle_list_t *list; -#endif /* PHP_RAPHF_API_H */ + if (ident && ident->len) { + if ((list = php_persistent_handle_list_find(provider, ident))) { + zend_hash_apply_with_argument(&list->free, + php_persistent_handle_apply_cleanup_ex, + &provider->rf); + } + } else { + zend_hash_apply_with_argument(&provider->list.free, + php_persistent_handle_apply_cleanup, &provider->rf); + } + return ZEND_HASH_APPLY_KEEP; +} -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ -/* - +--------------------------------------------------------------------+ - | PECL :: raphf | - +--------------------------------------------------------------------+ - | Redistribution and use in source and binary forms, with or without | - | modification, are permitted provided that the conditions mentioned | - | in the accompanying LICENSE file are met. | - +--------------------------------------------------------------------+ - | Copyright (c) 2013, Michael Wallner | - +--------------------------------------------------------------------+ -*/ +static void php_persistent_handle_hash_dtor(zval *p) +{ + php_persistent_handle_provider_t *provider = Z_PTR_P(p); -#ifdef HAVE_CONFIG_H -# include "config.h" + zend_hash_apply_with_argument(&provider->list.free, + php_persistent_handle_list_apply_dtor, provider); + zend_hash_destroy(&provider->list.free); + php_resource_factory_dtor(&provider->rf); + pefree(provider, 1); +} + +ZEND_RESULT_CODE php_persistent_handle_provide(zend_string *name, + php_resource_factory_ops_t *fops, void *data, void (*dtor)(void *)) +{ + php_persistent_handle_provider_t *provider = pemalloc(sizeof(*provider), 1); + + if (php_persistent_handle_list_init(&provider->list)) { + if (php_resource_factory_init(&provider->rf, fops, data, dtor)) { + zval p, *rv; + zend_string *ns; + +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "PROVIDE: %p %s\n", PHP_RAPHF_G, name_str); #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_raphf.h" + ZVAL_PTR(&p, provider); + ns = zend_string_init(name->val, name->len, 1); + rv = zend_symtable_update(&PHP_RAPHF_G->persistent_handle.hash, ns, &p); + zend_string_release(ns); -#ifndef PHP_RAPHF_TEST -# define PHP_RAPHF_TEST 0 + if (rv) { + return SUCCESS; + } + php_resource_factory_dtor(&provider->rf); + } + } + + return FAILURE; +} + + +php_persistent_handle_factory_t *php_persistent_handle_concede( + php_persistent_handle_factory_t *a, + zend_string *name, zend_string *ident, + php_persistent_handle_wakeup_t wakeup, + php_persistent_handle_retire_t retire) +{ + zval *zprovider = zend_symtable_find(&PHP_RAPHF_G->persistent_handle.hash, name); + + if (zprovider) { + zend_bool free_a = 0; + + if ((free_a = !a)) { + a = emalloc(sizeof(*a)); + } + memset(a, 0, sizeof(*a)); + + a->provider = Z_PTR_P(zprovider); + a->ident = zend_string_copy(ident); + a->wakeup = wakeup; + a->retire = retire; + a->free_on_abandon = free_a; + } else { + a = NULL; + } + +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "CONCEDE: %p %p (%s) (%s)\n", PHP_RAPHF_G, + a ? a->provider : NULL, name->val, ident->val); #endif -struct php_persistent_handle_globals { - ulong limit; - HashTable hash; -}; + return a; +} -ZEND_BEGIN_MODULE_GLOBALS(raphf) - struct php_persistent_handle_globals persistent_handle; -ZEND_END_MODULE_GLOBALS(raphf) +void php_persistent_handle_abandon(php_persistent_handle_factory_t *a) +{ + zend_bool f = a->free_on_abandon; -#ifdef ZTS -# define PHP_RAPHF_G ((zend_raphf_globals *) \ - (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(raphf_globals_id)]) -#else -# define PHP_RAPHF_G (&raphf_globals) +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "ABANDON: %p\n", a->provider); #endif -ZEND_DECLARE_MODULE_GLOBALS(raphf) + zend_string_release(a->ident); + memset(a, 0, sizeof(*a)); + if (f) { + efree(a); + } +} -#ifndef PHP_RAPHF_DEBUG_PHANDLES -# define PHP_RAPHF_DEBUG_PHANDLES 0 -#endif +void *php_persistent_handle_acquire(php_persistent_handle_factory_t *a, void *init_arg) +{ + int key; + zval *p; + zend_ulong index; + void *handle = NULL; + php_persistent_handle_list_t *list; + + list = php_persistent_handle_list_find(a->provider, a->ident); + if (list) { + zend_hash_internal_pointer_end(&list->free); + key = zend_hash_get_current_key(&list->free, NULL, &index); + p = zend_hash_get_current_data(&list->free); + if (p && HASH_KEY_NON_EXISTENT != key) { + handle = Z_PTR_P(p); + if (a->wakeup) { + a->wakeup(a, &handle); + } + zend_hash_index_del(&list->free, index); + } else { + handle = php_resource_factory_handle_ctor(&a->provider->rf, init_arg); + } #if PHP_RAPHF_DEBUG_PHANDLES -# undef inline -# define inline + fprintf(stderr, "CREATED: %p\n", handle); #endif - -php_resource_factory_t *php_resource_factory_init(php_resource_factory_t *f, - php_resource_factory_ops_t *fops, void *data, void (*dtor)(void *data)) -{ - if (!f) { - f = emalloc(sizeof(*f)); + if (handle) { + ++a->provider->list.used; + ++list->used; + } } - memset(f, 0, sizeof(*f)); - memcpy(&f->fops, fops, sizeof(*fops)); + return handle; +} - f->data = data; - f->dtor = dtor; +void *php_persistent_handle_accrete(php_persistent_handle_factory_t *a, void *handle) +{ + void *new_handle = NULL; + php_persistent_handle_list_t *list; - f->refcount = 1; + new_handle = php_resource_factory_handle_copy(&a->provider->rf, handle); + if (handle) { + list = php_persistent_handle_list_find(a->provider, a->ident); + if (list) { + ++list->used; + } + ++a->provider->list.used; + } - return f; + return new_handle; } -unsigned php_resource_factory_addref(php_resource_factory_t *rf) +void php_persistent_handle_release(php_persistent_handle_factory_t *a, void *handle) { - return ++rf->refcount; + php_persistent_handle_list_t *list; + + list = php_persistent_handle_list_find(a->provider, a->ident); + if (list) { + if (a->provider->list.used >= PHP_RAPHF_G->persistent_handle.limit) { +#if PHP_RAPHF_DEBUG_PHANDLES + fprintf(stderr, "DESTROY: %p\n", handle); +#endif + php_resource_factory_handle_dtor(&a->provider->rf, handle); + } else { + if (a->retire) { + a->retire(a, &handle); + } + zend_hash_next_index_insert_ptr(&list->free, handle); + } + + --a->provider->list.used; + --list->used; + } } -void php_resource_factory_dtor(php_resource_factory_t *f) +void php_persistent_handle_cleanup(zend_string *name, zend_string *ident) { - if (!--f->refcount) { - if (f->dtor) { - f->dtor(f->data); + php_persistent_handle_provider_t *provider; + php_persistent_handle_list_t *list; + + if (name) { + zval *zprovider = zend_symtable_find(&PHP_RAPHF_G->persistent_handle.hash, + name); + + if (zprovider && (provider = Z_PTR_P(zprovider))) { + if (ident) { + list = php_persistent_handle_list_find(provider, ident); + if (list) { + zend_hash_apply_with_argument(&list->free, + php_persistent_handle_apply_cleanup_ex, + &provider->rf); + } + } else { + zend_hash_apply_with_argument(&provider->list.free, + php_persistent_handle_apply_cleanup, + &provider->rf); + } } + } else { + zend_hash_apply_with_arguments( + &PHP_RAPHF_G->persistent_handle.hash, + php_persistent_handle_apply_cleanup_all, 1, ident); } } -void php_resource_factory_free(php_resource_factory_t **f) +HashTable *php_persistent_handle_statall(HashTable *ht) { - if (*f) { - php_resource_factory_dtor(*f); - if (!(*f)->refcount) { - efree(*f); - *f = NULL; + if (zend_hash_num_elements(&PHP_RAPHF_G->persistent_handle.hash)) { + if (!ht) { + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); } + zend_hash_apply_with_arguments( + &PHP_RAPHF_G->persistent_handle.hash, + php_persistent_handle_apply_statall, 1, ht); + } else if (ht) { + ht = NULL; } + + return ht; } -void *php_resource_factory_handle_ctor(php_resource_factory_t *f, void *init_arg) +static php_resource_factory_ops_t php_persistent_handle_resource_factory_ops = { + (php_resource_factory_handle_ctor_t) php_persistent_handle_acquire, + (php_resource_factory_handle_copy_t) php_persistent_handle_accrete, + (php_resource_factory_handle_dtor_t) php_persistent_handle_release +}; + +php_resource_factory_ops_t *php_persistent_handle_get_resource_factory_ops(void) { - if (f->fops.ctor) { - return f->fops.ctor(f->data, init_arg); + return &php_persistent_handle_resource_factory_ops; +} + +ZEND_BEGIN_ARG_INFO_EX(ai_raphf_stat_persistent_handles, 0, 0, 0) +ZEND_END_ARG_INFO(); +static PHP_FUNCTION(raphf_stat_persistent_handles) +{ + if (SUCCESS == zend_parse_parameters_none()) { + object_init(return_value); + if (php_persistent_handle_statall(HASH_OF(return_value))) { + return; + } + zval_dtor(return_value); } - return NULL; + RETURN_FALSE; } -void *php_resource_factory_handle_copy(php_resource_factory_t *f, void *handle) +ZEND_BEGIN_ARG_INFO_EX(ai_raphf_clean_persistent_handles, 0, 0, 0) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, ident) +ZEND_END_ARG_INFO(); +static PHP_FUNCTION(raphf_clean_persistent_handles) { - if (f->fops.copy) { - return f->fops.copy(f->data, handle); + zend_string *name = NULL, *ident = NULL; + + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!S!", &name, &ident)) { + php_persistent_handle_cleanup(name, ident); } - return NULL; } -void php_resource_factory_handle_dtor(php_resource_factory_t *f, void *handle) +#if PHP_RAPHF_TEST +# include "php_raphf_test.c" +#endif + +static const zend_function_entry raphf_functions[] = { + ZEND_NS_FENTRY("raphf", stat_persistent_handles, + ZEND_FN(raphf_stat_persistent_handles), + ai_raphf_stat_persistent_handles, 0) + ZEND_NS_FENTRY("raphf", clean_persistent_handles, + ZEND_FN(raphf_clean_persistent_handles), + ai_raphf_clean_persistent_handles, 0) +#if PHP_RAPHF_TEST + ZEND_NS_FENTRY("raphf", provide, ZEND_FN(raphf_provide), NULL, 0) + ZEND_NS_FENTRY("raphf", conceal, ZEND_FN(raphf_conceal), NULL, 0) + ZEND_NS_FENTRY("raphf", concede, ZEND_FN(raphf_concede), NULL, 0) + ZEND_NS_FENTRY("raphf", dispute, ZEND_FN(raphf_dispute), NULL, 0) + ZEND_NS_FENTRY("raphf", handle_ctor, ZEND_FN(raphf_handle_ctor), NULL, 0) + ZEND_NS_FENTRY("raphf", handle_copy, ZEND_FN(raphf_handle_copy), NULL, 0) + ZEND_NS_FENTRY("raphf", handle_dtor, ZEND_FN(raphf_handle_dtor), NULL, 0) +#endif + {0} +}; + +PHP_INI_BEGIN() + STD_PHP_INI_ENTRY("raphf.persistent_handle.limit", "-1", PHP_INI_SYSTEM, + OnUpdateLong, persistent_handle.limit, zend_raphf_globals, + raphf_globals) +PHP_INI_END() + +static HashTable *php_persistent_handles_global_hash; + +static PHP_GINIT_FUNCTION(raphf) { - if (f->fops.dtor) { - f->fops.dtor(f->data, handle); + raphf_globals->persistent_handle.limit = -1; + + zend_hash_init(&raphf_globals->persistent_handle.hash, 0, NULL, + php_persistent_handle_hash_dtor, 1); + if (php_persistent_handles_global_hash) { + zend_hash_copy(&raphf_globals->persistent_handle.hash, + php_persistent_handles_global_hash, NULL); } } -php_resource_factory_t *php_persistent_handle_resource_factory_init( - php_resource_factory_t *a, php_persistent_handle_factory_t *pf) +static PHP_GSHUTDOWN_FUNCTION(raphf) { - return php_resource_factory_init(a, - php_persistent_handle_get_resource_factory_ops(), pf, - (void(*)(void*)) php_persistent_handle_abandon); + zend_hash_destroy(&raphf_globals->persistent_handle.hash); } -zend_bool php_resource_factory_is_persistent(php_resource_factory_t *a) +PHP_MINIT_FUNCTION(raphf) { - return a->dtor == (void(*)(void *)) php_persistent_handle_abandon; + php_persistent_handles_global_hash = &PHP_RAPHF_G->persistent_handle.hash; + +#if PHP_RAPHF_TEST + PHP_MINIT(raphf_test)(INIT_FUNC_ARGS_PASSTHRU); +#endif + + REGISTER_INI_ENTRIES(); + return SUCCESS; } -static inline php_persistent_handle_list_t *php_persistent_handle_list_init( - php_persistent_handle_list_t *list) +PHP_MSHUTDOWN_FUNCTION(raphf) { - if (!list) { - list = pemalloc(sizeof(*list), 1); - } - list->used = 0; - zend_hash_init(&list->free, 0, NULL, NULL, 1); +#if PHP_RAPHF_TEST + PHP_MSHUTDOWN(raphf_test)(SHUTDOWN_FUNC_ARGS_PASSTHRU); +#endif - return list; + UNREGISTER_INI_ENTRIES(); + php_persistent_handles_global_hash = NULL; + return SUCCESS; } -static int php_persistent_handle_apply_stat(zval *p, int argc, va_list argv, - zend_hash_key *key) +static int php_persistent_handle_apply_info_ex(zval *p, int argc, + va_list argv, zend_hash_key *key) { php_persistent_handle_list_t *list = Z_PTR_P(p); - zval zsubentry, *zentry = va_arg(argv, zval *); + zend_hash_key *super_key = va_arg(argv, zend_hash_key *); + char used[21], free[21]; + + slprintf(used, sizeof(used), "%u", list->used); + slprintf(free, sizeof(free), "%d", zend_hash_num_elements(&list->free)); + + php_info_print_table_row(4, super_key->key->val, key->key->val, used, free); - array_init(&zsubentry); - add_assoc_long_ex(&zsubentry, ZEND_STRL("used"), list->used); - add_assoc_long_ex(&zsubentry, ZEND_STRL("free"), - zend_hash_num_elements(&list->free)); - if (key->key) { - add_assoc_zval_ex(zentry, key->key->val, key->key->len, &zsubentry); - } else { - add_index_zval(zentry, key->h, &zsubentry); - } return ZEND_HASH_APPLY_KEEP; } -static int php_persistent_handle_apply_statall(zval *p, int argc, va_list argv, - zend_hash_key *key) +static int php_persistent_handle_apply_info(zval *p, int argc, + va_list argv, zend_hash_key *key) { php_persistent_handle_provider_t *provider = Z_PTR_P(p); - HashTable *ht = va_arg(argv, HashTable *); - zval zentry; - - array_init(&zentry); zend_hash_apply_with_arguments(&provider->list.free, - php_persistent_handle_apply_stat, 1, &zentry); - - if (key->key) { - zend_hash_update(ht, key->key, &zentry); - } else { - zend_hash_index_update(ht, key->h, &zentry); - } + php_persistent_handle_apply_info_ex, 1, key); return ZEND_HASH_APPLY_KEEP; } -static int php_persistent_handle_apply_cleanup_ex(zval *p, void *arg) +PHP_MINFO_FUNCTION(raphf) { - php_resource_factory_t *rf = arg; - void *handle = Z_PTR_P(p); + php_info_print_table_start(); + php_info_print_table_header(2, + "Resource and persistent handle factory support", "enabled"); + php_info_print_table_row(2, "Extension version", PHP_RAPHF_VERSION); + php_info_print_table_end(); -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "DESTROY: %p\n", handle); + php_info_print_table_start(); + php_info_print_table_colspan_header(4, "Persistent handles in this " +#ifdef ZTS + "thread" +#else + "process" #endif - php_resource_factory_handle_dtor(rf, handle); - return ZEND_HASH_APPLY_REMOVE; + ); + php_info_print_table_header(4, "Provider", "Ident", "Used", "Free"); + zend_hash_apply_with_arguments( + &PHP_RAPHF_G->persistent_handle.hash, + php_persistent_handle_apply_info, 0); + php_info_print_table_end(); + + DISPLAY_INI_ENTRIES(); } -static int php_persistent_handle_apply_cleanup(zval *p, void *arg) -{ - php_resource_factory_t *rf = arg; - php_persistent_handle_list_t *list = Z_PTR_P(p); +zend_module_entry raphf_module_entry = { + STANDARD_MODULE_HEADER, + "raphf", + raphf_functions, + PHP_MINIT(raphf), + PHP_MSHUTDOWN(raphf), + NULL, + NULL, + PHP_MINFO(raphf), + PHP_RAPHF_VERSION, + ZEND_MODULE_GLOBALS(raphf), + PHP_GINIT(raphf), + PHP_GSHUTDOWN(raphf), + NULL, + STANDARD_MODULE_PROPERTIES_EX +}; +/* }}} */ - zend_hash_apply_with_argument(&list->free, - php_persistent_handle_apply_cleanup_ex, rf); - if (list->used) { - return ZEND_HASH_APPLY_KEEP; - } - zend_hash_destroy(&list->free); -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "LSTFREE: %p\n", list); +#ifdef COMPILE_DL_RAPHF +ZEND_GET_MODULE(raphf) #endif - pefree(list, 1); - return ZEND_HASH_APPLY_REMOVE; -} -static inline void php_persistent_handle_list_dtor( - php_persistent_handle_list_t *list, - php_persistent_handle_provider_t *provider) -{ -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "LSTDTOR: %p\n", list); +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +/* + +--------------------------------------------------------------------+ + | PECL :: raphf | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013, Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#ifndef PHP_RAPHF_H +#define PHP_RAPHF_H + +extern zend_module_entry raphf_module_entry; +#define phpext_raphf_ptr &raphf_module_entry + +#define PHP_RAPHF_VERSION "2.0.0dev" + +#ifdef PHP_WIN32 +# define PHP_RAPHF_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_RAPHF_API extern __attribute__ ((visibility("default"))) +#else +# define PHP_RAPHF_API extern #endif - zend_hash_apply_with_argument(&list->free, - php_persistent_handle_apply_cleanup_ex, &provider->rf); - zend_hash_destroy(&list->free); -} -static inline void php_persistent_handle_list_free( - php_persistent_handle_list_t **list, - php_persistent_handle_provider_t *provider) -{ - php_persistent_handle_list_dtor(*list, provider); -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "LSTFREE: %p\n", *list); +#ifdef ZTS +# include "TSRM.h" #endif - pefree(*list, 1); - *list = NULL; -} -static int php_persistent_handle_list_apply_dtor(zval *p, void *provider) -{ - php_persistent_handle_list_t *list = Z_PTR_P(p); +#include "php_raphf_api.h" - php_persistent_handle_list_free(&list, provider ); - ZVAL_PTR(p, NULL); - return ZEND_HASH_APPLY_REMOVE; -} +#endif /* PHP_RAPHF_H */ -static inline php_persistent_handle_list_t *php_persistent_handle_list_find( - php_persistent_handle_provider_t *provider, zend_string *ident) -{ - php_persistent_handle_list_t *list; - zval *zlist = zend_symtable_find(&provider->list.free, ident); - if (zlist && (list = Z_PTR_P(zlist))) { -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "LSTFIND: %p\n", list); -#endif - return list; - } +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +/* + +--------------------------------------------------------------------+ + | PECL :: raphf | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013, Michael Wallner | + +--------------------------------------------------------------------+ +*/ - if ((list = php_persistent_handle_list_init(NULL))) { - zval p, *rv; - zend_string *id; +#ifndef PHP_RAPHF_API_H +#define PHP_RAPHF_API_H - ZVAL_PTR(&p, list); - id = zend_string_init(ident->val, ident->len, 1); - rv = zend_symtable_update(&provider->list.free, id, &p); - zend_string_release(id); +#include "php_raphf.h" - if (rv) { -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "LSTFIND: %p (new)\n", list); -#endif - return list; - } - php_persistent_handle_list_free(&list, provider); - } +/** + * A resource constructor. + * + * @param opaque is the \a data from php_persistent_handle_provide() + * @param init_arg is the \a init_arg from php_resource_factory_init() + * @return the created (persistent) handle + */ +typedef void *(*php_resource_factory_handle_ctor_t)(void *opaque, void *init_arg); - return NULL; -} +/** + * The copy constructor of a resource. + * + * @param opaque the factory's data + * @param handle the (persistent) handle to copy + */ +typedef void *(*php_resource_factory_handle_copy_t)(void *opaque, void *handle); + +/** + * The destructor of a resource. + * + * @param opaque the factory's data + * @param handle the handle to destroy + */ +typedef void (*php_resource_factory_handle_dtor_t)(void *opaque, void *handle); + +/** + * The resource ops consisting of a ctor, a copy ctor and a dtor. + * + * Define this ops and register them with php_persistent_handle_provide() + * in MINIT. + */ +typedef struct php_resource_factory_ops { + /** The resource constructor */ + php_resource_factory_handle_ctor_t ctor; + /** The resource's copy constructor */ + php_resource_factory_handle_copy_t copy; + /** The resource's destructor */ + php_resource_factory_handle_dtor_t dtor; +} php_resource_factory_ops_t; -static int php_persistent_handle_apply_cleanup_all(zval *p, int argc, - va_list argv, zend_hash_key *key) -{ - php_persistent_handle_provider_t *provider = Z_PTR_P(p); - zend_string *ident = va_arg(argv, zend_string *); - php_persistent_handle_list_t *list; +/** + * The resource factory. + */ +typedef struct php_resource_factory { + /** The resource ops */ + php_resource_factory_ops_t fops; + /** Opaque user data */ + void *data; + /** User data destructor */ + void (*dtor)(void *data); + /** How often this factory is referenced */ + unsigned refcount; +} php_resource_factory_t; - if (ident && ident->len) { - if ((list = php_persistent_handle_list_find(provider, ident))) { - zend_hash_apply_with_argument(&list->free, - php_persistent_handle_apply_cleanup_ex, - &provider->rf); - } - } else { - zend_hash_apply_with_argument(&provider->list.free, - php_persistent_handle_apply_cleanup, &provider->rf); - } +/** + * Initialize a resource factory. + * + * If you register a \a dtor for a resource factory used with a persistent + * handle provider, be sure to call php_persistent_handle_cleanup() for your + * registered provider in MSHUTDOWN, else the dtor will point to no longer + * available memory if the extension has already been unloaded. + * + * @param f the factory to initialize; if NULL allocated on the heap + * @param fops the resource ops to assign to the factory + * @param data opaque user data; may be NULL + * @param dtor a destructor for the data; may be NULL + * @return \a f or an allocated resource factory + */ +PHP_RAPHF_API php_resource_factory_t *php_resource_factory_init( + php_resource_factory_t *f, php_resource_factory_ops_t *fops, void *data, + void (*dtor)(void *data)); - return ZEND_HASH_APPLY_KEEP; -} +/** + * Increase the refcount of the resource factory. + * + * @param rf the resource factory + * @return the new refcount + */ +PHP_RAPHF_API unsigned php_resource_factory_addref(php_resource_factory_t *rf); -static void php_persistent_handle_hash_dtor(zval *p) -{ - php_persistent_handle_provider_t *provider = Z_PTR_P(p); +/** + * Destroy the resource factory. + * + * If the factory's refcount reaches 0, the \a dtor for \a data is called. + * + * @param f the resource factory + */ +PHP_RAPHF_API void php_resource_factory_dtor(php_resource_factory_t *f); - zend_hash_apply_with_argument(&provider->list.free, - php_persistent_handle_list_apply_dtor, provider); - zend_hash_destroy(&provider->list.free); - php_resource_factory_dtor(&provider->rf); - pefree(provider, 1); -} +/** + * Destroy and free the resource factory. + * + * Calls php_resource_factory_dtor() and frees \a f if the factory's refcount + * reached 0. + * + * @param f the resource factory + */ +PHP_RAPHF_API void php_resource_factory_free(php_resource_factory_t **f); -ZEND_RESULT_CODE php_persistent_handle_provide(zend_string *name, - php_resource_factory_ops_t *fops, void *data, void (*dtor)(void *)) -{ - php_persistent_handle_provider_t *provider = pemalloc(sizeof(*provider), 1); +/** + * Construct a resource by the resource factory \a f + * + * @param f the resource factory + * @param init_arg for the resource constructor + * @return the new resource + */ +PHP_RAPHF_API void *php_resource_factory_handle_ctor(php_resource_factory_t *f, + void *init_arg); - if (php_persistent_handle_list_init(&provider->list)) { - if (php_resource_factory_init(&provider->rf, fops, data, dtor)) { - zval p, *rv; - zend_string *ns; +/** + * Create a copy of the resource \a handle + * + * @param f the resource factory + * @param handle the resource to copy + * @return the copy + */ +PHP_RAPHF_API void *php_resource_factory_handle_copy(php_resource_factory_t *f, + void *handle); -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "PROVIDE: %p %s\n", PHP_RAPHF_G, name_str); -#endif +/** + * Destroy (and free) the resource + * + * @param f the resource factory + * @param handle the resource to destroy + */ +PHP_RAPHF_API void php_resource_factory_handle_dtor(php_resource_factory_t *f, + void *handle); - ZVAL_PTR(&p, provider); - ns = zend_string_init(name->val, name->len, 1); - rv = zend_symtable_update(&PHP_RAPHF_G->persistent_handle.hash, ns, &p); - zend_string_release(ns); +/** + * Persistent handles storage + */ +typedef struct php_persistent_handle_list { + /** Storage of free resources */ + HashTable free; + /** Count of acquired resources */ + ulong used; +} php_persistent_handle_list_t; - if (rv) { - return SUCCESS; - } - php_resource_factory_dtor(&provider->rf); - } - } +/** + * Definition of a persistent handle provider. + * Holds a resource factory an a persistent handle list. + */ +typedef struct php_persistent_handle_provider { + /** + * The list of free handles. + * Hash of "ident" => array(handles) entries. Persistent handles are + * acquired out of this list. + */ + php_persistent_handle_list_t list; - return FAILURE; -} + /** + * The resource factory. + * New handles are created by this factory. + */ + php_resource_factory_t rf; +} php_persistent_handle_provider_t; +typedef struct php_persistent_handle_factory php_persistent_handle_factory_t; -php_persistent_handle_factory_t *php_persistent_handle_concede( - php_persistent_handle_factory_t *a, - zend_string *name, zend_string *ident, - php_persistent_handle_wakeup_t wakeup, - php_persistent_handle_retire_t retire) -{ - zval *zprovider = zend_symtable_find(&PHP_RAPHF_G->persistent_handle.hash, name); +/** + * Wakeup the persistent handle on re-acquisition. + */ +typedef void (*php_persistent_handle_wakeup_t)( + php_persistent_handle_factory_t *f, void **handle); +/** + * Retire the persistent handle on release. + */ +typedef void (*php_persistent_handle_retire_t)( + php_persistent_handle_factory_t *f, void **handle); - if (zprovider) { - zend_bool free_a = 0; +/** + * Definition of a persistent handle factory. + * + * php_persistent_handle_concede() will return a pointer to a + * php_persistent_handle_factory if a provider for the \a name has + * been registered with php_persistent_handle_provide(). + */ +struct php_persistent_handle_factory { + /** The persistent handle provider */ + php_persistent_handle_provider_t *provider; + /** The persistent handle wakeup routine; may be NULL */ + php_persistent_handle_wakeup_t wakeup; + /** The persistent handle retire routine; may be NULL */ + php_persistent_handle_retire_t retire; - if ((free_a = !a)) { - a = emalloc(sizeof(*a)); - } - memset(a, 0, sizeof(*a)); + /** The ident for which this factory manages resources */ + zend_string *ident; - a->provider = Z_PTR_P(zprovider); - a->ident = zend_string_copy(ident); - a->wakeup = wakeup; - a->retire = retire; - a->free_on_abandon = free_a; - } else { - a = NULL; - } + /** Whether it has to be free'd on php_persistent_handle_abandon() */ + unsigned free_on_abandon:1; +}; -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "CONCEDE: %p %p (%s) (%s)\n", PHP_RAPHF_G, - a ? a->provider : NULL, name->val, ident->val); -#endif +/** + * Register a persistent handle provider in MINIT. + * + * Registers a factory provider for \a name_str with \a fops resource factory + * ops. Call this in your MINIT. + * + * A php_resource_factory will be created with \a fops, \a data and \a dtor + * and will be stored together with a php_persistent_handle_list in the global + * raphf hash. + * + * A php_persistent_handle_factory can then be retrieved by + * php_persistent_handle_concede() at runtime. + * + * @param name the provider name, e.g. "http\Client\Curl" + * @param fops the resource factory ops + * @param data opaque user data + * @param dtor \a data destructor + * @return SUCCESS/FAILURE + */ +PHP_RAPHF_API ZEND_RESULT_CODE php_persistent_handle_provide( + zend_string *name, php_resource_factory_ops_t *fops, + void *data, void (*dtor)(void *)); - return a; -} +/** + * Retrieve a persistent handle factory at runtime. + * + * If a persistent handle provider has been registered for \a name, a new + * php_persistent_handle_factory creating resources in the \a ident + * namespace will be constructed. + * + * The wakeup routine \a wakeup and the retire routine \a retire will be + * assigned to the new php_persistent_handle_factory. + * + * @param a pointer to a factory; allocated on the heap if NULL + * @param name the provider name, e.g. "http\Client\Curl" + * @param ident the subsidiary namespace, e.g. "php.net:80" + * @param wakeup any persistent handle wakeup routine + * @param retire any persistent handle retire routine + * @return \a a or an allocated persistent handle factory + */ +PHP_RAPHF_API php_persistent_handle_factory_t *php_persistent_handle_concede( + php_persistent_handle_factory_t *a, + zend_string *name, zend_string *ident, + php_persistent_handle_wakeup_t wakeup, + php_persistent_handle_retire_t retire); -void php_persistent_handle_abandon(php_persistent_handle_factory_t *a) -{ - zend_bool f = a->free_on_abandon; +/** + * Abandon the persistent handle factory. + * + * Destroy a php_persistent_handle_factory created by + * php_persistent_handle_concede(). If the memory for the factory was allocated, + * it will automatically be free'd. + * + * @param a the persistent handle factory to destroy + */ +PHP_RAPHF_API void php_persistent_handle_abandon( + php_persistent_handle_factory_t *a); -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "ABANDON: %p\n", a->provider); -#endif +/** + * Acquire a persistent handle. + * + * That is, either re-use a resource from the free list or create a new handle. + * + * If a handle is acquired from the free list, the + * php_persistent_handle_factory::wakeup callback will be executed for that + * handle. + * + * @param a the persistent handle factory + * @param init_arg the \a init_arg for php_resource_factory_handle_ctor() + * @return the acquired resource + */ +PHP_RAPHF_API void *php_persistent_handle_acquire( + php_persistent_handle_factory_t *a, void *init_arg); - zend_string_release(a->ident); - memset(a, 0, sizeof(*a)); - if (f) { - efree(a); - } -} +/** + * Release a persistent handle. + * + * That is, either put it back into the free list for later re-use or clean it + * up with php_resource_factory_handle_dtor(). + * + * If a handle is put back into the free list, the + * php_persistent_handle_factory::retire callback will be executed for that + * handle. + * + * @param a the persistent handle factory + * @param handle the handle to release + */ +PHP_RAPHF_API void php_persistent_handle_release( + php_persistent_handle_factory_t *a, void *handle); -void *php_persistent_handle_acquire(php_persistent_handle_factory_t *a, void *init_arg) -{ - int key; - zval *p; - zend_ulong index; - void *handle = NULL; - php_persistent_handle_list_t *list; +/** + * Copy a persistent handle. + * + * Let the underlying resource factory copy the \a handle. + * + * @param a the persistent handle factory + * @param handle the resource to accrete + */ +PHP_RAPHF_API void *php_persistent_handle_accrete( + php_persistent_handle_factory_t *a, void *handle); - list = php_persistent_handle_list_find(a->provider, a->ident); - if (list) { - zend_hash_internal_pointer_end(&list->free); - key = zend_hash_get_current_key(&list->free, NULL, &index); - p = zend_hash_get_current_data(&list->free); - if (p && HASH_KEY_NON_EXISTENT != key) { - handle = Z_PTR_P(p); - if (a->wakeup) { - a->wakeup(a, &handle); - } - zend_hash_index_del(&list->free, index); - } else { - handle = php_resource_factory_handle_ctor(&a->provider->rf, init_arg); - } -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "CREATED: %p\n", handle); -#endif - if (handle) { - ++a->provider->list.used; - ++list->used; - } - } +/** + * Retrieve persistent handle resource factory ops. + * + * These ops can be used to mask a persistent handle factory as + * resource factory itself, so you can transparently use the + * resource factory API, both for persistent and non-persistent + * ressources. + * + * Example: + * ~~~~~~~~~~~~~~~{.c} + * php_resource_factory_t *create_my_rf(zend_string *persistent_id) + * { + * php_resource_factory_t *rf; + * + * if (persistent_id) { + * php_persistent_handle_factory_t *pf; + * php_resource_factory_ops_t *ops; + * zend_string *ns = zend_string_init("my", 2, 1); + * + * ops = php_persistent_handle_get_resource_factory_ops(); + * pf = php_persistent_handle_concede(NULL, ns, persistent_id, NULL, NULL); + * rf = php_persistent_handle_resource_factory_init(NULL, pf); + * zend_string_release(ns); + * } else { + * rf = php_resource_factory_init(NULL, &myops, NULL, NULL); + * } + * return rf; + * } + * ~~~~~~~~~~~~~~~ + */ +PHP_RAPHF_API php_resource_factory_ops_t * +php_persistent_handle_get_resource_factory_ops(void); - return handle; -} +/** + * Create a resource factory for persistent handles. + * + * This will create a resource factory with persistent handle ops, which wraps + * the provided reource factory \a pf. + * + * @param a the persistent handle resource factory to initialize + * @param pf the resource factory to wrap + */ +PHP_RAPHF_API php_resource_factory_t * +php_persistent_handle_resource_factory_init(php_resource_factory_t *a, + php_persistent_handle_factory_t *pf); -void *php_persistent_handle_accrete(php_persistent_handle_factory_t *a, void *handle) -{ - void *new_handle = NULL; - php_persistent_handle_list_t *list; +/** + * Check whether a resource factory is a persistent handle resource factory. + * + * @param a the resource factory to check + */ +PHP_RAPHF_API zend_bool php_resource_factory_is_persistent( + php_resource_factory_t *a); - new_handle = php_resource_factory_handle_copy(&a->provider->rf, handle); - if (handle) { - list = php_persistent_handle_list_find(a->provider, a->ident); - if (list) { - ++list->used; - } - ++a->provider->list.used; - } +/** + * Clean persistent handles up. + * + * Destroy persistent handles of provider \a name and in subsidiary + * namespace \a ident. + * + * If \a name is NULL, all persistent handles of all providers with a + * matching \a ident will be cleaned up. + * + * If \a identr is NULL all persistent handles of the provider will be + * cleaned up. + * + * Ergo, if both, \a name and \a ident are NULL, then all + * persistent handles will be cleaned up. + * + * You must call this in MSHUTDOWN, if your resource factory ops hold a + * registered php_resource_factory::dtor, else the dtor will point to + * memory not any more available if the extension has already been unloaded. + * + * @param name the provider name; may be NULL + * @param ident the subsidiary namespace name; may be NULL + */ +PHP_RAPHF_API void php_persistent_handle_cleanup(zend_string *name, + zend_string *ident); - return new_handle; -} +/** + * Retrieve statistics about the current process/thread's persistent handles. + * + * @return a HashTable like: + * ~~~~~~~~~~~~~~~ + * [ + * "name" => [ + * "ident" => [ + * "used" => 1, + * "free" => 0, + * ] + * ] + * ] + * ~~~~~~~~~~~~~~~ + */ +PHP_RAPHF_API HashTable *php_persistent_handle_statall(HashTable *ht); -void php_persistent_handle_release(php_persistent_handle_factory_t *a, void *handle) -{ - php_persistent_handle_list_t *list; +#endif /* PHP_RAPHF_API_H */ - list = php_persistent_handle_list_find(a->provider, a->ident); - if (list) { - if (a->provider->list.used >= PHP_RAPHF_G->persistent_handle.limit) { -#if PHP_RAPHF_DEBUG_PHANDLES - fprintf(stderr, "DESTROY: %p\n", handle); -#endif - php_resource_factory_handle_dtor(&a->provider->rf, handle); - } else { - if (a->retire) { - a->retire(a, &handle); - } - zend_hash_next_index_insert_ptr(&list->free, handle); - } - --a->provider->list.used; - --list->used; - } -} +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +/* + +--------------------------------------------------------------------+ + | PECL :: raphf | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2014, Michael Wallner | + +--------------------------------------------------------------------+ +*/ -void php_persistent_handle_cleanup(zend_string *name, zend_string *ident) -{ - php_persistent_handle_provider_t *provider; - php_persistent_handle_list_t *list; +#include - if (name) { - zval *zprovider = zend_symtable_find(&PHP_RAPHF_G->persistent_handle.hash, - name); +struct user_cb { + zend_fcall_info fci; + zend_fcall_info_cache fcc; +}; - if (zprovider && (provider = Z_PTR_P(zprovider))) { - if (ident) { - list = php_persistent_handle_list_find(provider, ident); - if (list) { - zend_hash_apply_with_argument(&list->free, - php_persistent_handle_apply_cleanup_ex, - &provider->rf); - } - } else { - zend_hash_apply_with_argument(&provider->list.free, - php_persistent_handle_apply_cleanup, - &provider->rf); - } - } - } else { - zend_hash_apply_with_arguments( - &PHP_RAPHF_G->persistent_handle.hash, - php_persistent_handle_apply_cleanup_all, 1, ident); +struct raphf_user { + struct user_cb ctor; + struct user_cb copy; + struct user_cb dtor; + struct { + struct user_cb dtor; + zval data; + } data; +}; + +static inline void user_cb_addref(struct user_cb *cb) +{ + Z_ADDREF(cb->fci.function_name); + if (cb->fci.object) { + Z_ADDREF_P((zval *) cb->fci.object); } } -HashTable *php_persistent_handle_statall(HashTable *ht) +static inline void user_cb_delref(struct user_cb *cb) { - if (zend_hash_num_elements(&PHP_RAPHF_G->persistent_handle.hash)) { - if (!ht) { - ALLOC_HASHTABLE(ht); - zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); - } - zend_hash_apply_with_arguments( - &PHP_RAPHF_G->persistent_handle.hash, - php_persistent_handle_apply_statall, 1, ht); - } else if (ht) { - ht = NULL; + if (cb->fci.object) { + Z_DELREF_P((zval *) cb->fci.object); } - - return ht; } -static php_resource_factory_ops_t php_persistent_handle_resource_factory_ops = { - (php_resource_factory_handle_ctor_t) php_persistent_handle_acquire, - (php_resource_factory_handle_copy_t) php_persistent_handle_accrete, - (php_resource_factory_handle_dtor_t) php_persistent_handle_release -}; +static void raphf_user_dtor(void *opaque) +{ + struct raphf_user *ru = opaque; + + zend_fcall_info_argn(&ru->data.dtor.fci, 1, &ru->data.data); + zend_fcall_info_call(&ru->data.dtor.fci, &ru->data.dtor.fcc, NULL, NULL); + zend_fcall_info_args_clear(&ru->data.dtor.fci, 1); + user_cb_delref(&ru->data.dtor); + zend_fcall_info_args_clear(&ru->ctor.fci, 1); + user_cb_delref(&ru->ctor); + zend_fcall_info_args_clear(&ru->copy.fci, 1); + user_cb_delref(&ru->copy); + zend_fcall_info_args_clear(&ru->dtor.fci, 1); + user_cb_delref(&ru->dtor); + memset(ru, 0, sizeof(*ru)); + efree(ru); +} -php_resource_factory_ops_t *php_persistent_handle_get_resource_factory_ops(void) +static void *user_ctor(void *opaque, void *init_arg TSRMLS_DC) { - return &php_persistent_handle_resource_factory_ops; + struct raphf_user *ru = opaque; + zval *zinit_arg = init_arg, *retval = ecalloc(1, sizeof(*retval)); + + zend_fcall_info_argn(&ru->ctor.fci, 2, &ru->data.data, zinit_arg); + zend_fcall_info_call(&ru->ctor.fci, &ru->ctor.fcc, retval, NULL); + zend_fcall_info_args_clear(&ru->ctor.fci, 0); + + return retval; } -ZEND_BEGIN_ARG_INFO_EX(ai_raphf_stat_persistent_handles, 0, 0, 0) -ZEND_END_ARG_INFO(); -static PHP_FUNCTION(raphf_stat_persistent_handles) +static void *user_copy(void *opaque, void *handle TSRMLS_DC) { - if (SUCCESS == zend_parse_parameters_none()) { - object_init(return_value); - if (php_persistent_handle_statall(HASH_OF(return_value))) { - return; - } - zval_dtor(return_value); - } - RETURN_FALSE; + struct raphf_user *ru = opaque; + zval *zhandle = handle, *retval = ecalloc(1, sizeof(*retval)); + + zend_fcall_info_argn(&ru->copy.fci, 2, &ru->data.data, zhandle); + zend_fcall_info_call(&ru->copy.fci, &ru->copy.fcc, retval, NULL); + zend_fcall_info_args_clear(&ru->copy.fci, 0); + + return retval; } -ZEND_BEGIN_ARG_INFO_EX(ai_raphf_clean_persistent_handles, 0, 0, 0) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, ident) -ZEND_END_ARG_INFO(); -static PHP_FUNCTION(raphf_clean_persistent_handles) +static void user_dtor(void *opaque, void *handle TSRMLS_DC) { - zend_string *name = NULL, *ident = NULL; + struct raphf_user *ru = opaque; + zval *zhandle = handle, retval; - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!S!", &name, &ident)) { - php_persistent_handle_cleanup(name, ident); + ZVAL_UNDEF(&retval); + zend_fcall_info_argn(&ru->dtor.fci, 2, &ru->data.data, zhandle); + zend_fcall_info_call(&ru->dtor.fci, &ru->dtor.fcc, &retval, NULL); + zend_fcall_info_args_clear(&ru->dtor.fci, 0); + if (!Z_ISUNDEF(retval)) { + zval_ptr_dtor(&retval); } } -#if PHP_RAPHF_TEST -# include "php_raphf_test.c" -#endif - -static const zend_function_entry raphf_functions[] = { - ZEND_NS_FENTRY("raphf", stat_persistent_handles, - ZEND_FN(raphf_stat_persistent_handles), - ai_raphf_stat_persistent_handles, 0) - ZEND_NS_FENTRY("raphf", clean_persistent_handles, - ZEND_FN(raphf_clean_persistent_handles), - ai_raphf_clean_persistent_handles, 0) -#if PHP_RAPHF_TEST - ZEND_NS_FENTRY("raphf", provide, ZEND_FN(raphf_provide), NULL, 0) - ZEND_NS_FENTRY("raphf", conceal, ZEND_FN(raphf_conceal), NULL, 0) - ZEND_NS_FENTRY("raphf", concede, ZEND_FN(raphf_concede), NULL, 0) - ZEND_NS_FENTRY("raphf", dispute, ZEND_FN(raphf_dispute), NULL, 0) - ZEND_NS_FENTRY("raphf", handle_ctor, ZEND_FN(raphf_handle_ctor), NULL, 0) - ZEND_NS_FENTRY("raphf", handle_copy, ZEND_FN(raphf_handle_copy), NULL, 0) - ZEND_NS_FENTRY("raphf", handle_dtor, ZEND_FN(raphf_handle_dtor), NULL, 0) -#endif - {0} +static php_resource_factory_ops_t user_ops = { + user_ctor, + user_copy, + user_dtor }; -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("raphf.persistent_handle.limit", "-1", PHP_INI_SYSTEM, - OnUpdateLong, persistent_handle.limit, zend_raphf_globals, - raphf_globals) -PHP_INI_END() +static int raphf_user_le; -static HashTable *php_persistent_handles_global_hash; +static void raphf_user_res_dtor(zend_resource *res TSRMLS_DC) +{ + php_resource_factory_free((void *) &res->ptr); +} -static PHP_GINIT_FUNCTION(raphf) +static PHP_FUNCTION(raphf_provide) { - raphf_globals->persistent_handle.limit = -1; + struct raphf_user *ru; + char *name_str; + size_t name_len; + zval *zdata; - zend_hash_init(&raphf_globals->persistent_handle.hash, 0, NULL, - php_persistent_handle_hash_dtor, 1); - if (php_persistent_handles_global_hash) { - zend_hash_copy(&raphf_globals->persistent_handle.hash, - php_persistent_handles_global_hash, NULL); + ru = ecalloc(1, sizeof(*ru)); + + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sfffzf", + &name_str, &name_len, + &ru->ctor.fci, &ru->ctor.fcc, + &ru->copy.fci, &ru->copy.fcc, + &ru->dtor.fci, &ru->dtor.fcc, + &zdata, + &ru->data.dtor.fci, &ru->data.dtor.fcc)) { + efree(ru); + return; } -} -static PHP_GSHUTDOWN_FUNCTION(raphf) -{ - zend_hash_destroy(&raphf_globals->persistent_handle.hash); + user_cb_addref(&ru->ctor); + user_cb_addref(&ru->copy); + user_cb_addref(&ru->dtor); + user_cb_addref(&ru->data.dtor); + + ZVAL_COPY(&ru->data.data, zdata); + + if (SUCCESS != php_persistent_handle_provide(name_str, name_len, + &user_ops, ru, raphf_user_dtor)) { + RETURN_FALSE; + } + RETURN_TRUE; } -PHP_MINIT_FUNCTION(raphf) +static PHP_FUNCTION(raphf_conceal) { - php_persistent_handles_global_hash = &PHP_RAPHF_G->persistent_handle.hash; + zend_string *name; -#if PHP_RAPHF_TEST - PHP_MINIT(raphf_test)(INIT_FUNC_ARGS_PASSTHRU); -#endif + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name)) { + return; + } - REGISTER_INI_ENTRIES(); - return SUCCESS; + RETURN_BOOL(FAILURE != zend_hash_del(&PHP_RAPHF_G->persistent_handle.hash, name)); } -PHP_MSHUTDOWN_FUNCTION(raphf) +static PHP_FUNCTION(raphf_concede) { -#if PHP_RAPHF_TEST - PHP_MSHUTDOWN(raphf_test)(SHUTDOWN_FUNC_ARGS_PASSTHRU); -#endif + char *name_str, *id_str; + size_t name_len, id_len; + php_persistent_handle_factory_t *pf; + php_resource_factory_t *rf; + php_resource_factory_ops_t *ops; + + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", + &name_str, &name_len, &id_str, &id_len)) { + return; + } + + ops = php_persistent_handle_get_resource_factory_ops(); + pf = php_persistent_handle_concede(NULL, name_str, name_len, id_str, id_len, + NULL, NULL TSRMLS_CC); + if (!pf) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Could not locate persistent handle factory '%s'", name_str); + RETURN_FALSE; + } + rf = php_resource_factory_init(NULL, ops, pf, + (void(*)(void*)) php_persistent_handle_abandon); + if (!rf) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, + "Could not create resource factory " + "for persistent handle factory '%s'", name_str); + RETURN_FALSE; + } - UNREGISTER_INI_ENTRIES(); - php_persistent_handles_global_hash = NULL; - return SUCCESS; + zend_register_resource(return_value, rf, raphf_user_le); } -static int php_persistent_handle_apply_info_ex(zval *p, int argc, - va_list argv, zend_hash_key *key) +static PHP_FUNCTION(raphf_dispute) { - php_persistent_handle_list_t *list = Z_PTR_P(p); - zend_hash_key *super_key = va_arg(argv, zend_hash_key *); - char used[21], free[21]; - - slprintf(used, sizeof(used), "%u", list->used); - slprintf(free, sizeof(free), "%d", zend_hash_num_elements(&list->free)); + zval *zrf; - php_info_print_table_row(4, super_key->key->val, key->key->val, used, free); + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zrf)) { + return; + } - return ZEND_HASH_APPLY_KEEP; + RETURN_BOOL(SUCCESS == zend_list_close(Z_RES_P(zrf))); } -static int php_persistent_handle_apply_info(zval *p, int argc, - va_list argv, zend_hash_key *key) +static PHP_FUNCTION(raphf_handle_ctor) { - php_persistent_handle_provider_t *provider = Z_PTR_P(p); + zval *zrf, *zrv, *zinit_arg; - zend_hash_apply_with_arguments(&provider->list.free, - php_persistent_handle_apply_info_ex, 1, key); + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", + &zrf, &zinit_arg)) { + return; + } - return ZEND_HASH_APPLY_KEEP; + zrv = php_resource_factory_handle_ctor(Z_RES_VAL_P(zrf), zinit_arg); + RETVAL_ZVAL(zrv, 0, 0); + efree(zrv); } -PHP_MINFO_FUNCTION(raphf) +static PHP_FUNCTION(raphf_handle_copy) { - php_info_print_table_start(); - php_info_print_table_header(2, - "Resource and persistent handle factory support", "enabled"); - php_info_print_table_row(2, "Extension version", PHP_RAPHF_VERSION); - php_info_print_table_end(); + zval *zrf, *zrv, *zhandle; - php_info_print_table_start(); - php_info_print_table_colspan_header(4, "Persistent handles in this " -#ifdef ZTS - "thread" -#else - "process" -#endif - ); - php_info_print_table_header(4, "Provider", "Ident", "Used", "Free"); - zend_hash_apply_with_arguments( - &PHP_RAPHF_G->persistent_handle.hash, - php_persistent_handle_apply_info, 0); - php_info_print_table_end(); + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", + &zrf, &zhandle)) { + return; + } - DISPLAY_INI_ENTRIES(); + zrv = php_resource_factory_handle_copy(Z_RES_VAL_P(zrf), zhandle); + RETVAL_ZVAL(zrv, 0, 0); + efree(zrv); } -zend_module_entry raphf_module_entry = { - STANDARD_MODULE_HEADER, - "raphf", - raphf_functions, - PHP_MINIT(raphf), - PHP_MSHUTDOWN(raphf), - NULL, - NULL, - PHP_MINFO(raphf), - PHP_RAPHF_VERSION, - ZEND_MODULE_GLOBALS(raphf), - PHP_GINIT(raphf), - PHP_GSHUTDOWN(raphf), - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ +static PHP_FUNCTION(raphf_handle_dtor) +{ + zval *zrf, *zhandle; -#ifdef COMPILE_DL_RAPHF -ZEND_GET_MODULE(raphf) -#endif + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", + &zrf, &zhandle)) { + return; + } + + php_resource_factory_handle_dtor(Z_RES_VAL_P(zrf), zhandle); +} + +static PHP_MINIT_FUNCTION(raphf_test) +{ + zend_register_long_constant(ZEND_STRL("RAPHF_TEST"), PHP_RAPHF_TEST, CONST_CS|CONST_PERSISTENT, module_number); + raphf_user_le = zend_register_list_destructors_ex(raphf_user_res_dtor, NULL, + "raphf_user", module_number); + return SUCCESS; +} +static PHP_MSHUTDOWN_FUNCTION(raphf_test) +{ + php_persistent_handle_cleanup(ZEND_STRL("test"), NULL, 0 TSRMLS_CC); + return SUCCESS; +} /* * Local variables: * tab-width: 4 @@ -5846,7 +6165,164 @@ ZEND_GET_MODULE(raphf) * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ ---TEST-- +‰PNG + + IHDRÙlç¹°gAMA± üabKGDùC» pHYs  šœtIMEÝ 'É=)… IDATxÚì½GÜùu5|*çœsWçfhr˜&hFÒ(YòH ËÛðÆ6¼´—¸ñð'0 m´²$À0Ù3$8$;‡ê®œsÎõ.Fç¢z,ùµ¤ç}k£Ñ YááÞsÏ9Wñÿð‹Éd¯×‹J¥½^N‡gϞÉ?‡CÌf3, ôû}¨Õj4 ¼öÚkP©TÈd2è÷ûX,°Ûí8<<Äîî.ªÕ*>÷¹ÏáääƒÁNV«+++°X,8;;C¹\†ÛíÆh4Ât:E§ÓÅbA¯×Ãöö64 ž={§Ó »ÝH§Óp:0›Íè÷û Ÿ ­V Ýn7nÜÀ|>‡Ëå‚F£A6›…Ãá€ÇãA©TÂùù9VVV0ŸÏ±²²‚|>x<ŽF£~¿ñxŒñxŒ›7oâää*• +'''hµZxóÍ71ŸÏ‡¡R©ÐjµÉdÐn·Ç11Náv»Q©Tðüùs ‡Cܺu N§Ϟ=ƒÉdB,Ã`0€R©ÄÖÖ +…^ÆãŊ‡ê7ÞxØét R©p||Œn·‹H$Fƒ`0ˆÑh„F£N‡ÑhÇðûý‡¸¸¸€F£ÅbÕjE¥RA(Âb±€ÃáÀ³gÏ°X, Õj¡Õj¡Óé`4Q­V¡Ñh P(Ðjµ0¡ÓéÐjµ`·Ûáóù T*Ñn·a0`2™ T*¡P(0P«Õ`2™‰D`6› Ñl61›Ípÿþ}ŒÇc”ËeD"( +L§S¬®®¢×ëa2™æó9ö÷÷Ñn·±³³ƒÙl†jµ +‹Å—Ë…x<Žóós ‡Clooc8¢\.c>ŸÜn7l6:t:, NNNÐh4àt:±X, R©>Ÿz½*• +NívÑhÓéÍfõz/ãñbÅCõÎ;ï<ôx<¸¸¸Àl6ƒÁ`Àb±€ÕjE£Ñ€Á`Àh4‚ÇãÃáÀp8„Éd‚ÅbA2™„ÍfƒÍfC³ÙD£ÑÀh4B$ÍfC»Ý†^¯G³ÙD:F$J¥Âh4B»ÝF¯×ƒB¡€Á`@¯×ƒZ­†ßïÇx<–€šL&x< ‚×땓´Z-ìv;Úí6jµz½Ìf3¦Ó)4 æó9L&†Ã!b±Òé´üÎ^¯‡t:˜Íf¼ÿþûP(¸~ý:†Ã!ªÕ*úý>ìv;¦Ó)‰‹nÞ¼ ¯× N‡L&ƒZ­›Í†••Yl*• +NF^¯ƒÁ³Ù v»V«Ýn­V ‘HãñÉdív6› /ãñbÅCõÕ¯~õa>Ÿ‡Ãá€Éd’Sp4áÃ?Ä`0À͛7Q«ÕP(°¹¹ Fƒn·‹N§FƒÅb‹Å‚ápÇƒÑh„ããc ‡Ch4øý~( +˜Íf, ŒÇcÀjµB£ÑÀl6Ãn·C­VL&@§Óa±X`8b4A¡P@­VC¯×C«ÕÂb±Àãñ ßïc:Ê"Ðëõ˜ÏçrÂL&èõzôû}8Àh4‚Á`@(’ÓÐjµ¢^¯Ãáp`±XÈ{6›MìììÀåra:ÊßU©TÐëõ˜N§˜L&ø裏àñxàñx`µZ‘J¥`³ÙÍf¡Ñh ×ëáp8ptt„\.£Ñˆ`0³ÙŒD"`0¥R‰—ñx±â¡ú¾ðp}}¥R ƒAv`«Õ‚ÇãÓé„R©Äb±€ÍfÃb±@µZ…B¡€ÏçC­VÃ|>‡^¯‡Éd‚V«E³ÙD¿ßG·Û…Á`€ÝnÇÎΚÍ&ƒªÕ*¬V+ü~?F£l6›œÍf*• +F£‹Å³Ù ÍfóùF£QN¦*ÓéG>3—ËÁ`0 V«Ál6C­VòCU*L&(•J(•Jx<¨Õj(•JÌçs8ܺu Z­jµZ­J¥jµý~:õz^¯óùN•J^¯ñxrºµÛm8NèõzŒF#ÌçslllƒºÝ.l6êõ:ŠÅ"Õj5¬V+”J%Òé4NNNðꫯB©TÂívK:’Ï祈n·ÛÐét˜Ïç¨×ë éŽÏçC£Ñ€Ýn‡Ñh”‡Ì‚<ŸÏc:B­Vc8Âív£V«Áëõb8b±X@­VˏÏçóÇp»ÝÐëõ¨×ë0™L°Ùl‡¨×ëðûýh6›èv»ˆÅbH$r"`p8‚zõû}ƒA¨T*är9B¡Z­†Ã!æó¹, ¢Ñ(†Ã! +.//a41NaµZQ(°X,àr¹­‰ÇãÐjµ8::B£ÑÁ`0@£ÑH +Ñív¡Óé T*%]á ÂÜ»V«ÉÉ`4Q¯×a4&|<ŸÏ¥ðÖh4‡èõzršÙl6h4YÓé&“ N‡FÒ&ötôz=šÍ¦¤>ƒÁ¥R óùƒóùÍfFŠz‡ÃŸÏ‡\.‡N§ƒÁ€[·n¡Ñh P(Àf³Áëõ"‹áìì …BANüƒƒ¼ŒÇ‹՟þéŸ>ÜÞކZ­†N§C³ÙÄt:E·Û•7è÷û è÷û(•JP(è÷ûP*•‡ÃP*•0°Ùl¸¼¼Äññ1ôz=|>ŸäÊ*• +J¥½^ý~óùN§S +O…BÁ`€Á`µZ-péÆƆ¼/¡`…B…B½^‹Å‚J¥"¹;¿«ÝnG2™Ä|>‡ÏçÃt:•E“W«Õb2™ ßï£ÕjA§Ó¡\.C§ÓIÏh4Éop¥À‡°X,èv»0›Íp8òJ¥jµÖ××áõz‘N§%àÁ`årÿöoÿ†ét +§Ó‰““hµZ¬®®âe<^¬x¨~ÿ÷ÿá`0þF³Ù„N§“^F§ÓA*•B¥R‘ëy8ÂårÁh4"¢ÕjI—›»7#“É  Âét +RÅ¢ÈéÂff4ˆçx<Æp8„R©Äd2DI§ÓIóq8¢T*ÉIY.—Ç…-`6›¥ð/‹Â(•J’2¹\.éó$ x½^Øív( +~€Ô ÌáY_°Q*•ðù|rKðÏp!=zôV«UXìóX­V¼ŒÇ‹Õ×¾öµ‡…Bççç˜Ïçr‚E" ‡CÔj5Ôj5, ˜ÍfA© +Ôj5Z­â ’sW*Ìf3ôû}ù{>ŸÐëõ0NFÑíva±Xàp8Ðjµ¤°œN§( +òÃY€v:D"Ìçsôû}øý~´Z-Äb1L&”Ëeܽ{årívãñkkkÈårÐëõÇP©TW~^¯G«Õ‚ÏçC·Û•ßçó ˆÀ÷q8Ðjµ¸¸¸~lôÚl¶+HÓ$öÆã1F£‘¤7/ãñbÅCõ;¿ó;m6Òé4Úí¶ô9:<b±¼^/&“‰49É׺¼¼D­V$‡á(—Ë(—ËX__—ÞÆd2‘¦¥ÓéD¯×“­Ùl"“É`:Âl6C¥R¡\.£ßïÃ`0Àf³Áï÷ E¦ÑhHJsyy)?P£Ñ P(`}}]`èr¹Œp8Œ­­-i’‡V*•N§¤Ø&S‚§¿^¯‡Ñh«ÝnÃápt~qq!ÏÂãñ ^¯#‘HÁß\«ÕP©T°ºº +«Õ*,‹—ñx±â¡úæ7¿ùhQ8F @¹\†R©DµZªL €ÅbZL£Ñ@·Û…J¥‚Ãá€ÅbL§Sá‡17w¹\d¦ÃᇍFC˜T«UéG°°e¨Õja:Ân·£Ûíb6›áüü‹‹“É‹ÅN§Sd±X`·ÛÑét„‡æt:¡ÑhÐëõ Õjqzz +³Ù ‹Å‚D"!E~¯×ƒÅbÁúú:òù<*• +:Ž@Ç$ΦÓi¨ÕjiŽ^^^¢Óé`6›ÉŸ{'ªû÷ï?œÍf0ÒÁ¯×ëršL&d³Yèõz„Ãa4›M ‡C€ÕjÅx<Æd2Á`0(´Ûí" +! ‚ï_­VÑëõ„±= àr¹„®²Œb t»]Aʍ†Ã!¼^¯ü¹v» ·Ûét*9??‡F£Úd2a>Ÿc0l6¦Ó)¦Ó)z½žð×Æã1ÔjµÐfx‹EL&!Ôò$eo&‰ Ýnc4!ÃápH1΂˜ý$6‚ÙÄt»Ý0™L‚¾µZ-¼ŒÇ‹՛o¾ù]óÉdµZ-Ô~…B¥R‰B¡N'4£Ñ(½›Í&ù1ósµZ “É$y6™ÕF£:n·[zäÅ- ÌçséY$ h4I[x“vc±Xý2™LH&“Èårøù|ŽápN­V‹B¡€x<³Ù …B!iÒb±€ßïG¹\Æh4’n¿V«…F£f¶J¥‚Õjä¨ÑhÀb±`ccC>Ïçóa±XàôôZ­>ŸOè@ϟ?G¿ßG­VC4…Z­†B¡Àp8ôN­V£Ûíâe<^¬x¨¾ýío?$lÉ¢¯V«Áétb8¢X," +A¡PH7ž'›N§Ãt:…Ëå’kx4a4É)zyy‰ápˆx<µZñx ƒÁ l‚L&#hV.—Ãx<–“‘‹…žÅb!'´Ùl–bX¡P Ýnc8¢Ñh²¦P(Ðét„JCé†Ãᐞ +åÃáÝnZ­V´C\h ˜b©T*‘It:ÉōF#òù÷¹‡l®±×P,Ñjµ ×ëa6›«««è÷ûÒq',\($÷e‘MÂËËKÉUÙ×étÒmµZÒ姬 ÕjÁår]y?’B‰åóyáÔ± °X,h4R”ûý~Io”J%f³t:ŠÅ"\.t:t:ºÝ.úý>L&f³aµZár¹îµX,P(H¥R0›Í²8Ʉp:˜ÏçÇ‡Ã‚Pñy2Îf3¸Ýnôz=är9L&¸Ýn¸ÝnÄãqÔëu¼ŒÇ‹ÕÛo¿ýÐï÷˕Üëõ0¥síp8àt:qyyy¥%9”'N«Õ‚V«¶v£Ñ@(’^›‰üaz½^Цv»X,&Wr³ÙD8–Þ ¹nÌߙ‚Ôëuh©ª­Õj˜L&ØÚÚÂb±@¯×‘`£Ñ aµZ¥‡@(C&“IÒ²"f³Ìf³œ® +…B×n·ù|`6›eqž‰þˆiåóù±X Ãá¹\‹ù| +…/ãñbÅCõå/ùa0„N§Ãéé)t:ÎÏÏá÷û¡×ë‘Íf¥eÎʞÀd2—BAµZ`0(?„ªS½^Á`€B¡£Ñ(ª]’P«Õ*\.Ôj5²Ù,:ìv;f³™À©£ÑHȬ̙ÉÈårÐh4…B˜Íf˜ÏçH&“P«Õ˜Ïç(—ËØÙÙZUÀ à2*g2™„²3%àBR}LÎû:äãY,èõzèõz¸\.ôû}á¼ÅãqA¢ìv;*• +l6^ÆãŊ‡ê«_ýêCþæœ<í´Z-ÎÏÏát: 1ŸÏá÷ûQ«Õ„Z‹EÄtÁ`PÐjlòù¼¤NGh3kkkh4èt:0øðÃáÑh4899‘‚÷îÝ»P©TøøãE»£V«¥ÉÈ^…ÕjÅh4’š$ +%‡Œvéو%¬Ûï÷%¿¦èp: +›Àl6Ã`0ˆ¬a<Kss>ŸÃjµ¢ÕjÉÉ;›Íàñx$=S*•"'!° P(°ººŠÑh„—ñx±â¡zýõ×úý~ôz=á|ñdªV«0™LX]]E«ÕBµZ…V«…Ûí†B¡âu0H…=¥R)_Šâ<´ô€¨V«˜ÏçR0gv»Ý¢!r¹\P(BFP*•’÷×j5øý~Ìf3„Ãa 8ù=ô£ Èn<K2ŸÏa6›Ñh4®4c™"‘r´X,‰D„\ËÞÉ«f³“É~¿étZH·z½^ +~¨T*p¹\¨Õjèt:ƒp8H¥R°X,è÷ûèt:x+ªx<þÐl6c{{‡*•J®nƒh4èõzÂIëõzh4ÒùW(ò÷˜†å "ÎcŸ¤Ýn m‡M@æø.— Éd•JjµZÐ,•ŒF#èõzÌf3T*lmmÉ©ùôéS‘@¬¯¯c8~Òqÿ9¥F¯×K_*•Ðëõ`4Eë¤Óé ×ëÑëõ®, +­V ƒÁÇ#é‚,¢©Áâ‚S«ÕÈårR‘%Þï÷a41 DêO1âññ1*• +^ÆãŊ‡êÿðMâÕKo‡ÕÕUi¼QÁÊ^‹V«E.—“æ‰CɃÕj…ÅbA§ÓÏçC¡P)û7v»]±ìߍF¹þ{½Z­Ìf3”J¥ð֔J%²Ù¬¤1N‰D:ëëë0 ¨T*(•JÒ±ŸL&"ê;>>–f$õO@@ <›$Æò{) +Ôj5)¬—û5ü-Íf&“IôY.—KD‘H:N™L±X Íf“ÉÑh/ãñ‚ÅãÞ½{—¯}—Ë…““Aa +…ìv»Øk©T*´Ûm)î‰úý>¬V«@ºZ­+++ØÛۃÛíÆd2A£ÑÀd2A»Ý†B¡8˜’­V “É$Ww±X„R©”^Êd2A(†ËåB¯×ւÛí†ÙlÆÚÚ²Ù,ž>}ŠÝÝ]ôû}9¹‰ö¸Ýn û4Ká©W©T R©`±Xí¢c›“v»]ôU#º\.Éùçó9r¹\.— i‹EŒnjµ4ô±2™Œ¤u/ãñâÄCI©4O¿‹‹ øý~QÕRÇ"”]{î|RGÎÎΤÎ×úú:2™Œô/t:œN§¸±ï Ñh`µZ…Œêñx ×ë…5¾œ¿›L&Qâa +…B…Bx÷ÝwÑï÷ñÆo`8ŠÌÜjµÂf³ Ê5›Í„¡NvÀh4B«Õ ÓÆÆ:F£, 2™ŒÀ0Eêt:¨V«¨×ë¢Çj·Ûh4¢ébQM½S¿ß¿@ °¹×ëÅËx¼xñP}ùË_~8 F1ŸÏ¹¡ÄVXÌÉm6†|A³ÙŒz½.×&)þ¥RIòvž—”Z¦^¯‡p8Œµµ54›M +1ôÇÐjµ(—ËXYYÁÖ֖]®¯¯‹‹,šŒF#F£‘ôMØíçŸaaìr¹¤ïC¿?—˳ٌ³³3hµZ¬­­‰ˆ’Ìô—ñx±â¡úË¿üˇJ¥årY<õìv;€äµ»»»èv»¨V«˜Íf¢”-‹‚ªÐNù•W^'ØH$«ÕŠÉd‚b±(ð¦ÏçC¹\–œ×jµ"™LÂï÷Ãçóa<#‘HH#”ýö]HµÛíÈf³§¾ùæ›"_ŸÍf‡ƒˆF£¨ÕjòïhGV­Vj4RÔËeFÄãqѱ?”Àd2ÁjµŠï^­V–g¦Ó)Âá° cN§^¯ù|ÑhëëëÒ,e:CC͗ñxqâ¡øÞ÷¾·˜L&èv»øàƒðÙÏ~V])»¦4a>Ÿ‹¥3;í½^O¸Z‘HD®g:Á²7떦ü¡PH¤Âñä#|œÍf1qÿþ}±å¢¯{*•‚Á`@«Õ’G£Qa)”Ëe4 lnn"ŸÏK~ìv»át:]#šf±XÄ*šÀÙ””³·²¹¹‰V«·Û-§ål66ŒÈXg_Š ð@ èµLÑhTNýñxŒ^¯‡>øo½õ–訣Ñ(ñ H‘ñà þ‹âA¸ýWÁLÿÿŒG¿ßób±(ñ Læÿëxý›ìÕ·¿ýí‡ì“¼ù曣Җ‹½ â½Ç“|²ž)ž£¬B£ÑA5H/D«ÕJ߆ü/."þýL&ÇÐh4H&“X]]…ËåÂÙÙvvv cÁËàP±k·Û‘ÉdÐívåïrÃ( +T*8N §‡°¯”ÍfÅՈÄXÊ?Hl¥ÄA£Ñˆ Òf³I³—Jòýl6jµš€ ~¿‡Íf¹\N +No¼ñ ²Ù,æó¹, n¢z½.µ†^¯íãqvv‹Å“É$ú«ét +¯×‹`0(ñÐét˜Ífp¹\âÞËŠñH¥Rðz½ËËK¬¬¬ÀétþÒxt:˜ÍfIm6Òé4ºÝ.âñ¸X¶¡,—Ëp8².šÍæ¨>—ËawwWå*•JPQ­V+·3)_Œ='™&šÍæ_9¿êþXŽ‡êßøÆÃ÷Þ{>ŸO‚AÒ#Œ¤–èõz(•JØl6éV¥'ÙӕJ +…âŠáÈh4ÓM…B!A¦¿:¡dÂÏf³¡PH8p888@8Æáá¡ÀÄÕjÁ`BÌ\[[C§ÓSÌF£!t"vÿN'¦Ó)ªÕª°h\IÔl<#Êûv»]Ù8¥RéŠò—RýeOv¥R)¶Ö˘Ýn°€l¦rï½÷œN§,öˆúý> +…ºÝ®¸ùr¡¨ÕjÔëu)¾'“‰¨˜—{m6›@ç<èH®V«"YžPÂþ’Á`@ Ó~}}GGG…B8>>–ú¦Z­Âï÷ãàà@œœ–Ð-¸^¯#›Í¢ÑhÈçsQRKF¤R©” ;ÐëõäÖµZ­0ÂŽ_ž8c4¡P(¤åá4NåÐ!€A=Z Ѓÿ'?ù ¼^¯0Iþßö‡Ýn‡F£‘g®øîw¿» `8Š?‚ÙlF­VC©T¶3U´¸‘÷Öï÷?!BþÜfŒèt:…^¯(™¾LqÈz惡ù%­¸<H +B¡ôvø°Ÿ={&vÉn·[z9Åb~¿Z­çççWXÛäóQÚÐëõ„Y@V™&“I\j3™Œøý•ËeaeeE‚±ºº +•J…'OžÀl6c6›! + £œ‚E +I\m4‡ÃÈårƒò]È)äæfäfÏçrÐðp Ÿ>dåðæ IDATF±XD"‘Àp8L§ÓÁn·#£R©ˆ ‘"EÖ0¤9œœœ  J*I_ˆÓÓS\\\ P(HCöoOê­X{Pf´œ–ÐÎÚn·Ë" +p¹\¢¦ç­jµ†Ã!=z$߃§;k–Åb!‡á}ƒÁ«Õ +ƒÁ€­­-ܾ}[€ŠñxŒÏ|æ3x÷Ýw…ÂÄÙ`\p´ ôŸk©R©ˆEÁ`€Ïça©ÏçC¥RÁéé©@êô5ämÍú”‡:™L+™fsSÑ^f³™4t¬¢öíõ×_Çb±LÍì_¶?˜½q¨†J¥‚úæ͛Èår888üýøøXN”ÕÕUÔëuôz=x<™^H²æ£GÏç%íãb!x±üâ‰Á^þw´cŠÄÑ5£Ñ‰DB†Èííí¡Ýncmm J¥ÿñÿ!Ž­Ùl7oޔSŠSêŒL&“XD³Þ##áøøP­V±··'´ ét +ƒÁ€·Þz n·ûûûP*•ƒâ—ÁÏbJC•0g{±Fk6›8;;ÃÓ§Oq~~.llÆþ¢ŸÏ§Ÿÿy6›ÉÍe0ÄÄ4•JáÞ½{²¸9—#}ø;©€æëŎŸÇz<‰Èj2™°¹¹ …BÿøDz÷÷÷‘J¥p~~.©Ú/{o¾?­àƒß¸qCêçt:d2)ö/ZgLÙçóZþsüoü>T\/ iÇc¬¯¯ãúõë¨ÕjØÛÛû_íl6‹n·+Ö©T +ꋋ ”J%‘˜s‚ÅÆÆêõ:ŽŽŽàt:‹ÅM¢¨×ëÉIÌT€@¶Ÿ~x„S ˜°žXN‹(`!Ûn·±¹¹‰\.‡J¥«ÕŠõõuhµZ¤Ói¹®9Ń> Bà ƒè÷ûH$( +p8˜ÏçX__Ç|>—|}:¢R©HzI³¦§¹\NØv»] +îÁ` µǛò´^NõÚíö=k†ét*J¸x»saŒàmÃFñd2‚5Ó­Ùl†7nÀl6ÃårÁétJêƦ-oåŹü=>½Áx{˜L&<þápׯ_Ù›ÉlX^ø\ÐË/ÖM•Ôï÷Q,ñÎ;ïˆt„ô)ڇú}ب&Iš¿‰ŸÉõIô‘ ×ðò‹1Îçó¨×ëâñÈÃñÚd™ †OHÂÛÛÛùÅÈóûý2?¸Ó鈅Ñö(è< +…°²²ƒÁ¿ß/hV«•tÌf³auu‡¡P.—K–ÏçÃÖ֖,\Šô†Ã¡Ð`h +…àóùP¯×Õq¹\Rƒ) +¹U)¡gï†ßm±XÀ`0 a:òä Æ•ßKð†ô!¯×+4{=Ì@B2»ÉÕ«V«8;;y·Ûk×® Ôn0ĨÅh4ÂápÀjµbss7oޔ´Q¥Raeen·^¯›››rCqÜk%„9˙P>'£p1‹ çÏy‚d*p“Ó$Õn·ãÁƒØÜ܄R©ÄŸÿùŸcwwñx\@ Zº¹Ýn‘Õ,è£T†^‰tãu82Έ’“?û³?ƒÙl–‚‘˹̬}¨(°Z­Ò÷óûý²Îâñ¸LµÛíXYY‘45„Ïær8†Ïç»â @¿ÿÓþ˜L&0™L(‹Ÿ”F+++¨T*RË05a‡œÁ¢ ët:•<Øív# +¡V«‰çGÔP¤·ŒL½þúë¸}û¶:‰Qð·¿¿/6˜æÑï÷Ñl6¥ÓϚÅ`0 _ñô£¢Õl6£ÝnË÷äìß7nH*Õh4Yâ¨ÕZ­†r¹,§û1¼-hriµZÅq—(ɤï;=y V«UlooË9zgg———Fò¼9.ÕëõâßøÂá0Þ}÷]S(Q¡=öææ&~úӟb±Xœ+ÎSÞØؐzË`0ˆ¯Å½{÷P.—¡ÕjåæN¥RÂlw»Ýâ)Oòî›o¾‰@ ˋ‹ ‡C¬­­]ËÃá°è´Íçs|üñÇ2³™Y †{÷îÁëõ +÷ñôôF<@¡P@¡P€V«•ÚŽ0;3›Í†o~ó›²ykµ¬V« á¼í“É$¼^¯8qU*$ að +|ç;߁×ës!ڃÿOûƒé3Ùÿ@à“>™Åb‘“ V«É(š‚ØívádÑÅU£ÑH1ÈùLdp€œB¡ÀÖ֖ twîÜÆ3eޑHDd’ÍބÑh`a>Ÿ‹Á?ƒ§ÓéÄv«T*ÁívKŠÐh4dáðtÕh48::B·ÛÅÚښܰårYƟòvæÉÄ[nssSÜfkµ´Z­Èèù`kµš,¨f³)·2{DÜ<ô0 h4(‹(•J’ŽÆb1„Ãa¬¬¬  Âh4bssS€`0(–ÕL·].—ÜRn·[Ð4öé0‹Åäû²¦"û­šÊX­VAhý~?~÷w_ûÚ×àñx°¶¶†ÍÍM$“IhµZ±Œ#c¤\.# +ÉÁÄvE“”ÖÐçîÝ»ø“?ù¬¯¯£Ýn#‰ +yãÆ ifÓъ>ûÝnWD¤lZß»wOØ[[[2mfÙ΀Ïßn·£Z­¢Z­"ŸÏËaʲ€ë—ëvyÔÓ/ÚÌ4¨ ”™LFNjr˜JqÊ;=û6›MI‡¡Òû½2”…sFQQ>‡Ãb±(‹Âår! ‘”ÓWWWáóùp~~.-nN6Yg°ÐfŸƒ½+‚´†&§P(°¶¶†½½=q„eNÎ x<Ñb1 œMÅiív>ŸgggÈd2¢Âå¼*šÎМ¥ßïãàà@`a¶h<£Õj%ä ®®® +0ÀC…z*Ë#Ãô.‰ Ñh V«áòò?ýéOÅR› ‰ÍfÃîî.B¡òù<²Ù¬pü‚Á +…ªÕªÔ‰ñxz½‡‡‡h·ÛhµZˆF£X,°ÛíâQ*•„¢¤R©„´Ì¾$×]Š···át:ñ…/|ï¿ÿ>Úí¶l`ŸˆD"2X}OöCÃá°¤Ú½^·nÝB6›EµZ…×ë†Ñh„ÙlF,“zh53:W©T +½^ï½?è Â6J¥‚Òçó¡Õj¡ÙlJ·»X,J±~çΡ™¤Ói‘4 +I™¾â¤Þˆ‚¿gϞá‡?ü!t:|>"‘ÎÎÎpyy §Ó)SÉ"áµl6›%E`Z7N1›Í Ñh°¹¹)´ö%\.—°¸):œÏçÂøv»Ýxã7 P(ž®V«â‹Á¥ ‡‡‡˜ÏçÈf³"AçxÔ\.'è!OM¡PHü6šÍ¦Œý)•JB"e}I‰øÚÚNOO1Éd°½½-N·§§§W†ì1McZH„‹ðu,ƒN§Ãþþ>Þ}÷]èõzƒAiK”ËeY¼¬'‰ÄòPËårxÿý÷ñïÿþïøøãÅ¥‰›o6›I=N»*‘Ûí¶l:²(\.>ÿùϋ6K­V#•JáîÝ»rYCïúÁ` ŒhF£J¥Rê%ZàÑÀ”`Y@ét———2W› +kª§Õ[4•rãWÙ\Ó&“ Êjµz…:ÃüÈÈÑё )ƒ}-")²Z­"N ¬LNÓ­;wî`4áÑ£GˆD"2ö”¬ ·Ûd2‰n·‹ëׯË&èv»RT/í¡x!›ÍŠÅ™F£Ëåðƒð*A +‹Å"º&ª}Ë岤wz½Gxƒô¤5óp8Äd2Ýn¾Ú|>'Y»Ý.3É|1ò[蛱µµ%-¢±t;28<<Äl6õkפqúüùsäóyär91eo†VÛ4æ<>>†ÃáÀ½{÷D)­×ë±X,pëÖ-Ìf3<þ¡PGÆÖÈév»(‹¸ÿ¾€ +z½ûûû8==E"‘ÀÖ֖¨†‰Øy½^d³YA$U*•|7ŽM"#Ÿ)^­V“ÅÌt‹ ^‹Å">ˆ´XF°É¹dÉBÒðññ±x–”J%ŒF#1we[€ÙѲ·äb±À׿þu1Q%ô«îÅbñ‰† ´ƒƒI/ªÕª,Šeêϵk×dt ùxD$Yè25"Æԇsª666°··‡z½ŽT*“É$H­½ØØäUn6›±±±! jž’¬Êå²q4!Êț££#looË ãt:廯T*ù+ +„B!¼óÎ;èõzxòä‰Ü²ì›1ãTG»Ý.¬tö &“ r¹"‘ˆL£$=Š ‚u +af¢•Óéûûûðz½p:²ˆ …‚4ó;vvv$ƒ³Ù GGGr"sü,[-LÍidêñx$ŏÇ( +˜L&ò]x#år9ôû}cwwWZ(³ÙLšÚìv:¡¤ ‡C¡¥•J%¡¦q!2I&“²†ø¾GGGŠÅb&žžÊš\~f„ã{½vwwe +&AFƒl6{%´Î#-¯ÛíJ“Üëõ¢ßïËgìïïÃf³!ÿÊûCI›b¯× ¯×‹b±(ˆ:»Ý.›ÍJ^}qq­V+}1¦Š´ +Ëd2(•JÐëõØØظâdËÁ ¤1 ™dB ¦˜ôF§±èh4’÷åɹ̶`‰ †^¯a Ãᐱ>‹EžM§ÓÁöö¶‘Ëå²ô¹ ûý>Âá°*• +ÉdÃáÛÛÛØßß¿’‰Ìçsi½îõz¥ôx<Ðjµxþü¹øÇollàþýû8::’[z4!•JI¯0QåÅb!ó–766$ÍnµZh·Û¸¸¸ÀÊʊÔBìi-?3Òôü~¿üVn¬z½ŽZ­†@ p%TH“?ËAíÄ)®_¿ŽŸüä'èt:‚püùUö‡’¨?¬X,¢^¯Ãn·KMÃ>;ê„My’ŽÇc4 øýþ+' S4•J%iûZ­f³Â$“€Œ æíä@6 œžžâéÓ§xë­·pûöm¨T*œžž"£V«‰"÷•W^A³ÙD­V“qÌf3œžžJ <…wÊ´³Ë–×ÇèªT*Ù°T…ü²x°>å\l¶¨Ú.‹Bçä›_g(¯]»&(T·ÛE*•’æE~œÈøìÙ3ä…ÃaL§S¤Y°.ÿx¢€¤¹F¼òÊ+¢"­V«R¼s$)›™$Åò¤âB'SºÙlÊúÕÕU™Ùí???‡ÇãÁÖÖ†Ã!ö÷÷a6›‘Ïç¥???G:–ÏaŽN§!"¤$¸ +1oá¦%û€ Ï`0`ss«««R P/ÅTh,g~-¿ôz½0ê[­‰ŽŽŽÏçÿÇxÏ´˜7!¬—ž©McVÁßS.—ñ³Ÿý «««rÈüºûCI\6³Ù,4ƒÁ ƒ§IybqHõg,Ã`0Àáá¡öø"4:›ÍP.—¥‘Ûjµp||ŒP($Œr +ŽŽŽäÇòE6…ÏçÿøEÌf3qFp»Ýøҗ¾—Ë…ÓÓSlmmassS +T¿ßgϞ¡Ñhˆ}—Ñh”[ŒµM¿ßG4•T€c_ ÙÅbR©¥R‰ëׯ õ‡{ggG¨8ü~ÍfSŒE­V«ôÏ8_xù`"A­ 79âè—Ń½F +yú§R)ܸqëëëò½©Xfm™H$¤¶[îv»]ìííÉâÞÛۓæ/¥T\d³YŸ–ãqvv†x<.¼}†¬£`0ˆÝÝ]Aü(-—ËÒ 8Â6ÑrºH2Ô:88€Ïçû¥ñ`M­R©¤óx<˜N§(—Ëxíµ×¤ÕÍfíý¡ænãàîP($^rppp€7n ‘Hˆ% ø~¿/jÖ¯ýëxþüù•“ÊZ±p´ŒÉdÈxY—N§ås©>]&t’›ÈAãgggðx<(•J"ìõzÂçÛÛۓæ$óir"§Ó©Pv–OÃ/}éKWb¹P§Ó© ûÙÏ~†»wïâòò³Ù +++Ò'#•‰í“É$Ú(ŠS3™ŒP3™Ì•MFíÁ–û÷ï£R©È ó_¯»Ý.’Éä•l‚,ŒýèGðx<ø‹¿ø éÕí#·ðӄ[Ž6â¼d¿ß/ršB¡ 4;ZÉ]^^"‹Ó¾µµ5!•óf ˆSb8àB¡Pàþýûxüø±¬Çét*¶Ô=òFdí8™LN§¡Õjñ­o}K¼BR©Ô•x°Í6@:ò@4E±X„Ãá€Ïç•D.—ûö‡²Ñh N‹›Q"‘€Ùl†Ãá~Z*•’ü•BÊB¡ ©Ä`0@³ÙÄÚÚڕšŒ©âÞÞšÍ&´Z-l6îܹ#ðs¹œðçó9R©”ËiË`0¦§&^¿~]]3™ ¶··±³³#f/Ÿ—›gù”§D4g§½½=iÎZ­V\»vM”Á”øj·ÛrÐÄb1ܸq?úяL&‘ÉdÍfà¢ü…sü^/Ö××±¹¹yÅ.€ƒ:TAd³Y¬­­a±X`ggG¦g’^W¯×‘ÏçŇ9]d©P($Åfl–E»dïS!°··‡½½=”Ëe<þ\ìܚÍ&NOOQ¯×ãý¡ÜÜÜŸÃá@¡PÀl6ÊÊîî.Âá0¢Ñ(|>Ÿì~Ne¤áH0¼rR-lŠÅ"~ðƒ +…ÖÖÖ°±±[·na8âñãÇBy:99¹lææwîܑ<š ßJ¥‚íímapVç÷j4q)›R©„½½=¡ÉÐ׏òw¦[„çé£Á‘«ì©ñ&[„MoƒÁ |Èv» §Ó‰ÕÕU™ˆrëÖ-Pn·Û%•á3³ÙlÐëõ°X,²ˆS©šÍ&nݺu%½^©T +*• +'''âu²|[î¿wïúý>¶¶¶J¥ðOÿôOÒzˆÅb⸼x™>F"Ôëu|÷»ßߔ@ €V«%ÈaµZE*•ºYùOŸ>[®ZÐÆâèèü±ÔÕl•ôz=É.ØD_Feys/$œNãóù`0P*•¤ ‚?Æññ1Êå²XÂ9N„B!ißüßØj·Û×_{{{úàE"™ÙDp•J%ƒ Øí¾ÿ¾8ú,çôlÔíììÈ¿?==•Ñ£„QYèÿä'?Áññ1.//¯œÄìU)•JüÝßýòù<ÎÏÏ‹ÅP©Tpyy)€›Éd;w°²²"Sz`áÁ˜\´ßû½ßC$A Àóçϱ½½-`9…$ƒîíí!àââ6›Mê¾Yõ4éaÀ—O`Jb–{‹FÈ­*• +_ýêW…º½½-ua4 òßÿ}œŸŸ_I³ }þóŸÇ‡~ˆ¯|å+¸ÿ>šÍ&ÎÏÏqqq!VjD&—ãǙeôÅ BúéÓ§"¥aëv»1ðäɹ¡™MðöàáI ˆ[8±ÎÎ΄¾¦ÑhP,±µµ%ƒû–y¦Ô+N§Sá·~ë·¤n&!¹×ëÁl6‹•µoäd’ƒ‰DDÇ¹Ï¿éþPw»]iĺÝnÒ‡¦4©TJè>jµét»»»P*•ø×ýWÄb11ç_²V«ÅÏ~ö3˜Íf|éK__‡G ª¨ÑhÄ3ƒ|<Âf³‰ì# +R‹ÅËåpvv&ý*ÇƒD"!'e¡P> y”œ#Ì[ŒßÓjµ"`0àüü\¬"‘r¹œÔ”‰D¯½öšÈ83™t*ÒÌh°É†&‰Æ­VKÒ +³ÙŒL&s%Å&ÐB/‘z½‹Å›Í†Á` NOÉdRdô“Éûûû{óE6y¿ßÇéé)þê¯þ +Íf?þñÑívñöÛo ³ÿôôÍfó +jÇø)\__Çåå%NOO¥õÀZ•‡èòMÅ ÄZo™AÁf0oŽ|>Ç›Í†>úf³Yüé¹c±˜¸Z-?3ʳ¸ñ˜:Ïf3µD‹À[:F*•’¿ ±³³#ޒìÙrâo²?Ô¼n)<Fb–ÂJ¹\¾b&ât:áñxÐl6Q*•àñxÄpeùE§ZjÁÈí+ +H$RR¯³|:qÁ²/‰`G~P·ÛÅÊʊèšhj³Œn>yòN§7oÞÄþþ>åÁÑ:Œ‹+ "NÃëõ +Á€òć0 Âh¿~ýºlb2U8µÓ\ZËQ.Do“å]¤X –Ëe‘Y(•J +X­Vq­âB …(šÚX­VT«U$“I|å+_AµZÅÿù?ÿGäz’y¿Ìø àb±Xpxx((){ˆtcìI[¶àÿ2]d å÷û¯ØK0ýe”ýÍjµ*©éåå¥Ô¬Ë/Nz¹¼¼Äõë×ÅA*•J¡ÓéÈ÷#ВÏçeÓ³¥aµZáp8„0@äù7Ýj$›ÍJqIò-eޔ·sÇSR>±²²‚••$‰+ÖøbξººŠv»ÓÓS‘•ÐzëÓþjµ@@ÆýÜ¿ßùÎwP.—åôyüø1>ûÙÏ +»áÚµk8??½k'ª¶Éãã ÄáñxwïޕïÁô‹°ð²)ŠÕjåu½^Çúúº¤|TýR:Ab)Õœöa·Û%0¿ÈۃñX[[ …†§¼9éV­VñôéS\y—Ë…`0ˆ@ »ÝŽoûÛèõz(‹899Íf³΄ŽÇãW6g#¯¬¬È­;NñÆo X,Šø•Eÿl6C0D§ÓÁx<– Búo%n`ZPºÂM¿³³ƒçϟ w’¾õl{,›:-³dˆ ŽF#ñ!mkÙ_d9=çaÎÍÍõÛï÷áóùpyyùï5{1šÍü´R©\ܱxä蝋‹ i–ËeL—<ٍ™LF¨E<¥>ý°X§Äb1!y¾óÎ;¸}û6NOOát:ñ¹Ï}ßûÞ÷D¨HnQ3*«kµÅZŽ~¹\–¡ÝL©t:¶··Å²ž„î9a„¹ør:DfÁêêªØYºg;ƒü¾ÍÍMQ~ói? ópÔì`0€R©ÄÉɉ¸óv»]ôû}I{i…À öh4 +Fƒ?ú£?ú„C§Vãý÷ßG©T” [ö.)ñà­T(àt:qíÚ5ìîî +dÿýï¸}û6Þ{ï=ñwd£ž“Åb}ëoúxF#¡N§›Í&Ýjµ*h%‘ÜN§#³Ÿ—7OF™Z³œš.±Ù®àå÷žL&xe³Y„B!üßØjœÐv$A­VÃêê*†Ã¡xA«vtt$b>½^/1AŒåS‚Å?5I\MÂ0sýe^£ÑˆP(„·ß~÷îݓ¹¾¾ŽT*…üàB²e h7@û3ׯ½öæó9úý¾<øåF&9pkkkÂE¬T*’JFܽ{™LÅbñŠ-¹ÍfC<Ý×ññ±˜ö0˜Ïç(‹ÂvÉçóðù|¢îV«Õøàƒ®Ô*¬ÉȓT«Õxòä‰h 8M’òšå°X,†x<“É„/~ñ‹Â`/‹Ò¬w»Ý°Ùl¸¸¸Ù¾×ëýoé"Ä +…þöoÿNGê§B¡€Ñh„?þã?Æp8”´Z¯×KíI¿G:Ÿ!—ËáââápXâV«…·Þz ƒÁ[[[Øßߗøòwa“<þüJª¨P(„äëõzqrr‚h4ŠN§s%í£ºšœUÖ~ñx\tuõz]ÔÝÝnWÔ¿îþP–äµ9 Ç¥'A×Ør¹ •J%j\.NûX6ž\þñÅb¯¾ú*Âá0n߯–& IDAT¾étŠGÉàÿøÇ¢\žL&XYYÁüÁ  + ªöꫯJšDuíêêªþ·Z-!»ŽF#lmm! +a6›!™L"ŸÏÃjµ"•J]éq@^,“áuÝJÙ>{läÑQ¤JR±XÄÙٙ Ácó™T 6j9c+•JI¾NÁà§)Bd}8Q“yÀCŒMf…B! +nzgºÝn¼ýöÛðx<‡Ãè÷û¢1£â—Œ‹Å‚D"¯×+ úåC’é¢×ëÆÌo¼@ |M4ívétZ4bOÞ¸q{{{x÷Ýw‘L&…3Øï÷EþÔét`2™DûÅþ']†Ãa, ©å?Í]díùúë¯ãÁƒ’5ðÙQû×ívQ.—Q«Õppp ZC¶ŠàääDÌ}˜ùüÚûƒ­„à™¿rî/;õ$„r’ ÙçdqP†¾|º¢5™LBÁùÆ7¾ ŸÏãââ·oßÆÑÑ +"‘¶¶¶ðÏÿüÏbÖòÚk¯áìì ÉdRš€‘HOŸ>ŠõW+++÷’Çæõz¥®zòäÉ£ +<)Ž,•J8??¿"6eÚțƒ·>ÿ™ô7ÞxCܱXøó&bnyJ ½E–©cË2ÊDŽežý<Ȥ™N§R¤ƒA1+b¯‹Òétâðð———0›Í¢Ã#âóùD·|H’SÈÚëöíÛøìg?‹b±ˆóós‰G4•1K¸>þp:’BôÑGâ§È>×l6ÃG}‹Å‚ñx,uk\Þ<€çϟËùet‘1& u43(–&óù\²ápˆÍÍM”ËeܺuKRQ¦³üÿ¿éþP“Ä»ì=žH$®8Q&Ïi‚$¶Ò#‘éÚòD滄¾™k3ƒ¢Cóx<ÂõbÁúà‡?ü¡äõù|ÿò/ÿ"´£ƒƒ8ܽ{ÑhT +S‚cqNOO¯˜x²QKGZš‘rEq&óxJ)8„·¬Á`q=Ëu&å0³Ù n·[Ná½½=iz//’åúb™Áð7ó7ØßßÇ÷¿ÿ}looˈ£¯|å+âFT“uH0D2™„Á`@¡P2‰HàÉ°§X–àÍ2]‰Äh4;w ññÇ‹MœÉdÂÉÉ ?~,-Š>úN§ׯ_—  »V«I¯Œ5æT*u…©â÷û1ŸÏRO$â±ÉóòM6¥eÃì€1ãÉxUòøñcÇ8¤ƒSs‚Á ŽŽŽ’ÿMö‡šìú ƒh·Û˜L&²H:r¹œ°)R©”(K}>Ÿ°+–ƒ¤×ë…SF X,ŠE×l6“éö‰D+++ÂuËår²èÊûþûï ¨ÛíâöíÛ 0™Lâ7o±Xp~~.'R>ŸG"‘@6›½Ro®3 „ŠåóùP«ÕD`j·ÛÑn·áv»¥%@_½Z­§Ó)è%½þ írr +‘/§Ó)Dgҝ(åù4]©Tpýúué÷üõ_ÿµ ÊS(ˆF£bJD.•JI­Kç䋋 ¤Óilllu*“ÉHL ÖÐ\v¦ÔŸñ(•JR§ñ;>~üf³ÛÛÛèt:ØÝݕxð÷x<KÂ~&“ nܸ!Ên >ŸétZ@,ö5].ž>}z…ô@^+¹L º]^^Ân·‹·?g5°ßåt:dy°X,‡¥¶üMö‡: ›Í +»¡X,â3Ÿù ’ɤäç×®]çY^rpª_t“qÁìîîÂd2ɬ^zø-ç¯øMÊÔb±@:F(’ÓÔl6ceeEЦeÿs +!«Õª è÷ûˆÅb8??G2™£¦n@@,íŒF£¤UG<™rµZ­OF“þºÏç^ÐÎí·û·ú5™L’š’˜|~~•J¯×+sèÀ^®ù̕J%ñ­o}K¸xjµ¯¼ò +’ɤ¬é‡á÷û…ÅÂÙ\´WcÚÅѬ¼)³Ù¬X#}Ú®›Ï–õ7u‡œ³LíÓjº(—J%!7Óä‡ ™¤^~'Xä4Òº`_ HF£<ßgϞý7ôÖÖæó¹hÜÖ××Eâ¤×ëq~~~ås鵇¥ÇÈç•J¥„:F£_w¨¹k94W -½®]»&·MµZÅÚÚ¢Ñ(2™ŒðÀ8³‰Þ{|Ñä…óÏø y’ü?íYSÛé™öobЊ$$@ƒñ†ín·S§&NW¥jªf¦æd²U–“|¾A*‡ù"ÉA*©¤;®ôô¤Ûv³X€¬]BB BìzÞù]%œdÞtú=¢ðQ¯¶Ðóÿ?ÏýÜ÷uý.jbæ?´¬‡ÍÏÏ["‘°_ýêW¶¼¼lóóóHrÒ|hfvi=ü~¿Æð;Øx|>ŸÆ ‘HDšÑ££#٘ü®á¤zÓ´‰¨wyyYœM QlÅP݇B!EI=}úT´+”úT _õýpüøÇ?^Íçó—r¶À¯ŸŸ×fãv»56ù[ëö ·ÒÙÜÜ´f³iËË˚±ñÒÐlà3ãà&ƒ¬÷N®y4àÝ ü¢Ú€Â¨àððPò1bj¿êûџN§eÁ =…¥!‡mnnN"–mNZÊLÝ{ÂÞ›¦Ói5.€bÞ¾}ÛÂá°:@xŒFFFlmmÍJ¥’ýö·¿ÕΊŒ¡",F”„HàSë»\.k·Û–H$. ¢{[¶˜ý¸Çäóy+•Jvrrb›››2B &L{ ‰DdˆÅÊ–ú¿·TäÄ!–•õ@ÝM) +…*­×ëb% ˆ¦Ä¬n||ÜÆÇÇ­Ñh¨s:22¢î"âçÅÅE•÷üB5??oñxÜ&''í£>²õõuÛØØ\hppÐjµšÖƒ\jփTP^ÜÞ¸Ñï~÷;EYMMM™×ë•A—áX¼Þ_N§Sw9þ=(žÃ`0hù|^ +փ,ìb±x Ýpvvfÿ?ޏvÞW¯^i—&Êív[,ÓîóùÔaCPÊüÀétÊÌØûƒ³±¸$h”J%í(N§S`Ô±±1iÔÎÎÎ,ÛÙٙ•J%ÕĔę҉k·ÛºÄ·Z-5$(_Ù­#‘ˆÍÎÎ +§Ì †ZÃívkþ·¿¿oápØÖ××ÍétÚ½{÷d΄`Ûn·•2I3ÀëõÚÔԔ(K +Šò"râ¿ùkssSJ·Ûmù|ÞÂá° ÿ¯õàI&“"CE"1JºÝ®0ÝtÏÞtÓlB­Aö6/{¡P°ééi½œ¨aÊå²Ý½{×Tbñàõ6Å°ñ‡B! ™Ýn·†Ê”á̹`N}Ó´‰^pppÐ^¾|)[ +ùxŸÏ€Œ§œL­VËb±˜† ëëëò°Q~Ñγ{÷îi¦Ó{z0T><<´Ç›Óé´z½.Ç.˜7×N"<6‚½½==Hx¹Ó°› +=½•Èéé©mllèŸ3À¦Œs8šsmmmÙáá¡P ñx\0ÑÞö=φËåX––;Š÷óósÉ´zטRïݟ± +˜AHb„òðÛÙÙ•Šþ³Z·Ûm+++šâOû*ïëÑ?;;k[[[æt:-‹i·Åb–L&ÕR/•JÂjÑí"ûɛ6Ôì´¾IsAè٠觃599i‘HDÌ<” Á`Pª"l+•ŠvlÇc[[[Öh44: áÁé477§ShrrR ¾ RVÚí¶Íü·”P(͙ót»] {ùË_ênùÙgŸY©T2§Ó©Ÿóüü\.m.Ͻs20i³³³’nÍÎÎÚææ¦Z__Ÿ•J%ÜÉnÇk‡ª‚4¸NG%Z$Ѭ¨P(\’+áóûýò3óÊår–L&5ô†çQ©T$4ðûý’U“ë½N0òƒj߇B!¡¿éNCñe{Sô@W‘n/–\Ð¥RIÅ/^È×Ƚ½ÛíJȀ§ŒÍý}?z×£Œ6í`EÍfÓnܸ!hã͛7Íív[6›µl6k>ŸOe.dù½¿PࣂïÇ ;;ÆÉ`0h>ŸÏ\.—°c”(wîÜ1§Ói}ô‘vóããc[XX°n·k¯^½RÐ@žÞÝÎívÛüǘËå²7nX©TÚ›M³Ù¼Ôbž7>>n¯_¿V{†󚽽=™)£Ñ¨²­¡d}öÙg2.,,Øøø¸ýñ@³·YD÷æ·Ûµl6k¡PH;ø‚<^(8z!±”2Ìuô]Äz´Z-k·Ûz1z…·l€”êÒҒœœX:õybbBÐÙ­­-Å`õ"Ø،¹#“F‰ˆ’‚çn?X+½¿xø!G§R)K¥RRœüùÏ։åv»UØòò²MMMٟÿügUŒ6þÑ÷£w=`ÞÑmÁÔH4vì"½š°z½n.—˒ɤµZ-K$2U²H~¿_¥b/Ñ‚R__ŸE£QQ_Ab³ Œ©u\.—­ÛíÊbÂωÑëõZ2™´t:métúñ + ÕîËeµéÏÏÏ-JÝl6e’d8‹ öääD TÒAã€¾µµeÃÃòƒ`‘Á$é÷û-›ÍÚÎΎ +-Jï%ž».É0X*âñ¸fZ”J¼ d5ûý~Ù<<år9´7n\Šx¢B@Ñ+=덷­Õj–H$¬¿¿ß²Ù¬:y¢T¥R)óûýq€:Ïd2J²U÷š\o8âòupp qL.—»ôÑ½½yó¦¼w¬ ê½zU̔gggòmË8 ^¯k~÷eߏ7×c ‹ÙgŸ}f‡‡‡ +…ìáǖH$„Ñ¢”á®@Ë·ëþðͯzUÔô}}}Òye³Y8¢Éۚ˜˜PûøèèÈîÝ»g©TʊŢMOO[¹\V§,r>Ÿ7§Ó©Å£>N¥R—fO”–¥RIò™?üPô½{÷TwS.î€l«× +“H$¤yÓ6ƒÄgjjÊ666Ô ‡ÃÒ +f³Y{ñâÅ_@:qjg2±™™s»ÝöâÅ u7éàú|> ƒ¢bqÇèÈ]T@/½¦jú—/_Z©TºtcýèÇãqk4–ËåÔЈF£RÏ3·Tî6á|kkk²!õ~_$UÆb1Ù_¶·· "„Âápˆ¸½½-Fïïåt:­X,*•'›Í^zIãñ¸}ñÅ*Açææ”8va||\ž³¥¥%k·Ûö¼D{±Ž[·n­ Ù‚ŒŒX¥R±ÝÝ]Ío˜}y<ÛÜܔ>+•JY©T²µµ5ÛØظôÀÑ!óx<²iËÅÀ–/w †€Ì0Pàƒ¢ì!yü,Œt:ý‹‰D´Ðh4”Cˆ!wF~Næ]ü.—ËööölßþøÇ?Z2™¼T®€#ácxxXFIû ÏÏÏíùóçöêÕ«¿Øgx<¥—¼xñÂ^¼x¡q­ï™™+‹¢ë +²p8¬!.ÆS,ŒH­I¥RöñÇÿ5¥\ 0Çcù|^ó*Æ+4@òù¼Z„³Ù¬ýéOÒÙ+kC|Ôu$ºZ­Jqr0—ËÙÚÚÚ%W;ê :z|xÈèXE˟ 'êþª¯V«e;;;öeÞÔ=ù|^ë1@§fvvVü§OŸênïýøøØâñ¸°}}}¶¾¾.–n·k£££Z|èTGGGJ$ ‡ÃÖjµleeEI“ÐiA—J%›žž‘™æHßñxÜ^¼xa_ûÚפ ¨ÕjæñxtBòbÞºuëR¶u¹\ž€Y +»'‚h4*åÿþþ¾Œxœ¨4`’`ù¨V« mggG³¼MÌjh¢°À‡Ã¦¦¦Ìãñؓ'OdÏùÏÿüOûä“OÅåeeE6 Ô6©TÊB¡6‰b±x oÆÅû 9ÖR¿àS‹F£ìîîÚ[o½¥Nr¿-//[4MÌ^¹\VìÒÙٙMLLˆ‡áñxô¼„Ãaóz½699©—ŒT¡L&c·oߖ¢(•J]8ÓÈà4"ó€ö‡jäCC…® b‚l6+d›†ÌT*¥´Ò/ó~°™òYR©”9~úӟ®NLLØÇl‡CmmŽÞ`0(é’'¾¨jµª{§–ÇãQª&;<÷­““Eðt»]«V«¶°° ™öjèÑÑQiÿ0-F"‘K0ö/..ì­·Þ²b±(‰N,³±±1]èévñ°‚ï^\\T›øõë×xCf£9@®ðÔԔPe$¢„B!)_¿~­&w„Ÿüä'Ößßo‰DBJ³×ëµÁÁA•t{{{:Aéüö–ß$µ’˜‰î±V«™×ëµÅÅEѾFGGíóÏ?·\.g vxx(|Ò¾³³3¶••{ùò¥}™÷ƒÆ§ùÅŅ9nß¾½Úét4`ˆFc‚Á%ìz˜$\°3¼õÖ[v÷î]»¸¸°¥¥%»sçŽår9ã8]ŽŽŽlkkË<<:årYÁ {{{ÇÕ¤”›™™Ñ‘WŒÏ…ä†Ùð>; Õ‹‹ ‹Åbr.OOOÛÑё”åøˆ°%ì­ÓéØþþ¾ƒA‘ª@•ÑU}çwìââÂö÷÷u!¥“ÙÐää¤ÿ½ÙØKKKò5‘á i ¿„-îR4~þÚzT*»yó¦5›M JyáäÞ»œô˜Ri&0 s8š}"Øm·Ûö駟ڻᆱ{Ûÿ¶˜1‘â@/•Jò÷Ä| Á8 ™m=¸~0°>>>¶Ç [7==mÝn÷¯®Ç?ò~ô®‡ãɓ'«üM¹\¶ÃÃCåf¡ºFÝqtt¤K"`âRÛí¶ìú¹\Îîß¿¯Ë*ô&äÿP‘Úí¶0Ù^¯W¤')e1ÀÕëuI”B¡B顨xöì™ [6›•âbppP‹†M¦7ëøø¸% Qˆé^ÑiŠF£¶»»kív[§®Ï瓉!, I0Ø<’ɤÅãqóù|öêÕ+»uë–.ô€e(ÅQƒ€³kµZÇ…F@Q©T„sèS`LÌçóöàÁƒK˜pdeÃÃò֠å㞊•a:P$²˜Q¹ ¤§‰‚5ɳgÏlddäïZéàÜn·Ö·2°ßïWb£‰¿µccc6::*$ÖëׯõŒommÙòòò% ª/û~ô®‡ã?øÁêÚښáæççՙ +…B²œ÷֘øjðQkÎ:==µX,¦öf«Õҋ‚ÎÃâ^·0¡z¢¸tú|>Í>°VÐ%üàƒÔ­CkÈðüZ¥R•ùRµZU{˜[NeþÝÄĄJ +.Û|”a4isʏY4Uøß͛7mmmͦ§§m}}Ý|>ŸTù‘HÄÖÖÖTÎý­õh4Ò>b¶d=賌-€ïÐðøßփv>.3Ì^êoïz  ¥ùÓív¿òz€` „SçW]z‹‹‹¶¾¾®õðûýj¸°_öýè]Çw¿ûÝU ‰maaAG4júJ¥b‡‡‡ + †cŽˆÙ5/AÖ¨“3™ŒMMM©•ÇÍårÙÚښëÈ200 »\¿$Wù|Þ"‘ˆ2±ˆ2=99‘à“ ¯¤%üD½ßՁ8ÀށøââB-|JšL&cwîܱóós5-@°£Á„÷x<¶¼¼lµZMߕËå²Ï?ÿ\vy†Ù×ëquÖÃ199¹ŠQìàà ÂÀ}>ŸôrÝn×~ýë_K~Ã.¨™ÆÕIDATÐÍëõŠîK‡…úždLZ»dôâqBõžN§U6ré$B”ŤnO¥R:žéƒAk6› +xcøMH]<؂½¡ñØ€s2sAÉ.ˆyx×jµªpAÔÌ©PŒ ¦ ښ…R©d»»»æp8ìÙ³g¶¶¶¦Ü³ëõ¸:ëáøÆ7¾±zpp`7oÞà‘#–äp^­VKR§ÅÅEé™± Qr¹\R«ß¸qü^¯Ž\”äyÑ=±‰‰ ‰‚Ùˆ‚©NšQ¿ÝºuK^ µµ5 A³Ù¬þߙ™]¦=æ^½æ>\ÙápXêï³³3•’K{ñ¸[Âqìt:–ËålqqÑnÞ¼i}ô‘Ô/[[[º˜'“I«T*6;;k>ŸÏ>ùäá®×ãj­‡ã»ßýîj/”|0´ééiù­Ø ;ŽÍÏÏ[__ŸKõ^™ >Lò´¦¢¦ÀƁÿ‰‹ÿá᡾,À$0ïP6›M)E- +’f%“I«Õj‰Dìøøø’¶òòñ›¹ÃÔøÐ`ý~¿2€{Cé€_â$@–lggGƒÐjµjñxÜ&&&ì¿þë¿ìèèÈâñ¸4tç°Á\¯ÇÕYÇw¾óUZäänÁt§LÀJ¢ÑhX©T’‚–‘¢ Èår +Å]«ÕäÇ¡³„ݝݶCZˆºLóù¼ÍÍÍÙÌ̌J$[•JŶ··íƍâ‚`íGغ³³£ðt´et¥ÊY8V}Ïð¼ÓéHU͔ŸîW4µv»­NXî±±1ÛÞÞÖ]¤¿¿ßÆÇÇíððPˆ¸¡¡!\àgU‡-åz=®Îz8ž>}ºê÷ûUcÖëuiܘO9NÛØØ°ƒƒ!Ԙ“¸Ýn)’00 {@¯8õôôT¿7_2–J5Ç£Yäb†»ããã +’»^«³Žÿ÷_­×ë’Ó RÙË4$g7‹©Ì˜žž¶Ï>ûÌFFF,HlI}Mö1ÆG šÔøÁ`PÙYÌ'P5c〥xrr"z®Û햤ˆ.£¨¨÷öö,‹É͊ÀJ1Ÿ› j‡b±hÙlÖÊå²ÍÍÍɲ¿ ýd±X‚®¤,Z×£££æt:¥&èÍQÛÃr¼^«³Žý×]å>??×Àb¤ÓiÙB…P·Ã«p»Ý644d…BÁFGGíààÀb±˜h=gggŠ6eC; 4^¢HŠÎð™ +…‚Õëu›™™‘L†¬âF£aÇÇǍFE=Bƒ·´´¤äÏD"!fæóyµ—Q>…O‹¼/Ï̬P(X$уË}¨Ûí*õ£ÕjY«Õ’Ï ˜ ì‹ëõ¸:ëáxÿý÷W1!âP˜˜!µ<‹‹ÅÌáp(/ ܾœíím”cl£s}‰<+v D¥ØÒq`÷š8É8æR wèSZÐcccr`%á³ãØ4ƒ£ÜZ>Ÿ7·Ûm"á|mµZ +…„7s»ÝÖét,N+ vúýû÷¥(²½½=K¥RŠiÂAÌŠ-ãëõ¸Zëáx÷ÝwWÙÝ:Ž¥R)±+ø ìf_¿~m‘HDA১§V«Õ¡v¦Cû-e :;f )'&&d7sÅy·Û•G«^¯[<·r¹,a1¨m>7ž) ¨ÌgÍÎΊx +"¦FhkµZUÍ jÎ<ùññ±,<b‘$ q(|>Ÿ~Žëõ¸ZëáøḚÉdlwwWrb±(`ðþýûV¯×ÅJàH„C»jnŽZ”Ø|q`¾¼^¯lX.\.—.½ü>ÃÃò͓Õ íÜßßWZýÑё˜ Þ°«“ƒª» BU,Ü 0!òsPhHK›Ðsî(иÎÎÎìÝl6-*Ša)ÿ}:¶H$b×ëqµÖÃñäɓÕ\.'U@2™´`0(¼×Ö֖þšé;"Êóós햄RÓ¶ÅóÃ̑Nˆ9󗓓µmÐPÎà?#èûLPp;;;Ë øN§ÓÖh4t™6›Í*Œ$özœ¼õzÝæçç•f‚º«G8S±^¯Ëå÷û­R©X$ƒ‡ùüü\UýP›hg³Y»^«µŽï|ç;«·nÝcáöíÛr·f2›˜˜° î0£¥Ói+ +Š "œv&íM¢ˆ(èÈD£Qk4ò…Ãa[XXPÈD¯€‹ËåÓæü ½J¤œ ÀFxJîï½{÷l}}]vvKêê±±1Ëd2ÔÀÂh4 +êBJè:,óóós;;;“Ö5H4ÈL\ÔI]á3ÀŠՒò# Z,³ßÿþ÷ffV*•”ê922¢ÈXÑ×ëqµÖÃñ½ï}o•YC>Ÿ—}š8"Ó蟷‘‘u¤èXa$A%üß<ßÿz<[YYQÇhppP*¬ôÀ¡U* ƒÇ-™LjwëÅi#²ñ •Ü,hÀï¼óŽ×ëqµÖÃñoÿöo«;;;‚uîííÙúúº¹Ýn¥g0ÔD&S©T´s`ý&*>")333ff–H$´H'''ò7Qÿf2ï‘w¼»»kvãÆ á¢¡ø²«–J%ÙÒ].—>/‰,\äA(cV¤íœL&ÍápÈUKH*pf6ÙlÖNNN¤0@žÔn·-‘HØÒҒˆÅ@V¹ƒµž˜˜°íím¶¯ýërâ’4Ã\æz=®Özôýüç?ïÂ-8??חð\¢Ä5›M»}û¶‹Ek4aW€©W¯×-“ÉØ«W¯ìɓ'Ößßo~¿_åž'j~ÂêHí¤Ü™ššRkÚåréKæB^(¤#cÒOØs\³p'ì [­V“ØùN(RÖñìì¬íììhG¤Á@ô-ô‘HćÐkƒƒƒ6==mûûûb­ó]ƒ¤¦Ä¶f³i×ëqµÖÃñÞ{ï­ö’„°O×j5ËçóB “ŠQ©T¤Ì†¼…¤ çŠÅ¢•Ëe›˜˜°ùùy)ÄÝn·hF쀔ކ††¤gCKÇ•º¯¯O‰†Ð„HžžžZ4Y í._¯×+Í"¨jZߝNGVy8¸l ;@ +ôüùsóz½ +°óz½655%5w&“[ãôôTv¹¹9ùµ &_¯ÇÕZÿdDÿÚ³{VIEND®B`‚--TEST-- pecl/http-v2 - general and stat --SKIPIF-- +--INI-- +raphf.persistent_handle.limit=0 +--FILE-- + +--EXPECTF-- +## call provide: +bool(true) +## call concede: +resource(4) of type (raphf_user) +## call handle_ctor: +### back 'ctor': +#### arg 0: string(10) "data value" +#### arg 1: int(1) +array(2) { + [0]=> + string(10) "data value" + [1]=> + int(1) +} +## call handle_copy: +### back 'copy': +#### arg 0: string(10) "data value" +#### arg 1: array(2) { + [0]=> + string(10) "data value" + [1]=> + int(1) +} +array(2) { + [0]=> + string(10) "data value" + [1]=> + array(2) { + [0]=> + string(10) "data value" + [1]=> + int(1) + } +} +object(stdClass)#%d (1) { + ["test"]=> + array(1) { + [1]=> + array(2) { + ["used"]=> + int(2) + ["free"]=> + int(0) + } + } +} +## call handle_dtor: +### back 'dtor': +#### arg 0: string(10) "data value" +#### arg 1: array(2) { + [0]=> + string(10) "data value" + [1]=> + int(1) +} +NULL +object(stdClass)#%d (1) { + ["test"]=> + array(1) { + [1]=> + array(2) { + ["used"]=> + int(1) + ["free"]=> + int(0) + } + } +} +## call handle_dtor: +### back 'dtor': +#### arg 0: string(10) "data value" +#### arg 1: array(2) { + [0]=> + string(10) "data value" + [1]=> + array(2) { + [0]=> + string(10) "data value" + [1]=> + int(1) + } +} +NULL +object(stdClass)#%d (1) { + ["test"]=> + array(1) { + [1]=> + array(2) { + ["used"]=> + int(0) + ["free"]=> + int(0) + } + } +} +## cleanup: +bool(true) +resource(4) of type (Unknown) +### back 'data_dtor': +#### arg 0: string(10) "data value" +bool(true) +bool(false) +Ÿ ™e)6e!?JŒÌ—w±t,øcGBMB \ No newline at end of file -- 2.30.2