diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-09-23 06:22:31 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-09-23 06:22:31 +0400 |
commit | 3c29271c428405fea4dee4279e4bc806d65d2f17 (patch) | |
tree | 81e5639810fbcc037e1e26325abdd9e8bebf3ca1 /core | |
parent | 1c805ec435aea2c18d83451eb682071ab0e9171b (diff) |
throw exception in case someone wants to cache an object
Diffstat (limited to 'core')
-rw-r--r-- | core/CacheFile.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/CacheFile.php b/core/CacheFile.php index 4aa8dd5d0a..139beeaffc 100644 --- a/core/CacheFile.php +++ b/core/CacheFile.php @@ -128,6 +128,10 @@ class CacheFile $id = $this->cachePath . $id . '.php'; + if (is_object($content)) { + throw new \Exception('You cannot use the CacheFile to cache an object, only arrays, strings and numbers.'); + } + $cache_literal = "<" . "?php\n"; $cache_literal .= "$" . "content = " . var_export($content, true) . ";\n"; $cache_literal .= "$" . "expires_on = " . $this->getExpiresTime() . ";\n"; |