mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-02 14:25:38 +08:00
refactor phpunit-swoole
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* @since 2.5
|
||||
*/
|
||||
|
||||
use ZM\Config\ZMConfig;
|
||||
use ZM\Console\Console;
|
||||
@@ -10,20 +7,20 @@ use ZM\Store\ZMAtomic;
|
||||
use ZM\Utils\DataProvider;
|
||||
use ZM\Utils\Terminal;
|
||||
|
||||
set_coroutine_params([]);
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// 模拟define
|
||||
chdir(__DIR__ . '/../');
|
||||
define("WORKING_DIR", getcwd());
|
||||
define("SOURCE_ROOT_DIR", WORKING_DIR);
|
||||
define("ZM_DATA", WORKING_DIR . "/zm_data/");
|
||||
define("LOAD_MODE", 0);
|
||||
define("FRAMEWORK_ROOT_DIR", realpath(__DIR__ . "/../"));
|
||||
define('WORKING_DIR', getcwd());
|
||||
const SOURCE_ROOT_DIR = WORKING_DIR;
|
||||
const ZM_DATA = WORKING_DIR . '/zm_data/';
|
||||
const LOAD_MODE = 0;
|
||||
define('FRAMEWORK_ROOT_DIR', dirname(__DIR__) . '/');
|
||||
|
||||
ZMConfig::setDirectory(WORKING_DIR."/config/");
|
||||
ZMConfig::setEnv("");
|
||||
if (ZMConfig::get("global") === false) {
|
||||
die (zm_internal_errcode("E00007") . "Global config load failed: " . ZMConfig::$last_error . "\nError path: " . DataProvider::getSourceRootDir() . "\nPlease init first!\nSee: https://github.com/zhamao-robot/zhamao-framework/issues/37\n");
|
||||
ZMConfig::setDirectory(WORKING_DIR . '/config/');
|
||||
ZMConfig::setEnv();
|
||||
if (ZMConfig::get('global') === false) {
|
||||
die (zm_internal_errcode('E00007') . 'Global config load failed: ' . ZMConfig::$last_error . "\nError path: " . DataProvider::getSourceRootDir() . "\nPlease init first!\nSee: https://github.com/zhamao-robot/zhamao-framework/issues/37\n");
|
||||
}
|
||||
LightCacheInside::init();
|
||||
ZMAtomic::init();
|
||||
|
||||
Reference in New Issue
Block a user