mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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->account->companies()->update(['is_large' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate();
|
$this->company->client_registration_fields = \App\DataMapper\ClientRegistrationFields::generate();
|
||||||
$this->company->save();
|
$this->company->save();
|
||||||
|
|
||||||
|
@ -81,9 +81,31 @@ class SystemHealth
|
|||||||
'pdf_engine' => (string) self::getPdfEngine(),
|
'pdf_engine' => (string) self::getPdfEngine(),
|
||||||
'queue' => (string) config('queue.default'),
|
'queue' => (string) config('queue.default'),
|
||||||
'trailing_slash' => (bool) self::checkUrlState(),
|
'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()
|
public static function checkUrlState()
|
||||||
{
|
{
|
||||||
if (env('APP_URL') && substr(env('APP_URL'), -1) == '/')
|
if (env('APP_URL') && substr(env('APP_URL'), -1) == '/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user