Skip to content

Commit 35ac980

Browse files
committed
bring bootstrap.php up to date.
1 parent 974aeef commit 35ac980

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

bootstrap.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
2+
/**
3+
* PHPCI - Continuous Integration for PHP
4+
*
5+
* @copyright Copyright 2013, Block 8 Limited.
6+
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
7+
* @link http://www.phptesting.org/
8+
*/
29

10+
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
11+
date_default_timezone_set(@date_default_timezone_get());
312

413
// Set up a basic autoloader for PHPCI:
514
$autoload = function ($class) {
@@ -18,8 +27,27 @@
1827

1928
spl_autoload_register($autoload, true, true);
2029

30+
if (!file_exists(dirname(__FILE__) . '/PHPCI/config.yml') && (!defined('PHPCI_IS_CONSOLE') || !PHPCI_IS_CONSOLE)) {
31+
header('Location: install.php');
32+
die;
33+
}
34+
35+
if (!file_exists(dirname(__FILE__) . '/vendor/autoload.php') && defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
36+
file_put_contents('php://stderr', 'Please install PHPCI with "composer install" before using console');
37+
exit(1);
38+
}
2139

2240

2341
// Load Composer autoloader:
2442
require_once(dirname(__FILE__) . '/vendor/autoload.php');
2543

44+
// Load configuration if present:
45+
$conf = array();
46+
$conf['b8']['app']['namespace'] = 'PHPCI';
47+
$conf['b8']['app']['default_controller'] = 'Home';
48+
$conf['b8']['view']['path'] = dirname(__FILE__) . '/PHPCI/View/';
49+
50+
$config = new b8\Config($conf);
51+
$config->loadYaml(dirname(__FILE__) . '/PHPCI/config.yml');
52+
53+
require_once(dirname(__FILE__) . '/vars.php');

0 commit comments

Comments
 (0)