Пример #1
0
 /**
  * @param int $id
  * @return array
  */
 public function get($id)
 {
     if (Utils::isBlank($id)) {
         return [];
     }
     if (!is_numeric($id)) {
         return [];
     }
     if (!($data = Cache::get($id, $this->_group))) {
         $data = $this->doScraping($id);
         Cache::save($data, $id, $this->_group);
     }
     return $data;
 }
Пример #2
0
 public function testCache_forgeの戻りインスタンスが異なる()
 {
     $this->assertNotEquals($this->instance1, Cache::forge());
 }
Пример #3
0
 /**
  * Clean cache.
  *
  * @param bool|string $group name of the cache group
  * @return void
  */
 public static function clean($group = FALSE)
 {
     $core = Cache::getInstance();
     $core->clean($group);
 }
Пример #4
0
 public function __construct()
 {
     $config['_id'] = 'Mock';
     $config['_group'] = 'ApiMock';
     $config['_url'] = 'http://jp.finalfantasyxiv.com/lodestone/character/';
     parent::__construct($config);
     Cache::clean($config['_group']);
 }