summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rwxr-xr-xapps/files/ajax/upload.php2
-rwxr-xr-xapps/files_archive/lib/storage.php2
-rwxr-xr-xapps/files_archive/lib/tar.php12
-rwxr-xr-xapps/files_archive/lib/zip.php2
-rwxr-xr-xapps/files_archive/tests/archive.php8
-rwxr-xr-xapps/files_archive/tests/storage.php2
-rwxr-xr-xapps/files_archive/tests/tar.php2
-rwxr-xr-xapps/files_archive/tests/zip.php2
-rwxr-xr-xapps/files_encryption/lib/proxy.php4
-rwxr-xr-xapps/files_encryption/tests/encryption.php4
-rwxr-xr-xapps/files_encryption/tests/stream.php4
-rwxr-xr-xapps/files_external/lib/ftp.php2
-rwxr-xr-xapps/files_external/lib/google.php2
-rwxr-xr-xapps/files_external/lib/swift.php8
-rwxr-xr-xapps/files_external/lib/webdav.php2
-rwxr-xr-xapps/files_external/tests/ftp.php2
16 files changed, 30 insertions, 30 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index c50f6233a46..ca64f58e14b 100755
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -46,7 +46,7 @@ $result=array();
if(strpos($dir,'..') === false){
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
- $target = OCP\Util::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
+ $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i],$target)){
$meta=OC_FileCache::getCached($target);
$result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target));
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php
index 7a4ae339621..086a338db25 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=OCP\Util::tmpFile();
+ $tmpFile=OCP\Files::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 3a07a28906c..2cb8dc2a8ae 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=OCP\Util::tmpFolder();
+ $tmp=OCP\Files::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=OCP\Util::tmpFolder();
+ $tmp=OCP\Files::tmpFolder();
if(!$this->fileExists($path)){
return false;
}
@@ -185,7 +185,7 @@ class OC_Archive_TAR extends OC_Archive{
if($success){
rename($tmp.$path,$dest);
}
- OCP\Util::rmdirr($tmp);
+ OCP\Files::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=OCP\Util::tmpFolder();
+ $tmp=OCP\Files::tmpFolder();
$this->tar->extract($tmp);
- OCP\Util::rmdirr($tmp.$path);
+ OCP\Files::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=OCP\Util::tmpFile($ext);
+ $tmpFile=OCP\Files::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 16f722a734e..22ab48937eb 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=OCP\Util::tmpFile($ext);
+ $tmpFile=OCP\Files::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 512afe9e915..1779127c932 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=OCP\Util::tmpFile('.txt');
+ $tmpFile=OCP\Files::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');
- OCP\Util::streamCopy($source,$fh);
+ OCP\Files::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=OCP\Util::tmpFolder();
+ $tmpDir=OCP\Files::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'));
- OCP\Util::rmdirr($tmpDir);
+ OCP\Files::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 52d6a4296e9..7ebcce4ac6f 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=OCP\Util::tmpFile('.zip');
+ $this->tmpFile=OCP\Files::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 c543c226bef..c138a51a651 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(OCP\Util::tmpFile('.tar.gz'));
+ return new OC_Archive_TAR(OCP\Files::tmpFile('.tar.gz'));
}
}
}else{
diff --git a/apps/files_archive/tests/zip.php b/apps/files_archive/tests/zip.php
index b22ea3b79e9..615c9e3c7e2 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(OCP\Util::tmpFile('.zip'));
+ return new OC_Archive_ZIP(OCP\Files::tmpFile('.zip'));
}
}
}else{
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index cbe88adb5e4..ba357f23502 100755
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
//first encrypt the target file so we don't end up with a half encrypted file
OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
$tmp=fopen('php://temp');
- OCP\Util::streamCopy($result,$tmp);
+ OCP\Files::streamCopy($result,$tmp);
fclose($result);
OC_Filesystem::file_put_contents($path,$tmp);
fclose($tmp);
@@ -104,7 +104,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
public function postGetMimeType($path,$mime){
if(self::isEncrypted($path)){
- $mime=OCP\Util::getMimeType('crypt://'.$path,'w');
+ $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
}
return $mime;
}
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index 24b3bbcaf40..00466cc671c 100755
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -27,14 +27,14 @@ class Test_Encryption extends UnitTestCase {
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileEncrypted=OCP\Util::tmpFile();
+ $tmpFileEncrypted=OCP\Files::tmpFile();
OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
$encrypted=file_get_contents($tmpFileEncrypted);
$decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileDecrypted=OCP\Util::tmpFile();
+ $tmpFileDecrypted=OCP\Files::tmpFile();
OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
$decrypted=file_get_contents($tmpFileDecrypted);
$this->assertEqual($decrypted,$source);
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 225e82c99e8..b23805d60b0 100755
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -22,7 +22,7 @@ class Test_CryptStream extends UnitTestCase {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=fopen($file,'r');
$target=$this->getStream('test2','w');
- OCP\Util::streamCopy($source,$target);
+ OCP\Files::streamCopy($source,$target);
fclose($target);
fclose($source);
@@ -44,7 +44,7 @@ class Test_CryptStream extends UnitTestCase {
$id=uniqid();
}
if(!isset($this->tmpFiles[$id])){
- $file=OCP\Util::tmpFile();
+ $file=OCP\Files::tmpFile();
$this->tmpFiles[$id]=$file;
}else{
$file=$this->tmpFiles[$id];
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 1618a22ba8a..981eeab58bf 100755
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -108,7 +108,7 @@ class OC_FileStorage_FTP extends OC_Filestorage_Common{
}else{
$ext='';
}
- $tmpFile=OCP\Util::tmpFile($ext);
+ $tmpFile=OCP\Files::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){
$this->getFile($path,$tmpFile);
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 24a9d6c3d52..a133d35e737 100755
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -84,7 +84,7 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
}
if ($isDownload) {
- $tmpFile = OCP\Util::tmpFile();
+ $tmpFile = OCP\Files::tmpFile();
$fp = fopen($tmpFile, 'w');
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_exec($curl);
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index aaba79d9b7b..e3ba9c240cf 100755
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -164,7 +164,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @return array
*/
private function getSubContainers($container){
- $tmpFile=OCP\Util::tmpFile();
+ $tmpFile=OCP\Files::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -190,7 +190,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
if(!$name){
return false;
}
- $tmpFile=OCP\Util::tmpFile();
+ $tmpFile=OCP\Files::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -225,7 +225,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
if(!$name){
return false;
}
- $tmpFile=OCP\Util::tmpFile();
+ $tmpFile=OCP\Files::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -501,7 +501,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
private function getTmpFile($path){
$obj=$this->getObject($path);
if(!is_null($obj)){
- $tmpFile=OCP\Util::tmpFile();
+ $tmpFile=OCP\Files::tmpFile();
$obj->save_to_filename($tmpFile);
return $tmpFile;
}else{
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 75e5f80d217..07c90d4878e 100755
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -150,7 +150,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}else{
$ext='';
}
- $tmpFile=OCP\Util::tmpFile($ext);
+ $tmpFile=OCP\Files::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){
$this->getFile($path,$tmpFile);
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
index d2d3622fa78..68481b4e66b 100755
--- a/apps/files_external/tests/ftp.php
+++ b/apps/files_external/tests/ftp.php
@@ -23,7 +23,7 @@ if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']){
}
public function tearDown(){
- OCP\Util::rmdirr($this->instance->constructUrl(''));
+ OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
}