summaryrefslogtreecommitdiffstats
path: root/apps/files_archive
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 00:20:45 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 00:20:45 +0200
commit93b63cf3755d3f1295c976c308b81c6340883abb (patch)
tree8e8a7413ea75723b7d21e18661a10842d1970bf1 /apps/files_archive
parente48f511606a1ef64aa39099055dd6ae437f45d03 (diff)
downloadnextcloud-server-93b63cf3755d3f1295c976c308b81c6340883abb.tar.gz
nextcloud-server-93b63cf3755d3f1295c976c308b81c6340883abb.zip
ported the rest of the OC_Helper calls
Diffstat (limited to 'apps/files_archive')
-rwxr-xr-x[-rw-r--r--]apps/files_archive/lib/storage.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/lib/tar.php12
-rwxr-xr-xapps/files_archive/lib/zip.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/archive.php8
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/storage.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/tar.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/zip.php2
7 files changed, 15 insertions, 15 deletions
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php
index 700d9633042..7a4ae339621 100644..100755
--- a/apps/files_archive/lib/storage.php
+++ b/apps/files_archive/lib/storage.php
@@ -104,7 +104,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
public function touch($path, $mtime=null){
if(is_null($mtime)){
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$this->archive->extractFile($path,$tmpFile);
$this->archive->addfile($path,$tmpFile);
}else{
diff --git a/apps/files_archive/lib/tar.php b/apps/files_archive/lib/tar.php
index 1eed11a762d..3a07a28906c 100644..100755
--- a/apps/files_archive/lib/tar.php
+++ b/apps/files_archive/lib/tar.php
@@ -93,7 +93,7 @@ class OC_Archive_TAR extends OC_Archive{
*/
function rename($source,$dest){
//no proper way to delete, rename entire archive, rename file and remake archive
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
$this->tar->extract($tmp);
rename($tmp.$source,$tmp.$dest);
$this->tar=null;
@@ -177,7 +177,7 @@ class OC_Archive_TAR extends OC_Archive{
* @return bool
*/
function extractFile($path,$dest){
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
if(!$this->fileExists($path)){
return false;
}
@@ -185,7 +185,7 @@ class OC_Archive_TAR extends OC_Archive{
if($success){
rename($tmp.$path,$dest);
}
- OC_Helper::rmdirr($tmp);
+ OCP\Util::rmdirr($tmp);
return $success;
}
/**
@@ -216,9 +216,9 @@ class OC_Archive_TAR extends OC_Archive{
return false;
}
//no proper way to delete, extract entire archive, delete file and remake archive
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
$this->tar->extract($tmp);
- OC_Helper::rmdirr($tmp.$path);
+ OCP\Util::rmdirr($tmp.$path);
$this->tar=null;
unlink($this->path);
$this->reopen();
@@ -237,7 +237,7 @@ class OC_Archive_TAR extends OC_Archive{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
if($this->fileExists($path)){
$this->extractFile($path,$tmpFile);
}elseif($mode=='r' or $mode=='rb'){
diff --git a/apps/files_archive/lib/zip.php b/apps/files_archive/lib/zip.php
index dd94859f089..16f722a734e 100755
--- a/apps/files_archive/lib/zip.php
+++ b/apps/files_archive/lib/zip.php
@@ -169,7 +169,7 @@ class OC_Archive_ZIP extends OC_Archive{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->fileExists($path)){
$this->extractFile($path,$tmpFile);
diff --git a/apps/files_archive/tests/archive.php b/apps/files_archive/tests/archive.php
index 9e99466a521..512afe9e915 100644..100755
--- a/apps/files_archive/tests/archive.php
+++ b/apps/files_archive/tests/archive.php
@@ -55,7 +55,7 @@ abstract class Test_Archive extends UnitTestCase {
$textFile=$dir.'/lorem.txt';
$this->assertEqual(file_get_contents($textFile),$this->instance->getFile('lorem.txt'));
- $tmpFile=OC_Helper::tmpFile('.txt');
+ $tmpFile=OCP\Util::tmpFile('.txt');
$this->instance->extractFile('lorem.txt',$tmpFile);
$this->assertEqual(file_get_contents($textFile),file_get_contents($tmpFile));
}
@@ -89,7 +89,7 @@ abstract class Test_Archive extends UnitTestCase {
$this->instance=$this->getNew();
$fh=$this->instance->getStream('lorem.txt','w');
$source=fopen($dir.'/lorem.txt','r');
- OC_Helper::streamCopy($source,$fh);
+ OCP\Util::streamCopy($source,$fh);
fclose($source);
fclose($fh);
$this->assertTrue($this->instance->fileExists('lorem.txt'));
@@ -109,13 +109,13 @@ abstract class Test_Archive extends UnitTestCase {
public function testExtract(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
$this->instance=$this->getExisting();
- $tmpDir=OC_Helper::tmpFolder();
+ $tmpDir=OCP\Util::tmpFolder();
$this->instance->extract($tmpDir);
$this->assertEqual(true,file_exists($tmpDir.'lorem.txt'));
$this->assertEqual(true,file_exists($tmpDir.'dir/lorem.txt'));
$this->assertEqual(true,file_exists($tmpDir.'logo-wide.png'));
$this->assertEqual(file_get_contents($dir.'/lorem.txt'),file_get_contents($tmpDir.'lorem.txt'));
- OC_Helper::rmdirr($tmpDir);
+ OCP\Util::rmdirr($tmpDir);
}
public function testMoveRemove(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
diff --git a/apps/files_archive/tests/storage.php b/apps/files_archive/tests/storage.php
index 4d0a83356bd..52d6a4296e9 100644..100755
--- a/apps/files_archive/tests/storage.php
+++ b/apps/files_archive/tests/storage.php
@@ -13,7 +13,7 @@ class Test_Filestorage_Archive_Zip extends Test_FileStorage {
private $tmpFile;
public function setUp(){
- $this->tmpFile=OC_Helper::tmpFile('.zip');
+ $this->tmpFile=OCP\Util::tmpFile('.zip');
$this->instance=new OC_Filestorage_Archive(array('archive'=>$this->tmpFile));
}
diff --git a/apps/files_archive/tests/tar.php b/apps/files_archive/tests/tar.php
index aa46455e659..c543c226bef 100644..100755
--- a/apps/files_archive/tests/tar.php
+++ b/apps/files_archive/tests/tar.php
@@ -16,7 +16,7 @@ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
}
protected function getNew(){
- return new OC_Archive_TAR(OC_Helper::tmpFile('.tar.gz'));
+ return new OC_Archive_TAR(OCP\Util::tmpFile('.tar.gz'));
}
}
}else{
diff --git a/apps/files_archive/tests/zip.php b/apps/files_archive/tests/zip.php
index 18a2997c1a5..b22ea3b79e9 100644..100755
--- a/apps/files_archive/tests/zip.php
+++ b/apps/files_archive/tests/zip.php
@@ -16,7 +16,7 @@ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
}
protected function getNew(){
- return new OC_Archive_ZIP(OC_Helper::tmpFile('.zip'));
+ return new OC_Archive_ZIP(OCP\Util::tmpFile('.zip'));
}
}
}else{