1 | <?php |
||
12 | class backupRun extends Command |
||
13 | { |
||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'tb-backup:run |
||
20 | {--databaseOnly : Only backup configuration database} |
||
21 | {--filesOnly : Only backup uploaded files}'; |
||
22 | |||
23 | /** |
||
24 | * The console command description. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $description = 'Creates a Tech Bench Bacup'; |
||
29 | |||
30 | protected $archive, $bar; |
||
31 | |||
32 | /** |
||
33 | * Create a new command instance. |
||
34 | * |
||
35 | * @return void |
||
|
|||
36 | */ |
||
37 | 2 | public function __construct() |
|
41 | |||
42 | /** |
||
43 | * Execute the console command. |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function handle() |
||
68 | |||
69 | |||
70 | protected function createBackupArchive() |
||
87 | |||
88 | protected function closeBackupArchive() |
||
93 | |||
94 | // Backup stored files |
||
95 | protected function backupFiles() |
||
107 | |||
108 | // Create a MYSQLDUMP of the database |
||
109 | protected function backupDatabase() |
||
121 | |||
122 | // Remove any temporary files |
||
123 | protected function cleanup() |
||
129 | } |
||
130 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.