Loads an XML setup file and parses it.

@param   string  $path  A path to the XML setup file.
@return  object
972792
public function loadSetupFile($path)
	{
		$result = false;

		if ($path)
		{
			if (!file_exists($path))
			{
				return $result;
			}

			$xml = simplexml_load_file($path);

			if ($params = $xml->params)
			{
				foreach ($params as $param)
				{
					$this->setXML($param);
					$result = true;
				}
			}
		}
		else
		{
			$result = true;
		}

		return $result;
	}
352353
private function loadFromPath(string $path): self
    {
        switch ($this->extension) {
            case self::FORMAT_JPEG:
                $this->createFromJpeg($path);
                break;
            case self::FORMAT_PNG:
                $this->createFromPng($path);
                break;
            case self::FORMAT_GIF:
                $this->createFromGif($path);
                break;
            case self::FORMAT_WD_IMAGE:
                $this->createFromEncrypted($path);
                break;
            default:
                throw new ImageException('This image format is not supported!');
        }
        return $this;
    }
576458
public static function parseXMLLanguageFile($path)
	{
		if (!is_readable($path))
		{
			throw new \RuntimeException('File not found or not readable');
		}

		// Try to load the file
		$xml = simplexml_load_file($path);

		if (!$xml)
		{
			return null;
		}

		// Check that it's a metadata file
		if ((string) $xml->getName() != 'metafile')
		{
			return null;
		}

		$metadata = array();

		foreach ($xml->metadata->children() as $child)
		{
			$metadata[$child->getName()] = (string) $child;
		}

		return $metadata;
	}
1195329
protected function parsePath($path = null)
    {
        $this->dirname   = '';
        $this->basename  = '';
        $this->extension = '';
        $this->filename  = '';

        if (empty($path)) {
            return $this;
        }

        $parts = pathinfo($path);

        if (isset($parts['dirname'])) {
            $this->dirname = rtrim($parts['dirname'], '/');
        }

        if (isset($parts['basename'])) {
            $this->basename = $parts['basename'];
        }

        if (isset($parts['extension'])) {
            $this->extension = $parts['extension'];
        }

        if (isset($parts['filename'])) {
            $this->filename = $parts['filename'];
        }

        return $this;
    }
92841
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)
        );
        $paths = array_map('strval', iterator_to_array($iterator));
        uasort($paths, 'strnatcasecmp');

        $features = array();

        foreach ($paths as $path) {
            $path = (string) $path;
            $loader = $this->gherkin->resolveLoader($path);

            if (null !== $loader) {
                $features = array_merge($features, $loader->load($path));
            }
        }

        return $features;
    }
277701
public static function parseFile($path)
    {
        if(!is_file($path))
        {
            throw new Exception('Invalid file path');
        }

        $toml = file_get_contents($path);

        // Remove BOM if present
        $toml = preg_replace('/^' . pack('H*','EFBBBF') . '/', '', $toml);

        return self::parse($toml);
    }
461918
protected function loadPath($path) {
        if (directory_exists($path)) {
            return $this->loadDirectory($path);
        } else if (file_exists($path)) {
            return $this->loadFile($path);
        }

        return [];
    }
981473
public function load($path = null, $filename = null)
    {
        $this->path     = isset($path) ? $path : $this->path;
        $this->filename = isset($filename) ? $filename : $this->filename;

        if (is_file($this->path.'/'.$this->filename))
        {
            $this->settings = json_decode(file_get_contents($this->path.'/'.$this->filename), true);
        }
        else
        {
            $this->settings = [];
        }

        return $this;
    }
588043
public function loadFile($path) {
        $config = null;

        try {
            $config = require $path;
        } catch (Exception $ex) {}

        if ( ! is_array($config)) {
            throw new InvalidConfigFormatException(
                s('ArrayConfigDriver expects config at path %s to be of format array[key => value].', $path)
            );
        }

        return $config;
    }
919894
public static function parseXmlLanguageFile($path)
	{
		if (!is_readable($path))
		{
			throw new \RuntimeException('File not found or not readable');
		}

		// Try to load the file
		$xml = simplexml_load_file($path);

		if (!$xml)
		{
			return;
		}

		// Check that it's a metadata file
		if ((string) $xml->getName() != 'metafile')
		{
			return;
		}

		$metadata = array();

		/** @var \SimpleXMLElement $child */
		foreach ($xml->metadata->children() as $child)
		{
			$metadata[$child->getName()] = (string) $child;
		}

		return $metadata;
	}
370075
public function getFile($path)
    {
        $file = new File($this->getFileSystemId(), $this->getFullPath($path));
        $file->setServiceLocator($this->getServiceLocator());
        return $file;
    }
820043
protected function loadModular($path)
    {
        $config = array();

        // Loop over files in $path (recursing into sub-directories)
        foreach ($this->filesIn($path) as $file) {
            // Determine the relative path of the current file by
            // stripping $path from the beginning of the absolute path
            $nestPath = $this->getNestPath($file->getPathname(), $path);

            $content = $this->configLoader->load($file->getPathname());
            $config = $this->merge($config, $this->nest($content, $nestPath));
        }

        return $config;
    }
1203013
public function loadTemplate($path)
    {
        $tpl = new Template();

        $tpl->injectVariables($this->getVariables());
        $tpl->setViewName($path);
        $tpl->setConfig("allow_debug", $this->getConfig("allow_debug"));
        $tpl->setConfig("layout", $this->getConfig("layout"));

        return $tpl->compile();
    }
738354
private function loadConfigurationFiles($path)
    {
        $this->configPath = $path;

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $this->set($fileKey, require $path);
        }

        foreach ($this->getConfigurationFiles() as $fileKey => $path) {
            $envConfig = require $path;

            foreach ($envConfig as $envKey => $value) {
                $this->set($fileKey.'.'.$envKey, $value);
            }
        }
    }
89111
protected function loadFromFile($path)
    {
        if (!file_exists($path)) {
            throw new \Exception(sprintf('Map file "%s" does not exist.', $path));
        }

        $map = require($path);
        if (!is_array($map)
            || !is_array($map[Settings::ALPHABET_CYR])
            || !is_array($map[Settings::ALPHABET_LAT])
        ) {
            throw new \Exception(sprintf(
                'Map file "%s" is not valid, should return an array with %s and %s subarrays.',
                $path,
                Settings::ALPHABET_CYR,
                Settings::ALPHABET_LAT
            ));
        }

        return $map;
    }
835048
public function load($path)
    {
        list($data, $items) = array(array(), array($path));

        if (substr((string) $path, -4) !== '.php')
        {
            $directory = new \RecursiveDirectoryIterator($path);

            $iterator = new \RecursiveIteratorIterator($directory);

            $regex = new \RegexIterator($iterator, '/^.+\.php$/i', 1);

            $items = (array) array_keys(iterator_to_array($regex));
        }

        foreach ((array) $items as $item)
        {
            $name = $this->rename($item, $path);

            $data = require $item;

            $this->set((string) $name, $data);
        }
    }
545384
protected function loadMeta($path, \DOMNode $context = null)
    {
        $result = [];

        /** @var \DOMElement $node */
        foreach ($this->xpath->query($path, $context) as $node) {
            $attribute = $node->tagName;
            $lang = $this->xpath->query('@lang', $node)->item(0)->nodeValue;

            if (!isset($result[$node->tagName])) {
                $result[$attribute] = [];
            }
            $result[$attribute][$lang] = $node->textContent;
        }

        return $result;
    }