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

saveResource(string $name) not working as Expected

Discussion in 'Plugin Help' started by sero583, Jan 28, 2019.

  1. sero583

    sero583 Spider

    Messages:
    8
    GitHub:
    sero583
    Always when I use this function, I have a folder right in the place where plugin.yml is at called "resources". I have also subfolders in it, I just do that "subfolder/fname.ftype". The file is saving but the returned boolean is always false and the file is empty but some are not. Default config for e.g is empty…

    EDIT: Used files are .json files. But path is absolutelty correct. I even looped getResources() and did saveResource in that way. No chance.
     
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Do you have reproducing code for this problem?
     
  3. sero583

    sero583 Spider

    Messages:
    8
    GitHub:
    sero583
    PHP:
    public const DEFAULT_PRESET_CONFIGS = array("config.json""language/en_US.json""language/de_DE.json""language/en_UK.json""EXECUTION_VALUES.json");

    foreach(
    self::DEFAULT_PRESET_CONFIGS as $name) {
                
    $this->plugin->saveResource($name);
                
    StaticLogger::dev_info("Saving resource $name");
                
    $this->configs[$name] = new Config($this->plugin->getDataFolder() . $nameConfig::DETECT);
            }
    The code which gets executed
     
    Last edited: Jan 28, 2019
  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.