示例#1
0
文件: Yaml.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return string|array|stdClass The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     if (extension_loaded('yaml')) {
         return yaml_parse($contents);
     }
     return YamlParser::parse($contents);
 }
示例#2
0
 /**
  * Loads in the given file and parses it.
  *
  * @param string|bool|null $file File to load
  *
  * @return array The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = is_file($file) ? $file : false;
     $contents = $this->parseVars(Utils::getContent($this->file));
     if ($this->file && !is_null($file)) {
         $this->parsedFile = $this->parseProperties($contents);
     }
 }
示例#3
0
文件: Neon.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return array The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     return NeonParser::decode($contents);
 }
示例#4
0
文件: Json.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return array The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     return json_decode($contents, true);
 }
示例#5
0
文件: Xml.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return array|SimpleXMLElement The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     return simplexml_load_string($contents, 'SimpleXMLElement', LIBXML_NOWARNING | LIBXML_NOERROR);
 }
示例#6
0
文件: Toml.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return array The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     return TomlLib::Parse($contents);
 }
示例#7
0
文件: Ini.php 项目: xeriab/konfig
 /**
  * Loads in the given file and parses it.
  *
  * @param string $file File to load
  *
  * @return array The parsed file data
  *
  * @since              0.2.4
  * @codeCoverageIgnore
  */
 protected function loadFile($file = null)
 {
     $this->file = $file;
     $contents = $this->parseVars(Utils::getContent($file));
     return @parse_ini_string($contents, true);
 }