update() 공개 메소드

Runs the script's update hooks.
public update ( )
 /**
  * @Request({"redirect": "string"}, csrf=true)
  */
 public function migrateAction($redirect = null)
 {
     if ($updates = $this->scripts->hasUpdates()) {
         $this->scripts->update();
         $message = __('Your Pagekit database has been updated successfully.');
     } else {
         $message = __('Your database is up to date.');
     }
     App::config('system')->set('version', App::version());
     if ($redirect) {
         App::message()->success($message);
         return App::redirect($redirect);
     }
     return App::response()->json(compact('status', 'message'));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $config = $this->container->config('system');
     $scripts = new PackageScripts($this->container->path() . '/app/system/scripts.php', $config->get('version'));
     if ($scripts->hasUpdates()) {
         $scripts->update();
     }
     $config->set('version', $this->container->version());
     $this->line(sprintf('<info>%s</info>', __('Your Pagekit database has been updated successfully.')));
 }