mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
New architecture to make tests easier
This commit is contained in:
16
boot.php
Normal file
16
boot.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Load configuration
|
||||||
|
$config = new GitList\Config('config.ini');
|
||||||
|
$config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
|
// 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;
|
||||||
17
index.php
17
index.php
@@ -6,18 +6,5 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
$app = require 'boot.php';
|
||||||
// Load configuration
|
$app->run();
|
||||||
$config = new GitList\Config('config.ini');
|
|
||||||
$config->set('git', 'repositories', rtrim($config->get('git', 'repositories'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
|
|
||||||
|
|
||||||
// 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());
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
Reference in New Issue
Block a user