mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
20 lines
746 B
PHP
20 lines
746 B
PHP
<?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'); |