Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Status/Health.php
<?php | <?php | ||||
namespace App\Console\Commands\Status; | namespace App\Console\Commands\Status; | ||||
use Illuminate\Console\Command; | use Illuminate\Console\Command; | ||||
use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||
use Illuminate\Support\Facades\Redis; | use Illuminate\Support\Facades\Redis; | ||||
use App\Backends\LDAP; | use App\Backends\DAV; | ||||
use App\Backends\IMAP; | use App\Backends\IMAP; | ||||
use App\Backends\Roundcube; | use App\Backends\LDAP; | ||||
use App\Backends\OpenExchangeRates; | use App\Backends\OpenExchangeRates; | ||||
use App\Backends\Roundcube; | |||||
use App\Providers\Payment\Mollie; | use App\Providers\Payment\Mollie; | ||||
//TODO stripe | //TODO stripe | ||||
//TODO firebase | //TODO firebase | ||||
class Health extends Command | class Health extends Command | ||||
{ | { | ||||
/** | /** | ||||
Show All 37 Lines | |||||
try { | try { | ||||
return Mollie::healthcheck(); | return Mollie::healthcheck(); | ||||
} catch (\Exception $exception) { | } catch (\Exception $exception) { | ||||
$this->line($exception); | $this->line($exception); | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
private function checkDAV() | |||||
{ | |||||
try { | |||||
DAV::healthcheck(); | |||||
return true; | |||||
} catch (\Exception $exception) { | |||||
$this->line($exception); | |||||
return false; | |||||
} | |||||
} | |||||
private function checkLDAP() | private function checkLDAP() | ||||
{ | { | ||||
try { | try { | ||||
LDAP::healthcheck(); | LDAP::healthcheck(); | ||||
return true; | return true; | ||||
} catch (\Exception $exception) { | } catch (\Exception $exception) { | ||||
$this->line($exception); | $this->line($exception); | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$result = 0; | $result = 0; | ||||
$steps = [ | $steps = [ | ||||
'DB', 'Redis', 'IMAP', 'Roundcube', 'Meet', 'Mollie', 'OpenExchangeRates', | 'DB', 'Redis', 'IMAP', 'Roundcube', 'Meet', 'DAV', 'Mollie', 'OpenExchangeRates', | ||||
]; | ]; | ||||
if (\config('app.with_ldap')) { | if (\config('app.with_ldap')) { | ||||
array_unshift($steps, 'LDAP'); | array_unshift($steps, 'LDAP'); | ||||
} | } | ||||
foreach ($steps as $step) { | foreach ($steps as $step) { | ||||
$func = "check{$step}"; | $func = "check{$step}"; | ||||
Show All 14 Lines |