We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function setupRoutes(Router $router) |
| 46 | 46 | { |
| 47 | - $router->group(['namespace' => 'Backpack\BackupManager\app\Http\Controllers'], function ($router) { |
|
| 47 | + $router->group(['namespace' => 'Backpack\BackupManager\app\Http\Controllers'], function($router) { |
|
| 48 | 48 | require __DIR__.'/app/Http/routes.php'; |
| 49 | 49 | }); |
| 50 | 50 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | private function registerBackupManager() |
| 69 | 69 | { |
| 70 | - $this->app->bind('backupmanager', function ($app) { |
|
| 70 | + $this->app->bind('backupmanager', function($app) { |
|
| 71 | 71 | return new BackupManager($app); |
| 72 | 72 | }); |
| 73 | 73 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -Route::group(['prefix' => 'admin', 'middleware' => ['web', 'auth']], function () { |
|
| 3 | +Route::group(['prefix' => 'admin', 'middleware' => ['web', 'auth']], function() { |
|
| 4 | 4 | |
| 5 | 5 | // Backup |
| 6 | 6 | Route::get('backup', 'BackupController@index'); |
@@ -80,13 +80,11 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | if ($disk->exists($file_name)) { |
| 82 | 82 | return response()->download($storage_path.$file_name); |
| 83 | - } |
|
| 84 | - else |
|
| 83 | + } else |
|
| 85 | 84 | { |
| 86 | 85 | abort(404, trans('backpack::backup.backup_doesnt_exist')); |
| 87 | 86 | } |
| 88 | - } |
|
| 89 | - else |
|
| 87 | + } else |
|
| 90 | 88 | { |
| 91 | 89 | abort(404, trans('backpack::backup.only_local_downloads_supported')); |
| 92 | 90 | } |
@@ -103,8 +101,7 @@ discard block |
||
| 103 | 101 | $disk->delete($file_name); |
| 104 | 102 | |
| 105 | 103 | return 'success'; |
| 106 | - } |
|
| 107 | - else |
|
| 104 | + } else |
|
| 108 | 105 | { |
| 109 | 106 | abort(404, trans('backpack::backup.backup_doesnt_exist')); |
| 110 | 107 | } |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $this->data['backups'] = []; |
| 19 | 19 | |
| 20 | - foreach (config('laravel-backup.backup.destination.disks') as $disk_name) { |
|
| 21 | - $disk = Storage::disk($disk_name); |
|
| 22 | - $adapter = $disk->getDriver()->getAdapter(); |
|
| 23 | - $files = $disk->allFiles(); |
|
| 20 | + foreach (config('laravel-backup.backup.destination.disks') as $disk_name) { |
|
| 21 | + $disk = Storage::disk($disk_name); |
|
| 22 | + $adapter = $disk->getDriver()->getAdapter(); |
|
| 23 | + $files = $disk->allFiles(); |
|
| 24 | 24 | |
| 25 | 25 | // make an array of backup files, with their filesize and creation date |
| 26 | 26 | foreach ($files as $k => $f) { |
@@ -49,14 +49,14 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | try { |
| 51 | 51 | ini_set('max_execution_time', 300); |
| 52 | - // start the backup process |
|
| 53 | - Artisan::call('backup:run'); |
|
| 52 | + // start the backup process |
|
| 53 | + Artisan::call('backup:run'); |
|
| 54 | 54 | $output = Artisan::output(); |
| 55 | 55 | |
| 56 | - // log the results |
|
| 57 | - Log::info("Backpack\BackupManager -- new backup started from admin interface \r\n".$output); |
|
| 58 | - // return the results as a response to the ajax call |
|
| 59 | - echo $output; |
|
| 56 | + // log the results |
|
| 57 | + Log::info("Backpack\BackupManager -- new backup started from admin interface \r\n".$output); |
|
| 58 | + // return the results as a response to the ajax call |
|
| 59 | + echo $output; |
|
| 60 | 60 | } catch (Exception $e) { |
| 61 | 61 | Response::make($e->getMessage(), 500); |
| 62 | 62 | } |
@@ -64,47 +64,47 @@ discard block |
||
| 64 | 64 | return 'success'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Downloads a backup zip file. |
|
| 69 | - */ |
|
| 70 | - public function download() |
|
| 71 | - { |
|
| 72 | - $disk = Storage::disk(\Request::input('disk')); |
|
| 73 | - $file_name = \Request::input('file_name'); |
|
| 74 | - $adapter = $disk->getDriver()->getAdapter(); |
|
| 75 | - |
|
| 76 | - if ($adapter instanceof \League\Flysystem\Adapter\Local) { |
|
| 77 | - $storage_path = $disk->getDriver()->getAdapter()->getPathPrefix(); |
|
| 78 | - |
|
| 79 | - if ($disk->exists($file_name)) { |
|
| 80 | - return response()->download($storage_path.$file_name); |
|
| 81 | - } |
|
| 82 | - else |
|
| 83 | - { |
|
| 84 | - abort(404, trans('backpack::backup.backup_doesnt_exist')); |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - else |
|
| 88 | - { |
|
| 89 | - abort(404, trans('backpack::backup.only_local_downloads_supported')); |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * Deletes a backup file. |
|
| 95 | - */ |
|
| 96 | - public function delete($file_name) |
|
| 97 | - { |
|
| 98 | - $disk = Storage::disk(\Request::input('disk')); |
|
| 99 | - |
|
| 100 | - if ($disk->exists($file_name)) { |
|
| 101 | - $disk->delete($file_name); |
|
| 102 | - |
|
| 103 | - return 'success'; |
|
| 104 | - } |
|
| 105 | - else |
|
| 106 | - { |
|
| 107 | - abort(404, trans('backpack::backup.backup_doesnt_exist')); |
|
| 108 | - } |
|
| 109 | - } |
|
| 67 | + /** |
|
| 68 | + * Downloads a backup zip file. |
|
| 69 | + */ |
|
| 70 | + public function download() |
|
| 71 | + { |
|
| 72 | + $disk = Storage::disk(\Request::input('disk')); |
|
| 73 | + $file_name = \Request::input('file_name'); |
|
| 74 | + $adapter = $disk->getDriver()->getAdapter(); |
|
| 75 | + |
|
| 76 | + if ($adapter instanceof \League\Flysystem\Adapter\Local) { |
|
| 77 | + $storage_path = $disk->getDriver()->getAdapter()->getPathPrefix(); |
|
| 78 | + |
|
| 79 | + if ($disk->exists($file_name)) { |
|
| 80 | + return response()->download($storage_path.$file_name); |
|
| 81 | + } |
|
| 82 | + else |
|
| 83 | + { |
|
| 84 | + abort(404, trans('backpack::backup.backup_doesnt_exist')); |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + else |
|
| 88 | + { |
|
| 89 | + abort(404, trans('backpack::backup.only_local_downloads_supported')); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * Deletes a backup file. |
|
| 95 | + */ |
|
| 96 | + public function delete($file_name) |
|
| 97 | + { |
|
| 98 | + $disk = Storage::disk(\Request::input('disk')); |
|
| 99 | + |
|
| 100 | + if ($disk->exists($file_name)) { |
|
| 101 | + $disk->delete($file_name); |
|
| 102 | + |
|
| 103 | + return 'success'; |
|
| 104 | + } |
|
| 105 | + else |
|
| 106 | + { |
|
| 107 | + abort(404, trans('backpack::backup.backup_doesnt_exist')); |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | 110 | } |