1 | <?php |
||
22 | class Backup extends Command |
||
23 | { |
||
24 | /** |
||
25 | * The console command name. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $name = 'phpbu:backup'; |
||
30 | |||
31 | /** |
||
32 | * The console command description. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $description = 'Execute the backup'; |
||
37 | |||
38 | /** |
||
39 | * phpbu App runner. |
||
40 | * |
||
41 | * @var \phpbu\App\Runner |
||
42 | */ |
||
43 | private $runner; |
||
44 | |||
45 | /** |
||
46 | * @var \phpbu\Laravel\Configuration\Proxy |
||
47 | */ |
||
48 | private $configProxy; |
||
49 | |||
50 | /** |
||
51 | * Constructor. |
||
52 | * |
||
53 | * @param \phpbu\App\Runner $runner Runner to execute the backups |
||
54 | * @param \phpbu\Laravel\Configuration\Proxy $configProxy Laravel configuration proxy |
||
55 | */ |
||
56 | 3 | public function __construct(Runner $runner, Proxy $configProxy) |
|
63 | |||
64 | /** |
||
65 | * Execute the console command. |
||
66 | * |
||
67 | * @throws \Exception |
||
68 | * @return bool |
||
69 | */ |
||
70 | 3 | public function fire() |
|
82 | |||
83 | /** |
||
84 | * @throws \Exception |
||
85 | * @return bool |
||
86 | */ |
||
87 | 3 | public function handle() |
|
91 | |||
92 | /** |
||
93 | * Creates a phpbu configuration. |
||
94 | * |
||
95 | * @return \phpbu\App\Configuration |
||
96 | */ |
||
97 | 3 | protected function createConfiguration() |
|
116 | |||
117 | /** |
||
118 | * Make sure we have a valid configuration. |
||
119 | * |
||
120 | * @throws \phpbu\Laravel\Configuration\Exception |
||
121 | */ |
||
122 | 2 | protected function validateConfig() |
|
138 | |||
139 | /** |
||
140 | * Create a logger/printer to do some output. |
||
141 | * |
||
142 | * @return \phpbu\Laravel\Cmd\Printer |
||
143 | */ |
||
144 | 2 | protected function createPrinter() |
|
151 | |||
152 | /** |
||
153 | * Get the console command options. |
||
154 | * |
||
155 | * @return array |
||
156 | */ |
||
157 | 3 | protected function getOptions() |
|
165 | } |
||
166 |