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

Weird config saving issue.

Comments in 'Plugin Development' started by Legoboy0215, Jan 22, 2016.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    I have a file called signs.yml. I save all my sign hashes there, somewhat like this:

    array(1){
    'hi' => true
    }

    Everytime I save it, after 10 seconds it disappears. Anyone know why?
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    So does it appear in the signs.yml but then it automatically disappears?
    If it is not saved at all, maybe you haven't done save()?
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Thats a var_dump($config->getAll()) format.
    I did save(). I have a task to show the config files content. When I place a sign, it is saved. The var_dump task shows it. When I break the sign it says removed (expected behavior). But when I place the sign, wait for a few seconds, then the var_dump task shows that the file is empty, and when i break the sign there is no removed message (Which means signis not in config). Why does it disappear ???
    TheDeibo likes this.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Maybe you should really show more source.
    Vaivez66 likes this.
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    There is actually nothing to show.
    PHP:
    $all $this->getConfig()->getAll();
    $all[] = "ho";
    $this->getConfig()->setAll($all);
    $this->getConfig()->save();
    Get config returns my config instance file.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Any other code that involves your config?
    Legoboy0215 and PocketKiller like this.

Share This Page

Advertisement