From 84881864965e5d3f36abc4567f8c30afb0f186c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=83=B3=E6=89=93=E7=9E=8C=E7=9D=A1?= <66461682@qq.com> Date: Tue, 18 Feb 2025 18:26:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .watcher.php | 23 +++++++++++++++++++++++ app/Controller/IndexController.php | 2 ++ entrypoint.sh | 10 ---------- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 .watcher.php delete mode 100755 entrypoint.sh diff --git a/.watcher.php b/.watcher.php new file mode 100644 index 0000000..39f4bab --- /dev/null +++ b/.watcher.php @@ -0,0 +1,23 @@ + ScanFileDriver::class, + 'bin' => PHP_BINARY, + 'watch' => [ + 'dir' => ['app', 'config'], + 'file' => ['.env'], + 'scan_interval' => 2000, + ], + 'ext' => ['.php', '.env'], +]; diff --git a/app/Controller/IndexController.php b/app/Controller/IndexController.php index 9be020b..4247ab7 100644 --- a/app/Controller/IndexController.php +++ b/app/Controller/IndexController.php @@ -12,6 +12,8 @@ declare(strict_types=1); namespace App\Controller; +use Hyperf\HttpServer\Annotation\AutoController; + class IndexController extends AbstractController { public function index() diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index bd858e4..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Check if vendor directory exists -if [ ! -d "/opt/www/vendor" ]; then - # Run composer install if vendor directory does not exist - composer install -fi - -# Run Hyperf application -php bin/hyperf.php "$@"