public function init()
    {
        $json = [];
        foreach ($this->dataset as $file) {
            if (!(is_file($file) && is_readable($file))) {
                throw new Exception("File '$file' for dataset not readable.");
            }
            $content = file_get_contents($file);
            $key = pathinfo($file, PATHINFO_FILENAME);
            $json[$key] = json_decode($content, true);
        }

        $this->session->set(self::KEY, $json);
        return $this;
    }
public function init()
    {
        $json = [];
        foreach ($this->dataset as $file) {
            if (!(is_file($file) && is_readable($file))) {
                throw new Exception("File '$file' for dataset not readable.");
            }
            $content = file_get_contents($file);
            $key = pathinfo($file, PATHINFO_FILENAME);
            $json[$key] = json_decode($content, true);
        }

        $this->session->set(self::KEY, $json);
        return $this;
    }
public function init ( ) { $ json = [ ] ; foreach ( $ this -> dataset as $ file ) { if ( ! ( is_file ( $ file ) && is_readable ( $ file ) ) ) { throw new Exception ( "File '$file' for dataset not readable." ) ; } $ content = file_get_contents ( $ file ) ; $ key = pathinfo ( $ file , PATHINFO_FILENAME ) ; $ json [ $ key ] = json_decode ( $ content , true ) ; } $ this -> session -> set ( self :: KEY , $ json ) ; return $ this ; }
Fill the session with default data that are read from files.

@throws Anax\RemServer\Exception when bad configuration.

@return self
Fill the session with default data that are read from files .