debian/0000775000000000000000000000000012301065075007167 5ustar debian/copyright0000664000000000000000000001251511724733204011132 0ustar This package was debianized by Raphael Geissert It was downloaded from http://pecl.php.net/package/tokyo_tyrant Upstream Author: Mikko Koppanen Copyright (c) 2009-2010 Mikko Koppanen Upstream content notice: tokyo_tyrant can be used under PHP License 3.01 or 3-clause BSD License. -------------------------------------------------------------------- The PHP License, version 3.01 Copyright (c) 1999 - 2009 The PHP Group. All rights reserved. -------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, is permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. The name "PHP" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact group@php.net. 4. Products derived from this software may not be called "PHP", nor may "PHP" appear in their name, without prior written permission from group@php.net. You may indicate that your software works in conjunction with PHP by saying "Foo for PHP" instead of calling it "PHP Foo" or "phpfoo" 5. The PHP Group may publish revised and/or new versions of the license from time to time. Each version will be given a distinguishing version number. Once covered code has been published under a particular version of the license, you may always continue to use it under the terms of that version. You may also choose to use such covered code under the terms of any subsequent version of the license published by the PHP Group. No one other than the PHP Group has the right to modify the terms applicable to covered code created under this License. 6. Redistributions of any form whatsoever must retain the following acknowledgment: "This product includes PHP software, freely available from ". THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND ANY EXPRESSED 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 PHP DEVELOPMENT TEAM OR ITS 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. -------------------------------------------------------------------- This software consists of voluntary contributions made by many individuals on behalf of the PHP Group. The PHP Group can be contacted via Email at group@php.net. For more information on the PHP Group and the PHP project, please see . PHP includes the Zend Engine, freely available at . Copyright (c) 2010, Mikko Koppanen 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. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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 MIKKO KOPPANEN 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. The Debian packaging is: Copyright (C) 2010 Raphael Geissert and is licensed, unless otherwise specified, under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option), any later version. On Debian systems, the full licence text is available at "/usr/share/common-licenses/LGPL-2.1" debian/rules0000775000000000000000000000266111724733204010260 0ustar #!/usr/bin/make -f EXT = tokyo-tyrant EXT_so = tokyo_tyrant include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk CFLAGS += -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security PHP_MAJOR := 5 PHP_CONFIG := /usr/bin/php-config$(PHP_MAJOR) PHP_PKG := php$(PHP_MAJOR)-$(EXT) PHPIZE := phpize$(PHP_MAJOR) DEB_CONFIGURE_EXTRA_FLAGS = --disable-rpath --with-php-config=$(PHP_CONFIG) DEB_SRCDIR := $(wildcard $(EXT_so)-*) DEB_MAKE_INSTALL_TARGET = install INSTALL_ROOT=$(DEB_DESTDIR) DEB_MAKE_CHECK_TARGET = test makebuilddir/$(PHP_PKG):: $(DEB_SRCDIR)/configure $(DEB_SRCDIR)/configure:: $(wildcard $(DEB_SRCDIR)/config*.m4) cd $(DEB_SRCDIR); \ $(PHPIZE) clean:: [ ! -f $(DEB_BUILDDIR)/Makefile ] || \ $(MAKE) -C $(DEB_BUILDDIR) clean $(RM) $(DEB_BUILDDIR)/tmp-php.ini cd $(DEB_SRCDIR) && $(PHPIZE) --clean [ ! -f debian/$(EXT_so).autogen.ini ] || \ $(RM) debian/$(EXT_so).autogen.ini debian/$(EXT_so).ini install/$(PHP_PKG):: debian/$(EXT_so).ini install -D -m 644 debian/$(EXT_so).ini $(DEB_DESTDIR)/etc/php$(PHP_MAJOR)/conf.d/$(EXT_so).ini echo "php:Depends=phpapi-`$(PHP_CONFIG) --phpapi`" >> debian/$(PHP_PKG).substvars debian/$(EXT_so).ini: echo "; configuration for the $(EXT) module" > debian/$(EXT_so).autogen.ini echo "extension=$(EXT_so).so" >> debian/$(EXT_so).autogen.ini # leave the .autogen file around to use it as a flag when cleaning cp -a debian/$(EXT_so).autogen.ini debian/$(EXT_so).ini debian/tokyo_tyrant.ini0000664000000000000000000000044411724733204012444 0ustar ; configuration for the tokyo_tyrant module extension=tokyo_tyrant.so ;tokyo_tyrant.default_timeout=0.0 ;tokyo_tyrant.session_salt= ;tokyo_tyrant.key_prefix= ;tokyo_tyrant.allow_failover=1 ;tokyo_tyrant.fail_threshold=5 ;tokyo_tyrant.health_check_divisor=1000 ;tokyo_tyrant.php_expiration=0 debian/source/0000775000000000000000000000000011724733204010473 5ustar debian/source/format0000664000000000000000000000001411724733204011701 0ustar 3.0 (quilt) debian/watch0000664000000000000000000000012211724733204010217 0ustar version=3 http://pecl.php.net/package/tokyo_tyrant \ /get/tokyo_tyrant-(.+)\.tgz debian/changelog0000664000000000000000000000277112301065075011050 0ustar php-tokyo-tyrant (0.6.0-2build3) trusty; urgency=medium * No change rebuild for phpapi-20121212+lfs (LFS ABI break on 32-bit arches). -- Robie Basak Wed, 19 Feb 2014 08:24:29 +0000 php-tokyo-tyrant (0.6.0-2build2) saucy; urgency=low * Rebuild for PHP 5.5. -- Colin Watson Tue, 16 Jul 2013 01:44:19 +0100 php-tokyo-tyrant (0.6.0-2build1) quantal; urgency=low * No-change rebuild for phpapi change -- Ilya Barygin Sat, 30 Jun 2012 13:04:23 +0400 php-tokyo-tyrant (0.6.0-2) unstable; urgency=low * Cherry-pick upstream's PHP 5.4 support patch -- Raphael Geissert Sun, 04 Mar 2012 12:57:12 -0600 php-tokyo-tyrant (0.6.0-1) unstable; urgency=low * New upstream release * Bump Standards Version, no change needed * Adjust default settings to match upstream's * Add source/format file, set it to 3.0 quilt -- Raphael Geissert Sun, 04 Mar 2012 12:39:16 -0600 php-tokyo-tyrant (0.5.0-1) unstable; urgency=low * New upstream release * Bump Standards Version, no change needed -- Raphael Geissert Thu, 29 Jul 2010 00:28:30 -0400 php-tokyo-tyrant (0.4.0-1) unstable; urgency=low * New upstream release -- Raphael Geissert Wed, 07 Apr 2010 18:28:01 -0500 php-tokyo-tyrant (0.3.0-1) unstable; urgency=low * Initial release (Closes: #573893) -- Raphael Geissert Sun, 14 Mar 2010 16:53:15 -0600 debian/control0000664000000000000000000000150711724733204010601 0ustar Source: php-tokyo-tyrant Section: php Priority: optional Maintainer: Debian PHP Maintainers Uploaders: Raphael Geissert Build-Depends: debhelper (>= 6.0.7~), php5-dev (>= 5.2.0), cdbs (>= 0.4.52~), libtokyotyrant-dev, pkg-config Standards-Version: 3.9.3 Homepage: http://pecl.php.net/package/tokyo_tyrant Vcs-Git: git://git.debian.org/pkg-php/php-tokyo-tyrant.git Vcs-Browser: http://git.debian.org/?p=pkg-php/php-tokyo-tyrant.git Package: php5-tokyo-tyrant Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${php:Depends} Description: PHP interface to Tokyo Cabinet's network interface, Tokyo Tyrant PHP extension providing an Object-Oriented interface to Tokyo Tyrant via the binary protocol. . The key-value and table (with query) APIs are both supported. debian/patches/0000775000000000000000000000000011724735342010627 5ustar debian/patches/series0000664000000000000000000000001611724735342012041 0ustar php_5.4.patch debian/patches/php_5.4.patch0000664000000000000000000001404111724735342013025 0ustar Description: Add support for PHP 5.4's API changes Origin: https://github.com/mkoppanen/php-tokyo_tyrant/commit/5a45c640e57dca18335897f8c7fd7555258fd091 https://github.com/mkoppanen/php-tokyo_tyrant/commit/b0d7e0ceedf16e8496511011343bd5ade185eda2 Last-Update: 2011-11-03 Index: php-tokyo-tyrant/tokyo_tyrant-0.6.0/tokyo_tyrant.c =================================================================== --- php-tokyo-tyrant.orig/tokyo_tyrant-0.6.0/tokyo_tyrant.c +++ php-tokyo-tyrant/tokyo_tyrant-0.6.0/tokyo_tyrant.c @@ -1824,7 +1824,7 @@ ZEND_BEGIN_ARG_INFO_EX(tokyo_tyrant_setm ZEND_ARG_INFO(0, check_consistency) ZEND_END_ARG_INFO() -static function_entry php_tokyo_tyrant_class_methods[] = +static zend_function_entry php_tokyo_tyrant_class_methods[] = { PHP_ME(tokyotyrant, __construct, tokyo_tyrant_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(tokyotyrant, connect, tokyo_tyrant_connect_args, ZEND_ACC_PUBLIC) @@ -1864,7 +1864,7 @@ ZEND_BEGIN_ARG_INFO_EX(tokyo_tyrant_tabl ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -static function_entry php_tokyo_tyrant_table_class_methods[] = +static zend_function_entry php_tokyo_tyrant_table_class_methods[] = { /* Inherit and override */ PHP_ME(tokyotyranttable, put, tokyo_tyrant_put_args, ZEND_ACC_PUBLIC) @@ -1908,7 +1908,7 @@ ZEND_BEGIN_ARG_INFO_EX(tokyo_tyrant_quer ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -static function_entry php_tokyo_tyrant_query_class_methods[] = +static zend_function_entry php_tokyo_tyrant_query_class_methods[] = { PHP_ME(tokyotyrantquery, __construct, tokyo_tyrant_query_construct_args, ZEND_ACC_PUBLIC) PHP_ME(tokyotyrantquery, addcond, tokyo_tyrant_query_addcond_args, ZEND_ACC_PUBLIC) @@ -1933,7 +1933,7 @@ ZEND_BEGIN_ARG_INFO_EX(tokyo_tyrant_iter ZEND_ARG_OBJ_INFO(0, TokyoTyrant, TokyoTyrant, 0) ZEND_END_ARG_INFO() -static function_entry php_tokyo_tyrant_iterator_class_methods[] = +static zend_function_entry php_tokyo_tyrant_iterator_class_methods[] = { /* Iterator interface */ PHP_ME(tokyotyrantiterator, __construct, tokyo_tyrant_iterator_construct_args, ZEND_ACC_PUBLIC) @@ -1958,17 +1958,7 @@ static void php_tokyo_tyrant_query_objec } if (intern->parent) { - -#ifdef Z_REFCOUNT_P - Z_SET_REFCOUNT_P(intern->parent, Z_REFCOUNT_P(intern->parent) - 1); - if (Z_REFCOUNT_P(intern->parent) <= 0) { -#else - intern->parent->refcount--; - if (intern->parent->refcount == 0) { -#endif - /* TODO: check if this leaks */ - efree(intern->parent); - } + zval_ptr_dtor(&(intern->parent)); } if (intern->res) { @@ -1982,9 +1972,20 @@ static void php_tokyo_tyrant_query_objec efree(intern); } +/* PHP 5.4 */ +#if PHP_VERSION_ID < 50399 +# define object_properties_init(zo, class_type) { \ + zval *tmp; \ + zend_hash_copy((*zo).properties, \ + &class_type->default_properties, \ + (copy_ctor_func_t) zval_add_ref, \ + (void *) &tmp, \ + sizeof(zval *)); \ + } +#endif + static zend_object_value php_tokyo_tyrant_query_object_new(zend_class_entry *class_type TSRMLS_DC) { - zval *tmp; zend_object_value retval; php_tokyo_tyrant_query_object *intern; @@ -1998,7 +1999,7 @@ static zend_object_value php_tokyo_tyran intern->parent = NULL; zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); + object_properties_init(&intern->zo, class_type); retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_tokyo_tyrant_query_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &tokyo_tyrant_query_object_handlers; @@ -2018,17 +2019,7 @@ static void php_tokyo_tyrant_iterator_ob } if (intern->parent) { - -#ifdef Z_REFCOUNT_P - Z_SET_REFCOUNT_P(intern->parent, Z_REFCOUNT_P(intern->parent) - 1); - if (Z_REFCOUNT_P(intern->parent) <= 0) { -#else - intern->parent->refcount--; - if (intern->parent->refcount == 0) { -#endif - /* TODO: check if this leaks */ - efree(intern->parent); - } + zval_ptr_dtor(&(intern->parent)); } zend_object_std_dtor(&intern->zo TSRMLS_CC); efree(intern); @@ -2049,7 +2040,7 @@ static zend_object_value php_tokyo_tyran intern->current = NULL; zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); + object_properties_init(&intern->zo, class_type); retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_tokyo_tyrant_iterator_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &tokyo_tyrant_iterator_object_handlers; @@ -2087,7 +2078,7 @@ static zend_object_value php_tokyo_tyran } zend_object_std_init(&intern->zo, class_type TSRMLS_CC); - zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); + object_properties_init(&intern->zo, class_type); retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_tokyo_tyrant_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &tokyo_tyrant_object_handlers; Index: php-tokyo-tyrant/tokyo_tyrant-0.6.0/tokyo_tyrant_funcs.c =================================================================== --- php-tokyo-tyrant.orig/tokyo_tyrant-0.6.0/tokyo_tyrant_funcs.c +++ php-tokyo-tyrant/tokyo_tyrant-0.6.0/tokyo_tyrant_funcs.c @@ -234,8 +234,8 @@ zend_bool php_tt_query_object_init(php_t query->conn = db->conn; query->parent = parent; query->res = NULL; -#ifdef Z_REFCOUNT_P - Z_SET_REFCOUNT_P(parent, Z_REFCOUNT_P(parent) + 1); +#ifdef Z_ADDREF_P + Z_ADDREF_P(parent); #else parent->refcount++; #endif @@ -264,8 +264,8 @@ zend_bool php_tt_iterator_object_init(ph iterator->conn = db->conn; iterator->parent = parent; -#ifdef Z_REFCOUNT_P - Z_SET_REFCOUNT_P(parent, Z_REFCOUNT_P(parent) + 1); +#ifdef Z_ADDREF_P + Z_ADDREF_P(parent); #else parent->refcount++; #endif debian/compat0000664000000000000000000000000211724733204010371 0ustar 5