diff options
author | robocoder <anthon.pang@gmail.com> | 2011-04-03 23:31:58 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2011-04-03 23:31:58 +0400 |
commit | 1f51cb30a868ae1242d2e06a198ff1d33da3d27f (patch) | |
tree | a09226cf293bd14ed94d89eaddd60f42154288c3 /core/Unzip | |
parent | e66a1f73b2687984685c335ca2c7b5d10ffe4893 (diff) |
refs #2256
git-svn-id: http://dev.piwik.org/svn/trunk@4297 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Unzip')
-rw-r--r-- | core/Unzip/Interface.php | 42 | ||||
-rw-r--r-- | core/Unzip/PclZip.php | 3 | ||||
-rw-r--r-- | core/Unzip/ZipArchive.php | 3 |
3 files changed, 46 insertions, 2 deletions
diff --git a/core/Unzip/Interface.php b/core/Unzip/Interface.php new file mode 100644 index 0000000000..cd86202281 --- /dev/null +++ b/core/Unzip/Interface.php @@ -0,0 +1,42 @@ +<?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 interface + * + * @package Piwik + * @subpackage Piwik_Unzip + */ +interface Piwik_Unzip_Interface +{ + /** + * Constructor + * + * @param string $filename Name of the .zip archive + */ + function __construct($filename); + + /** + * Extract files from archive to target directory + * + * @param string $pathExtracted Absolute path of target directory + * @return mixed Array of filenames if successful; or 0 if an error occurred + */ + public function extract($pathExtracted); + + /** + * Get error status string for the latest error + * + * @return string + */ + public function errorInfo(); +} diff --git a/core/Unzip/PclZip.php b/core/Unzip/PclZip.php index 002b84b647..b47b766dc6 100644 --- a/core/Unzip/PclZip.php +++ b/core/Unzip/PclZip.php @@ -19,8 +19,9 @@ require_once PIWIK_INCLUDE_PATH . '/libs/PclZip/pclzip.lib.php'; * Unzip wrapper around PclZip * * @package Piwik + * @subpackage Piwik_Unzip */ -class Piwik_Unzip_PclZip implements Piwik_iUnzip +class Piwik_Unzip_PclZip implements Piwik_Unzip_Interface { private $pclzip; public $filename; diff --git a/core/Unzip/ZipArchive.php b/core/Unzip/ZipArchive.php index 1e0c93ffda..0a84463482 100644 --- a/core/Unzip/ZipArchive.php +++ b/core/Unzip/ZipArchive.php @@ -14,8 +14,9 @@ * Unzip wrapper around ZipArchive * * @package Piwik + * @subpackage Piwik_Unzip */ -class Piwik_Unzip_ZipArchive implements Piwik_iUnzip +class Piwik_Unzip_ZipArchive implements Piwik_Unzip_Interface { private $ziparchive; public $filename; |