public function __construct($Section) { $this->Section = $Section; $Data = Json::Decode("lang/{$Section}.json"); if (is_array($Data)) { $this->Data = $Data; } else { Std::Out("[Warning] [Lang] Can't load lang/{$Section}.json"); } }
private static function LoadFile($File) { if (substr($File, strlen($File) - 5) !== '.json') { $File .= '.json'; } $Data = Json::Decode("config/{$File}"); if (is_array($Data)) { return self::$Config[substr($File, 0, strlen($File) - 5)] = $Data; } return false; }
public final function Load() { if (!is_string($this->Extension) || extension_loaded($this->Extension)) { if ($this->ModuleManager->KeyExists($this->Key)) { $this->Path = "class/Modules/{$this->Key}_{$this->AliasOf}"; $this->JPath = $this->Path . '.json'; $this->XPath = $this->Path . '.' . $this->PathExtension; if (basename(dirname(realpath($this->JPath))) === 'Modules') { $Json = Json::Decode($this->JPath); if (is_array($Json)) { if (is_readable($this->XPath)) { // Lint $this->Data = $Json; if (isset($this->Data['Libs']) && is_array($this->Data['Libs'])) { foreach ($this->Data['Libs'] as $Lib) { if (!LoadLib($Lib)) { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). {$Lib} lib doesn't exists"); $this->Loaded = self::NOT_LOADED; return $this->Loaded; } } } $this->Loaded = $this->_Load(); return $this->Loaded; } else { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). {$this->PathExtension} file is not readable"); } } else { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). Json file is not decodeable"); } } else { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). It is not in Modules folder"); } } else { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). That key doesn't exists"); } } else { Std::Out("[Warning] [Modules] Can't load {$this->Key}::{$this->Name} ({$this->AliasOf}). {$this->Extension} extension is not loaded"); } $this->Loaded = self::NOT_LOADED; return $this->Loaded; }
public final function Load() { if (!is_string($this->Extension) || extension_loaded($this->Extension)) { $this->Path = __DIR__ . "/Threads/{$this->Name}"; $this->JPath = $this->Path . '.json'; $this->XPath = $this->Path . '.' . $this->PathExtension; if (basename(dirname(realpath($this->JPath))) === 'Threads') { $Json = Json::Decode($this->JPath); if (is_array($Json)) { if (is_readable($this->XPath)) { // Lint $this->Data = $Json; if (isset($this->Data['Libs']) && is_array($this->Data['Libs'])) { foreach ($this->Data['Libs'] as $Lib) { if (!LoadLib($Lib)) { Std::Out("[Warning] [Threads] Can't load {$this->Name}. {$Lib} lib doesn't exists"); $this->Loaded = self::NOT_LOADED; return $this->Loaded; } } } $this->Loaded = $this->_Load(); return $this->Loaded; } else { Std::Out("[Warning] [Threads] Can't load {$this->Name}. {$this->PathExtension} file is not readable"); } } else { Std::Out("[Warning] [Threads] Can't load {$this->Name}. Json file is not decodeable"); } } else { Std::Out("[Warning] [Threads] Can't load {$this->Name}. It is not in Threads folder"); } } else { Std::Out("[Warning] [Threads] Can't load {$this->Name}. {$this->Extension} extension is not loaded"); } $this->Loaded = self::NOT_LOADED; return $this->Loaded; }