本文整理汇总了PHP中Container::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::run方法的具体用法?PHP Container::run怎么用?PHP Container::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ArgParser
#!/usr/bin/php
<?php
$argParser = new ArgParser();
$command = $argParser->getCommand();
if ($command == ArgParser::CMD_START) {
Container::checkDocker();
foreach (Framework::getFrameworks() as $framework) {
$container = new Container($framework);
$container->run();
}
} else {
if ($command == ArgParser::CMD_STOP) {
Container::checkDocker();
foreach (Framework::getFrameworks() as $framework) {
$container = new Container($framework);
$container->stop();
}
} else {
if ($command == ArgParser::CMD_BENCHMARK) {
out("Doing " . Benchmark::NUMBER_OF_CALLS . " calls per framework. Displaying averages.");
foreach (Framework::getFrameworks() as $framework) {
$benchmark = new Benchmark($framework);
$benchmark->run()->outputTimes();
}
} else {
out("== Available commands: ==");
out(ArgParser::CMD_BENCHMARK);
out(ArgParser::CMD_START);
out(ArgParser::CMD_STOP);
}
}
示例2: implode
$this->formatter($ok, 'Version Control', implode(', ', $availableVcs), 'This only checks for subversion, git, and mercurial as they are the most common. I recommend git. You may safely ignore this check if you\'re using somethign else, but you *should* be using something.');
}
public function checkKernel()
{
$availableVcs = [];
$kernel = strtolower(php_uname('s'));
$ok = $kernel == 'darwin' || $kernel == 'linux';
$this->formatter($ok, 'Kernel', $kernel, 'If you are not running on linux or osx, you\'re in uncharted territory. If on windows, you should probably look into cygwin or setting up some kind of unix-like environment on your machine.');
}
public function checkCaseSensitive()
{
$ok = !(file_exists(strtoupper(__FILE__)) && file_exists(strtolower(__FILE__)));
$caseSensitive = true;
$this->formatter($ok, 'FS Case Sensitive', $ok ? 'Sensitive' : 'Insensitive', 'Your current filesystem appears to be case-insensitive, which may lead to problems if you deploy your code to a case-sensitive production server.');
}
}
Container::addTask(new SystemReport());
# load additional tasks from the project directories, if we're in a valid project
Container::findTasks();
# Determine what the task we're trying to run is
# the first element of the array is simply this filename, so get rid of it right away
array_shift($argv);
# Determine if a task is being passed. If not, default to 'usage'
if (count($argv) > 0) {
$task = array_shift($argv);
} else {
$task = 'usage';
}
# run the task and exit.
Container::run($task, $argv);
exit;