Re: Proposal for a new extension AMFEXT

From: Date: Wed, 06 Jun 2007 18:03:49 +0000
Subject: Re: Proposal for a new extension AMFEXT
References: 1 2 3 4 5 6 7 8 9  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-4715@lists.php.net to get a copy of this message
It is painful to maintain two APIs when one has actually no benefit
I don't see how it's painful - dual API looks like this: /* {{{ proto array Collator::sort(array input) U Sort an array using collation }}} */ /* {{{ proto array collator_sort(Collator coll, array input) U Sort an array using collation */ PHP_FUNCTION(collator_sort) {
	zval             *object;
php_collator_obj *collatorobj;
	zval             *array;
	HashTable        *target_hash;
	zend_collator    *orig_collator;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa/", &object, unicode_collator_ce, &array) == FAILURE) { RETURN_FALSE; } collatorobj = (php_collator_obj *) zend_object_store_get_object(object TSRMLS_CC); What's painful in it? Maybe you need a couple of additional methods - like ctor method for functional API - but that should be it. -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

« previous php.pecl.dev (#4715) next »