diff --git a/bootstrap/app.php b/bootstrap/app.php
index f2801adf..037e17df 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -12,7 +12,7 @@
*/
$app = new Illuminate\Foundation\Application(
- realpath(__DIR__.'/../')
+ $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php
deleted file mode 100644
index 264355ac..00000000
--- a/bootstrap/autoload.php
+++ /dev/null
@@ -1,25 +0,0 @@
-'.
- '[错误] 根目录下未发现 vendor 文件夹,请使用 composer 安装依赖库。详情请阅读 http://t.cn/REyMUqA'
- );
-}
diff --git a/bootstrap/chkenv.php b/bootstrap/chkenv.php
index 28cf3182..869cff75 100644
--- a/bootstrap/chkenv.php
+++ b/bootstrap/chkenv.php
@@ -7,12 +7,20 @@
exit($error);
}
+ if (!file_exists(__DIR__.'/../vendor/autoload.php')) {
+ die_with_utf8_encoding(
+ '[Error] No vendor folder found. Please use the released built package.
'.
+ '[错误] 根目录下未发现 vendor 文件夹,请使用正式的已构建好的 release 包。'
+ );
+ }
+
+ $requiredVersion = '7.2.0';
preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches);
$version = $matches[1];
- if (version_compare($version, '7.2.0', '<')) {
+ if (version_compare($version, $requiredVersion, '<')) {
die_with_utf8_encoding(
- '[Error] Blessing Skin requires PHP version >= 7.2.0, you are now using '.$version.'
'.
- '[错误] 你的 PHP 版本过低('.$version.'),Blessing Skin 要求至少为 7.2.0'
+ '[Error] Blessing Skin requires PHP version >= '.$requiredVersion.', you are now using '.$version.'
'.
+ '[错误] 你的 PHP 版本过低('.$version.'),Blessing Skin 要求至少为 '.$requiredVersion
);
}
diff --git a/bootstrap/kernel.php b/bootstrap/kernel.php
deleted file mode 100644
index 086945f0..00000000
--- a/bootstrap/kernel.php
+++ /dev/null
@@ -1,24 +0,0 @@
-make(Illuminate\Contracts\Http\Kernel::class);
-
-$response = $kernel->handle(
- $request = Illuminate\Http\Request::capture()
-);
-
-$response->send();
-
-$kernel->terminate($request, $response);
diff --git a/phpunit.xml b/phpunit.xml
index 7f2a9889..63134b83 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -7,7 +7,7 @@
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
- bootstrap="bootstrap/autoload.php">
+ bootstrap="vendor/autoload.php">
./tests
diff --git a/public/index.php b/public/index.php
index 9b61d889..a49ecf2b 100755
--- a/public/index.php
+++ b/public/index.php
@@ -1,11 +1,53 @@
make(Illuminate\Contracts\Http\Kernel::class);
+
+$response = $kernel->handle(
+ $request = Illuminate\Http\Request::capture()
+);
+
+$response->send();
+
+$kernel->terminate($request, $response);