Find an object definition by its path.

@param string $path

@return array|false
165289
private function getObjectData($path)
    {
        foreach ($this->tree as $objectData) {
            if ($objectData['path'] === $path) {
                return $objectData;
            }
        }

        return false;
    }
1041107
public function findMapping($path) {
        if (!strEndsWith($path, '/'))
            $path .= '/';
        // $path: /
        // $path: /action/
        // $path: /controller/action/
        // $path: /controller/action/parameter/

        $pattern = $path;
        while (strlen($pattern)) {
            if (isset($this->mappings['paths'][$pattern]))          // path keys start and end with a slash "/"
                return $this->mappings['paths'][$pattern];
            $pattern = strLeftTo($pattern, '/', $count=-2, $includeLimiter=true);
            if ($pattern == '/')
                break;
        }
        return null;
    }
1060343
protected function get_folders( $path ) {
		if ( isset( $this->subfolders[ $path ] ) ) {
			return $this->subfolders[ $path ];
		}

		$this->subfolders[ $path ] = $this->search_folders( $path );
		return $this->subfolders[ $path ];
	}
523480
private function getObjectRecursive($path)
    {
        $tree = $object = $this;
        foreach ($this->splitPath($path) as $part) {
            $object = $tree->getObject($part);
            if (!$object instanceof Tree) {
                return $object;
            }
            $tree = $object;
        }

        return $object;
    }
408279
public static function parsePath($path)
    {
        $components = pathinfo($path);

        return [
            'directory' => isset($components['dirname']) ? self::fixPath($components['dirname']) : null,
            'filename' => isset($components['filename']) ? $components['filename'] : null,
            'extension' => isset($components['extension']) ? $components['extension'] : null,
        ];
    }
1159757
private function getClassNameByPath($path)
	{
		foreach ($this->map as $key => $value) {
			if ($value === $path) {
				return $key;
			}
		}
		
		return null;
	}
308522
protected function getObject($path)
    {
        $location = $this->applyPathPrefix($path);

        return $this->container->getObject($location);
    }
1221649
public function getPath($path)
    {
        if (! is_array($path)) {
            $path = [$path];
        }

        $search_for = [
            '%BASE',
            '%STORAGE',
        ];

        $replace_by = [
            base_path(),
            storage_path(),
        ];

        if (function_exists('app_path')) {
            $search_for[] = '%APP';
            $replace_by[] = app_path();
        }

        if (function_exists('public_path')) {
            $search_for[] = '%PUBLIC';
            $replace_by[] = public_path();
        }

        $folders = str_replace($search_for, $replace_by, $path);

        foreach ($folders as $k => $v) {
            $folders[$k] = realpath($v);
        }

        return $folders;
    }
1269973
public function fetch($path) {
        $result = $this->result;
        $keys = explode(".", $path);
        foreach ($keys as $key) {
            if (!array_key_exists($key, $result)) {
                return null;
            }
            $result = $result[$key];
        }
        return $result;
    }
145826
private function detectFromPath(string $path)
    {
        if (!$this->usePath) {
            return null;
        }

        $dirs = explode('/', ltrim($path, '/'), 2);
        $first = strtolower((string) array_shift($dirs));

        if (!empty($first) && in_array($first, $this->languages, true)) {
            return $first;
        }
    }
98105
public function findPhp($path)
    {
        $allFiles = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
        $phpFiles = new RegexIterator($allFiles, '/\.php$/');
        $files = array();
        foreach ($phpFiles as $phpFile) {
            $filename = $phpFile->getRealpath();
            $content = file_get_contents($filename);
            $files[] = new File($filename, $content);
        }

        return $files;
    }
1270214
public function getFolder($path = '')
    {
        $this->connect();

        $path = trim($path, '/');

        if (file_exists($this->scheme . '/' . $path))
        {

            $result = [ 'folders' => $this->listSubFolder($path), 'files' => $this->listFiles($path) ];

            $folder = new Folder($path, $result);

            return $folder;
        }

        return false;
    }
836340
protected function byPath($path)
    {
        $pathinfo = pathinfo(strtolower($path));

        if ($pathinfo['dirname'] === '\\') {
            $pathinfo['dirname'] = '/';
        }

        $path = ($pathinfo['dirname'] === '/')
        ? $pathinfo['dirname'] . $pathinfo['filename']
        : $pathinfo['dirname'] . '/' . $pathinfo['filename'];
        $path = $this->normalizePath($path);

        if ($path === '/') {
            $path = '/index';
        }

        $class = [];
        foreach (explode('/', $path) as $word) {
            if ($word) {
                $class[] = $word;
            }
        }
        $class = $this->getConfig('namespace') . implode('\\', array_map('ucfirst', $class));

        return [$class, []];
    }
341299
public function findClass($path)
    {
        $namespace = null;
        $tokens = token_get_all(file_get_contents($path));
        foreach ($tokens as $key => $token) {
            if ($this->tokenIsNamespace($token)) {
                $namespace = $this->getNamespace($key + 2, $tokens);
            } elseif ($this->tokenIsClassOrInterface($token)) {
                return ltrim($namespace.'\\'.$this->getClass($key + 2, $tokens), '\\');
            }
        }
    }
448141
public function get($path)
    {
        if (false === $json = $this->runRequest($path, 'GET')) {
            return false;
        }

        return $this->decode($json);
    }
30665
protected function _findSymlinks($path) {
		if (is_link($path)) {
			return true;
		}
		
		if (is_dir($path)) {
			foreach (scandir($path) as $name) {
				if ($name != '.' && $name != '..') {
					$p = $path.DIRECTORY_SEPARATOR.$name;
					if (is_link($p) || !$this->nameAccepted($name)) {
						$this->setError(elFinder::ERROR_SAVE, $name);
						return true;
					}
					if (is_dir($p) && $this->_findSymlinks($p)) {
						return true;
					} elseif (is_file($p)) {
						$this->archiveSize += sprintf('%u', filesize($p));
					}
				}
			}
		} else {
			
			$this->archiveSize += sprintf('%u', filesize($path));
		}
		
		return false;
	}
1012686
public function find($path, $object = false)
    {
        return $this->from($path)->prepare()->get($object);
    }