mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
Initial commit
This commit is contained in:
16
controllers/rssController.php
Normal file
16
controllers/rssController.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
$app->get('{repo}/{branch}/rss/', function($repo, $branch) use($app) {
|
||||
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
|
||||
$commits = $repository->getCommits();
|
||||
|
||||
$html = $app['twig']->render('rss.twig', array(
|
||||
'baseurl' => $app['baseurl'],
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'commits' => $commits,
|
||||
));
|
||||
|
||||
return new Symfony\Component\HttpFoundation\Response($html, 200, array('Content-Type' => 'application/rss+xml'));
|
||||
})->assert('repo', '[\w-._]+')
|
||||
->assert('branch', '[\w-._]+');
|
||||
Reference in New Issue
Block a user