- PHP 5.4 support

- include vars.inc in package.xml
- Fix tests to be gnupg version independent
fixes bug 60913
fixes bug 60915
This commit is contained in:
Rasmus Lerdorf 2012-01-29 02:29:40 +00:00
parent a33d9eb54a
commit 71d97801e9
4 changed files with 11 additions and 6 deletions

View file

@ -173,13 +173,17 @@ zend_object_value gnupg_obj_new(zend_class_entry *class_type TSRMLS_DC){
zval *tmp;
zend_object_value retval;
intern = emalloc(sizeof(gnupg_object));
intern = ecalloc(1, sizeof(gnupg_object));
intern->zo.ce = class_type;
#if PHP_VERSION_ID < 50399
intern->zo.properties = NULL;
ALLOC_HASHTABLE (intern->zo.properties);
zend_hash_init (intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
#else
object_properties_init(&intern->zo, class_type);
#endif
retval.handle = zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC);
retval.handlers = (zend_object_handlers *) & gnupg_object_handlers;

View file

@ -55,6 +55,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file name="gnupg_res_sign_normal.phpt" role="test" />
<file name="gnupg_res_sign_normal_noarmor.phpt" role="test" />
<file name="gnupg_res_zzz_deletekey.phpt" role="test" />
<file name="vars.inc" role="test" />
</dir> <!-- //tests -->
<file name="config.m4" role="src" />
<file name="EXPERIMENTAL" role="doc" />

View file

@ -11,8 +11,8 @@ $ret = $gpg -> export($fingerprint);
var_dump($ret);
?>
--EXPECTF--
string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.3 (GNU/Linux)
string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.%d.%d (GNU/Linux)
mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3
afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z

View file

@ -9,8 +9,8 @@ $ret = gnupg_export($gpg, $fingerprint);
var_dump($ret);
?>
--EXPECTF--
string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.3 (GNU/Linux)
string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.%d.%d (GNU/Linux)
mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3
afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z