2010-12-16 20:36:29 +00:00
|
|
|
<?php
|
2011-01-14 23:11:13 +00:00
|
|
|
|
|
|
|
|
/* Get the size of the terminal (only works on Linux, on Windows it's always 80) */
|
2017-08-14 16:13:46 -04:00
|
|
|
|
|
|
|
|
use ProcessMaker\Core\System;
|
|
|
|
|
|
2011-01-14 23:11:13 +00:00
|
|
|
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a |grep columns')), $output);
|
2017-08-10 08:27:16 -04:00
|
|
|
if (sizeof($output) == 3 && isset($output[2]) && isset($output[2][0])) {
|
|
|
|
|
define("COLUMNS", $output[2][0]);
|
2011-01-14 23:11:13 +00:00
|
|
|
} else {
|
2017-08-10 08:27:16 -04:00
|
|
|
define("COLUMNS", 80);
|
2011-01-14 23:11:13 +00:00
|
|
|
}
|
|
|
|
|
|
2010-12-16 20:36:29 +00:00
|
|
|
/**
|
2011-01-27 15:04:37 +00:00
|
|
|
* Returns workspace objects from an array of workspace names.
|
2010-12-16 20:36:29 +00:00
|
|
|
*
|
2011-01-27 15:04:37 +00:00
|
|
|
* @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
|
2010-12-16 20:36:29 +00:00
|
|
|
*/
|
2017-08-10 08:27:16 -04:00
|
|
|
function get_workspaces_from_args($args, $includeAll = true)
|
|
|
|
|
{
|
|
|
|
|
return \ProcessMaker\Util\System::getWorkspacesFromArgs($args, $includeAll);
|
2010-12-16 20:36:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|