mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-09-02 02:27:20 +02:00
Initial commit
This commit is contained in:
20
controllers/statsController.php
Normal file
20
controllers/statsController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$app->get('{repo}/stats/{branch}', function($repo, $branch) use($app) {
|
||||
$repository = $app['git']->getRepository($app['git.repos'] . $repo);
|
||||
$stats = $repository->getStatistics($branch);
|
||||
$authors = $repository->getAuthorStatistics();
|
||||
|
||||
return $app['twig']->render('stats.twig', array(
|
||||
'baseurl' => $app['baseurl'],
|
||||
'page' => 'stats',
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
'stats' => $stats,
|
||||
'authors' => $authors,
|
||||
));
|
||||
})->assert('repo', '[\w-._]+')
|
||||
->assert('branch', '[\w-._]+')
|
||||
->value('branch', 'master');
|
||||
Reference in New Issue
Block a user