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.
This commit is contained in:
Erik Amaru Ortiz
2012-06-10 08:14:36 -04:00
parent 3223d53b75
commit e57ada553e
2 changed files with 5 additions and 4 deletions

View File

@@ -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]

View File

@@ -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');