summaryrefslogtreecommitdiff
path: root/app/Core/Cache.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-20 12:38:35 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-20 12:38:35 -0400
commitfe57edd9e87832dbd14ea8ffd2dc2f16ac1ceb6f (patch)
treeb8124f61496c9ce6d0d805e83e2818c6746711f9 /app/Core/Cache.php
parent8079b5af64fbebd14a3a0e470bc48bcb4a9bade3 (diff)
Add abstract cache layer
Diffstat (limited to 'app/Core/Cache.php')
-rw-r--r--app/Core/Cache.php58
1 files changed, 0 insertions, 58 deletions
diff --git a/app/Core/Cache.php b/app/Core/Cache.php
deleted file mode 100644
index 670a76e0..00000000
--- a/app/Core/Cache.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-namespace Core;
-
-use Pimple\Container;
-
-abstract class Cache
-{
- /**
- * Container instance
- *
- * @access protected
- * @var \Pimple\Container
- */
- protected $container;
-
- abstract public function init();
- abstract public function set($key, $value);
- abstract public function get($key);
- abstract public function flush();
- abstract public function remove($key);
-
- /**
- * Constructor
- *
- * @access public
- * @param \Pimple\Container $container
- */
- public function __construct(Container $container)
- {
- $this->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;
- }
-}