From e05dcdf09cfad3477eabbb1962883e54fa038797 Mon Sep 17 00:00:00 2001 From: Lkeme <19500576+lkeme@users.noreply.github.com> Date: Sun, 18 Jun 2023 13:49:26 +0800 Subject: [PATCH] [fix] the following paths have collided --- src/core/Core.php | 106 ---------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 src/core/Core.php diff --git a/src/core/Core.php b/src/core/Core.php deleted file mode 100644 index 1aac663..0000000 --- a/src/core/Core.php +++ /dev/null @@ -1,106 +0,0 @@ -global_path = $global_path; - $this->profile_name = $profile_name; - // 定义全局常量 - $this->initSystemConstant(); - // 初始化全局文件夹 - $this->initSystemPath(); - } - - /** - * 初始化全局常量 - * @return void - */ - protected function initSystemConstant(): void - { - define('APP_MICROSECOND', 1000000); - define('APP_RESOURCES_PATH', $this->global_path . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR); - define('APP_PLUGIN_PATH', $this->global_path . DIRECTORY_SEPARATOR . 'plugin' . DIRECTORY_SEPARATOR); - // Profile - define('PROFILE_CONFIG_PATH', $this->fillPath('config')); - define('PROFILE_DEVICE_PATH', $this->fillPath('device')); - define('PROFILE_LOG_PATH', $this->fillPath('log')); - define('PROFILE_TASK_PATH', $this->fillPath('task')); - define('PROFILE_CACHE_PATH', $this->fillPath('cache')); - - // 判断profile/*是否存在存在 - if (!is_dir(PROFILE_CONFIG_PATH)) { - die("加载 {$this->profile_name} 用户文档失败,请检查路径!"); - } - } - - /** - * 补充目录 - * @param string $path - * @return string - */ - protected function fillPath(string $path): string - { - // */profile/*/* - return $this->global_path . DIRECTORY_SEPARATOR . 'profile' . DIRECTORY_SEPARATOR . $this->profile_name . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR; - } - - /** - * 初始化系统目录(创建、设置权限) - * @return void - */ - protected function initSystemPath(): void - { - $system_paths = [ - PROFILE_CONFIG_PATH, - PROFILE_DEVICE_PATH, - PROFILE_LOG_PATH, - PROFILE_TASK_PATH, - PROFILE_CACHE_PATH - ]; - foreach ($system_paths as $path) { - if (!file_exists($path)) { - Path::CreateFolder($path); - Path::SetFolderPermissions($path); - } - } - } - - -}