本文整理匯總了PHP中yii\helpers\Console::moveCursorUp方法的典型用法代碼示例。如果您正苦於以下問題:PHP Console::moveCursorUp方法的具體用法?PHP Console::moveCursorUp怎麽用?PHP Console::moveCursorUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\helpers\Console
的用法示例。
在下文中一共展示了Console::moveCursorUp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testStripAnsiFormat
public function testStripAnsiFormat()
{
ob_start();
ob_implicit_flush(false);
echo 'a';
Console::moveCursorForward(1);
echo 'a';
Console::moveCursorDown(1);
echo 'a';
Console::moveCursorUp(1);
echo 'a';
Console::moveCursorBackward(1);
echo 'a';
Console::moveCursorNextLine(1);
echo 'a';
Console::moveCursorPrevLine(1);
echo 'a';
Console::moveCursorTo(1);
echo 'a';
Console::moveCursorTo(1, 2);
echo 'a';
Console::clearLine();
echo 'a';
Console::clearLineAfterCursor();
echo 'a';
Console::clearLineBeforeCursor();
echo 'a';
Console::clearScreen();
echo 'a';
Console::clearScreenAfterCursor();
echo 'a';
Console::clearScreenBeforeCursor();
echo 'a';
Console::scrollDown();
echo 'a';
Console::scrollUp();
echo 'a';
Console::hideCursor();
echo 'a';
Console::showCursor();
echo 'a';
Console::saveCursorPosition();
echo 'a';
Console::restoreCursorPosition();
echo 'a';
Console::beginAnsiFormat([Console::FG_GREEN, Console::BG_BLUE, Console::UNDERLINE]);
echo 'a';
Console::endAnsiFormat();
echo 'a';
Console::beginAnsiFormat([Console::xtermBgColor(128), Console::xtermFgColor(55)]);
echo 'a';
Console::endAnsiFormat();
echo 'a';
$ouput = Console::stripAnsiFormat(ob_get_clean());
ob_implicit_flush(true);
// $output = str_replace("\033", 'X003', $ouput );// uncomment for debugging
$this->assertEquals(str_repeat('a', 25), $ouput);
}
示例2: recursiveScan
protected function recursiveScan($path, &$migrations)
{
$path = \Yii::getAlias($path);
$alias = $this->getAliasByPath($path);
echo "Lookup {$alias}\n";
Console::moveCursorUp();
$dir = opendir($path);
while (($file = readdir($dir)) !== false) {
$subpath = $path . DIRECTORY_SEPARATOR . $file;
if (in_array($file, ['.', '..', '.git', 'yiisoft', 'models', 'controllers', 'views', 'components'])) {
continue;
}
if (is_dir($subpath)) {
$this->recursiveScan($subpath, $migrations);
} else {
if (preg_match('/^(m(\\d{6}_\\d{6})_.*?)\\.php$/', $file, $matches) && is_file($subpath)) {
$migrations[$alias][] = $matches[1];
}
}
}
closedir($dir);
Console::clearLine();
return $migrations;
}