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

EconomyAPI Not Compatiable With Plugin

Discussion in 'Plugin Help' started by ALLINSEO, Mar 23, 2017.

  1. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    I am trying to use a plugin and getting errors, I think cause its a little old and maybe the plugin code is calling to an older function and needs to be changed?
    ERROR
    Code:
    Call to undefined method onebone\economyapi\EconomyAPI::getConfigurationValue()
    
    Plugin Code
    Code:
      $autoSaveTerm = EconomyAPI::getInstance()->getConfigurationValue("auto-save-interval");
    
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    make sure EconomyAPI::getInstance() returns economy API not null
    other then that i am not very sure
     
  3. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    how would I run such a command to get output and see if it is null or not?

    this seems to be whats in EconomyApi.php
    Code:
    if($this->getConfig()->get("auto-save-interval") > 0){
    $this->getServer()->getScheduler()->scheduleDelayedRepeatingTask(new SaveTask($this), $this->getConfig()->get("auto-save-interval") * 1200, $this->getConfig()->get("auto-save-interval") * 1200);
    }
    
    
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    by trying to assert it
    if (EconomyAPI::getInstance() !== EconomyAPI) echo "ERROR!"
    but i doubt that's the issue, you should just look into the main file for the API and see if it still existed
    i think that's more likely
     
  5. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    I was looking through console and noticed there is a little more to the error.

    ERROR 1;
    Code:
    Call to undefined method onebone\economyapi\EconomyAPI::getConfigurationValue()" (EXCEPTION) in "/EconomyPotionShop.phar/src/Khinenw/PotionDispenser/Dispenser" at line 97
    
    ERROR 2;
    Code:
    [Server] INFO Notice: Use of undefined constant EconomyAPI - assumed 'EconomyAPI' in phar:///plugins/EconomyPotionShop.phar/src/Khinenw/PotionDispenser/Dispenser.php on line 63
    
    Update;
    I just checked I have a ton of plugins that use
    Code:
    use onebone\economyapi\EconomyAPI;
    
    although I dont see them using "::getConfigurationValue()" so maybe the call to the plugin is incorrect?
    I am attempting to use This Plugin

    UDATE2;
    it is definitly not using the right function, I can only find "getConfigurationValue" in an older version of EconomyAPI that I have "EconomyAPI v2.0.9" none of the new files contain this function.
     
    Last edited: Mar 23, 2017
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    check the economy of the latest main.php file to see if there's any ways to get the value you wanted
     
  7. ALLINSEO

    ALLINSEO Baby Zombie

    Messages:
    133
    updating the plugin to the new config function for economyAPI fixed it thanks.
     
  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.