MINOR Don't use chdir(), it confuses the hell out of phpunit (e.g. directory_exists() and realpath() no longer work as expected)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111051 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-09-21 20:29:13 +00:00 committed by Sam Minnee
parent 3d820173ce
commit 02c1b56c01

View File

@ -6,8 +6,6 @@
$_SERVER['SCRIPT_FILENAME'] = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'cli-script.php';
$_SERVER['SCRIPT_NAME'] = '.' . DIRECTORY_SEPARATOR . 'sapphire' . DIRECTORY_SEPARATOR . 'cli-script.php';
// Change to
chdir(dirname($_SERVER['SCRIPT_FILENAME']));
define('BASE_PATH', rtrim(dirname(dirname(dirname(__FILE__)))), DIRECTORY_SEPARATOR);
// Copied from cli-script.php, to enable same behaviour through phpunit runner.
@ -27,7 +25,7 @@ if(isset($_SERVER['argv'][2])) {
}
if(!class_exists('Object')) {
require_once("core/Core.php");
require_once("sapphire/core/Core.php");
global $databaseConfig;
DB::connect($databaseConfig);
}