![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ledger.corals.io/Corals/core/Foundation/Providers/ |
<?php namespace Corals\Foundation\Providers; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\ServiceProvider; class BaseUpdateModuleServiceProvider extends ServiceProvider { protected $module_code = ''; protected $batches_path = ''; protected $module_public_path = ''; /** * Bootstrap the application services. * * @return void */ public function boot() { app()->booted(function () { $this->coralsBooted(); $this->updatePublicAssets(); \Cache::flush(); }); } /** * @throws \Exception */ protected function coralsBooted() { $batches = []; $files = \File::glob($this->batches_path); foreach ($files as $batch) { $batches[basename($batch, '.php')] = $batch; } \Modules::executeModuleBatches($this->module_code, $batches); } protected function updatePublicAssets() { $filesystem = new Filesystem(); $modulePublicPath = $this->module_public_path; if (!empty($modulePublicPath) && $filesystem->exists($modulePublicPath)) { $filesystem->copyDirectory($modulePublicPath, public_path('/')); } } }