2020-07-07 21:28:18 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
2022-06-09 11:12:28 -04:00
|
|
|
use App\Console\Commands\WorkCommand;
|
2020-08-10 17:11:55 -04:00
|
|
|
use App\Log\LogManager;
|
2022-06-09 11:12:28 -04:00
|
|
|
use Illuminate\Queue\Worker;
|
2020-08-10 17:11:55 -04:00
|
|
|
use Illuminate\Support\Facades\App;
|
2020-07-07 21:28:18 -04:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
2020-08-10 17:11:55 -04:00
|
|
|
|
2020-07-07 21:28:18 -04:00
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
2025-03-27 12:06:06 +00:00
|
|
|
$this->app->bind(\Illuminate\Contracts\Foundation\MaintenanceMode::class, \Illuminate\Foundation\MaintenanceModeManager::class);
|
|
|
|
|
|
2022-06-09 11:12:28 -04:00
|
|
|
$this->app->bind(WorkCommand::class, function ($app) {
|
|
|
|
|
$isDownForMaintenance = function () {
|
|
|
|
|
return $this->app->isDownForMaintenance();
|
|
|
|
|
};
|
|
|
|
|
return new WorkCommand(App::make(Worker::class, ['isDownForMaintenance' => $isDownForMaintenance]), $app['cache.store']);
|
2020-08-10 17:11:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$this->app->singleton('log', function ($app) {
|
|
|
|
|
return new LogManager($app);
|
|
|
|
|
});
|
2020-07-07 21:28:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
|
|
|
|
//is important for propel sql query builder
|
|
|
|
|
setlocale(LC_NUMERIC, 'C');
|
|
|
|
|
}
|
|
|
|
|
}
|