Add file system checks to self checker
This commit is contained in:
parent
f4bfc69a49
commit
ea39f4eefc
2 changed files with 22 additions and 1 deletions
|
|
@ -241,7 +241,6 @@ class Import implements ShouldQueue
|
|||
$this->company->account->companies()->update(['is_large' => true]);
|
||||
}
|
||||
|
||||
|
||||
$this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate();
|
||||
$this->company->save();
|
||||
|
||||
|
|
|
|||
|
|
@ -81,9 +81,31 @@ class SystemHealth
|
|||
'pdf_engine' => (string) self::getPdfEngine(),
|
||||
'queue' => (string) config('queue.default'),
|
||||
'trailing_slash' => (bool) self::checkUrlState(),
|
||||
'file_permissions' => (string) self::checkFileSystem()
|
||||
];
|
||||
}
|
||||
|
||||
public static function checkFileSystem()
|
||||
{
|
||||
|
||||
$directoryIterator = new \RecursiveDirectoryIterator(base_path(), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
|
||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||
|
||||
if(strpos($file->getPathname(), '.git') !== false)
|
||||
continue;
|
||||
|
||||
//nlog($file->getPathname());
|
||||
|
||||
if ($file->isFile() && ! $file->isWritable()) {
|
||||
return "{$file->getFileName()} is not writable";
|
||||
}
|
||||
}
|
||||
|
||||
return 'Ok';
|
||||
|
||||
}
|
||||
|
||||
public static function checkUrlState()
|
||||
{
|
||||
if (env('APP_URL') && substr(env('APP_URL'), -1) == '/')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue