diff --git a/start.php b/start.php index 86ef2534..b2a5a311 100644 --- a/start.php +++ b/start.php @@ -30,9 +30,6 @@ if (!defined('APP_DEBUG')) { define('APP_DEBUG', $debug); } -// 注册自动加载 -Loader::register(); - // 加载模式定义文件 $mode = require MODE_PATH . APP_MODE . EXT; @@ -41,6 +38,9 @@ if (isset($mode['namespace'])) { Loader::addNamespace($mode['namespace']); } +// 注册自动加载 +Loader::register(); + // 加载模式别名定义 if (isset($mode['alias'])) { Loader::addMap($mode['alias']); diff --git a/tests/thinkphp/library/think/configTest.php b/tests/thinkphp/library/think/configTest.php index 959a8f3e..f0048a44 100644 --- a/tests/thinkphp/library/think/configTest.php +++ b/tests/thinkphp/library/think/configTest.php @@ -94,10 +94,9 @@ class configTest extends \PHPUnit_Framework_TestCase $this->assertEquals([], Config::get(null, $range)); $this->assertEquals(null, Config::get(null, 'does_not_exist')); // test $_ENV configuration - defined('ENV_PREFIX') or define('ENV_PREFIX', '_TEST_'); - $name = 'test_name'; - $value = 'value'; - $_ENV[ENV_PREFIX . $name] = $value; + $name = 'test_name'; + $value = 'value'; + putenv(ENV_PREFIX . $name . '=' . $value); $this->assertEquals($value, Config::get($name, $range)); // test getting configuration $reflectedPropertyConfig->setValue([$range => ['abcd' => 'efg']]);