From b45126ce167af88cb05d1128cae058441edd2555 Mon Sep 17 00:00:00 2001 From: dxkite Date: Sun, 7 Jul 2019 16:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suda/loader/loader.php | 2 +- .../builder/ApplicationBuilder.php | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/suda/loader/loader.php b/suda/loader/loader.php index d2ecd586..069c89e6 100644 --- a/suda/loader/loader.php +++ b/suda/loader/loader.php @@ -12,7 +12,7 @@ defined('SUDA_DEBUG') or define('SUDA_DEBUG', false); defined('SUDA_DEBUG_LEVEL') or define('SUDA_DEBUG_LEVEL', 'debug'); // 定义版本 -define('SUDA_VERSION', '3.1.3-alpha'); +define('SUDA_VERSION', '3.1.2'); // 设置默认时区 date_default_timezone_set(SUDA_TIMEZONE); // 调试模式 diff --git a/suda/src/application/builder/ApplicationBuilder.php b/suda/src/application/builder/ApplicationBuilder.php index 6ee4aa4c..1381d7ca 100644 --- a/suda/src/application/builder/ApplicationBuilder.php +++ b/suda/src/application/builder/ApplicationBuilder.php @@ -21,13 +21,13 @@ class ApplicationBuilder * 创建应用 * @param Loader $loader * @param string $path - * @param string $manifast + * @param string $manifest * @param string $dataPath * @return Application */ - public static function build(Loader $loader, string $path, string $manifast, string $dataPath):Application + public static function build(Loader $loader, string $path, string $manifest, string $dataPath):Application { - $manifestConfig = static::loadManifest($manifast); + $manifestConfig = static::loadManifest($path, $manifest); if (array_key_exists('import', $manifestConfig)) { static::importClassLoader($loader, $manifestConfig['import'], $path); } @@ -40,11 +40,12 @@ public static function build(Loader $loader, string $path, string $manifast, str /** * 加载App主配置 * @param string $path + * @param string $manifest * @return array|null */ - public static function loadManifest(string $path) + public static function loadManifest(string $path, string $manifest) { - $manifest = static::resolveManifest($path); + $manifest = static::resolveManifest($path, $manifest); return Config::loadConfig($manifest) ?? []; } @@ -52,18 +53,19 @@ public static function loadManifest(string $path) * 获取Manifest路径 * * @param string $path + * @param string $manifestPath * @return string */ - protected static function resolveManifest(string $path):string + protected static function resolveManifest(string $path, string $manifestPath):string { - $manifest = PathResolver::resolve($path); + $manifest = PathResolver::resolve($manifestPath); if ($manifest === null) { FileSystem::copyDir(SUDA_RESOURCE.'/app', $path); - $manifest = PathResolver::resolve($path); + $manifest = PathResolver::resolve($manifestPath); } if ($manifest === null) { throw new ApplicationException( - sprintf('missing manifest in %s', dirname($path)), + sprintf('missing manifest in %s', dirname($manifestPath)), ApplicationException::ERR_MANIFEST_IS_EMPTY ); } else {