private static function loadConfig()
{
// Only load once
if (null !== static::$config) {
return;
}
if (!file_exists(static::$configPath) || !is_readable(static::$configPath)) {
throw new ErrorException('Config file not found or unreadable.');
}
$config = Yaml::parse(file_get_contents(static::$configPath))['tissue'];
if (['you', 'repo'] !== array_keys($config) || ['username', 'password'] !== array_keys($config['you']) || ['author', 'name'] !== array_keys($config['repo'])) {
throw new ErrorException('Invalid config file.');
}
static::$config = $config;
}