예제 #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);
 }