mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Added storing of found repos in cache file.
This commit is contained in:
@@ -39,17 +39,20 @@ class Application extends SilexApplication
|
||||
));
|
||||
|
||||
$repositories = $config->get('git', 'repositories');
|
||||
/*
|
||||
echo "doing this\n";
|
||||
$repositories = $app['git']->getRepositories($repositories);
|
||||
$config->set('git', 'repositories', $repositories);
|
||||
*/
|
||||
|
||||
$cached_repos = $root . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'repos.json';
|
||||
|
||||
$this->register(new GitServiceProvider(), array(
|
||||
'git.client' => $config->get('git', 'client'),
|
||||
'git.repos' => $repositories,
|
||||
'cache.repos' => $cached_repos,
|
||||
'ini.file' => "config.ini",
|
||||
'git.hidden' => $config->get('git', 'hidden') ? $config->get('git', 'hidden') : array(),
|
||||
));
|
||||
|
||||
$cached_repos = $root . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'repos.json';
|
||||
|
||||
|
||||
$this->register(new ViewUtilServiceProvider());
|
||||
$this->register(new RepositoryUtilServiceProvider());
|
||||
$this->register(new UrlGeneratorServiceProvider());
|
||||
@@ -61,6 +64,7 @@ class Application extends SilexApplication
|
||||
return $twig;
|
||||
}));
|
||||
|
||||
|
||||
// Handle errors
|
||||
$this->error(function (\Exception $e, $code) use ($app) {
|
||||
if ($app['debug']) {
|
||||
|
||||
@@ -41,4 +41,6 @@ class Client extends BaseClient
|
||||
|
||||
return new Repository($path, $this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use Silex\ServiceProviderInterface;
|
||||
|
||||
class GitServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Register the Git\Client on the Application ServiceProvider
|
||||
*
|
||||
@@ -19,6 +20,8 @@ class GitServiceProvider implements ServiceProviderInterface
|
||||
$app['git'] = function () use ($app) {
|
||||
$options['path'] = $app['git.client'];
|
||||
$options['hidden'] = $app['git.hidden'];
|
||||
$options['ini.file'] = $app['ini.file'];
|
||||
$options['cache.repos'] = $app['cache.repos'];
|
||||
|
||||
return new Client($options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user