diff options
author | Greg Beaver <cellog@php.net> | 2009-07-26 01:24:12 +0000 |
---|---|---|
committer | Greg Beaver <cellog@php.net> | 2009-07-26 01:24:12 +0000 |
commit | 66908185b72d42eadc505af14c5e561e5e4679be (patch) | |
tree | 9b921292550c8b6a270e77b45161bba651a0a2b8 /ext/phar/stream.c | |
parent | 732f4af0823da1114d7ab32b53ef804904a8d7b8 (diff) | |
download | php-git-66908185b72d42eadc505af14c5e561e5e4679be.tar.gz |
fix basic phar test issues, failing tests phar_oo_009.phpt and phar_buildfromiterator10.phpt are due to bugs in Spl
Diffstat (limited to 'ext/phar/stream.c')
-rw-r--r-- | ext/phar/stream.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/phar/stream.c b/ext/phar/stream.c index e8d80ce684..a357ba0da5 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -207,18 +207,30 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, char *pat fpf = php_stream_alloc(&phar_ops, idata, NULL, mode); php_url_free(resource); efree(internal_file); +#if PHP_MAJOR_VERSION >= 6 + if (context && context->options && phar_find_key(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption TSRMLS_CC)) { +#else if (context && context->options && zend_hash_find(HASH_OF(context->options), "phar", sizeof("phar"), (void**)&pzoption) == SUCCESS) { +#endif pharcontext = HASH_OF(*pzoption); if (idata->internal_file->uncompressed_filesize == 0 && idata->internal_file->compressed_filesize == 0 +#if PHP_MAJOR_VERSION >= 6 + && phar_find_key(pharcontext, "compress", sizeof("compress"), (void**)&pzoption TSRMLS_CC) +#else && zend_hash_find(pharcontext, "compress", sizeof("compress"), (void**)&pzoption) == SUCCESS +#endif && Z_TYPE_PP(pzoption) == IS_LONG && (Z_LVAL_PP(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0 ) { idata->internal_file->flags &= ~PHAR_ENT_COMPRESSION_MASK; idata->internal_file->flags |= Z_LVAL_PP(pzoption); } +#if PHP_MAJOR_VERSION >= 6 + if (phar_find_key(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption TSRMLS_CC)) { +#else if (zend_hash_find(pharcontext, "metadata", sizeof("metadata"), (void**)&pzoption) == SUCCESS) { +#endif if (idata->internal_file->metadata) { zval_ptr_dtor(&idata->internal_file->metadata); idata->internal_file->metadata = NULL; |