forked from inhere/php-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationInterface.php
More file actions
54 lines (45 loc) · 1.25 KB
/
Copy pathApplicationInterface.php
File metadata and controls
54 lines (45 loc) · 1.25 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
54
<?php
/**
* Created by PhpStorm.
* User: inhere
* Date: 2017-08-14
* Time: 16:51
*/
namespace Inhere\Console\Base;
/**
* Interface ApplicationInterface
* @package Inhere\Console
*/
interface ApplicationInterface
{
// event name list
const ON_BEFORE_RUN = 'beforeRun';
const ON_AFTER_RUN = 'afterRun';
const ON_RUN_ERROR = 'runError';
const ON_STOP_RUN = 'stopRun';
const ON_NOT_FOUND = 'notFound';
/**
* @param bool $exit
*/
public function run($exit = true);
public function stop($code = 0);
/**
* run a independent command
* @param string $name
* @param bool $believable
* @return mixed
*/
public function runCommand($name, $believable = false);
/**
* run a controller's action
* @param string $name Controller name
* @param string $action Command
* @param bool $believable The `$name` is believable
* @param bool $standAlone
* @return mixed
*/
public function runAction($name, $action, $believable = false, $standAlone = false);
public function controller(string $name, string $controller = null);
public function command(string $name, $handler = null, $description = null);
public function showCommandList($quit = true);
}