本文整理汇总了PHP中Symfony\Component\Process\Process::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::__construct方法的具体用法?PHP Process::__construct怎么用?PHP Process::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Process\Process
的用法示例。
在下文中一共展示了Process::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($port, $host)
{
$this->port = $port;
$this->host = $host;
parent::__construct(sprintf('exec php -dalways_populate_raw_post_data=-1 -derror_log= -S %s -t public/ public/index.php', $this->getConnectionString()), __DIR__ . '/../../../../');
$this->setTimeout(null);
}
示例2: __construct
public function __construct($script, $duration)
{
$this->script = $script;
$this->initialDuration = $duration;
$this->enableOutput();
parent::__construct($script, null, null, null, null, []);
}
示例3: __construct
/**
* @param string $script Passed to php binary
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
* @param array|null $env The environment variables or null to inherit
* @param int|float|null $timeout The timeout in seconds or null to disable
*/
public function __construct($script, $cwd = null, array $env = null, $timeout = null)
{
// By telling PHP to log errors without having a log file, PHP will write
// errors to STDERR in a specific format (each line is prefixed with PHP).
$commandline = sprintf('php -d log_errors=1 -d error_log=NULL %s', $script);
parent::__construct($commandline, $cwd, $env, null, $timeout);
}
示例4: __construct
/**
* ScenarioProcess constructor.
*
* @param ScenarioInfo $scenarioInfo
* @param null|string $commandline
* @param null $cwd
* @param array|null $env
* @param null $input
* @param int $timeout
* @param array $options
*/
public function __construct(ScenarioInfo $scenarioInfo, $commandline, $cwd = null, array $env = null, $input = null, $timeout = 0, array $options = array())
{
$this->scenarioInfo = $scenarioInfo;
$this->commandLine = $commandline;
$this->optionCollection = new ProcessOptionCollection();
parent::__construct($this->getCommandLineWithOptions(), $cwd, $env, $input, $timeout, $options);
}
示例5: prepare
public function prepare(BehatWrapper $behat, BehatCommand $command, $cwd = null)
{
// Build the command line options, flags, and arguments.
$binary = ProcessUtils::escapeArgument($behat->getBehatBinary());
$commandLine = rtrim($binary . ' ' . $command->getCommandLine());
parent::__construct($commandLine, $cwd, null, null, $behat->getTimeout(), array());
}
示例6: __construct
public function __construct(Container $container, Container $parent = null)
{
$cmd = 'lxc-info -s -n ' . $container->getName();
if (!empty($parent)) {
$cmd = 'lxc-attach -n ' . $parent->getName() . ' -- ' . $cmd;
}
parent::__construct($cmd);
}
示例7: __construct
/**
* Constructor.
*
* @param string $script The PHP script to run (as a string)
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
* @param int $timeout The timeout in seconds
* @param array $options An array of options for proc_open
*/
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = array())
{
$executableFinder = new PhpExecutableFinder();
if (false === ($php = $executableFinder->find())) {
$php = null;
}
parent::__construct($php, $cwd, $env, $script, $timeout, $options);
}
示例8: __construct
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();
}
示例9: __construct
public function __construct($profileName, $profileVersion, $downloadHost = null)
{
$cmd = 'rprofmgr profile:download-version --profile-version=' . escapeshellarg($profileVersion);
if (!empty($downloadHost)) {
$cmd .= ' --download-host=' . escapeshellarg($downloadHost);
}
$cmd .= ' ' . escapeshellarg($profileName);
parent::__construct($cmd);
}
示例10: __construct
/**
* Use the Builder to create a environment process
*/
public function __construct($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array())
{
$env = array_replace(array('USERPROFILE' => getenv('HOME')), (array) $env);
$inherits = array('PATH', 'SystemRoot', 'LOCALAPPDATA', 'SystemDrive', 'SSH_AUTH_SOCK', 'CommonProgramFiles', 'APPDATA', 'COMPUTERNAME', 'TEMP', 'TMP', 'USERNAME', 'PHPRC', 'PHP_PEAR_BIN_DIR', 'PHP_PEAR_PHP_BIN', 'PSC_CMS', 'XDEBUG_CONFIG', 'WEBFORGE');
foreach ($inherits as $inherit) {
$env[$inherit] = getenv($inherit);
}
parent::__construct($commandline, $cwd, $env, $stdin, $timeout, $options);
}
示例11: __construct
/**
* @param GitWrapper $gitWrapper
* @param GitCommand $gitCommand
*/
public function __construct(GitWrapper $gitWrapper, GitCommand $gitCommand)
{
$commandLine = ProcessUtils::escapeArgument($gitWrapper->getGitBinary()) . ' ' . $gitCommand->getCommandLine();
$directory = realpath($gitCommand->getDirectory());
$envVars = null;
$wrapperEnvVars = $gitWrapper->getEnvVars();
if (!empty($wrapperEnvVars)) {
$envVars = array_merge($_ENV, $_SERVER, $wrapperEnvVars);
}
parent::__construct($commandLine, $directory, $envVars, null, $gitCommand->getTimeout());
}
示例12: __construct
/**
* @param CommandLine $commandLine
* @param ProcessEnvironment $processEnvironment
* @param int|float|null $timeout
* @param string|null $cwd
*/
public function __construct(CommandLine $commandLine, ProcessEnvironment $processEnvironment, $timeout = null, $cwd = null)
{
$this->processEnvironment = $processEnvironment;
parent::__construct((string) $commandLine, $cwd, $this->processEnvironment->exportToEnvsArray());
if ($timeout) {
$this->setTimeout($timeout);
// compatibility to SF 2.2
if (method_exists($this, 'setIdleTimeout')) {
$this->setIdleTimeout($timeout);
}
}
}
示例13: __construct
/**
* Constructor.
*
* @param Console $console The console
* @param string $command The command line to run
* @param string|null $cwd The working directory or null to use the
* working dir of the current PHP process
*/
public function __construct(Console $console, $command, $cwd = null)
{
$this->console = $console;
if (is_string($command)) {
$command = trim($command);
} elseif (is_array($command)) {
$command = implode('; ', $command);
} else {
throw new \Netresearch\Kite\Exception('Command must be string or array, ' . gettype($command) . ' given.', 1312454906);
}
parent::__construct($command, $cwd, null, null, null);
}
示例14: __construct
public function __construct($cmd, $cwd = null, $identityfile = null, $passphrase = null, $timeout = 180)
{
if (!empty($passphrase)) {
$command = base_path() . '/scripts/git.sh -i ' . $identityfile . ' ' . $cmd;
$commandline = $this->expectWithPassphrase($command, $passphrase, $timeout);
} elseif (!empty($identityfile)) {
$command = base_path() . '/scripts/git.sh -i ' . $identityfile . ' ' . $cmd;
$commandline = $this->expect($command, $timeout);
} else {
$command = $cmd;
$commandline = $this->expect($cmd, $timeout);
}
parent::__construct($commandline, $cwd);
}
示例15: __construct
/**
* Constructor.
*
* @param string $script The PHP script to run (as a string)
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
* @param int $timeout The timeout in seconds
* @param array $options An array of options for proc_open
*/
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = array())
{
$executableFinder = new PhpExecutableFinder();
if (false === ($php = $executableFinder->find())) {
$php = null;
}
if ('phpdbg' === PHP_SAPI) {
$file = tempnam(sys_get_temp_dir(), 'dbg');
file_put_contents($file, $script);
register_shutdown_function('unlink', $file);
$php .= ' ' . ProcessUtils::escapeArgument($file);
$script = null;
}
parent::__construct($php, $cwd, $env, $script, $timeout, $options);
}