From f0653e70ea7a22582587cdd2077b7e806c680cc5 Mon Sep 17 00:00:00 2001 From: hbbzy <3435579019@qq.com> Date: Fri, 29 Nov 2024 14:12:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=A7=E8=A1=8Ccomposer=20bin?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=97=B6=EF=BC=8C=E6=8A=A5Use=20of=20undefin?= =?UTF-8?q?ed=20constant=20ROOT=5FPATH=20-=20assumed=20'ROOT=5FPATH'=20cho?= =?UTF-8?q?re:=20=E4=B8=8D=E5=BB=BA=E8=AE=AE=E5=9C=A8composer.json?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=89=88=E6=9C=AC=E5=8F=B7=E3=80=82=E5=8F=AF?= =?UTF-8?q?=E5=8F=82=E9=98=85https://getcomposer.org/doc/04-schema.md#vers?= =?UTF-8?q?ion=20chore:=20=E5=A2=9E=E5=8A=A0pre-autoload-dump=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=89=A7=E8=A1=8Cdump-autoload=20-o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 7 ++++++- src/common.php | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index be6cab6..9f43a8f 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "addons package for fastadmin", "homepage": "https://github.com/karsonzhang/fastadmin-addons", "license": "Apache-2.0", - "version": "1.4.0", "authors": [ { "name": "Karson", @@ -19,6 +18,7 @@ }, "require": { "php": ">=7.0.0", + "topthink/framework": "~5.0", "nelexa/zip": "^3.3 || ^4.0" }, "autoload": { @@ -33,5 +33,10 @@ "think-config": { "addons": "src/config.php" } + }, + "scripts": { + "pre-autoload-dump": [ + "composer dump-autoload -o" + ] } } diff --git a/src/common.php b/src/common.php index 0f95710..2d91198 100644 --- a/src/common.php +++ b/src/common.php @@ -13,6 +13,11 @@ use think\Response; use think\Route; +if (!defined('ROOT_PATH') && is_file(dirname(__DIR__, 4) . '/vendor/autoload.php')) { + define('ROOT_PATH', dirname(__DIR__, 4)); +} +!defined('DS') && define('DS', DIRECTORY_SEPARATOR); + // 插件目录 define('ADDON_PATH', ROOT_PATH . 'addons' . DS);