diff options
author | Guy Brand <gb@unistra.fr> | 2015-08-10 10:03:27 +0200 |
---|---|---|
committer | Guy Brand <gb@unistra.fr> | 2015-08-10 10:03:27 +0200 |
commit | 53a57d16b9c741bb44099fd93bf79efa06796341 (patch) | |
tree | 24a90a50afe9325926c8ebaa2ed90f9fa093e5b9 /inc/TarLib.class.php | |
parent | cf6e6645c31a9f185cef3fb9452fb188882ede47 (diff) | |
parent | a060d9973e7c1d5051f2cc426937881826e4972e (diff) | |
download | rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.gz rpg-53a57d16b9c741bb44099fd93bf79efa06796341.tar.bz2 |
Merge branch master into stable
Diffstat (limited to 'inc/TarLib.class.php')
-rw-r--r-- | inc/TarLib.class.php | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php deleted file mode 100644 index dd319a79a..000000000 --- a/inc/TarLib.class.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/** - * This is a compatibility wrapper around the new Tar class - * - * Use of this library is strongly discouraged. Only basic extraction is wrapped, - * everything else will fail. - * - * @deprecated 2012-11-06 - */ -class TarLib { - - const COMPRESS_GZIP = 1; - const COMPRESS_BZIP = 2; - const COMPRESS_AUTO = 3; - const COMPRESS_NONE = 0; - const TARLIB_VERSION = '1.2'; - const FULL_ARCHIVE = -1; - const ARCHIVE_DYNAMIC = 0; - const ARCHIVE_RENAMECOMP = 5; - const COMPRESS_DETECT = -1; - - private $file = ''; - private $tar; - - public $_result = true; - - function __construct($file, $comptype = TarLib::COMPRESS_AUTO, $complevel = 9) { - dbg_deprecated('class Tar'); - - if(!$file) $this->error('__construct', '$file'); - - $this->file = $file; - switch($comptype) { - case TarLib::COMPRESS_AUTO: - case TarLib::COMPRESS_DETECT: - $comptype = Tar::COMPRESS_AUTO; - break; - case TarLib::COMPRESS_GZIP: - $comptype = Tar::COMPRESS_GZIP; - break; - case TarLib::COMPRESS_BZIP: - $comptype = Tar::COMPRESS_BZIP; - break; - default: - $comptype = Tar::COMPRESS_NONE; - } - - $this->complevel = $complevel; - - try { - $this->tar = new Tar(); - $this->tar->open($file, $comptype); - } catch(Exception $e) { - $this->_result = false; - } - } - - function Extract($p_what = TarLib::FULL_ARCHIVE, $p_to = '.', $p_remdir = '', $p_mode = 0755) { - if($p_what != TarLib::FULL_ARCHIVE) { - $this->error('Extract', 'Ep_what'); - return 0; - } - - try { - $this->tar->extract($p_to, $p_remdir); - } catch(Exception $e) { - return 0; - } - return 1; - } - - function error($func, $param = '') { - $error = 'TarLib is deprecated and should no longer be used.'; - - if($param) { - $error .= "In this compatibility wrapper, the function '$func' does not accept your value for". - "the parameter '$param' anymore."; - } else { - $error .= "The function '$func' no longer exists in this compatibility wrapper."; - } - - msg($error, -1); - } - - function __call($name, $arguments) { - $this->error($name); - } -}
\ No newline at end of file |