remove unused and depricated getFolderSize
This commit is contained in:
parent
39086ef63e
commit
7152b8b4ee
|
@ -190,7 +190,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
|
||||||
|
|
||||||
public function filesize($path) {
|
public function filesize($path) {
|
||||||
if ($path == "" || $path == "/" || $this->is_dir($path)) {
|
if ($path == "" || $path == "/" || $this->is_dir($path)) {
|
||||||
return $this->getFolderSize($path);
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
$source = $this->getSource($path);
|
$source = $this->getSource($path);
|
||||||
if ($source) {
|
if ($source) {
|
||||||
|
@ -200,35 +200,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFolderSize($path) {
|
|
||||||
return 0; //depricated
|
|
||||||
}
|
|
||||||
|
|
||||||
private function calculateFolderSize($path) {
|
|
||||||
if ($this->is_file($path)) {
|
|
||||||
$path = dirname($path);
|
|
||||||
}
|
|
||||||
$size = 0;
|
|
||||||
if ($dh = $this->opendir($path)) {
|
|
||||||
while (($filename = readdir($dh)) !== false) {
|
|
||||||
if ($filename != "." && $filename != "..") {
|
|
||||||
$subFile = $path."/".$filename;
|
|
||||||
if ($this->is_file($subFile)) {
|
|
||||||
$size += $this->filesize($subFile);
|
|
||||||
} else {
|
|
||||||
$size += $this->getFolderSize($subFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($size > 0) {
|
|
||||||
$dbpath = rtrim($this->datadir.$path, "/");
|
|
||||||
// $query = OCP\DB::prepare("INSERT INTO *PREFIX*foldersize VALUES(?,?)");
|
|
||||||
// $result = $query->execute(array($dbpath, $size));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $size;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function clearFolderSizeCache($path) {
|
private function clearFolderSizeCache($path) {
|
||||||
$path = rtrim($path, "/");
|
$path = rtrim($path, "/");
|
||||||
$path = preg_replace('{(/)\1+}', "/", $path);
|
$path = preg_replace('{(/)\1+}', "/", $path);
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
*/
|
*/
|
||||||
class OC_Filestorage_Local extends OC_Filestorage_Common{
|
class OC_Filestorage_Local extends OC_Filestorage_Common{
|
||||||
protected $datadir;
|
protected $datadir;
|
||||||
private static $mimetypes=null;
|
|
||||||
public function __construct($arguments){
|
public function __construct($arguments){
|
||||||
$this->datadir=$arguments['datadir'];
|
$this->datadir=$arguments['datadir'];
|
||||||
if(substr($this->datadir,-1)!=='/'){
|
if(substr($this->datadir,-1)!=='/'){
|
||||||
|
@ -41,7 +40,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
|
||||||
}
|
}
|
||||||
public function filesize($path){
|
public function filesize($path){
|
||||||
if($this->is_dir($path)){
|
if($this->is_dir($path)){
|
||||||
return $this->getFolderSize($path);
|
return 0;
|
||||||
}else{
|
}else{
|
||||||
return filesize($this->datadir.$path);
|
return filesize($this->datadir.$path);
|
||||||
}
|
}
|
||||||
|
@ -186,15 +185,6 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief get the size of folder and it's content
|
|
||||||
* @param string $path file path
|
|
||||||
* @return int size of folder and it's content
|
|
||||||
*/
|
|
||||||
public function getFolderSize($path){
|
|
||||||
return 0;//depricated, use OC_FileCach instead
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a file or folder has been updated since $time
|
* check if a file or folder has been updated since $time
|
||||||
* @param int $time
|
* @param int $time
|
||||||
|
|
Loading…
Reference in New Issue