PHP Class Gush\ConfigFactory

Show file Open project: gushphp/gush Class Usage Examples

Public Methods

Method Description
createConfig ( $home = null, string | null $localHome = null ) : Config Create a new Config object using the local filesystem.
dumpToFile ( Config $config, string $type ) : string Dump configuration to the related config-file.
getHomedir ( ) : string Get the home directory of Gush.

Private Methods

Method Description
getFilesystem ( ) : Symfony\Component\Filesystem\Filesystem
loadFileOrEmpty ( string $filename ) : array

Method Details

createConfig() public static method

Note that any missing config file is ignored. When the home directory doesn't exist it's created.
public static createConfig ( $home = null, string | null $localHome = null ) : Config
$localHome string | null Local home directory to load extra configuration from when null this is ignored
return Config

dumpToFile() public static method

The config-file is automatically determined using type.
public static dumpToFile ( Config $config, string $type ) : string
$config Config
$type string
return string

getHomedir() public static method

This checks multiple environment variables: * GUSH_HOME * APPDATA (used by Windows) * HOME
public static getHomedir ( ) : string
return string