diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-11-08 22:36:05 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-11-08 22:36:05 +0100 |
commit | 5cc6635eb81a8d76c04ee040a791f51ebbe389ef (patch) | |
tree | cfe2caa4dc4d76075f9cad9b883f5d0e471db2ed /lib | |
parent | ca6c500799ec13c433ca74b8caa80875084c4943 (diff) | |
download | nextcloud-server-5cc6635eb81a8d76c04ee040a791f51ebbe389ef.tar.gz nextcloud-server-5cc6635eb81a8d76c04ee040a791f51ebbe389ef.zip |
remove OC_Filesystem::fromUploadedFile
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filestorage.php | 1 | ||||
-rw-r--r-- | lib/filestorage/local.php | 11 | ||||
-rw-r--r-- | lib/filesystem.php | 28 |
3 files changed, 4 insertions, 36 deletions
diff --git a/lib/filestorage.php b/lib/filestorage.php index 90071a86dbe..70aaf985b8b 100644 --- a/lib/filestorage.php +++ b/lib/filestorage.php @@ -47,7 +47,6 @@ class OC_Filestorage{ public function fopen($path,$mode){} public function toTmpFile($path){}//copy the file to a temporary file, used for cross-storage file actions public function fromTmpFile($tmpPath,$path){}//copy a file from a temporary file, used for cross-storage file actions - public function fromUploadedFile($tmpPath,$path){}//copy a file from a temporary file, used for cross-storage file actions public function getMimeType($path){} public function hash($type,$path,$raw){} public function free_space($path){} diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 7711116db35..b5d6023c494 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -189,17 +189,6 @@ class OC_Filestorage_Local extends OC_Filestorage{ } } - public function fromUploadedFile($tmpFile,$path){ - $fileStats = stat($tmpFile); - if(move_uploaded_file($tmpFile,$this->datadir.$path)){ - touch($this->datadir.$path, $fileStats['mtime'], $fileStats['atime']); - $this->clearFolderSizeCache($path); - return true; - }else{ - return false; - } - } - private function delTree($dir) { $dirRelative=$dir; $dir=$this->datadir.$dir; diff --git a/lib/filesystem.php b/lib/filesystem.php index a25e8697985..268f7ddbd28 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -200,6 +200,10 @@ class OC_Filesystem{ } } + /** + * following functions are equivilent to their php buildin equivilents for arguments/return values. + */ + static public function mkdir($path){ return self::basicOperation('mkdir',$path,array('create','write')); } @@ -362,26 +366,6 @@ class OC_Filesystem{ } } } - static public function fromUploadedFile($tmpFile,$path){ - if(OC_FileProxy::runPreProxies('fromUploadedFile',$tmpFile,$path) and self::canWrite($path) and $storage=self::getStorage($path)){ - $run=true; - $exists=self::file_exists($path); - if(!$exists){ - OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path, 'run' => &$run)); - } - if($run){ - OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run)); - } - if($run){ - $result=$storage->fromUploadedFile($tmpFile,self::getInternalPath($path)); - if(!$exists){ - OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path)); - } - OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path)); - return $result; - } - } - } static public function getMimeType($path){ return self::basicOperation('getMimeType',$path); } @@ -413,10 +397,6 @@ class OC_Filesystem{ } - static public function update_session_file_hash($sessionname,$sessionvalue){ - $_SESSION[$sessionname] = $sessionvalue; - } - /** * abstraction for running most basic operations * @param string $operation |