diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-11-12 11:36:31 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-11-12 11:36:31 +0000 |
commit | ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd (patch) | |
tree | 45a342e145c7559d88e3e9eac4405835fdce6364 /lib/pinq/Cache.php | |
parent | 77a3e2e20abdb74dc1e872204edc1e0474bbab44 (diff) | |
download | www-ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd.tar www-ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd.tar.gz www-ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd.tar.bz2 www-ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd.tar.xz www-ce07e3d3f4cd90bedd0107d8b4b1bf07d29d0afd.zip |
reorg code, license headers
Diffstat (limited to 'lib/pinq/Cache.php')
-rw-r--r-- | lib/pinq/Cache.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/pinq/Cache.php b/lib/pinq/Cache.php new file mode 100644 index 000000000..8a5a3d4d1 --- /dev/null +++ b/lib/pinq/Cache.php @@ -0,0 +1,55 @@ +<?php +/** + * + * PHP version 5.4 + * + * @category Mageia + * @package Mageia\Web\www\Pinq + * @author rda <rda@mageia.org> + * @link http://www.mageia.org/ + * + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2+ + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License aspublished by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. +*/ + +abstract class Pinq_Cache +{ + abstract public function __construct(); + + /** + * @param string $key + * + * @return mixed + */ + abstract public function get($key); + + /** + * @param mixed $value + * @param string $key + * @param integer $timeout + */ + abstract public function set($value, $key, $timeout = 0); +} + +class Pinq_Memcache_Cache extends Pinq_Cache +{ + + public function __construct($timeout = 0) + { + $this->timeout = $timeout; + } + + public function get($key) + { + + } + + public function set($value, $key, $timeout = 0) + { + $timeout = $timeout > 0 ? $timeout : $this->timeout; + } +}
\ No newline at end of file |