Returns ElementInterface from pug input file.

@param string $path path of the compiled source

@return ElementInterface
186843
public function compileFileIntoElement($path)
    {
        $path = $this->resolve($path);

        return $this->compileIntoElement($this->getFileContents($path), $path);
    }
1372336
public static function getKeyFromPem($path)
    {
        $content = file_get_contents($path);

        $decSerializer = new DerPublicKeySerializer();
        $pemSerializer = new PemPublicKeySerializer($decSerializer);
        $key = $pemSerializer->parse($content);
        $key = $decSerializer->getUncompressedKey($key);

        return hex2bin($key);
    }
70941
public function getAssetUrl($path)
    {
        if (false !== strpos($path, '://') || 0 === strpos($path, '//')) {
            return $path;
        }

        if (!$this->container->has('request')) {
            return $path;
        }

        if ('/' !== substr($path, 0, 1)) {
            $path = '/' . $path;
        }

        $request = $this->container->get('request');
        $path = $request->getBasePath() . $path;

        return $path;
    }
1154888
protected function getGitRepositoryFor($path)
    {
        $git = new GitRepository($this->determineGitRoot($path));
        if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
            $git->getConfig()->setLogger(
                new ConsoleLogger($this->output)
            );
        }

        return $git;
    }
227014
public function get ($path) {
		list ($first, $rest) = self::getFirstAndRestPathElements($path);

		if (array_key_exists($first, $this -> data)) {
			$value = $this -> data[$first];
			if (is_null($rest)) {
				return $value;
			} else if ($value instanceof TreeInterface) {
				return $value -> get($rest);
			} else {
				throw new InvalidKeyException("Value at key `" . $first . "` is a scalar; cannot step further down the requested path `" . $rest . "`");
			}
		} else {
			throw new NonExistentKeyException("Key `" . $first . "` does not exist.");
		}
	}
39892
public function getNodes($path)
    {
        $domXPath = new \DOMXpath($this->domDocument);
        // TODO: Swap the lines below for version 5.1.
        //			$nodes = $domXPath->evaluate($path);
        $nodes = $domXPath->query($path);
        if ($nodes) {
            return ($nodes->length > 0) ? $nodes : null;
        } else {
            throw new Exception('Bad XPath expression: ' . $path);
        }
    }
845030
public function getNodeCollection($path)
    {
        // init
        $result = null;
        $chunks = $this->splitPath($path);

        // action
        $curObj = $this;
        $count = 0;
        foreach ($chunks as $chunk) {
            // check, if attributes exist
            $regs = array();
            preg_match('/^([a-z]+)(?:\[(.*)\])?$/i', $chunk, $regs);

            // if there are attributes, store them in array
            $chunkAttributes = array();
            if (sizeof($regs) > 2) {
                // get chunk name
                $chunk = $regs[1];

                // get attributes
                $tmpAttributes = preg_split('/\,/', $regs[2]);
                for ($i = 0; $i < sizeof($tmpAttributes); $i++) {
                    list($key, $value) = preg_split('/\=/', $tmpAttributes[$i]); // split into key = value
                    $key = substr($key, 1, strlen($key) - 1); // remove @
                    $value = trim($value, '\''); // remove ''
                    $chunkAttributes[$key] = $value; // add to attributes list
                }
            }

            //echo $count.' / '.sizeof($chunks)."\n";

            try {
                if ($count + 1 < sizeof($chunks)) {
                    if (($curObj = $curObj->getChildNode($chunk, $chunkAttributes)) != null) {
                        // zuweisung schon oben in if-block schon erfolgt
                    } else {
                        throw new ChildDoesNotExistException(
                            'Child nodes "'.$chunk.'" '.' ("'.$path.'") does not exist.'
                        );
                    }

                } else {
                    if (sizeof($result = $curObj->getChildNodes($chunk, $chunkAttributes)) > 0) {
                        //var_dump($result);die;
                    }
                }
            } catch (\Exception $e) {
                //die('XXXXXXX');
                throw $e;
            }

            /*
            //if ( ( $curObj = $curObj->GetChildNodes($chunk, $chunkAttributes) ) != null ) {
            if ( sizeof( $curObj = $curObj->GetChildNodes($chunk, $chunkAttributes) ) > 0 ) {
              // zuweisung schon oben in if-block schon erfolgt
            }
            else {
              throw new ChildDoesNotExistException('Child nodes "'.$chunk.'" '.' ("'.$path.'") does not exist.');
            }
            */

            $count++;
        }

        // return
        return $result;
        //return $curObj;
    }
1084112
public function getChildByPath($path)
    {
        if (!is_array($path)) {
            $path = trim($path, " /");
            $pieces = explode("/", $path);
        } else {
             $pieces = $path;
        }
            
        if (!sizeof($pieces)) return $this;

        if ($alias = array_shift($pieces)) {

                $c = $this->getChildByAlias($alias);
                if (sizeof($pieces)) {
                    return $c->getChildByPath($pieces);
                } else {
                    return $c;
                }

        }
        return $this;
    }
1020485
private function getComponentForPath( $path, $context )
	{
		foreach ( $path as $element )
		{
			if ( ! $context ) continue;
			if ( ! isset( $context[ $element ] ) )
			{
				$context = array();
				continue;
			}
			$context = $context[ $element ];
		}

		return $context;
	}
744580
public function getElement($path)
    {
        $data = $this->getRawData($path);

        if (is_array($data)) {
            return false;
        } else {
            return $data;
        }
    }
100742
public function get($path)
    {
        $configValue = $this->getRepository()->findOneByPath($path);
        if ($configValue) {
            return $configValue->getValue();
        }

        return null;
    }
878869
static function GetFileSystemEntryType($path)
    {
        if (is_file($path))
            return FileSystemEntryType::File();
        else if (is_link($path))
            return FileSystemEntryType::Link();
        else if (is_dir($path))
            return FileSystemEntryType::Folder();
        else
            throw new Exceptions\PathNotFoundException("Path $path not found");
    }
81427
protected function getRawVisibility($path)
    {
        try {
            $acl = $this->getObject($path)->acl()->get(['entity' => 'allUsers']);
            return $acl['role'] === Acl::ROLE_READER ?
                AdapterInterface::VISIBILITY_PUBLIC :
                AdapterInterface::VISIBILITY_PRIVATE;
        } catch (NotFoundException $e) {
            // object may not have an acl entry, so handle that gracefully
            return AdapterInterface::VISIBILITY_PRIVATE;
        }
    }
906622
private function getValidPath($path)
    {
        // If `$path` is array
        if (is_array($path)) {
            return $this->getPathFromArray($path);
        }

        // If `$path` is a directory
        if (is_dir($path)) {
            $paths = glob($path . '/*.*');
            if (empty($paths)) {
                throw new EmptyDirectoryException("Configuration directory: [$path] is empty");
            }
            return $paths;
        }

        // If `$path` is not a file, throw an exception
        if (!file_exists($path)) {
            throw new FileNotFoundException("Configuration file: [$path] cannot be found");
        }
        return array($path);
    }
533591
public function getPublicPackageResourceUriByPath($path)
    {
        $this->initialize();
        list($packageKey, $relativePathAndFilename) = $this->getPackageAndPathByPublicPath($path);
        return $this->getPublicPackageResourceUri($packageKey, $relativePathAndFilename);
    }
1238175
public static function fromFile($path)
    {
        /** @var self $message */
        $message = static::fromString(join(PHP_EOL, file($path, FILE_IGNORE_NEW_LINES)));
        return $message;
    }
487602
private function reader($path)
    {
        $reader = ReaderFactory::create($this->getType($path));
        $this->setOptions($reader);
        /* @var \Box\Spout\Reader\ReaderInterface $reader */
        $reader->open($path);

        return $reader;
    }