diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-05-12 20:14:48 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-05-12 20:14:48 +0200 |
commit | c5e98652982d0d04b4687f7779d2a0e4f7c936c8 (patch) | |
tree | 8e36b4c8c6c0b1532224ef22dc1199e568fe3e9c /application | |
parent | acbe0e4cd2c3b839a5f6f499eea059977976cdba (diff) |
Hide notice when getting key from memcache
This looks horrible, but gets the job done...
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r-- | application/libraries/MemcacheLibrary.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/application/libraries/MemcacheLibrary.php b/application/libraries/MemcacheLibrary.php index dcc08b942..dc993b7a5 100644 --- a/application/libraries/MemcacheLibrary.php +++ b/application/libraries/MemcacheLibrary.php @@ -90,7 +90,15 @@ class MemcacheLibrary { */ public function get($key) { $this->logDebugMessage(sprintf("%s key requested from memcache", $key)); - return $this->memcachedInstance->get($key); + + // hide notice if server is unreachable + $old_error_level = error_reporting(); + error_reporting($old_error_level & ~E_NOTICE); + + $ret = $this->memcachedInstance->get($key); + + error_reporting($old_error_level); + return $ret; } /** |