Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-09-07 20:31:14 +0400
committerRobin Appelman <icewind@owncloud.com>2012-09-07 20:31:14 +0400
commit3b8f539837e9be3fd94c4897e366404e5304ac7d (patch)
tree62b184336bf07a8e31ba83616eadd9c344c9457d /files_archive
parentd39194dabe96c73d7dbc25033c7e7403ebc7d743 (diff)
put filestorages in a namespace
Diffstat (limited to 'files_archive')
-rw-r--r--files_archive/appinfo/app.php4
-rw-r--r--files_archive/lib/storage.php14
-rw-r--r--files_archive/tests/storage.php4
3 files changed, 12 insertions, 10 deletions
diff --git a/files_archive/appinfo/app.php b/files_archive/appinfo/app.php
index 67376c4a0..a95e2425a 100644
--- a/files_archive/appinfo/app.php
+++ b/files_archive/appinfo/app.php
@@ -6,8 +6,8 @@
* See the COPYING-README file.
*/
-OC::$CLASSPATH['OC_Filestorage_Archive']='apps/files_archive/lib/storage.php';
+OC::$CLASSPATH['OC\Files\Storage\Archive']='apps/files_archive/lib/storage.php';
-OCP\Util::connectHook('OC_Filesystem','get_mountpoint','OC_Filestorage_Archive','autoMount');
+OCP\Util::connectHook('OC_Filesystem','get_mountpoint','OC\Files\Storage\Archive','autoMount');
OCP\Util::addscript( 'files_archive', 'archive' );
diff --git a/files_archive/lib/storage.php b/files_archive/lib/storage.php
index 3c14c3e1f..28fa3063f 100644
--- a/files_archive/lib/storage.php
+++ b/files_archive/lib/storage.php
@@ -6,7 +6,9 @@
* See the COPYING-README file.
*/
-class OC_Filestorage_Archive extends OC_Filestorage_Common{
+namespace OC\Files\Storage;
+
+class Archive extends \OC\Files\Storage\Common{
/**
* underlying local storage used for missing functions
* @var OC_Archive
@@ -25,7 +27,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
public function __construct($params){
- $this->archive=OC_Archive::open($params['archive']);
+ $this->archive=\OC_Archive::open($params['archive']);
$this->path=$params['archive'];
}
@@ -53,7 +55,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
}
$id=md5($this->path.$path);
- OC_FakeDirStream::$dirs[$id]=$content;
+ \OC_FakeDirStream::$dirs[$id]=$content;
return opendir('fakedir://'.$id);
}
public function stat($path){
@@ -123,7 +125,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
}
private function toTmpFile($path){
- $tmpFile=OC_Helper::tmpFile($extension);
+ $tmpFile=\OC_Helper::tmpFile($extension);
$this->archive->extractFile($path,$tmpFile);
return $tmpFile;
}
@@ -146,7 +148,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
$path=$params['path'];
if(!self::$rootView){
- self::$rootView=new OC_FilesystemView('');
+ self::$rootView=new \OC_FilesystemView('');
}
self::$enableAutomount=false;//prevent recursion
$supported=array('zip','tar.gz','tar.bz2','tgz');
@@ -156,7 +158,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
$archive=substr($path,0,$pos+strlen($ext)-1);
if(self::$rootView->file_exists($archive) and array_search($archive,self::$mounted)===false){
$localArchive=self::$rootView->getLocalFile($archive);
- OC_Filesystem::mount('OC_Filestorage_Archive',array('archive'=>$localArchive),$archive.'/');
+ \OC_Filesystem::mount('\OC\Files\Storage\Archive',array('archive'=>$localArchive),$archive.'/');
self::$mounted[]=$archive;
}
}
diff --git a/files_archive/tests/storage.php b/files_archive/tests/storage.php
index 74ddf2287..94ac4ada4 100644
--- a/files_archive/tests/storage.php
+++ b/files_archive/tests/storage.php
@@ -14,7 +14,7 @@ class Test_Filestorage_Archive_Zip extends Test_FileStorage {
public function setUp(){
$this->tmpFile=OCP\Files::tmpFile('.zip');
- $this->instance=new OC_Filestorage_Archive(array('archive'=>$this->tmpFile));
+ $this->instance=new \OC\Files\Storage\Archive(array('archive'=>$this->tmpFile));
}
public function tearDown(){
@@ -30,7 +30,7 @@ class Test_Filestorage_Archive_Tar extends Test_FileStorage {
public function setUp(){
$this->tmpFile=OCP\Files::tmpFile('.tar.gz');
- $this->instance=new OC_Filestorage_Archive(array('archive'=>$this->tmpFile));
+ $this->instance=new \OC\Files\Storage\Archive(array('archive'=>$this->tmpFile));
}
public function tearDown(){