Example #1
0
 /**
  * Optimize git repo
  *
  * @return  void
  */
 public function gitgcTask()
 {
     $id = Request::getVar('id', 0);
     // Get repo model
     require_once PATH_CORE . DS . 'components' . DS . 'com_projects' . DS . 'models' . DS . 'repo.php';
     $project = new Models\Project($id);
     if (!$project->exists()) {
         App::redirect(Route::url('index.php?option=' . $this->_option, false), Lang::txt('COM_PROJECTS_NOTICE_ID_NOT_FOUND'), 'error');
         return;
     }
     $repo = new \Components\Projects\Models\Repo($project, 'local');
     $params = array('path' => $repo->get('path'), 'adv' => true);
     $repo->call('optimize', $params);
     // Redirect
     App::redirect(Route::url('index.php?option=' . $this->_option . '&task=edit&id=' . $id, false), Lang::txt('Git repo optimized'));
 }