mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 06:26:52 +01:00 
			
		
		
		
	* Init * Health Page * Admin API Keys * Update API Keys * Database Hosts * Mounts * remove `s` * Users * Webhooks * Server never again... * Fix Server * Settings * Update Mounts * Update Databasehost * Update Server * Oops, Update Server * Nodes * Update User * Dashboard * Update Server * Profile * Egg * Role & Update Egg * Add base Laravel lang files * update apikey * remove html back to settings, remove comment * add `:resource` to create_action * Update Egg * Update Egg v2 * Update 1 * trans cf info label * Update charts * more trans * Update Webhook * update Health * Update Server * Update Role * Fixes * Bulk Update * AnotherOne * Fix relation button label * rename `admin1` to `admin` Leftover from testing... oops * More Translations * Updates * `pint` + Relation Manager Titles
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Checks;
 | 
						|
 | 
						|
use Spatie\Health\Checks\Check;
 | 
						|
use Spatie\Health\Checks\Result;
 | 
						|
 | 
						|
use function config;
 | 
						|
 | 
						|
class DebugModeCheck extends Check
 | 
						|
{
 | 
						|
    protected bool $expected = false;
 | 
						|
 | 
						|
    public function expectedToBe(bool $bool): self
 | 
						|
    {
 | 
						|
        $this->expected = $bool;
 | 
						|
 | 
						|
        return $this;
 | 
						|
    }
 | 
						|
 | 
						|
    public function run(): Result
 | 
						|
    {
 | 
						|
        $actual = config('app.debug');
 | 
						|
 | 
						|
        $result = Result::make()
 | 
						|
            ->meta([
 | 
						|
                'actual' => $actual,
 | 
						|
                'expected' => $this->expected,
 | 
						|
            ])
 | 
						|
            ->shortSummary($this->convertToWord($actual));
 | 
						|
 | 
						|
        return $this->expected === $actual
 | 
						|
            ? $result->ok()
 | 
						|
            : $result->failed(trans('admin/health.results.debugmode.failed', [
 | 
						|
                'actual' => $this->convertToWord($actual),
 | 
						|
                'expected' => $this->convertToWord($this->expected),
 | 
						|
            ]));
 | 
						|
    }
 | 
						|
 | 
						|
    protected function convertToWord(bool $boolean): string
 | 
						|
    {
 | 
						|
        return $boolean ? 'true' : 'false';
 | 
						|
    }
 | 
						|
}
 |