From cb91e27ab33d4e2b2d13b26cdc8d965d1607201e Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Fri, 12 Oct 2012 16:29:35 +0200 Subject: check if directory already exist before executing mkdir --- lib/fileproxy/fileoperations.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/fileproxy/fileoperations.php (limited to 'lib/fileproxy') diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php new file mode 100644 index 00000000000..f2a5324ef96 --- /dev/null +++ b/lib/fileproxy/fileoperations.php @@ -0,0 +1,38 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see . + * + */ + +/** + * check if standard file operations + */ + +class OC_FileProxy_FileOperations extends OC_FileProxy{ + static $rootView; + private $userQuota=-1; + + public function premkdir($path) { + if(!self::$rootView){ + self::$rootView = new OC_FilesystemView(''); + } + return !self::$rootView->file_exists($path); + } + +} \ No newline at end of file -- cgit v1.2.3 From d4fd83301ac7e713301ee1309e102fc4726ae344 Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Fri, 12 Oct 2012 16:33:06 +0200 Subject: remove unneeded variable --- lib/fileproxy/fileoperations.php | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/fileproxy') diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php index f2a5324ef96..fe7edafad2b 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/fileproxy/fileoperations.php @@ -26,7 +26,6 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{ static $rootView; - private $userQuota=-1; public function premkdir($path) { if(!self::$rootView){ -- cgit v1.2.3