remove unused variables from webdav file backend

remotes/origin/stable5
Robin Appelman 13 years ago
parent c04aa8d6a9
commit 23c71b15a0
  1. 15
      apps/files_external/lib/webdav.php

@ -77,16 +77,11 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array(),1); $response=$this->client->propfind($path, array(),1);
$stripLength=strlen($this->root)+strlen($path);
$id=md5('webdav'.$this->root.$path); $id=md5('webdav'.$this->root.$path);
OC_FakeDirStream::$dirs[$id]=array(); OC_FakeDirStream::$dirs[$id]=array();
$skip = true; $files=array_keys($response);
foreach($response as $file=>$data){ array_shift($files);//the first entry is the current directory
// Skip the first file, because it is the current directory foreach($files as $file){
if ($skip) {
$skip = false;
continue;
}
$file = urldecode(basename($file)); $file = urldecode(basename($file));
OC_FakeDirStream::$dirs[$id][]=$file; OC_FakeDirStream::$dirs[$id][]=$file;
} }
@ -120,7 +115,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
public function file_exists($path){ public function file_exists($path){
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array('{DAV:}resourcetype')); $this->client->propfind($path, array('{DAV:}resourcetype'));
return true;//no 404 exception return true;//no 404 exception
}catch(Exception $e){ }catch(Exception $e){
return false; return false;
@ -201,7 +196,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$mtime=time(); $mtime=time();
} }
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime,)); $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
} }
public function getFile($path,$target){ public function getFile($path,$target){

Loading…
Cancel
Save