Holy cleanup, batman.

This commit is contained in:
Dan Cryer 2013-10-10 01:01:06 +01:00
commit 77fae9a56d
58 changed files with 967 additions and 847 deletions

View file

@ -27,20 +27,22 @@ $autoload = function ($class) {
spl_autoload_register($autoload, true, true);
// Define our APPLICATION_PATH, if not already defined:
if (!defined('APPLICATION_PATH')) {
define('APPLICATION_PATH', dirname(__FILE__) . '/');
}
if (!file_exists(APPLICATION_PATH . 'PHPCI/config.yml')) {
header('Location: install.php');
die;
if (!file_exists(dirname(__FILE__) . '/PHPCI/config.yml')) {
if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
file_put_contents('php://stderr', 'Please install PHPCI with "composer install" before using console');
exit(1);
} else {
header('Location: install.php');
die;
}
}
// Load Composer autoloader:
require_once(APPLICATION_PATH . 'vendor/autoload.php');
require_once(dirname(__FILE__) . '/vendor/autoload.php');
// Load configuration if present:
$conf = array();
@ -49,9 +51,6 @@ $conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = dirname(__FILE__) . '/PHPCI/View/';
$config = new b8\Config($conf);
$config->loadYaml(APPLICATION_PATH . 'PHPCI/config.yml');
$config->loadYaml(dirname(__FILE__) . '/PHPCI/config.yml');
// Define our PHPCI_URL, if not already defined:
if (!defined('PHPCI_URL')) {
define('PHPCI_URL', $config->get('phpci.url', '') . '/');
}
require_once(dirname(__FILE__) . '/vars.php');