示例#1
0
 /**
  * Object Initialize.
  */
 public function init()
 {
     if ($data = Cache::get($this->_id, $this->_group)) {
         $mapping = $data;
     } else {
         $mappingJson = file_get_contents($this->_mappingFilePath);
         $mapping = JSON::parse($mappingJson);
         Cache::save($mapping, $this->_id, $this->_group);
     }
     $this->setMapping($mapping);
     return $this;
 }
示例#2
0
 public function testJSON_JSONデコード_配列が返る()
 {
     $json = JSON::parse('{"formatted JSON" : 1}');
     $this->assertEquals(["formatted JSON" => 1], $json);
 }