diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 062d2b42..2b679468 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -85,7 +85,7 @@ class SystemController extends Controller // Commands $commands_list = [ - 'freescout:fetch-emails' => 'freescout:fetch-emails', + 'freescout:fetch-emails' => 'freescout:fetch-emails', \Helper::getWorkerIdentifier() => 'queue:work' ]; foreach ($commands_list as $command_identifier => $command_name) { @@ -174,19 +174,23 @@ class SystemController extends Controller ]; } - // Check new version + // Check new version if enabled $new_version_available = false; - $latest_version = \Cache::remember('latest_version', 15, function () { - try { - return \Updater::getVersionAvailable(); - } catch (\Exception $e) { - SystemController::$latest_version_error = $e->getMessage(); - return ''; - } - }); + if (!\Config::get('app.disable_updating')) { + $latest_version = \Cache::remember('latest_version', 15, function () { + try { + return \Updater::getVersionAvailable(); + } catch (\Exception $e) { + SystemController::$latest_version_error = $e->getMessage(); + return ''; + } + }); - if ($latest_version && version_compare($latest_version, \Config::get('app.version'), '>')) { - $new_version_available = true; + if ($latest_version && version_compare($latest_version, \Config::get('app.version'), '>')) { + $new_version_available = true; + } + } else { + $latest_version = \Config::get('app.version'); } return view('system/status', [ @@ -303,7 +307,7 @@ class SystemController extends Controller case 'update': try { $status = \Updater::update(); - + // Artisan::output() } catch (\Exception $e) { $response['msg'] = __('Error occured. Please try again or try another :%a_start%update method:%a_end%', ['%a_start%' => '', '%a_end%' => '']); @@ -319,14 +323,18 @@ class SystemController extends Controller break; case 'check_updates': - try { - $response['new_version_available'] = \Updater::isNewVersionAvailable(config('app.version')); - $response['status'] = 'success'; - } catch (\Exception $e) { - $response['msg'] = __('Error occured').': '.$e->getMessage(); - } - if (!$response['msg'] && !$response['new_version_available']) { - // Adding session flash is useless as cache is cleated + if (!\Config::get('app.disable_updating')) { + try { + $response['new_version_available'] = \Updater::isNewVersionAvailable(config('app.version')); + $response['status'] = 'success'; + } catch (\Exception $e) { + $response['msg'] = __('Error occured').': '.$e->getMessage(); + } + if (!$response['msg'] && !$response['new_version_available']) { + // Adding session flash is useless as cache is cleated + $response['msg_success'] = __('You have the latest version installed'); + } + } else { $response['msg_success'] = __('You have the latest version installed'); } break; diff --git a/config/app.php b/config/app.php index b1fa6261..511583cf 100644 --- a/config/app.php +++ b/config/app.php @@ -268,9 +268,9 @@ return [ /* |-------------------------------------------------------------------------- | none - send to the customer only agent's reply in the email. - | + | | last - send to the customer the last message in the email. - | + | | full - send to the customer full conversation history in the email. | |------------------------------------------------------------------------- @@ -280,7 +280,7 @@ return [ /* |-------------------------------------------------------------------------- | none - send to the user only agent's reply in the email. - | + | | last - send to the user the last message in the email. | | full - send to the user full conversation history in the email. @@ -289,6 +289,13 @@ return [ */ 'email_user_history' => env('APP_EMAIL_USER_HISTORY', 'full'), + /* + |-------------------------------------------------------------------------- + | Disable update checker + |-------------------------------------------------------------------------- + */ + 'disable_updating' => env('APP_DISABLE_UPDATING', false), + /* |-------------------------------------------------------------------------- | Autoloaded Service Providers diff --git a/resources/views/system/status.blade.php b/resources/views/system/status.blade.php index 9634e577..5bacda3f 100644 --- a/resources/views/system/status.blade.php +++ b/resources/views/system/status.blade.php @@ -22,19 +22,23 @@