mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Added cache refresh option
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user