diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index 3484e24e381d..2093ea55af7e 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -48,14 +48,14 @@ class SetupController extends Controller public function index() { $check = SystemHealth::check(false); - - if ($check['system_health'] == true && $check['simple_db_check'] && Schema::hasTable('accounts') && $account = Account::all()->first()) { + + if ($check['system_health'] == true && $check['simple_db_check'] && Schema::hasTable('accounts') && $account = Account::first()) { return redirect('/'); } if(Ninja::isHosted()) return redirect('/'); - + return view('setup.index', ['check' => $check]); } @@ -211,29 +211,31 @@ class SetupController extends Controller public function checkPdf(Request $request) { try { - if (config('ninja.pdf_generator') == 'phantom') { - return $this->testPhantom(); - } - $pdf = new Snappdf(); + // if (config('ninja.pdf_generator') == 'phantom') { + // return $this->testPhantom(); + // } - if (config('ninja.snappdf_chromium_path')) { - $pdf->setChromiumPath(config('ninja.snappdf_chromium_path')); - } + // $pdf = new Snappdf(); - if (config('ninja.snappdf_chromium_arguments')) { - $pdf->clearChromiumArguments(); - $pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments')); - } + // if (config('ninja.snappdf_chromium_path')) { + // $pdf->setChromiumPath(config('ninja.snappdf_chromium_path')); + // } - $pdf = $pdf - ->setHtml('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!') - ->generate(); + // if (config('ninja.snappdf_chromium_arguments')) { + // $pdf->clearChromiumArguments(); + // $pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments')); + // } - Storage::disk(config('filesystems.default'))->put('test.pdf', $pdf); - Storage::disk('local')->put('test.pdf', $pdf); + // $pdf = $pdf + // ->setHtml('GENERATING PDFs WORKS! Thank you for using Invoice Ninja!') + // ->generate(); - return response(['url' => Storage::disk('local')->url('test.pdf')], 200); + // Storage::disk(config('filesystems.default'))->put('test.pdf', $pdf); + // Storage::disk('local')->put('test.pdf', $pdf); + return response(['url' => ''], 200); + + // return response(['url' => Storage::disk('local')->url('test.pdf')], 200); } catch (Exception $e) { nlog($e->getMessage()); diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 5b95d72c39fa..70d1cef93afa 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -77,7 +77,7 @@ class SystemHealth 'open_basedir' => (bool)self::checkOpenBaseDir(), 'mail_mailer' => (string)self::checkMailMailer(), 'flutter_renderer' => (string)config('ninja.flutter_canvas_kit'), - 'jobs_pending' => (int) Queue::size(), + 'jobs_pending' => (int) self::checkQueueSize(), 'pdf_engine' => (string) self::getPdfEngine(), 'queue' => (string) config('queue.default'), 'trailing_slash' => (bool) self::checkUrlState(), @@ -85,6 +85,20 @@ class SystemHealth ]; } + private static function checkQueueSize() + { + $count = 0; + + try{ + $count = Queue::size(); + } + catch(\Exception $e){ + + } + + return $count; + } + public static function checkFileSystem() { diff --git a/resources/views/setup/_application.blade.php b/resources/views/setup/_application.blade.php index 69dd519f1709..de2d37c11282 100644 --- a/resources/views/setup/_application.blade.php +++ b/resources/views/setup/_application.blade.php @@ -52,10 +52,6 @@
- - {{ ctrans('texts.setup_phantomjs_note') }} -