/** * @return Requirement\Result */ public function checkRequirements() { $result = new Requirement\Result(); if ($this->commandLine->isToolInstalled($this->cmd)) { $result->setSucess(true); } else { $result->setErrorMessage('command line tool "ps" ist not installed. Please install "ps".'); } return $result; }
/** * @return Requirement\Result */ public function checkRequirements() { $result = new Requirement\Result(); if ($this->getOS() == 'Linux') { $result->setSucess(true); } else { $result->setErrorMessage('this program works only with linux'); } return $result; }
/** * @return Requirement\Result */ public function checkRequirements() { $result = new Requirement\Result(); if (function_exists('posix_getuid')) { $result->setSucess(true); } else { $result->setSucess(false); $result->setErrorMessage('posix extension missing. please install php posix extension'); return $result; } if (posix_getuid() == 0) { $result->setSucess(true); } else { $result->setSucess(false); $result->setErrorMessage('root access required. please execute this script as root.'); } return $result; }
/** * @return Requirement\Result */ public function checkRequirements() { $commandLine = new CommandLine(); $result = new Requirement\Result(); if ($commandLine->isToolInstalled($this->cmd . ' -h')) { $result->setSucess(true); } else { $result->setErrorMessage('command line tool "strace" ist not installed. Please install "strace".'); } if ($result->getSucess()) { if (false === $commandLine->isToolInstalled('tail --help')) { $result->setSucess(false); $result->setErrorMessage('command line tool "tail" is not installed. please install "tail".'); } } if ($result->getSucess()) { if (false === function_exists('pcntl_fork')) { $result->setSucess(false); $result->setErrorMessage('PCNTL extension not found. Please install PHP PCNTL extension. If the extension is installed, check your php.ini if there are some pcntl functions disabled (https://github.com/markus-perl/php-strace/issues/1).'); } } return $result; }