mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Add logos to check data
This commit is contained in:
parent
755f125bf0
commit
97300d571d
@ -87,6 +87,7 @@ class CheckData extends Command
|
|||||||
$this->checkClientBalances();
|
$this->checkClientBalances();
|
||||||
$this->checkContacts();
|
$this->checkContacts();
|
||||||
$this->checkUserAccounts();
|
$this->checkUserAccounts();
|
||||||
|
$this->checkLogoFiles();
|
||||||
|
|
||||||
if (! $this->option('client_id')) {
|
if (! $this->option('client_id')) {
|
||||||
$this->checkOAuth();
|
$this->checkOAuth();
|
||||||
@ -840,6 +841,30 @@ class CheckData extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkLogoFiles()
|
||||||
|
{
|
||||||
|
$accounts = DB::table('accounts')
|
||||||
|
->where('logo', '!=', '')
|
||||||
|
->orderBy('id')
|
||||||
|
->get(['logo']);
|
||||||
|
|
||||||
|
$countMissing = 0;
|
||||||
|
|
||||||
|
foreach ($accounts as $account) {
|
||||||
|
$path = public_path('logo/' . $account->logo);
|
||||||
|
if (! file_exists($path)) {
|
||||||
|
$this->logMessage('Missing file: ' . $account->logo);
|
||||||
|
$countMissing++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($countMissing > 0) {
|
||||||
|
$this->isValid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->logMessage($countMissing . ' missing logo files');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user