N98\Magento\Application\ConfigFile::createFromFile PHP Method

createFromFile() public static method

public static createFromFile ( string $path ) : ConfigFile
$path string
return ConfigFile
    public static function createFromFile($path)
    {
        $configFile = new static();
        $configFile->loadFile($path);
        return $configFile;
    }

Usage Example

Esempio n. 1
0
 /**
  * Obtain the (optional) stop-file-config-file, it is placed in the folder of the stop-file, always
  * prefixed with a dot: stop-file-folder/.n98-magerun2.yaml
  *
  * @param string $magerunStopFileFolder
  * @return ConfigFile|null
  */
 public function getStopFileConfigFile($magerunStopFileFolder)
 {
     if (empty($magerunStopFileFolder)) {
         return;
     }
     $stopFileConfigFilePath = $magerunStopFileFolder . '/.' . $this->customConfigFilename;
     if (!file_exists($stopFileConfigFilePath)) {
         return;
     }
     try {
         $stopFileConfigFile = ConfigFile::createFromFile($stopFileConfigFilePath);
         $stopFileConfigFile->applyVariables($this->magentoRootFolder);
     } catch (InvalidArgumentException $e) {
         $stopFileConfigFile = null;
     }
     return $stopFileConfigFile;
 }
All Usage Examples Of N98\Magento\Application\ConfigFile::createFromFile