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

How do I modify a .Phar file?

Comments in 'Plugin Development' started by loginphp, Jul 9, 2014.

  1. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    The best part of the old API was because I was able to modify my server according to it's needs and do it on the fly.

    I've noticed with all these new plugins that I can't just open a .phar file and change something, and let me tell you, that sucks REALLY hard and will suck even harder in the long run. Not being able to edit a .phar file on the fly is like having an Apple device and needing a jailbreak (because Apple is so insecure about how they feel with their product).

    With Pocketmine 1.4, will there be a way to modify the source so we can have specific settings to make the game funner for everyone else?

    People don't realize it yet, but this will be the biggest disappointment for server owners soon to come.
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Not being able to edit a .phar isn't a result of a bad product on our end but a lack of knowledge on yours. Code inside a phar isn't obfuscated and can be easily decompressed and worked with.
    PEMapModder likes this.
  3. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    [EDIT: Removed my own post due to my own offensive behavior]
    Last edited: Jul 9, 2014
  4. MinecrafterJPN
    Offline

    MinecrafterJPN Active Member Plugin Developer

    Joined:
    Aug 26, 2013
    Posts:
    154
    Plugins:
    9
    Minecraft User:
    MinecrafterJPN
    Use FolderPluginLoader bundled in devtools.
    This loader can load a folder plugin :)
  5. MegaSamNinja
    Offline

    MegaSamNinja Active Member

    Joined:
    Sep 13, 2013
    Posts:
    138
    Minecraft User:
    Bamuel
    I wonder if there's a application which opens .phar files and you can edit all the .php files in it
  6. Adrian
    Offline

    Adrian Active Member

    Joined:
    Jun 26, 2014
    Posts:
    64
    Minecraft User:
    Adrian
    Can
    Can't you use [New API] DevTools I open a .phar file with notepad :D
    DevTools can be used to also extract and make .phar plugins which would let you see the source code :D
    It's only for New API and the plugin is made by awesome Shoghicp
  7. MegaSamNinja
    Offline

    MegaSamNinja Active Member

    Joined:
    Sep 13, 2013
    Posts:
    138
    Minecraft User:
    Bamuel
    Yea but that takes time in extracting and compiling


    I know how to make a phar and decompile a phar

    I was wondering if theres a software like notepad ++ but it shows all the files in the phar file and you can edit it
    Adrian likes this.
  8. Adrian
    Offline

    Adrian Active Member

    Joined:
    Jun 26, 2014
    Posts:
    64
    Minecraft User:
    Adrian
    I'm not sure if there is a software.
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder

    First, I agree with the point that a user-friendly plugin needs to allow easy modification of values inside. Therefore, I disagree with @Falk's point that being unable to edit values does not symbolize a bad product.

    Second, I disagree with your point that allowing editing PHAR files easily symbolizes a good product. Instead, a user-friendly plugin should allow users to edit in a config file, or even better, in-game and/or on-console, instead of editing the code directly.

    Third, I believe @Falk understands what the general public wants and enjoys. If you look at his plugins, they usually have allow you to edit settings in-game.

    Fourth, please do not be so offensive. You can suggest adding that feature in that plugin's thread if they don't have that feature.

    Fifth, to answer your question, http://unphar.com is what you may want. Then you will want to use DevTools to load unphar'ed plugins.

    Sixth, plugin developers sometimes don't want people to edit their plugins, especially when people, like, change "SimpleAuth" into "[Server name]-Auth". Just some, idk.
    Last edited: Jul 9, 2014
    Falk and loginphp like this.
  10. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    That's awesome! now this post is useful and packs a punch :) Thanks MinecrafterJPN.
  11. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    This is good to know, thanks! Very helpful post and what's old news to you is always new to me and others here who may see your posts.
  12. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    You're right, I was WAYY too offensive there. I may even get banned now o_O I better watch it next time. It's like I went crazy or something, not cool at all. I would take the time to learn how to program, but as you know that's a lifetime learning experience and I'm already learning other things.

    I also sort of understand what you mean about some devs not wanting people to edit their files. I can see myself in their shoes. Thanks for the help and insight PEMapModder ^_^

    Where can I get devtools at? I looked in the plugin section but I don't see anything, maybe I just missed it.

    The unphar website you gave me was exactly what I was looking for, now to just compile it back using devtools!

    When you get a chance take a look at my thread HERE --> http://forums.pocketmine.net/threads/leveling-up-would-give-huge-replay-value-to-this-game.4244/
    Last edited: Jul 9, 2014
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    http://forums.pocketmine.net/plugins/.515/
    Using /extractplugin <plugin> in DevTools can also decompress the file into a folder, and it also saves the trouble of network upload/download as well as helps editing directly.
    loginphp likes this.
  14. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    Hmm ok, so this is the plugin 'for' DevTools, but is there any idea where I can get DevTools? I've tried searching the plugin section but I didn't see it. Maybe I just missed it. Strangely I can't seem to find it on google either hehe =]
    Last edited: Jul 9, 2014
  15. Topic
    Offline

    Topic New Member Plugin Developer

    Joined:
    Aug 29, 2013
    Posts:
    47
    Plugins:
    3
    Minecraft User:
    topic
    But remember there is a copyright, and not all are allowed to edit their plugins
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You can edit, just cannot publish.
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This is exactly the plugin called DevTools, not a plugin "for" DevTools.
  18. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    Ok I think I get it now. I put this in my plugins folder, then load it from the server console? I thought I tried that and it didn't recognize one of the DevTool commands I put in. I'll give it another try. I'm running the Pocketmine 1.4dev version that came out Sunday. Please forgive me for being so new to all of this.

    Also, I would never edit someone's hard work and try to republish it as my own. If anything I would just simply ask the plugin owner and get his/her approval of the edit to publish. However, I don't intend on publishing others work ^_^ You guys are very helpful to me by coming back and replying when you don't have to. I'll remember your names <3
    Last edited: Jul 9, 2014
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is because I am too bored. (This is partially a lie though. I have just written 440 lines and rewritten 126 lines to PocketFactions, xEcon and StatsCore today plus digging into some PocketMine-MP bugs and studying the new entity events they added in the beta release, but I was indeed a bit bored this morning)

    Look at the bottom of this page ;)
    Last edited: Jul 9, 2014
  20. loginphp
    Offline

    loginphp Active Member

    Joined:
    Sep 17, 2013
    Posts:
    75
    Minecraft User:
    loginphp
    Any idea why the devtools plugin is not loading for me? I put it in my plugins folder. I see no instructions anywhere on how to install and use it, I can only find instructions on what the commands mean. I'm trying to type the commands in the server console and it says it don't exist and even tried using /plugins to see if it's on the list, it's not even there. >_<

    I type in for example /makeplugin and I get "00:39:40[INFO] Unknown command. Type "help" for help."

    Apparently the plugin doesn't exist in the console, but it's in the folder. I'm also baffled that this plugin has no installation instructions to be found anywhere. Not even the official website has instructions. :/
    Last edited: Jul 10, 2014

Share This Page

Advertisement