/**
* @param string $name the name of the runtime folder,
* @throws \Exception
*/
public static function createRuntimeFolders($name = 'runtime')
{
self::output("\n%gBuilding runtime '{$name}' folders.%n");
umask(0);
$directories = Config::value('yiinitializr.app.directories.' . $name);
if (null === $directories) {
throw new \Exception("Unable to find 'yiinitializr.app.directories.{$name}' on the settings.");
}
if (!is_array($directories)) {
$directories = array($directories);
}
foreach ($directories as $directory) {
$runtime = $directory . '/' . $name;
if (!file_exists($runtime)) {
@mkdir($runtime, 02777);
self::output("Your {$name} folder has been created on {$directory}.");
} else {
self::output("'{$name}' %pfolder already exists. No action has been executed.%n");
}
}
self::output("%gRuntime '{$name}' folders creation process finished.%n");
}