Exemplo n.º 1
0
 /**
  * @param string $filePath
  * @throws Exception
  */
 public function __construct($filePath = '')
 {
     if (!file_exists($filePath)) {
         throw new Exception("Config file dont exists {$filePath}");
     }
     parent::__construct(json_decode(file_get_contents($filePath), true));
 }
Exemplo n.º 2
0
 /**
  * @param string $filePath
  * @throws Exception
  */
 public function __construct($filePath = '')
 {
     if (!file_exists($filePath)) {
         throw new Exception("Config file dont exists {$filePath}");
     }
     parent::__construct(require $filePath);
 }
Exemplo n.º 3
0
 /**
  * Ini constructor.
  * @param string $filePath
  * @throws Exception
  */
 public function __construct($filePath = '')
 {
     if (!file_exists($filePath)) {
         throw new Exception("Config file dont exists {$filePath}");
     }
     $configArray = parse_ini_file(realpath($filePath), true);
     if (isset($configArray[Config::CONFIG_INI_SECTOR])) {
         $configArray = $this->createConfigArray($configArray);
     }
     parent::__construct($configArray);
 }