diff --git a/src/GitList/Application.php b/src/GitList/Application.php index 353b238..df4f709 100644 --- a/src/GitList/Application.php +++ b/src/GitList/Application.php @@ -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']) { diff --git a/src/GitList/Git/Client.php b/src/GitList/Git/Client.php index 94d476a..5605dd1 100644 --- a/src/GitList/Git/Client.php +++ b/src/GitList/Git/Client.php @@ -41,4 +41,6 @@ class Client extends BaseClient return new Repository($path, $this); } + + } diff --git a/src/GitList/Provider/GitServiceProvider.php b/src/GitList/Provider/GitServiceProvider.php index 5427560..d3738c8 100644 --- a/src/GitList/Provider/GitServiceProvider.php +++ b/src/GitList/Provider/GitServiceProvider.php @@ -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); };