Loads file from path.

@param string $path

@return array|null
491720
protected function findFileAt($path)
    {
        try {
            $files = $this->fromDirectory('')
                ->withPrefix($path)
                ->withDelimiter('')
                ->limit(1)
                ->get();
        } catch (ApiRequestFailedException $e) {
            return;
        }

        return $files->get(0);
    }
567176
private static function getPathFiles(array $path): array
    {
        // load external files
        $result = [];
        $pathFinder = Finder::findFiles('*')->in($path);
        foreach ($pathFinder as $file) {
            $result[$file->getRealPath()] = $file->getBaseName();
        }
        return $result;
    }
855349
public function getFields($path = null)
    {
        $path = $path ?:  __DIR__.'/../tmp-fields.txt';

        // Have we already fetched the fields?
        if (! is_null($this->fields))
        {
            return $this->fields;
        }

        // If not, let's grab it if it exists.
        if (file_exists($path))
        {
            return $this->fields = json_decode($this->file->get($path), true);
        }

        // Well, it doesn't exist. Just return false
        // from now on for this instance.
        $this->fields = false;

        return false;
    }
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);
        }
    }
699427
public function loadFile($path)
    {
        $parser = Parser::parse($path, $this);
        $this->onLoad();
        return !$parser->isErroneous();
    }
616304
private static function loadDefinitionsFromPath(string $path): array
    {
        if (!\file_exists($path)) {
            throw new \RuntimeException(\sprintf('Path "%s" does not exist', $path));
        }

        if (!\is_dir($path)) {
            return self::loadDefinitionsFromFile($path);
        }

        $definitions = [];
        foreach (\glob($path . '/*.php', \GLOB_ERR) as $file) {
            if (\is_file($file)) {
                $definitions[] = self::loadDefinitionsFromFile($file);
            }
        }

        return \count($definitions) === 0 ? [] : \array_merge(...$definitions);
    }
47121
public static function load(string $path): void
    {
        $filePath = \absolute_path($path, static::FILE);
        if (!\is_readable($filePath) || !\is_file($filePath)) {
            return;
        }

        $array = self::optimizeGet($path, $filePath);

        if ($array === false) {
            $array = \parse_ini_file($filePath, false, INI_SCANNER_RAW);
        }

        foreach ($array as $name => $value) {
            static::set($name, $value);
        }

        self::optimizeSet($path, $array, $filePath);
    }
870516
public function load($path)
	{
		$dir = new \DirectoryIterator(realpath($path));
		foreach ($dir as $fileInfo) {
			if($fileInfo->isFile() && $fileInfo->isReadable() && $fileInfo->getExtension()=='php') {
				$array = include $fileInfo->getPathname();
				$fileName = $fileInfo->getFilename();
				$keyName = substr($fileName, 0, strpos($fileName, '.'));
				$this->commonSettings[$keyName] = $array;
			}
		}
	}
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;
	}
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;
    }
92034
public static function loadPatternsInPath($path)
    {
        $groups = array();

        if ($handle = opendir($path)) {

            while (false !== ($entry = readdir($handle))) {
                
                $fullPath = $path . '/' . $entry;

                if (substr($entry, 0, 1) !== '.') {

                    $id = trim(str_replace(Primer::$PATTERN_PATH, '', $fullPath), '/');

                    // Load the pattern
                    $groups[] = new Group($id);
                }
            }

            closedir($handle);
        }

        return $groups;
    }
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;
    }
370075
public function getFile($path)
    {
        $file = new File($this->getFileSystemId(), $this->getFullPath($path));
        $file->setServiceLocator($this->getServiceLocator());
        return $file;
    }
1073528
protected function loadFilePath($path) {
		$realPath = realpath($path);
		if (DIRECTORY_SEPARATOR == '\\') { // windows
			$realPath = str_replace('\\', '\\\\', $realPath);
		}
		return $this->db->real_escape_string($realPath);
	}
387671
public function checksumByPath(string $path)
    {
        return file_exists($path) ? $this->checksum((string) file_get_contents($path)) : null;
    }
873769
protected static function scandirJob(string $path): ?array
    {
        if (!\is_dir($path)) {
            return null;
        }
        
        $entries = @\glob($path . \DIRECTORY_SEPARATOR . '*', \GLOB_NOSORT);
        
        return ($entries === false) ? null : $entries;
    }
1041761
public function load($key)
    {
        if (file_exists($path = $this->path . $key)) {
            return unserialize(file_get_contents($path));
        }

        return null;
    }