forked from inhere/php-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCommand.php
More file actions
53 lines (37 loc) · 1.07 KB
/
Copy pathTestCommand.php
File metadata and controls
53 lines (37 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Created by PhpStorm.
* User: inhere
* Date: 2017-02-27
* Time: 18:58
*/
namespace inhere\console\examples;
use inhere\console\Command;
use inhere\console\utils\AnsiCode;
/**
* Class Test
* @package app\console\commands
*/
class TestCommand extends Command
{
public function execute()
{
$this->output->write('hello, this in ' . __METHOD__);
// $this->output->panel($_SERVER, 'Server information', '');
$this->write('this is a message text.', false);
sleep(1);
AnsiCode::make()->cursor(AnsiCode::CURSOR_BACKWARD, 6);
sleep(1);
AnsiCode::make()->cursor(AnsiCode::CURSOR_FORWARD, 3);
sleep(1);
AnsiCode::make()->cursor(AnsiCode::CURSOR_BACKWARD, 2);
sleep(2);
AnsiCode::make()->screen(AnsiCode::CLEAR_LINE, 3);
$this->write('after 2s scroll down 3 row.');
sleep(2);
AnsiCode::make()->screen(AnsiCode::SCROLL_DOWN, 3);
$this->write('after 3s clear screen.');
sleep(3);
AnsiCode::make()->screen(AnsiCode::CLEAR);
}
}