diff options
author | devianl2 <devianleong@gmail.com> | 2022-02-13 21:07:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-13 21:07:28 +0800 |
commit | 4a71aee0ab56a8450f5791554d06f544f6be1157 (patch) | |
tree | f899aaab754cf6708a823e33179b7167b3a6b079 /src | |
parent | 88d7940d4db9519c046f8c5375ef092da1daab35 (diff) | |
parent | 4a36318e1ba5b5d50afe0a7991168df26945f52d (diff) |
Merge pull request #11 from KhaledLela/handle_publish_translations3.0.2
Handle publish translations for scorm runtime exceptions handler
Diffstat (limited to 'src')
-rw-r--r-- | src/ScormServiceProvider.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ScormServiceProvider.php b/src/ScormServiceProvider.php index 1806775..b50adc4 100644 --- a/src/ScormServiceProvider.php +++ b/src/ScormServiceProvider.php @@ -13,7 +13,7 @@ class ScormServiceProvider extends ServiceProvider { public function register() { - $this->app->bind('scorm-manager', function($app) { + $this->app->bind('scorm-manager', function ($app) { return new ScormManager(); }); } @@ -23,19 +23,24 @@ class ScormServiceProvider extends ServiceProvider $this->offerPublishing(); } - protected function offerPublishing() { + protected function offerPublishing() + { // function not available and 'publish' not relevant in Lumen - if (! function_exists('config_path')) { + if (!function_exists('config_path')) { return; } $this->publishes([ - __DIR__.'/../config/scorm.php' => config_path('scorm.php'), + __DIR__ . '/../config/scorm.php' => config_path('scorm.php'), ], 'config'); $this->publishes([ - __DIR__.'/../database/migrations/create_scorm_tables.php.stub' => $this->getMigrationFileName('create_scorm_tables.php'), + __DIR__ . '/../database/migrations/create_scorm_tables.php.stub' => $this->getMigrationFileName('create_scorm_tables.php'), ], 'migrations'); + + $this->publishes([ + __DIR__ . '/../resources/lang/en-US/scorm.php' => resource_path('lang/en-US/scorm.php'), + ]); } /** @@ -49,14 +54,14 @@ class ScormServiceProvider extends ServiceProvider $filesystem = $this->app->make(Filesystem::class); - return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) + return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR) ->flatMap(function ($path) use ($filesystem) { - return $filesystem->glob($path.'*_create_scorm_tables.php'); - })->push($this->app->databasePath()."/migrations/{$timestamp}_create_scorm_tables.php") + return $filesystem->glob($path . '*_create_scorm_tables.php'); + })->push($this->app->databasePath() . "/migrations/{$timestamp}_create_scorm_tables.php") ->flatMap(function ($path) use ($filesystem, $migrationFileName) { - return $filesystem->glob($path.'*_'.$migrationFileName); + return $filesystem->glob($path . '*_' . $migrationFileName); }) - ->push($this->app->databasePath()."/migrations/{$timestamp}_{$migrationFileName}") + ->push($this->app->databasePath() . "/migrations/{$timestamp}_{$migrationFileName}") ->first(); } } |