function merge_action($mergeId) { $this->setBranch(); $api = new \firegit\app\mod\git\Merge(); $merge = $api->getMerge($mergeId); if (!$merge) { throw new \Exception('firegit.u_notfound'); } $orig = $merge['orig_branch']; $dest = $merge['dest_branch']; setcookie('branch', $orig, time() + 3600 * 24, '/'); //blame使用cookie $commits = $this->repo->listCommits($orig, $dest); $branches = $this->repo->listBranches(); $umod = new \firegit\app\mod\user\User(); $tusers = $umod->getUsers(); // 评论 $modComment = new \firegit\app\mod\util\Comment(); $comments = $modComment->getComments(1, $mergeId, $this->_sz); require_once VENDOR_ROOT . '/parsedown/Parsedown.php'; $parsedown = new \Parsedown(); foreach ($comments['list'] as $key => $value) { $comments['list'][$key]['content'] = $parsedown->text($value['content']); } $this->set(array('pageTitle' => '合并请求:' . $merge['title'], 'merge' => $merge, 'commits' => $this->packCommits($commits), 'navType' => 'merge', 'branches' => $branches, 'orig' => $orig, 'dest' => $dest, 'tusers' => $tusers, 'notShowNav' => true, 'comments' => $comments['list'], 'curUser' => $this->getData('user')))->setView('git/merge.phtml'); }
function _del_action() { $commentId = intval($this->get('comment_id')); if ($commentId <= 0) { throw new \Exception('firegit.u_notfound'); } $mod = new \firegit\app\mod\util\Comment(); $mod->delComment($commentId, $this->getData('user')); }