Removing PHPCI's custom autoloader in favour of Composer autoloader.
Closes #661
This commit is contained in:
parent
f562de55c7
commit
0357103013
|
@ -10,23 +10,6 @@
|
|||
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
|
||||
// Set up a basic autoloader for PHPCI:
|
||||
$autoload = function ($class) {
|
||||
$file = str_replace(array('\\', '_'), '/', $class);
|
||||
$file .= '.php';
|
||||
|
||||
if (substr($file, 0, 1) == '/') {
|
||||
$file = substr($file, 1);
|
||||
}
|
||||
|
||||
if (is_file(dirname(__DIR__) . '/' . $file)) {
|
||||
include(dirname(__DIR__) . '/' . $file);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
spl_autoload_register($autoload, true, true);
|
||||
|
||||
// Load Composer autoloader:
|
||||
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
||||
|
||||
|
|
|
@ -16,23 +16,6 @@ if (empty($timezone)) {
|
|||
date_default_timezone_set('UTC');
|
||||
}
|
||||
|
||||
// Set up a basic autoloader for PHPCI:
|
||||
$autoload = function ($class) {
|
||||
$file = str_replace(array('\\', '_'), '/', $class);
|
||||
$file .= '.php';
|
||||
|
||||
if (substr($file, 0, 1) == '/') {
|
||||
$file = substr($file, 1);
|
||||
}
|
||||
|
||||
if (is_file(dirname(__FILE__) . '/' . $file)) {
|
||||
include(dirname(__FILE__) . '/' . $file);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
spl_autoload_register($autoload, true, true);
|
||||
|
||||
// If the PHPCI config file is not where we expect it, try looking in
|
||||
// env for an alternative config path.
|
||||
$configFile = dirname(__FILE__) . '/PHPCI/config.yml';
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
"source": "https://github.com/Block8/PHPCI"
|
||||
},
|
||||
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PHPCI\\": "PHPCI"
|
||||
}
|
||||
},
|
||||
|
||||
"require": {
|
||||
"php": ">=5.3.8",
|
||||
"ext-mcrypt": "*",
|
||||
|
|
986
composer.lock
generated
986
composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue