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