Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

to phar or not to phar?

Comments in 'Plugin Development' started by udwarf, Aug 20, 2016.

  1. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    Hi guys!
    Sorry that this is post without code attempt examples and so on

    I have just a simple question
    Should I use phar-format of my plugins if I'm not going to distribute them?
    It there any benefits of using plugins on production server in phars instead of php-sources?
  2. EdwardAllington
    Offline

    EdwardAllington Active Member

    Joined:
    Jan 29, 2015
    Posts:
    78
    Minecraft User:
    Edwardthedog2
    Yes, and yes. There are indeed benefits. The main reason, is because when they are in zip format, they can only be loaded with Developer Tools. Running the plugins with developer tools (at least as far as I know, and have experienced), can be slower. So I would indeed recommend running them in phar format. Plus, when in phar format, the plugins are easier and quicker to install.
    udwarf likes this.
  3. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    In a nutshell: Use PHAR when you're distributing it for deployment, and source when you're developing, and want people to easily see your code. Unless it's a development server, you're probably going to want to use an archived version of the plugin. You might also want to check out this StackOverflow question: http://stackoverflow.com/questions/3521484/advantages-of-phar-archives-in-php
    udwarf and SOFe like this.
  4. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    @PEMapModder's NOWHERE framework might make versioning of phar files easier by generating a new plugin.yml every time.

Share This Page

Advertisement