1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138:
<?php
namespace Nethgui\System;
class Process extends \Symfony\Component\Process\Process implements ProcessInterface
{
public $log;
public function __construct($command, $input = NULL)
{
parent::__construct($command);
$this->setInput($input);
$this->setTimeout(0);
$this->identifier = md5(uniqid());
$this->log = new \Nethgui\Log\Nullog();
}
public function addArgument($arg)
{
throw new \LogicException(sprintf("%s: %s is not supported", __CLASS__, __FUNCTION__), 1405516178);
}
public function dispose()
{
throw new \LogicException(sprintf("%s: %s is not supported", __CLASS__, __FUNCTION__), 1405516179);
}
public function exec()
{
$this->log->deprecated();
$this->run();
return $this;
}
public function getExitCode()
{
$code = parent::getExitCode();
return $code === NULL ? FALSE : $code;
}
public function getIdentifier()
{
return $this->identifier;
}
public function getOutput()
{
if ($this->isOutputDisabled()) {
$this->log->deprecated();
return '';
}
$output = parent::getOutput();
if($output[strlen($output) - 1] === "\n") {
return substr($output, 0, -1);
}
return $output;
}
public function getOutputArray()
{
$this->log->deprecated();
return explode("\n", $this->getOutput());
}
public function getTimes()
{
throw new \LogicException(sprintf("%s: %s is not supported", __CLASS__, __FUNCTION__), 1405516180);
}
public function isDisposed()
{
throw new \LogicException(sprintf("%s: %s is not supported", __CLASS__, __FUNCTION__), 1405516181);
}
public function kill()
{
$this->log->deprecated();
if ($this->isRunning()) {
$this->stop();
return TRUE;
}
return FALSE;
}
public function readExecutionState()
{
$this->log->deprecated();
$s = $this->getStatus();
if ($s === self::STATUS_READY) {
return self::STATE_NEW;
} elseif ($s === self::STATUS_STARTED) {
return self::STATE_RUNNING;
} elseif ($s === self::STATUS_TERMINATED) {
return self::STATE_EXITED;
}
throw new \RuntimeException(sprintf("%s::%s() unknown execution state: %s", __CLASS__, __FUNCTION__, $s), 1405516182);
}
public function readOutput()
{
$this->log->deprecated();
return $this->getIncrementalOutput();
}
public function setIdentifier($identifier)
{
$this->identifier = $identifier;
return $this;
}
public function setPhpWrapper(\Nethgui\Utility\PhpWrapper $object)
{
return $this;
}
}