1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #4248 from turbo124/v5-develop

Fixes for setup
This commit is contained in:
David Bomba 2020-11-02 11:25:20 +11:00 committed by GitHub
commit e24e25f9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 18 deletions

View File

@ -20,6 +20,7 @@ use App\Jobs\Util\VersionCheck;
use App\Models\Account; use App\Models\Account;
use App\Utils\CurlUtils; use App\Utils\CurlUtils;
use App\Utils\SystemHealth; use App\Utils\SystemHealth;
use App\Utils\Traits\AppSetup;
use DB; use DB;
use Exception; use Exception;
use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Foundation\Application;
@ -37,6 +38,8 @@ use Spatie\Browsershot\Browsershot;
*/ */
class SetupController extends Controller class SetupController extends Controller
{ {
use AppSetup;
public function index() public function index()
{ {
$check = SystemHealth::check(false); $check = SystemHealth::check(false);
@ -128,6 +131,8 @@ class SetupController extends Controller
VersionCheck::dispatchNow(); VersionCheck::dispatchNow();
$this->buildCache(true);
return redirect('/'); return redirect('/');
} catch (Exception $e) { } catch (Exception $e) {
info($e->getMessage()); info($e->getMessage());

View File

@ -36,22 +36,6 @@ class Gateway extends StaticModel
protected $dateFormat = 'Y-m-d H:i:s.u'; protected $dateFormat = 'Y-m-d H:i:s.u';
// /**
// * @return mixed
// * @deprecated 5.0.17 No longer needs as we are removing omnipay dependence
// */
// public function getFields()
// {
// if ($this->isCustom()) {
// return [
// 'name' => '',
// 'text' => '',
// ];
// } else {
// return Omnipay::create($this->provider)->getDefaultParameters();
// }
// }
public function getOptionsAttribute() public function getOptionsAttribute()
{ {
return $this->getMethods(); return $this->getMethods();

View File

@ -30,12 +30,12 @@ trait AppSetup
return $check['system_health'] == 'true'; return $check['system_health'] == 'true';
} }
public function buildCache() public function buildCache($force = false)
{ {
$cached_tables = config('ninja.cached_tables'); $cached_tables = config('ninja.cached_tables');
foreach ($cached_tables as $name => $class) { foreach ($cached_tables as $name => $class) {
if (request()->has('clear_cache') || ! Cache::has($name)) { if (request()->has('clear_cache') || ! Cache::has($name) || $force) {
// check that the table exists in case the migration is pending // check that the table exists in case the migration is pending
if (! Schema::hasTable((new $class())->getTable())) { if (! Schema::hasTable((new $class())->getTable())) {