mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Add file system checks to self checker
This commit is contained in:
parent
f4bfc69a49
commit
ea39f4eefc
@ -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…
Reference in New Issue
Block a user