This commit is contained in:
Paula Quispe
2017-08-10 08:27:16 -04:00
parent 6f79021e89
commit eb3a80f883
2 changed files with 26 additions and 37 deletions

View File

@@ -28,6 +28,26 @@ class System
}
}
/**
* Returns workspace objects from an array of workspace names.
*
* @param array $args an array of workspace names
* @param bool $includeAll if true and no workspace is specified in args,
* returns all available workspaces
* @return array of workspace objects
*/
public static function getWorkspacesFromArgs($args, $includeAll = true)
{
$workspaces = array();
foreach ($args as $arg) {
$workspaces[] = new \workspaceTools($arg);
}
if (empty($workspaces) && $includeAll) {
$workspaces = \System::listWorkspaces();
}
return $workspaces;
}
/**
* Flush the cache files for the specified workspace.
*