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
}
/* }}} */
+/* {{{ 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
*/
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}
};