本文整理汇总了PHP中Terminus::isTest方法的典型用法代码示例。如果您正苦于以下问题:PHP Terminus::isTest方法的具体用法?PHP Terminus::isTest怎么用?PHP Terminus::isTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terminus
的用法示例。
在下文中一共展示了Terminus::isTest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Instantiates object, sets cache and session
*
* @return [TerminusCommand] $this
*/
public function __construct()
{
//Load commonly used data from cache
$this->cache = Terminus::getCache();
$this->logger = Terminus::getLogger();
$this->outputter = Terminus::getOutputter();
$this->session = Session::instance();
if (!Terminus::isTest()) {
$this->checkForUpdate();
}
}
示例2: testIsTest
public function testIsTest()
{
$this->assertTrue(Terminus::isTest());
}
示例3: launchSelf
/**
* Launch another Terminus command using the runtime arguments for the
* current process
*
* @param string $command Command to call
* @param array $args Positional arguments to use
* @param array $assoc_args Associative arguments to use
* @param bool $exit_on_error True to exit if the command returns error
* @return int The command exit status
*/
public static function launchSelf($command, $args = array(), $assoc_args = array(), $exit_on_error = true)
{
$reused_runtime_args = array('path', 'url', 'user', 'allow-root');
foreach ($reused_runtime_args as $key) {
if (array_key_exists($key, self::getRunner()->config)) {
$assoc_args[$key] = self::getRunner()->config[$key];
}
}
if (Terminus::isTest()) {
$script_path = __DIR__ . '/boot-fs.php';
} else {
$script_path = $GLOBALS['argv'][0];
}
$php_bin = '"' . self::getPhpBinary() . '"';
$script_path = '"' . $script_path . '"';
$escaped_args = array_map('escapeshellarg', $args);
$args = implode(' ', $escaped_args);
$assoc_args = Utils\assocArgsToStr($assoc_args);
$full_command = "{$php_bin} {$script_path} {$command} {$args} {$assoc_args}";
$status = self::launch($full_command, $exit_on_error);
return $status;
}