Example #1
0
 public function __construct($file = "channels.json")
 {
     try {
         $this->fDB = new ReadWrite($file, File::MODE_READ_WRITE);
     } catch (\Hoa\File\Exception\FileDoesNotExist $exception) {
         File::create($file, false);
         $this->fDB = new ReadWrite($file, File::MODE_READ_WRITE);
     }
     if ($this->fDB->getSize() > 0) {
         $this->read();
     } else {
         $this->write();
     }
 }