当前位置: 首页>>代码示例>>PHP>>正文


PHP Json::Decode方法代码示例

本文整理汇总了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");
     }
 }
开发者ID:kumar003vinod,项目名称:WhatsBot,代码行数:10,代码来源:Lang.php

示例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;
 }
开发者ID:kumar003vinod,项目名称:WhatsBot,代码行数:11,代码来源:Config.php

示例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;
 }
开发者ID:kumar003vinod,项目名称:WhatsBot,代码行数:42,代码来源:Module.php

示例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;
 }
开发者ID:hasanalom,项目名称:WhatsBot,代码行数:38,代码来源:Thread.php


注:本文中的Json::Decode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。