Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2010-11-13 07:26:27 +0300
committerrobocoder <anthon.pang@gmail.com>2010-11-13 07:26:27 +0300
commit8f82cedd549bdd35859b554f70aa90bb5dd58818 (patch)
tree3349c8b7b25afe07accd65ff543993e153ffa1bc /core/Unzip.php
parent4a7d095026d5abcb6912e33381f34b4bf57fd6d1 (diff)
fixes #1814
git-svn-id: http://dev.piwik.org/svn/trunk@3312 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Unzip.php')
-rw-r--r--core/Unzip.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/core/Unzip.php b/core/Unzip.php
new file mode 100644
index 0000000000..3ad2c04a8b
--- /dev/null
+++ b/core/Unzip.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ * @version $Id$
+ *
+ * @category Piwik
+ * @package Piwik
+ */
+
+/**
+ * Unzip wrapper around ZipArchive and PclZip
+ *
+ * @package Piwik
+ */
+class Piwik_Unzip
+{
+ /**
+ * Returns an unarchiver
+ *
+ * @param string $filename Name of .zip archive
+ * @return Piwik_Unzip
+ */
+ static public function getDefaultUnzip($filename)
+ {
+ if(defined('ZIPARCHIVE::ER_OK'))
+ return new Piwik_Unzip_ZipArchive($filename);
+
+ return new Piwik_Unzip_PclZip($filename);
+ }
+}