Removing PHPCI's custom autoloader in favour of Composer autoloader.

Closes #661
This commit is contained in:
Marco Vito Moscaritolo 2014-11-19 22:31:00 +01:00 committed by Dan Cryer
parent f562de55c7
commit 0357103013
4 changed files with 788 additions and 238 deletions

View file

@ -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');

View file

@ -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';

View file

@ -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

File diff suppressed because it is too large Load diff