summaryrefslogtreecommitdiffstats
path: root/lib/archive/tar.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/archive/tar.php')
-rw-r--r--lib/archive/tar.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/archive/tar.php b/lib/archive/tar.php
index 86d39b88968..0fa633c6038 100644
--- a/lib/archive/tar.php
+++ b/lib/archive/tar.php
@@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
-require_once '3rdparty/Archive/Tar.php';
+require_once 'Archive/Tar.php';
class OC_Archive_TAR extends OC_Archive{
const PLAIN=0;
@@ -23,7 +23,7 @@ class OC_Archive_TAR extends OC_Archive{
private $path;
function __construct($source) {
- $types=array(null,'gz','bz');
+ $types=array(null, 'gz', 'bz');
$this->path=$source;
$this->tar=new Archive_Tar($source, $types[self::getTarType($source)]);
}
@@ -84,7 +84,7 @@ class OC_Archive_TAR extends OC_Archive{
* @param string source either a local file or string data
* @return bool
*/
- function addFile($path,$source='') {
+ function addFile($path, $source='') {
if($this->fileExists($path)) {
$this->remove($path);
}
@@ -107,7 +107,7 @@ class OC_Archive_TAR extends OC_Archive{
* @param string dest
* @return bool
*/
- function rename($source,$dest) {
+ function rename($source, $dest) {
//no proper way to delete, rename entire archive, rename file and remake archive
$tmp=OCP\Files::tmpFolder();
$this->tar->extract($tmp);
@@ -130,8 +130,7 @@ class OC_Archive_TAR extends OC_Archive{
if( $file == $header['filename']
or $file.'/' == $header['filename']
or '/'.$file.'/' == $header['filename']
- or '/'.$file == $header['filename'])
- {
+ or '/'.$file == $header['filename']) {
return $header;
}
}
@@ -214,7 +213,7 @@ class OC_Archive_TAR extends OC_Archive{
* @param string dest
* @return bool
*/
- function extractFile($path,$dest) {
+ function extractFile($path, $dest) {
$tmp=OCP\Files::tmpFolder();
if(!$this->fileExists($path)) {
return false;
@@ -294,7 +293,7 @@ class OC_Archive_TAR extends OC_Archive{
* @param string mode
* @return resource
*/
- function getStream($path,$mode) {
+ function getStream($path, $mode) {
if(strrpos($path, '.')!==false) {
$ext=substr($path, strrpos($path, '.'));
}else{
@@ -309,7 +308,7 @@ class OC_Archive_TAR extends OC_Archive{
if($mode=='r' or $mode=='rb') {
return fopen($tmpFile, $mode);
}else{
- OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+ OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
self::$tempFiles[$tmpFile]=$path;
return fopen('close://'.$tmpFile, $mode);
}
@@ -334,7 +333,7 @@ class OC_Archive_TAR extends OC_Archive{
$this->tar->_close();
$this->tar=null;
}
- $types=array(null,'gz','bz');
+ $types=array(null, 'gz', 'bz');
$this->tar=new Archive_Tar($this->path, $types[self::getTarType($this->path)]);
}
}