123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?php
- namespace ZN\Caching;
- class __USE_STATIC_ACCESS__Cache implements CacheInterface
- {
- //----------------------------------------------------------------------------------------------------
- //
- // Yazar : Ozan UYKUN <ozanbote@windowslive.com> | <ozanbote@gmail.com>
- // Site : www.zntr.net
- // Lisans : The MIT License
- // Telif Hakkı: Copyright (c) 2012-2016, zntr.net
- //
- //----------------------------------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------------------------------
- // Protected Cache
- //----------------------------------------------------------------------------------------------------
- //
- // Sürücü bilgisi
- //
- // @var string
- //
- //----------------------------------------------------------------------------------------------------
- protected $cache;
-
- //----------------------------------------------------------------------------------------------------
- // Construct
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $driver
- // @return bool
- //
- //----------------------------------------------------------------------------------------------------
- public function __construct($driver = '')
- {
- $this->cache = \Driver::run('Cache', $driver);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Call Method
- //----------------------------------------------------------------------------------------------------
- //
- // __call()
- //
- //----------------------------------------------------------------------------------------------------
- use \CallUndefinedMethodTrait;
-
- //----------------------------------------------------------------------------------------------------
- // Driver Method
- //----------------------------------------------------------------------------------------------------
- //
- // driver()
- //
- //----------------------------------------------------------------------------------------------------
- use \DriverMethodTrait;
-
- //----------------------------------------------------------------------------------------------------
- // Error Control
- //----------------------------------------------------------------------------------------------------
- //
- // $error
- // $success
- //
- // error()
- // success()
- //
- //----------------------------------------------------------------------------------------------------
- use \ErrorControlTrait;
-
- //----------------------------------------------------------------------------------------------------
- // Data Manipulation Methods Başlangıç
- //----------------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------------
- // Select
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @return mixed
- //
- //----------------------------------------------------------------------------------------------------
- public function select($key = '')
- {
- return $this->cache->select($key);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Insert
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @param variable $var
- // @param numeric $time
- // @param mixed $expressed
- // @return bool
- //
- //----------------------------------------------------------------------------------------------------
- public function insert($key = '', $var = '', $time = 60, $compressed = false)
- {
- return $this->cache->insert($key, $var, $time, $compressed);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Delete
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @return mixed
- //
- //----------------------------------------------------------------------------------------------------
- public function delete($key = '')
- {
- return $this->cache->delete($key);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Data Manipulation Methods Bitiş
- //----------------------------------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------------------------------
- // Increment Methods Başlangıç
- //----------------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------------
- // Increment
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @param numeric $increment
- // @return void
- //
- //----------------------------------------------------------------------------------------------------
- public function increment($key = '', $increment = 1)
- {
- return $this->cache->increment($key, $increment);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Deccrement
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @param numeric $decrement
- // @return void
- //
- //----------------------------------------------------------------------------------------------------
- public function decrement($key = '', $decrement = 1)
- {
- return $this->cache->decrement($key, $decrement);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Increment Methods Bitiş
- //----------------------------------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------------------------------
- // Info Methods Başlangıç
- //----------------------------------------------------------------------------------------------------
- //----------------------------------------------------------------------------------------------------
- // Info
- //----------------------------------------------------------------------------------------------------
- //
- // @param mixed $info
- // @return mixed
- //
- //----------------------------------------------------------------------------------------------------
- public function info($type = 'user')
- {
- return $this->cache->info($type);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Get Meta Data
- //----------------------------------------------------------------------------------------------------
- //
- // @param string $key
- // @return mixed
- //
- //----------------------------------------------------------------------------------------------------
- public function getMetaData($key = '')
- {
- return $this->cache->getMetaData($key);
- }
-
- //----------------------------------------------------------------------------------------------------
- // Is Supported
- //----------------------------------------------------------------------------------------------------
- //
- // @param void
- // @return bool
- //
- //----------------------------------------------------------------------------------------------------
- public function isSupported()
- {
- return $this->cache->isSupported();
- }
-
- //----------------------------------------------------------------------------------------------------
- // Clean
- //----------------------------------------------------------------------------------------------------
- //
- // @param void
- // @return void
- //
- //----------------------------------------------------------------------------------------------------
- public function clean()
- {
- return $this->cache->clean();
- }
-
- //----------------------------------------------------------------------------------------------------
- // Info Methods Bitiş
- //----------------------------------------------------------------------------------------------------
- }
|