本文整理汇总了PHP中Command::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::run方法的具体用法?PHP Command::run怎么用?PHP Command::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::run方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upMigration
public function upMigration()
{
echo PHP_EOL;
Command::run(array('migrate:install'));
echo PHP_EOL;
Command::run(array('migrate'));
}
示例2: exec
public function exec(Command $cmd)
{
$match = NULL;
// Get clear shell for work
while (true) {
switch (expect_expectl($this->__stream, array(array("(.*)[\$|#][ ]\$", SHELL, EXP_REGEXP)), $match)) {
case SHELL:
$cmd->run($this);
return $this;
// Chain of commands
break 2;
case EXP_EOF:
case EXP_FULLBUFFER:
break 2;
case EXP_TIMEOUT:
throw new \Exception("Connection time out");
break 2;
default:
throw new \Exception("Error has occurred!");
break 2;
}
}
return false;
}
示例3: createAdmin
public static function createAdmin($username, $password)
{
echo "Publishing Bundle..." . PHP_EOL;
Command::run(array('bundle:publish'));
echo "Registering administrator..." . PHP_EOL;
Command::run(array('admin::setup', $username, $password));
}
示例4: getopt
<?php
if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) {
date_default_timezone_set(@date_default_timezone_get());
}
require_once 'bootstrap.php';
$shortopts = 'dluce:m:p:r:h:';
$options = getopt($shortopts);
if (isset($options['e'])) {
$command = new Command($options);
$command->run();
} else {
CommandHelper::runHelp();
}
示例5: startTime
{
$this->startTime();
for ($x = 0; $x < 100000; $x++) {
new \Congow\Orient\Query\Command\Credential\Grant('OMN');
}
$this->stop();
$this->output();
}
protected function startTime()
{
$this->time = microtime(true);
}
protected function stop()
{
$this->elapsed = microtime(true) - $this->time;
}
protected function output()
{
echo "Elapsed: \n{$this->elapsed}\n";
}
}
$benchmark = new Command();
$benchmark->run();
示例6: catch
<?php
/*
* Knee framework
* Назначение: Работа с командной строкой
*/
namespace Knee\CLI;
try {
Command::run($_SERVER['argv']);
} catch (\Exception $e) {
echo $e->getMessage();
}
echo PHP_EOL;
示例7: main
/**
* Main entry
*/
public static function main()
{
$oCommand = new Command();
return $oCommand->run($_SERVER['argv']);
}