当不使用mongodb时,启动报错注入错误。[ERROR] DI Reflection Manager collecting class reflections failed.

Open
#76 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
mongodb, php
Domain
backend, databases

Research direction

Start by reading the listed result classes under vendor/hyperf/gotask/src/MongoClient/Type/ and the DI reflection path that collects them. Reproduce startup with the asynchronous task feature enabled and MongoDB absent; done means startup no longer reports missing MongoDB\BSON\Unserializable interfaces when MongoDB is not used.

Written by the indexing model from the issue text.

Description

当只是使用golang的异步任务功能,没有安装mongodb包时,会出现错误:
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/BulkWriteResult.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/DeleteResult.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/IndexInfo.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/InsertManyResult.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/InsertOneResult.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found
[ERROR] DI Reflection Manager collecting class reflections failed.
File: /home/vagrant/code/robot-processes/vendor/hyperf/gotask/src/MongoClient/Type/UpdateResult.php.
Exception: Interface "MongoDB\BSON\Unserializable" not found

请问如何解决或者屏蔽?

Dominant language
PHP
Stars
255
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyperf/gotask

All issues in hyperf/gotask

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.