示例#1
0
 /**
  * Display the update dashboard
  *
  * @return  void
  */
 public function displayTask()
 {
     // Set any errors
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     $source = Component::params('com_update')->get('git_repository_source', null);
     $this->view->repositoryVersion = json_decode(Cli::version());
     $this->view->repositoryVersion = $this->view->repositoryVersion[0];
     $this->view->repositoryMechanism = json_decode(Cli::mechanism());
     $this->view->repositoryMechanism = $this->view->repositoryMechanism[0];
     $this->view->databaseMechanism = Config::get('dbtype');
     $this->view->databaseVersion = \App::get('db')->getVersion();
     $this->view->status = json_decode(Cli::status());
     $this->view->upcoming = json_decode(Cli::update(true, false, $source));
     $this->view->migration = json_decode(Cli::migration());
     if (!isset($this->view->repositoryMechanism)) {
         $this->view->message = 'Please ensure that the component is properly configured';
         $this->view->setLayout('error');
     } elseif ($this->view->repositoryMechanism != 'GIT') {
         $this->view->message = 'The CMS update component currently only supports repositories managed via GIT';
         $this->view->setLayout('error');
     }
     // Output the HTML
     $this->view->display();
 }