symfony / monolog-bundle

Symfony Monolog Bundle

Home Page:symfony.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error Attempted to load class "MongoClient" from the global namespace

cimo23 opened this issue · comments

$client = new Definition('MongoClient', [

bug occur when we use the configuration without Id Service
class MongoClient not compatible with new PHP mongo class 'MongoDB\Client'

monolog:
    handlers:
        main:
            type: mongo
            mongo:
               host: '127.0.0.1'
               port: 27017
               user: root
               pass: '123456'
               database: logsDb
               collection: logsCollection

This seems to be incompatible with the newer mongodb extension, but I don't think changing the class name in the definition is enough to make it work. Unfortunately, I currently don't have a project I can try this on. Would you like to work on a PR for this?

I don't Understande work on PR

but i have make the test and changing the definition resolve the bug

If you have made the change and it solves the issue, than you are pretty much done with the pull request.

Github has a documentation on how create pull requests: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

I find it a bit hard to understand, so here is the short version according to me:

  1. Fork the symfony/monolog-bundle repository
    You should have a repository called cimo23/monolog-bundle afterwards, that is basically a copy of the original
  2. Clone your fork (cimo23/monolog-bundle)
  3. Switch into a new branch (e.g. git switch -c issue_420_fix)
  4. Copy your changes into this repository, commit and push them
  5. In Github when you go to symfony/monolog-bundle you should see a notification, that you have a branch from which you can create a pull request
  6. Fill out the form and click the green button. That's it!

Afterwards people will review your PR and let you know if you need to make some more adjustments and once everything is ready one of the contributors will merge the pull request.