mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
commit
e24e25f9f0
@ -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());
|
||||||
|
@ -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();
|
||||||
|
@ -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())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user