How to use composer with pmmp plugins?

Discussion in 'Development' started by mcbeserver, Aug 15, 2021.

  1. mcbeserver

    mcbeserver Creeper

    Messages:
    2
    Hey guys,

    image I have a composer file like this:

    Code:
    {
        "name": "plugin/plugin",
        "description": "Plugin",
        "type": "project",
        "require": {
            "pocketmine/pocketmine-mp": "^3.22.1",
            "joshcam/mysqli-database-class": "^2.9.3",
            "ext-mysqli": "*"
        },
        "autoload": {
            "psr-4": {
                "Plugin\\Plugin\\": "src/"
            }
        }
    }
    
    Using these dependencies is no problem in my IDE, but when I put the source files to my local plugins folder of my server, it cannot find the mysqli stuff I added in the composer.json. I just drag and drop my src + plugin.yml and using devtools - so I'm not converting my plugin into a phar or something like that. What step do I miss? I've a lot of experience in JavaScript...and there we have the package.json (the npm stuff) - I think its pritty similar.

    I mean of course it cannot find these dependencies, since the mysqli sources aren't in the plugins folder of the server. Do I need to download the sources of mysqli and put this into my plugins folder? I already tried this out, but it didnt work. I'd like to use more dependecies for my plugin, not only msqli. Just a side note.

    I've also basic knowledge in Java + Maven..so if someone is familar with this, you can also explain it to me in the java + maven-way :D


    Thanks in advance.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.