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

Use a config file

Discussion in 'Development' started by HittmanA, Nov 23, 2016.

  1. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    How can I make/access config files from a plugin?
     
  2. Reid

    Reid Spider Jockey

    Messages:
    43
    I would recommend looking at and playing with some peoples code on GitHub that helped me a lot then once you think you have a pretty decent understanding of the API read the pocketmine src
     
    HittmanA likes this.
  3. Bamuel

    Bamuel Silverfish

    Messages:
    16
    GitHub:
    bamuel
    alternatively if you wanna read whole config file
    PHP:
    $myconfig fopen("plugins/dir/config.yml""w") or die("Unable to open file!");
     
    Last edited: Nov 23, 2016
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Throwing exceptions is better than die() in plugins. You don't want to destroy other plugins just because your own plugin doesn't work. Moreover, die() would probably not kill other threads.
     
    ifvictr likes this.
  5. Bamuel

    Bamuel Silverfish

    Messages:
    16
    GitHub:
    bamuel
    Shhhh, I'm destroying people's code
     
  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.