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

How to convert PHP5 Plugins to PHP7

Comments in 'Plugin Development' started by Epicrafter60, May 18, 2016.

  1. Epicrafter60
    Offline

    Epicrafter60 New Member

    Joined:
    Jun 5, 2015
    Posts:
    19
    Minecraft User:
    Epicrafter60
    Guys i need your help! I still do not know how to update plugins and convert them to php7 from php5... So I was gonna ask is there another way to update it aside from the api bumper with devtools? if there is, let me know but if you can explain well how to do it with devtools then please tell me because maybe there are things i didn't know so please help me out! Thanks :) ill reply
  2. Epicrafter60
    Offline

    Epicrafter60 New Member

    Joined:
    Jun 5, 2015
    Posts:
    19
    Minecraft User:
    Epicrafter60
    Umm anyone know?
  3. Inta
    Offline

    Inta Active Member

    Joined:
    Feb 11, 2016
    Posts:
    84
    Minecraft User:
    InstantlyTa
    Sure!
    1. Extract that plugin (/extractplugin) with DevTools
    2. Open ANY .php files in the /src folder
    3. Replace any String or Byte or Int or Float or something like that with that name+Tag
    Ex. StringTag ByteTag IntTag FloatTag
    I used to use PHPStorm to do this. Check out how to do it with PHPStorm on Google.
    And remember to change the "use" at the beginning of the file as well (String->StringTag, etc.)
    4. Back to business!
    Primus likes this.
  4. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Perhaps saying NBT class names need to have 'Tag' behind its name is better, since there are much more NBT tags. Additionally, you just don't open any PHP files, you need to open all of them.
    Also, don't forget to bump API at plugin.yml.
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Not all of them. Enum is ListTag now, not EnumTag
    Primus, minebuilder0110 and Survingo like this.
  6. Epicrafter60
    Offline

    Epicrafter60 New Member

    Joined:
    Jun 5, 2015
    Posts:
    19
    Minecraft User:
    Epicrafter60
    devtools is php5...
  7. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Use pmt.mcpe.me.
  8. TheDeibo
    Offline

    TheDeibo Notable Member Plugin Developer

    Joined:
    Sep 8, 2014
    Posts:
    692
    Plugins:
    1
    Minecraft User:
    TheDeibo
    here is a php7 devtools (bumped by me) it is the 1.10.0 release. Not 1.11.0 release. it works the same though.

    Attached Files:

Share This Page

Advertisement