diff --git a/update_amda/makeTree.php b/update_amda/makeTree.php index 77f8942..8143526 100644 --- a/update_amda/makeTree.php +++ b/update_amda/makeTree.php @@ -5,15 +5,14 @@ */ error_reporting(E_ERROR); - define("AMDA_SPASE_INTERFACE", getenv("AMDA_SPASE_INTERFACE")); - if ( AMDA_SPASE_INTERFACE == "" ) + if (getenv("AMDA_SPASE_INTERFACE") === false) require_once("./config.php"); else - require_once(AMDA_SPASE_INTERFACE."/config.php"); - - if (defined("DATAPATH") && file_exists(DATAPATH.'rank.json')) - $cmpArr = json_decode(file_get_contents(DATAPATH.'rank.json'), true); + require_once(getenv("AMDA_SPASE_INTERFACE")."/config.php"); + + if (getenv("DATAPATH") !== false && file_exists(getenv("DATAPATH")."rank.json")) + $cmpArr = json_decode(file_get_contents(getenv("DATAPATH")."rank.json"), true); else $cmpArr = null; -- libgit2 0.21.2