本文整理汇总了PHP中Process::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::execute方法的具体用法?PHP Process::execute怎么用?PHP Process::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @param $cmd
* @param array $processOptions
* @return Process
*/
public function execute($cmd, $processOptions = array())
{
// @todo
// this thing is only there to avoid outputing config commands
// will have to go once #12539 is fixed
if (!(isset($this->options['skip_output']) && preg_match($this->options['skip_output'], $cmd))) {
$this->output(sprintf("[33m-!- %s[0m", $cmd));
}
$full_cmd = sprintf($this->options['format'], $cmd);
$this->output(sprintf("[33m-!- (DEBUG) %s[0m", $full_cmd), Output::SCOPE_DEBUG);
$proc = new Process($full_cmd, array_merge($this->processOptions, $processOptions));
$proc->execute();
return $proc;
}
示例2: Process
<?php
require 'libraries/start.php';
$p = new Process();
// step 1: create config
$p->addStep(1, 'install/config.php', 'install/config-write.php', array(array('config.db.host', Validation::NOT_EMPTY, 'Database Host must not be empty'), array('config.db.host', Validation::STRING, 'Database Host must be a string'), array('config.db.name', Validation::NOT_EMPTY, 'Database Name must not be empty'), array('config.db.name', Validation::STRING, 'Database Name must be a string'), array('config.db.username', Validation::NOT_EMPTY, 'Database Username must not be empty'), array('config.db.username', Validation::STRING, 'Database Username must be a string'), array('config.db.password', Validation::STRING, 'Database Password must be a string'), array('config.user.name', Validation::NOT_EMPTY, 'User Name must not be empty'), array('config.user.name', Validation::STRING, 'User Name must be a string'), array('config.user.email', Validation::NOT_EMPTY, 'E-mail must not be empty'), array('config.user.email', Validation::STRING, 'E-mail must be a string'), array('config.user.email', Validation::EMAIL, 'E-mail must be a valid e-mail address'), array('config.user.address1', Validation::STRING, 'Address 1 must be a string'), array('config.user.address2', Validation::STRING, 'Address 2 must be a string'), array('config.user.city', Validation::STRING, 'City must be a string'), array('config.user.state', Validation::STRING, 'State/Province must be a string'), array('config.user.zip', Validation::STRING, 'Postal Code must be a string'), array('config.user.country', Validation::STRING, 'Country must be a string'), array('config.default_invoice_theme', Validation::STRING, 'Default Invoice Theme must be a string'), array('config.default_receipt_theme', Validation::STRING, 'Default Receipt Theme must be a string'), array('config.default_wage', Validation::NUMERIC, 'Default Wage must be a decimal number')));
// step 2: install sql
$p->addStep(2, 'install/sql.php', 'install/sql-write.php');
// step 3: finished
$p->addStep(3, 'install/finished.php', 'install/finished-redirect.php');
// execute
$p->execute();