增强 MongoDB 集成及用户管理功能
更新 composer.json 文件,添加新的依赖项:vlucas/phpdotenv、predis/predis、dragonmantank/cron-expression、php-amqplib/php-amqplib 以及 ramsey/uuid。 在 IndexController 中添加 MongoDB 连接测试接口。 在 UserController 中实现用户管理接口,用于创建、更新、删除和搜索用户。 在 database.php 中配置 MongoDB 连接设置。 更新路由,以包含新的与用户相关的 API 接口。 增强用户操作中的错误处理和日志记录功能。 在 process.php 中引入数据同步和工作进程配置。
This commit is contained in:
@@ -29,9 +29,17 @@ if (empty(Worker::$eventLoopClass)) {
|
||||
}
|
||||
|
||||
set_error_handler(function ($level, $message, $file = '', $line = 0) {
|
||||
// 忽略 MongoDB Laravel 的废弃警告(E_USER_DEPRECATED = 16384)
|
||||
// 这些警告不影响功能,只是提示使用新的API
|
||||
if ($level === E_USER_DEPRECATED && strpos($message, 'Using "$collection" property is deprecated') !== false) {
|
||||
return true; // 忽略此警告
|
||||
}
|
||||
|
||||
if (error_reporting() & $level) {
|
||||
throw new ErrorException($message, 0, $level, $file, $line);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if ($worker) {
|
||||
|
||||
Reference in New Issue
Block a user