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:
|
// 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());
|
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:
|
// Load Composer autoloader:
|
||||||
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
require_once(dirname(__DIR__) . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
|
|
@ -16,23 +16,6 @@ if (empty($timezone)) {
|
||||||
date_default_timezone_set('UTC');
|
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
|
// If the PHPCI config file is not where we expect it, try looking in
|
||||||
// env for an alternative config path.
|
// env for an alternative config path.
|
||||||
$configFile = dirname(__FILE__) . '/PHPCI/config.yml';
|
$configFile = dirname(__FILE__) . '/PHPCI/config.yml';
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
"source": "https://github.com/Block8/PHPCI"
|
"source": "https://github.com/Block8/PHPCI"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PHPCI\\": "PHPCI"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.8",
|
"php": ">=5.3.8",
|
||||||
"ext-mcrypt": "*",
|
"ext-mcrypt": "*",
|
||||||
|
|
984
composer.lock
generated
984
composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue