Example #1
0
 /**
  * @param string $path
  * @return ConfigFile
  * @throws InvalidArgumentException if $path is invalid (can't be read for whatever reason)
  */
 public static function createFromFile($path)
 {
     if (!is_readable($path)) {
         throw new InvalidArgumentException(sprintf("Config-file is not readable: '%s'", $path));
     }
     $configFile = new static();
     $configFile->loadFile($path);
     return $configFile;
 }
Example #2
0
 /**
  * @param string $path
  * @return ConfigFile
  * @throws InvalidArgumentException if $path is invalid (can't be read for whatever reason)
  */
 public static function createFromFile($path)
 {
     $configFile = new static();
     $configFile->loadFile($path);
     return $configFile;
 }