mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-02-04 05:39:42 +01:00
Minor fixes and path checks
This commit is contained in:
19
boot.php
19
boot.php
@@ -4,32 +4,17 @@ if (!isset($config)) {
|
||||
die("No configuration object provided.");
|
||||
}
|
||||
|
||||
$repositories = $config->get('git', 'repositories');
|
||||
|
||||
if (!is_array($repositories)) {
|
||||
# Convert the single item to an array - this is the internal handling
|
||||
$repositories = array($repositories);
|
||||
if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
|
||||
die(sprintf('The "%s" folder must be writable for GitList to run.', __DIR__ . DIRECTORY_SEPARATOR . 'cache'));
|
||||
}
|
||||
|
||||
$tmp_arr = array();
|
||||
foreach ($repositories as $repo) {
|
||||
$tmp = rtrim($repo, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
||||
$tmp_arr []= $tmp;
|
||||
}
|
||||
$repositories = $tmp_arr;
|
||||
|
||||
|
||||
|
||||
// Startup and configure Silex application
|
||||
$app = new GitList\Application($config, __DIR__);
|
||||
|
||||
|
||||
// Mount the controllers
|
||||
$app->mount('', new GitList\Controller\MainController());
|
||||
$app->mount('', new GitList\Controller\BlobController());
|
||||
$app->mount('', new GitList\Controller\CommitController());
|
||||
$app->mount('', new GitList\Controller\TreeController());
|
||||
|
||||
|
||||
return $app;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user