fix: 修复初始化安装时清理缓存报错的问题

修改aapanel 安装文档增加inotify 扩展说明
修改webman.php 自动检测是否安装inotify扩展,如果安装则自动拉取热重载监控
This commit is contained in:
xboard 2024-05-29 00:56:00 +08:00
parent fd52795f49
commit 7246eb6ebc
3 changed files with 32 additions and 29 deletions

View File

@ -188,7 +188,7 @@ class XboardInstall extends Command
$this->saveToEnv($envConfig); $this->saveToEnv($envConfig);
$this->call('config:cache'); $this->call('config:cache');
$this->call('cache:clear'); \Artisan::call('cache:clear');
$this->info('正在导入数据库请稍等...'); $this->info('正在导入数据库请稍等...');
\Artisan::call("migrate", ['--force' => true]); \Artisan::call("migrate", ['--force' => true]);
$this->info(\Artisan::output()); $this->info(\Artisan::output());

View File

@ -23,7 +23,7 @@ URL=https://www.aapanel.com/script/install_6.0_en.sh && if [ -f /usr/bin/curl ];
- swoole4 - swoole4
- readline - readline
- event - event
- inotify - inotify (可选,热重载依赖)
4. 解除被禁止函数 4. 解除被禁止函数
> aaPanel 面板 > App Store > 找到PHP 8.1点击Setting > Disabled functions 将以下函数从列表中删除 > aaPanel 面板 > App Store > 找到PHP 8.1点击Setting > Disabled functions 将以下函数从列表中删除

View File

@ -23,6 +23,7 @@ $http_worker->onMessage = static function ($connection, $request) {
} }
}; };
if (extension_loaded('inotify')) {
$worker = new Worker(); $worker = new Worker();
$worker->name = 'FileMonitor'; $worker->name = 'FileMonitor';
$worker->reloadable = false; $worker->reloadable = false;
@ -54,6 +55,8 @@ $worker->onWorkerStart = function ($worker) {
} }
Worker::$globalEvent->add($worker->inotifyFd, EventInterface::EV_READ, 'check_files_change'); Worker::$globalEvent->add($worker->inotifyFd, EventInterface::EV_READ, 'check_files_change');
}; };
}
function addInofity(string $realpath, $fd) function addInofity(string $realpath, $fd)
{ {
global $monitor_files; global $monitor_files;