Pantheon\Terminus\Config::ensureDirExists PHP Method

ensureDirExists() public method

Ensures a directory exists
public ensureDirExists ( string $name, string $value ) : boolean | null
$name string The name of the config var
$value string The value of the named config var
return boolean | null
    public function ensureDirExists($name, $value)
    {
        if (strpos($name, 'TERMINUS_') !== false && strpos($name, '_DIR') !== false && $value != '~') {
            try {
                $dir_exists = is_dir($value) || !file_exists($value) && @mkdir($value, 0777, true);
            } catch (\Exception $e) {
                return false;
            }
            return $dir_exists;
        }
        return null;
    }