/** * 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); }
/** * 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); } }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }