diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 9c83ed10e..78a8a137a 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -2917,5 +2917,32 @@ class Bootstrap return $url; } } - } + /** + * isWinOs + * + * @return true if the 3 first letters of PHP_OS got 'WIN', otherwise false. + */ + function isWinOs() + { + return strtoupper(substr(PHP_OS, 0, 3)) == "WIN"; + } + /** + * isNTOs + * + * @return true if PHP_OS is 'WINNT', otherwise false. + */ + function isNTOs() + { + return PHP_OS == "WINNT"; + } + /** + * isLinuxOs + * + * @return true if PHP_OS (upper text) got 'LINUX', otherwise false. + */ + function isLinuxOs() + { + return strtoupper(PHP_OS) == "LINUX"; + } +} diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index 3d6b0bb8c..5bce04b33 100755 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -384,7 +384,7 @@ function run_workspace_backup($args, $opts) { $filesize = array_key_exists("filesize", $opts) ? $opts['filesize'] : -1; if($filesize >= 0) { - if(!G::isLinuxOs()){ + if(!Bootstrap::isLinuxOs()){ CLI::error("This is not a Linux enviroment, cannot use this filesize [-s] feature.\n"); return; } @@ -429,7 +429,7 @@ function run_workspace_restore($args, $opts) { $multiple = array_key_exists("multiple", $opts); $dstWorkspace = $args[1]; if(!empty($multiple)){ - if(!G::isLinuxOs()){ + if(!Bootstrap::isLinuxOs()){ CLI::error("This is not a Linux enviroment, cannot use this multiple [-m] feature.\n"); return; }