|
| $name = 'snipeit:backup' |
|
| $description = 'This command creates a database dump and zips up all of the uploaded files in the upload directories.' |
|
Definition at line 7 of file SystemBackup.php.
App\Console\Commands\SystemBackup::__construct |
( |
| ) |
|
Create a new command instance.
- Returns
- void
Definition at line 28 of file SystemBackup.php.
30 parent::__construct();
App\Console\Commands\SystemBackup::fire |
( |
| ) |
|
Execute the console command.
- Returns
- mixed
Definition at line 38 of file SystemBackup.php.
41 $files[
'avatars'] = glob(public_path().
'/uploads/avatars/*');
42 $files[
'models'] = glob(public_path().
'/uploads/models/*');
43 $files[
'suppliers'] = glob(public_path().
'/uploads/suppliers/*');
44 $files[
'private_uploads'] = glob(config(
'app.private_uploads').
'/*');
45 $base_filename = date(
'Ymdgis');
46 $zip_file = config(
'app.private_uploads').
'/backups/zips/'.$base_filename.
'-backup.zip';
47 $db_dump = config(
'app.private_uploads').
'/backups/sql/'.$base_filename.
'-db.sql';
48 $this->call(
'db:backup', array(
'filename' => $db_dump));
53 Zipper::make($zip_file)
54 ->folder(
'avatars')->add($files[
'avatars'])
55 ->folder(
'models')->add($files[
'models'])
56 ->folder(
'suppliers')->add($files[
'suppliers'])
57 ->folder(
'private_uploads')->add($files[
'private_uploads'])
58 ->folder(
'database')->add($db_dump)->close();
60 $this->info(
'Backup file created at '.$zip_file);
61 $this->info(
'Removing SQL dump at '.$db_dump);
App\Console\Commands\SystemBackup::$description = 'This command creates a database dump and zips up all of the uploaded files in the upload directories.' |
|
protected |
App\Console\Commands\SystemBackup::$name = 'snipeit:backup' |
|
protected |
The documentation for this class was generated from the following file: