Loads features from provided resource.

@param string $path Resource to load

@return FeatureNode[]
342742
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        if ($this->cache) {
            if ($this->cache->isFresh($path, filemtime($path))) {
                $feature = $this->cache->read($path);
            } elseif (null !== $feature = $this->parseFeature($path)) {
                $this->cache->write($path, $feature);
            }
        } else {
            $feature = $this->parseFeature($path);
        }

        return null !== $feature ? array($feature) : array();
    }
748096
private function readNode($path)
    {
        $finder = new Finder($path);

        if(false !== $finder->getPropertiesPath())
        {
            $uri = str_replace($this->contentPath, '', $path);
            $uri = $uri ? $uri : '/';
            $properties = PropertiesParser::parse($finder);
            $node = new Node($properties['name'], $uri);

            //Add child nodes and link references
            $index = 0;
            foreach (SortorderParser::parse($finder) as $subPath)
            {
                $child = $this->readNode($path . DIRECTORY_SEPARATOR . $subPath);
                $node->addChildAsLast($child);
                $child->setParent($node);

                if($index)
                {
                    $child->setPrev($node->getChildByIndex($index - 1));
                    $node->getChildByIndex($index - 1)->setNext($child);
                }

                $index++;
            }

            //Set properties and set tree_ properties to nodes
            foreach ($properties['properties'] as $key => $value)
            {
                $node->setProperty($key, $value);
            }

            return $node;
        }

        throw new \Coral\SiteBundle\Exception\SitemapException("Unable to find properties for: [$path]");
    }
1285008
public function loadFile($path) {
        $content = trim(file_read($path));
        $config = [];

        if ( ! empty($content)) {
            $config = Yaml::parse($content);
        }

        return $config;
    }
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;
    }
450326
public static function serialize(Path $path): array
    {
        $result = [];
        foreach ($path as $step) {
            $result[] = $step;
        }

        return $result;
    }
96278
public function readStream($path)
    {
        try {
            return [
                'stream' => $this->api->content($path),
                'path' => $path,
            ];
        } catch (\Exception $e) {
            return false;
        }
    }
393984
protected function loadStructureAreas($path, $xpath)
    {
        $result = [];

        foreach ($xpath->query($path) as $node) {
            $area = [];

            foreach ($node->attributes as $key => $attr) {
                if (in_array($key, ['key'])) {
                    $area[$key] = $attr->value;
                } else {
                    $area['attributes'][$key] = $attr->value;
                }
            }

            $meta = $this->loadMeta('x:meta/x:*', $xpath, $node);
            $area['title'] = $meta['title'];

            if (!isset($area['key'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Zone does not have a key in the attributes');
            }

            $result[] = $area;
        }

        return $result;
    }
740244
private function getFiles($path)
    {
        if (is_file($path)) {
            return [new SplFileInfo($path, '', '')];
        }

        return $this->finder->name('*.php')->in(realpath($path));
    }
144348
public function serialize(Path $path)
    {
        return [
            'id' => $path->getUuid(),
            'display' => [
                'description' => $path->getDescription(),
                'showOverview' => $path->getShowOverview(),
                'showSummary' => $path->getShowSummary(),
                'openSummary' => $path->getOpenSummary(),
                'numbering' => $path->getNumbering() ? $path->getNumbering() : 'none',
                'manualProgressionAllowed' => $path->isManualProgressionAllowed(),
            ],
            'opening' => [
                'secondaryResources' => $path->getSecondaryResourcesTarget(),
            ],
            'steps' => array_map(function (Step $step) {
                return $this->serializeStep($step);
            }, $path->getRootSteps()),
        ];
    }
287831
public function load($path)
    {
        $factory = $this;

        if (is_dir($path)) {
            foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
                require $file->getRealPath();
            }
        }

        return $factory;
    }
1299721
protected function loadEnv(/*# string */ $path)/*# : array */
    {
        // read data
        $content = $this->readContent($path);

        // parse it
        $pairs = $this->parseString($content);

        // expand any '${__DIR__}' or '${__FILE__}'
        if (false !== strpos($content, '${BASH_SOURCE') ||
            false !== strpos($content, '${__')
        ) {
            $this->expandMagic($pairs, $path);
        }

        return $pairs;
    }
1104409
public static function loadDotFile($path)
    {
        $file = file_get_contents($path);
        if ($file === false) {
            return null;
        }

        $file = str_replace("\r", "\n", $file);      // Turn CR into LF
        $file = str_replace("\n\n", "\n", $file);   // Turn LFLF into LF
        $lines = explode("\n", $file);

        $data = [];

        $lineCount = count($lines);

        for ($i = 0; $i < $lineCount; $i++) {
            $line = trim($lines[$i]);
            if (strlen($line) === 0) {
                continue;
            }

            $split = explode('=', $line, 2);
            if (count($split) < 2) {
                throw new Exception\ConfigurationException("Invalid data in .bitrank file on line $i. ($line)");
            }

            $key = $split[0];
            $value = $split[1];

            $data[$key] = $value;
        }

        return $data;
    }
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;
	}
1243167
private function loadLocaleFiles($path)
    {
        $files = [];

        foreach ($this->filesystem->allFiles($path) as $file) {
            /** @var \Symfony\Component\Finder\SplFileInfo $file */
            $key = str_replace(
                ['.php', DS], ['', '.'], $file->getRelativePathname()
            );

            $files[$key] = [
                'path'    => $file->getRealPath(),
                'content' => $this->filesystem->getRequire($file),
            ];
        }

        return $files;
    }
488949
public function readStream($path)
    {
        $location = $this->applyPathPrefix($path);
        $resource = ($this->ossClient->isUseSSL() ? 'https://' : 'http://') . $this->bucket . '.' . $this->endpoint . '/' . $location;
        return [
            'stream' => $resource = fopen($resource, 'r')
        ];
    }
1122543
protected function getConfigurationFiles($path)
	{
		$files = [];

		foreach (Finder::create()->files()->name('*.php')->in($path) as $file)
		{
			$files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
		}

		return $files;
	}
140499
protected function loadStructureTags($path, $xpath)
    {
        $result = [];

        foreach ($xpath->query($path) as $node) {
            $tag = [
                'name' => null,
                'attributes' => [],
            ];

            foreach ($node->attributes as $key => $attr) {
                if (in_array($key, ['name'])) {
                    $tag[$key] = $attr->value;
                } else {
                    $tag['attributes'][$key] = $attr->value;
                }
            }

            if (!isset($tag['name'])) {
                // this should not happen because of the XSD validation
                throw new \InvalidArgumentException('Tag does not have a name in template definition');
            }

            $result[] = $tag;
        }

        return $result;
    }