diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-10-04 18:09:42 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-10-04 18:09:42 +0300 |
commit | ef65037211f9111bb5c77fe657e50dc948db4f75 (patch) | |
tree | 8a996e149ebd976159a7be0eb118d5aa40ff99b2 /lib | |
parent | 65750cb2448af6d543132819ea7f7ee9720b825c (diff) | |
download | nextcloud-server-ef65037211f9111bb5c77fe657e50dc948db4f75.tar.gz nextcloud-server-ef65037211f9111bb5c77fe657e50dc948db4f75.zip |
Make mimetypes static. Jenkis will be happy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/cache/cache.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 852036929dd..82f5f504cba 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -34,8 +34,8 @@ class Cache { */ private $storageCache; - private $mimetypeIds = array(); - private $mimetypes = array(); + private static $mimetypeIds = array(); + private static $mimetypes = array(); /** * @param \OC\Files\Storage\Storage|string $storage @@ -64,32 +64,32 @@ class Cache { * @return int */ public function getMimetypeId($mime) { - if (empty($this->mimetypeIds)) { + if (empty(self::$mimetypeIds)) { $this->loadMimetypes(); } - if (!isset($this->mimetypeIds[$mime])) { + if (!isset(self::$mimetypeIds[$mime])) { $result = \OC_DB::executeAudited('INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)', array($mime)); - $this->mimetypeIds[$mime] = \OC_DB::insertid('*PREFIX*mimetypes'); - $this->mimetypes[$this->mimetypeIds[$mime]] = $mime; + self::$mimetypeIds[$mime] = \OC_DB::insertid('*PREFIX*mimetypes'); + self::$mimetypes[self::$mimetypeIds[$mime]] = $mime; } - return $this->mimetypeIds[$mime]; + return self::$mimetypeIds[$mime]; } public function getMimetype($id) { - if (empty($this->mimetypes)) { + if (empty(self::$mimetypes)) { $this->loadMimetypes(); } - return isset($this->mimetypes[$id]) ? $this->mimetypes[$id] : null; + return isset(self::$mimetypes[$id]) ? self::$mimetypes[$id] : null; } protected function loadMimetypes(){ $result = \OC_DB::executeAudited('SELECT `id`, `mimetype` FROM `*PREFIX*mimetypes`', array()); while ($result && $row = $result->fetchRow()) { - $this->mimetypeIds[$row['mimetype']] = $row['id']; - $this->mimetypes[$row['id']] = $row['mimetype']; + self::$mimetypeIds[$row['mimetype']] = $row['id']; + self::$mimetypes[$row['id']] = $row['mimetype']; } } |