Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2013-09-23 06:22:31 +0400
committerThomas Steur <thomas.steur@gmail.com>2013-09-23 06:22:31 +0400
commit3c29271c428405fea4dee4279e4bc806d65d2f17 (patch)
tree81e5639810fbcc037e1e26325abdd9e8bebf3ca1 /core
parent1c805ec435aea2c18d83451eb682071ab0e9171b (diff)
throw exception in case someone wants to cache an object
Diffstat (limited to 'core')
-rw-r--r--core/CacheFile.php4
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";