Added cache refresh option

This commit is contained in:
Wim Rijnders
2013-01-20 15:31:36 +01:00
parent 2715c5467a
commit fd7ad3fb7b
2 changed files with 16 additions and 0 deletions

View File

@@ -20,6 +20,21 @@ class MainController implements ControllerProviderInterface
));
})->bind('homepage');
$route->get('/refresh', function() use ($app ) {
$app['git']->deleteCached();
# These don't work:
#echo sfContext::getInstance()->getRequest()->getReferer();
#$app->redirect($request->attributes->get('referer'));
#$app->redirect( $app->getRequest()->getReferer() );
# TODO: Fix following to return to referring page
# Or get rid of hardcoded path
return $app->redirect( "/gitlist/");
})->bind('refresh');
$route->get('{repo}/stats/{branch}', function($repo, $branch) use ($app) {
$repotmp = $app['git']->getRepositoryCached($app['git.repos'], $repo);

View File

@@ -10,6 +10,7 @@
<div class="nav-collapse">
<ul class="nav pull-right">
<li><a href="http://gitlist.org/">About</a></li>
<li><a href="{{ path('homepage') }}refresh">Refresh</a></li>
<li><a href="https://github.com/klaussilveira/gitlist/issues/new">Report bug</a></li>
<li><a href="https://github.com/klaussilveira/gitlist/wiki">Help</a></li>
</ul>