/** * Handles updating Grav * * @return bool True if the action was performed */ public function taskUpdategrav() { require_once __DIR__ . '/gpm.php'; if (!$this->authorizeTask('install grav', ['admin.super'])) { return; } $result = \Grav\Plugin\Admin\Gpm::selfupgrade(); if ($result) { $this->admin->json_response = ['status' => 'success', 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_WAS_SUCCESSFULLY_UPDATED_TO') . ' ']; } else { $this->admin->json_response = ['status' => 'error', 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_UPDATE_FAILED') . ' <br>' . Installer::lastErrorMsg()]; } return true; }
/** * Handles updating Grav * * @return bool True is the action was performed */ public function taskUpdategrav() { require_once __DIR__ . '/gpm.php'; if (!$this->authoriseTask('install grav', ['admin.super'])) { return; } if (is_link(ROOT_DIR . 'index.php')) { $this->admin->json_response = ['status' => 'error', 'message' => 'Cannot upgrade: Grav is symlinked. Please upgrade manually']; return false; } $result = \Grav\Plugin\Admin\Gpm::selfupgrade(); if ($result) { $this->admin->json_response = ['status' => 'success', 'message' => 'Grav was successfully updated to ']; } else { $this->admin->json_response = ['status' => 'error', 'message' => 'Grav update failed']; } return true; }
/** * Handles updating Grav * * @return bool True if the action was performed */ public function taskUpdategrav() { if (!$this->authorizeTask('install grav', ['admin.super'])) { return false; } $gpm = Gpm::GPM(); $version = $gpm->grav->getVersion(); $result = Gpm::selfupgrade(); if ($result) { $this->admin->json_response = ['status' => 'success', 'type' => 'updategrav', 'version' => $version, 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_WAS_SUCCESSFULLY_UPDATED_TO') . ' ' . $version]; } else { $this->admin->json_response = ['status' => 'error', 'type' => 'updategrav', 'version' => GRAV_VERSION, 'message' => $this->admin->translate('PLUGIN_ADMIN.GRAV_UPDATE_FAILED') . ' <br>' . Installer::lastErrorMsg()]; } return true; }
/** * Handles updating Grav * * @return bool True is the action was performed */ public function taskUpdategrav() { require_once __DIR__ . '/gpm.php'; if (!$this->authoriseTask('install grav', ['admin.super'])) { return; } $result = \Grav\Plugin\Admin\Gpm::selfupgrade(); if ($result) { $this->admin->json_response = ['status' => 'success', 'message' => 'Grav was successfully updated to ']; } else { $this->admin->json_response = ['status' => 'error', 'message' => 'Grav update failed <br>' . Installer::lastErrorMsg()]; } return true; }