From 3076ba22dd8346725b4e1ad757532c00df5b18d9 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 2 Jan 2015 17:19:13 -0500 Subject: Fix bugs, improve perfs and use SimpleLogger instead of Monolog --- app/Core/Cache.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 app/Core/Cache.php (limited to 'app/Core/Cache.php') diff --git a/app/Core/Cache.php b/app/Core/Cache.php new file mode 100644 index 00000000..670a76e0 --- /dev/null +++ b/app/Core/Cache.php @@ -0,0 +1,58 @@ +container = $container; + $this->init(); + } + + /** + * Proxy cache + * + * Note: Arguments must be scalar types + * + * @access public + * @param string $container Container name + * @param string $method Container method + * @return mixed + */ + public function proxy($container, $method) + { + $args = func_get_args(); + $key = 'proxy_'.implode('_', $args); + $result = $this->get($key); + + if ($result === null) { + $result = call_user_func_array(array($this->container[$container], $method), array_splice($args, 2)); + $this->set($key, $result); + } + + return $result; + } +} -- cgit v1.2.3