From e57ada553e9dd173c8d10d46f07b02ee52def827 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Sun, 10 Jun 2012 08:14:36 -0400 Subject: [PATCH] Litle tweaks for config.ini-example - tweak for git.repositories config to don't care "with ending slash" cond. - tweak for app.baseurl config to don't care "without ending slash" cond. --- config.ini-example | 6 +++--- index.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config.ini-example b/config.ini-example index 0684768..fc99be3 100644 --- a/config.ini-example +++ b/config.ini-example @@ -1,12 +1,12 @@ [git] client = '/usr/bin/git' ; Your git executable path -repositories = '/var/www/projects/' ; Path to your repositories (with ending slash) +repositories = '/var/www/projects/' ; Path to your repositories ; You can hide repositories from GitList, just copy this for each repository you want to hide -; hidden[] = '/var/www/projects/BetaTest' +; hidden[] = '/var/www/projects/BetaTest' [app] -baseurl = 'http://localhost/git' ; Base URL of the application (without ending slash) +baseurl = 'http://localhost/git' ; Base URL of the application ; If you need to specify custom filetypes for certain extensions, do this here [filetypes] diff --git a/index.php b/index.php index 4ba6b5c..c9147cf 100644 --- a/index.php +++ b/index.php @@ -14,9 +14,10 @@ if (empty($config['git']['repositories']) || !is_dir($config['git']['repositorie require_once 'phar://'.__DIR__.'/vendor/silex.phar'; $app = new Silex\Application(); -$app['baseurl'] = $config['app']['baseurl']; +$app['baseurl'] = rtrim($config['app']['baseurl'], '/'); $app['filetypes'] = $config['filetypes']; $app['hidden'] = isset($config['git']['hidden']) ? $config['git']['hidden'] : array(); +$config['git']['repositories'] = rtrim($config['git']['repositories'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; // Register Git and Twig libraries $app['autoloader']->registerNamespace('Git', __DIR__.'/lib');