本文整理汇总了PHP中Json::Decode方法的典型用法代码示例。如果您正苦于以下问题:PHP Json::Decode方法的具体用法?PHP Json::Decode怎么用?PHP Json::Decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Json
的用法示例。
在下文中一共展示了Json::Decode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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");
}
}
示例2: LoadFile
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;
}
示例3: Load
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;
}
示例4: Load
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;
}