From: Greg Beaver Date: Thu, 18 Jan 2007 00:13:18 +0000 (+0000) Subject: add class constants Phar::COMPRESSED, Phar::GZ, and Phar::BZ2 for eventual compressio... X-Git-Tag: RELEASE_1_0_0RC1~237 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c35b9f30b615373d1742536191b45617ec503a3d;p=php add class constants Phar::COMPRESSED, Phar::GZ, and Phar::BZ2 for eventual compression manipulation --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c617cfc719..ca13aaf54a 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1224,7 +1224,7 @@ PHP_METHOD(Phar, mapPhar) RETURN_BOOL(phar_open_compiled_file(alias, alias_len TSRMLS_CC) == SUCCESS); } /* }}} */ -/* {{{ proto mixed Phar::loadPhar(string url [, string alias]) +/* {{{ proto mixed Phar::loadPhar(string filename [, string alias]) * Loads any phar archive with an alias */ PHP_METHOD(Phar, loadPhar) { @@ -3059,6 +3059,8 @@ static void php_phar_init_globals_module(zend_phar_globals *phar_globals) phar_globals->readonly = 1; } /* }}} */ +#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \ + zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); PHP_MINIT_FUNCTION(phar) /* {{{ */ { @@ -3072,6 +3074,10 @@ PHP_MINIT_FUNCTION(phar) /* {{{ */ zend_class_implements(phar_ce_archive TSRMLS_CC, 2, spl_ce_Countable, zend_ce_arrayaccess); + REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "COMPRESSED", PHAR_ENT_COMPRESSION_MASK) + REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "GZ", PHAR_ENT_COMPRESSED_GZ) + REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "BZ2", PHAR_ENT_COMPRESSED_BZ2) + INIT_CLASS_ENTRY(ce, "PharFileInfo", php_entry_methods); phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo, NULL TSRMLS_CC);