1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Announcement PocketMine-MP is now using Composer

Discussion in 'News' started by dktapps, Sep 10, 2017.

Thread Status:
Not open for further replies.
  1. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Hello to everyone reading this: I'm here to announce that PocketMine-MP is now using Composer for dependency and autoloader management.

    Hold on. What is Composer?
    Composer is a dependency manager for PHP project. Using it means that PocketMine-MP can now use third-party libraries for implementing things instead of writing in-house implementations or copy-pasting code into the project.

    Read more about Composer here.

    How does this affect me?
    If you are using a source-code installation of PocketMine-MP (git clone for example) you will now need Composer to initialize the autoloader and install dependencies required by PocketMine-MP.

    This does not affect installations using prebuilt phars obtained from Jenkins, since Jenkins handles autoloader generation and dependency installation automatically. This means that Jenkins phars will automatically include all necessary autoloader files and dependency packages.

    Where can I get Composer for my system?
    If you have updated your PHP binary from official sources recently, you'll already have a composer.phar in your PHP binary's `bin` folder.

    If you want to install Composer manually, you can do so by following the instructions here.

    Help! It's telling me "Composer autoloader not found" when I try to start the server!
    This message means exactly what it says. Initializing the autoloader is easy:

    With the local composer.phar provided with our PHP packages
    Code:
    $ bin/php7/bin/php bin/composer.phar install
    
    With a global Composer installation:
    Code:
    $ composer install
    
    Updating dependencies when updating PocketMine-MP
    Also very simple. This is the same as the `install` process, just substitute `update` for `install`.

    It is crucial that you remember to update dependencies when you update a source-code installation.
     
  2. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    Any differences for Windows or should we just run the command provided through CLI?

    EDIT: Nevermind, I see there's an installer for Windows. This'll be good though!
     
  3. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    The path to PHP on the prebuilts for Windows is `bin\php\php.exe` instead of `bin/php7/bin/php`, but other than that the process is the same. Composer is already shipped with Windows builds.


    There will be updates in the next few days to automate the whole process.
     
  4. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    Might as well have a global installation of Composers anyways, but can't wait to see what this brings us in the future!
     
  5. NFGamerMC

    NFGamerMC Spider Jockey

    Messages:
    30
    Does this mean composer packages in plugins without copying? @dktapps
     
  6. XenialDan

    XenialDan Baby Zombie

    Messages:
    141
    GitHub:
    thebigsmilexd
    In my oppinion, this simply overcomplicates the installation process for people who simply want to run a server from source instead of having to fiddle around with 3 setups: getting the src and installing pmmp, composer, plugins
     
    Last edited: Sep 11, 2017
  7. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    Well why would a composer installation make people go crazy?

    Also yes it is complicated now as to installing this composer which is completely new to PocketMine Beginners whom have not heard of it.

    But I think its something good.
     
  8. alexwolf_dev

    alexwolf_dev Spider Jockey

    Messages:
    43
    GitHub:
    Frago9876543210
    Nice, but bin for windows without colors.
     
  9. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Since when is it supposed to have colors?
     
  10. ProjectInfinity

    ProjectInfinity Witch

    Messages:
    58
    GitHub:
    projectinfinity
    Great news!
     
    sharletsings123 likes this.
  11. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    I think he means those coloured texts that the android apk "Pocket Server" has a feature where you can make the logs of PMMP Colour full or is it just that PMMP supports it as well? Anyways I believe its what he meant or else no clue.
     
  12. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    Lawl, I have been using the composer for 1 of my projects and its good in its job.
     
  13. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    And once composer is set up, development gets much easier with depndency management.
     
  14. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    beginners shouldn't be running servers from source-code... you should always use phars for production servers.
     
  15. Eternalharvest

    Eternalharvest Spider

    Messages:
    11
    GitHub:
    eternalharvest
    I want to use composer for my plugin dependency management and automate phar build.
    Is there official guideline to use composer for these purpose?

    I wonder if DevTool plugin can load the class managed by composer when I introduce composer in my plugin.
    Anyway, I think composer support is nice work!!
     
  16. sharletsings123

    sharletsings123 Baby Zombie

    Messages:
    116
    GitHub:
    sharletk
    I think the team is working out on making a space where "how to use composer in my project for pmmp" is explained on the docs. Not sure but ask a staff member.
     
    LewBr likes this.
  17. KaitoDoDoYT

    KaitoDoDoYT Creeper

    Messages:
    4
    GitHub:
    kaitododoyt
    How to install autoloader on windows?
     
  18. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    reading the original post might be a good place to start...
     
  19. Bluzzi

    Bluzzi Spider Jockey

    Messages:
    46
    root@hyp04:/home/ESPEL# bin/php7/bin/php bin/composer.phar install
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Composer could not find a composer.json file in /home/ESPEL
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

    I have this error, I do not quite understand how to put the dialer in place: /
     
  20. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Don't run as root, first of all. Try following the instructions:
     
    Bluzzi, iiFlamiinBlaze and dktapps like this.
Thread Status:
Not open for further replies.
  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.