]> granicus.if.org Git - php/commitdiff
- Add Phar::getSupportedCompression()
authorMarcus Boerger <helly@php.net>
Mon, 14 May 2007 18:31:18 +0000 (18:31 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 14 May 2007 18:31:18 +0000 (18:31 +0000)
ext/phar/TODO
ext/phar/phar_object.c

index 930e2cad2b24d7113841c7aefddfbe645eeb039d..abb93f3aa6e7ecc48c83ec8b4c1b513713355377 100644 (file)
@@ -43,11 +43,12 @@ Version 1.1.0
  
 Version 1.2.0
 
- * add PharFileInfo::hasMetadata(), PharFileInfo::delMetadata() [Marcus]
- * fix Phar::CanWrite() [Marcus]
- * add preliminary phar command (phar.php) [Marcus] 
- * add phar command (phar.phar) [Marcus]
- * list all available signature methods
+ X add PharFileInfo::hasMetadata(), PharFileInfo::delMetadata() [Marcus]
+ X fix Phar::CanWrite() [Marcus]
+ X add preliminary phar command (phar.php) [Marcus] 
+ X add phar command (phar.phar) [Marcus]
+ X list all available compression methods using Phar::getSupportedCompression() [Marcus]
+
  * ability to have Phar object return file class as offsetGet() result
  * ability to store empty directories
  * [optional] Phar->rollback() to abort a write transaction
index aea802a7b3a394ac92772abd3c497cebf985626e..4d20643a7a81ab2c6f9a171a46adf11a4286f6e2 100755 (executable)
@@ -413,6 +413,22 @@ PHP_METHOD(Phar, getSupportedSignatures)
 }
 /* }}} */
 
+/* {{{ proto array Phar::getSupportedCompression()
+ * Return array of supported comparession algorithms
+ */
+PHP_METHOD(Phar, getSupportedCompression)
+{
+       array_init(return_value);
+
+#if !HAVE_ZLIB
+       add_next_index_stringl(return_value, "GZ", 2, 1);
+#endif
+#if !HAVE_BZ2
+       add_next_index_stringl(return_value, "BZIP2", 5, 1);
+#endif
+}
+/* }}} */
+
 /* {{{ proto array|false Phar::getSignature()
  * Return signature or false
  */
@@ -1314,6 +1330,7 @@ zend_function_entry php_archive_methods[] = {
        PHP_ME(Phar, mapPhar,               arginfo_phar_mapPhar,      ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
        PHP_ME(Phar, getExtractList,        NULL,                      ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
        PHP_ME(Phar, getSupportedSignatures,NULL,                      ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
+       PHP_ME(Phar, getSupportedCompression,NULL,                     ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
        {NULL, NULL, NULL}
 };