summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-15 17:55:55 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-15 17:55:55 +0000
commit2fb451c87241b5dfb44b45129978e1bb9b971a26 (patch)
treefaca7f0132377c12a8a9f4397e5d4d91fdc0fd99 /modules/system/system.api.php
parent977d635bb1705ecebae8783a5e629214986eaddf (diff)
downloadbrdo-2fb451c87241b5dfb44b45129978e1bb9b971a26.tar.gz
brdo-2fb451c87241b5dfb44b45129978e1bb9b971a26.tar.bz2
- Patch #604618 by Crell, JacobSingh: create a common interface for Archive operations so we can handle .zip, .tar.gz.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index c1f597855..1f4d1d394 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -2399,6 +2399,34 @@ function hook_action_info_alter(&$actions) {
}
/**
+ * Declare archivers to the system.
+ *
+ * An archiver is a class that is able to package and unpackage one or more files
+ * into a single possibly compressed file. Common examples of such files are
+ * zip files and tar.gz files. All archiver classes must implement
+ * ArchiverInterface.
+ *
+ * When mapping a
+ *
+ * Each entry should be keyed on a unique value, and specify three
+ * additional keys:
+ * - class: The name of the PHP class for this archiver.
+ * - extensions: An array of file extensions that this archiver supports.
+ * - weight: This optional key specifies the weight of this archiver.
+ * When mapping file extensions to archivers, the first archiver by
+ * weight found that supports the requested extension will be used.
+ */
+function system_archiver_info() {
+ return array(
+ 'tar' => array(
+ 'class' => 'ArchiverTar',
+ 'extensions' => array('tar', 'tar.gz', 'tar.bz2'),
+ ),
+ );
+}
+
+
+/**
* Defines additional date types.
*
* Next to the 'long', 'medium' and 'short' date types defined in core, any