Пример #1
0
 /**
  * New JSONLoader instance
  *
  * @param string $path          Absolute path to JSON file
  * @param boolean $autoread     [optional] If file shall be autoread
  * @param boolean $autocreate   [optional] If file shall be autocreated if it doesn't exist
  *
  * @throws \Exceptions\JSONLoaderException
  */
 public function __construct($path, $autoread = false, $autocreate = false)
 {
     parent::__construct($path, $autoread, $autocreate);
     if ($this->getContents() === false) {
         throw new \Exceptions\JSONLoaderException($this->getPath());
     }
 }
Пример #2
0
 /**
  * Create Storage instance
  *
  * @param string $name Storage name
  */
 public function __construct($name)
 {
     $this->name = $name;
     parent::__construct(self::StoragePath($this->getName()), false, true);
 }