]> source.dussan.org Git - nextcloud-server.git/commitdiff
make files versions root a class constant
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 10 Oct 2013 18:09:38 +0000 (20:09 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 10 Oct 2013 18:09:38 +0000 (20:09 +0200)
apps/files_versions/lib/versions.php

index 48c25831ebb31afbd4c0f3a9b84e3c002f21838e..772422166557cb043a4638d368d698e16edec418 100644 (file)
@@ -19,6 +19,7 @@ class Storage {
 
        const DEFAULTENABLED=true;
        const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota
+       const VERSIONS_ROOT = 'files_versions/';
 
        private static $max_versions_per_interval = array(
                //first 10sec, one version every 2sec
@@ -241,7 +242,7 @@ class Storage {
        public static function getVersions($uid, $filename) {
                $versions = array();
                // fetch for old versions
-               $view = new \OC\Files\View('/' . $uid . '/files_versions/');
+               $view = new \OC\Files\View('/' . $uid . '/' . self::VERSIONS_ROOT);
 
                $pathinfo = pathinfo($filename);
 
@@ -345,8 +346,7 @@ class Storage {
         */
        private static function getAllVersions($uid) {
                $view = new \OC\Files\View('/' . $uid . '/');
-               $versionsPath = 'files_versions/';
-               $dirs = array($versionsPath);
+               $dirs = array(self::VERSIONS_ROOT);
 
                while (!empty($dirs)) {
                        $dir = array_pop($dirs);