Skip to content
Snippets Groups Projects
Unverified Commit 4388ec22 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Little bit of code cleanup

parent a6760560
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,7 @@ abstract class Proxy { ...@@ -65,7 +65,7 @@ abstract class Proxy {
static $db; static $db;
static $coreUserManager; static $coreUserManager;
static $coreNotificationManager; static $coreNotificationManager;
if(is_null($fs)) { if($fs === null) {
$ocConfig = \OC::$server->getConfig(); $ocConfig = \OC::$server->getConfig();
$fs = new FilesystemHelper(); $fs = new FilesystemHelper();
$log = new LogWrapper(); $log = new LogWrapper();
...@@ -158,7 +158,7 @@ abstract class Proxy { ...@@ -158,7 +158,7 @@ abstract class Proxy {
*/ */
private function getCacheKey($key) { private function getCacheKey($key) {
$prefix = 'LDAP-Proxy-'; $prefix = 'LDAP-Proxy-';
if(is_null($key)) { if($key === null) {
return $prefix; return $prefix;
} }
return $prefix.md5($key); return $prefix.md5($key);
...@@ -187,16 +187,16 @@ abstract class Proxy { ...@@ -187,16 +187,16 @@ abstract class Proxy {
* @param mixed $value * @param mixed $value
*/ */
public function writeToCache($key, $value) { public function writeToCache($key, $value) {
if(is_null($this->cache)) { if($this->cache === null) {
return; return;
} }
$key = $this->getCacheKey($key); $key = $this->getCacheKey($key);
$value = base64_encode(json_encode($value)); $value = base64_encode(json_encode($value));
$this->cache->set($key, $value, '2592000'); $this->cache->set($key, $value, 2592000);
} }
public function clearCache() { public function clearCache() {
if(is_null($this->cache)) { if($this->cache === null) {
return; return;
} }
$this->cache->clear($this->getCacheKey(null)); $this->cache->clear($this->getCacheKey(null));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment