芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/vendor/codeception/codeception/ext/RunProcess.php
0]; protected static $events = [ Events::SUITE_BEFORE => 'runProcess', Events::SUITE_AFTER => 'stopProcess' ]; private $processes = []; public function _initialize() { if (!class_exists('Symfony\Component\Process\Process')) { throw new ExtensionException($this, 'symfony/process package is required'); } } public function runProcess() { $this->processes = []; foreach ($this->config as $key => $command) { if (!$command) { continue; } if (!is_int($key)) { continue; // configuration options } if (method_exists(Process::class, 'fromShellCommandline')) { //Symfony 4.2+ $process = Process::fromShellCommandline($command, $this->getRootDir(), null, null, null); } else { $process = new Process($command, $this->getRootDir(), null, null, null); } $process->start(); $this->processes[] = $process; $this->output->debug('[RunProcess] Starting '.$command); } sleep($this->config['sleep']); } public function __destruct() { $this->stopProcess(); } public function stopProcess() { foreach (array_reverse($this->processes) as $process) { /** @var $process Process **/ if (!$process->isRunning()) { continue; } $this->output->debug('[RunProcess] Stopping ' . $process->getCommandLine()); $process->stop(); } $this->processes = []; } /** * Disable the deserialization of the class to prevent attacker executing * code by leveraging the __destruct method. * * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection */ public function __sleep() { throw new \BadMethodCallException('Cannot serialize ' . __CLASS__); } /** * Disable the deserialization of the class to prevent attacker executing * code by leveraging the __destruct method. * * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection */ public function __wakeup() { throw new \BadMethodCallException('Cannot unserialize ' . __CLASS__); } }