Get mapped asset path from manifest file

@param string $sourcePath

@return string
@throws Exception
972325
public function getAssetPath(string $sourcePath)
    {
        $manifest = $this->readFile();
        $path = $this->pathHelper->prefix($sourcePath);

        if (!array_key_exists($path, $manifest)) {
            throw new Exception("Unable to locate path '{$path}' in Mix manifest.");
        }

        return $this->urlHelper->getUrl($manifest[$path]);
    }
1051680
protected static function getMountNameFromPath($path)
	{
		preg_match('/([[:alpha:]]*):\/\//', $path, $name);

		if (!isset($name[1]) || !$name[1])
		{
			throw new \Exception('Could not determine source mount type', 500);
		}

		return $name[1];
	}
1365684
private function buildPathFromSource(string $path) :string {
    //return $this->buildContext->getPath('build') . '/' .
    return str_replace('.', '/', str_replace($this->context . ".", '', $this->viewNameFromSource($path))) .
      $this->buildExtension;
  }
802292
private function getFilePath($filePath = null)
    {
        $filePath = $filePath ?? $this->filePath ?? null;

        if (null === $filePath) {
            throw NoFilePathGivenException::import();
        }

        return $filePath;
    }
670426
public function assetPath($path = null)
    {
        return ! is_null($path) ? $this->assetDir().'/'.ltrim($path, '/') : $this->assetDir();
    }
207275
public function open($sourceImagePath) 
    {
        if(!file_exists($sourceImagePath) || !is_readable($sourceImagePath)) {
            throw new \RuntimeException("File '" . $sourceImagePath . "' does *not* exists OR is *not* readable.");
        }
    	$this->sourceImagePath = $sourceImagePath;
    	$this->parseImageInfo()
    		->initSourceImageResource();
    	
    	return $this;
    }
361124
public function asset_url($path)
	{
		$url = $this->asset_path($path);

		if (filter_var($url, FILTER_VALIDATE_URL) === false)
		{
			$url = \Uri::create($url);
		}

		return $url;
	}
267818
public static function getFileUrl($filePath, $addTimestamp = FALSE) {

		if (!file_exists($filePath)) {
			throw new \Exception('File not found at path ' . $filePath);
		}
		
		// check if valid path
		if (FALSE === strpos($filePath, APPLICATION_PATH)) {
			throw new \Exception('File path doesn’t match the application root folder ' . APPLICATION_PATH);
		}
		
		// BASE_HREF has trailing slash
		$url = BASE_HREF . substr($filePath, strlen(APPLICATION_PATH)+1);
			
		if ($addTimestamp) {
			$timestamp = filemtime($filePath);
			// check if valid timestamp
			if (FALSE == $timestamp) {
				throw new \Exception('File last change timestamp failed for ' . $filePath);
			}
			$url .= '?' . $timestamp;
		}
		
		return $url;

	}
353054
static function getSymbolicPath($realpath)
    {
        $root = $_SERVER['DOCUMENT_ROOT'];
        $script = $_SERVER['SCRIPT_FILENAME'];
        $root = str_replace('\\', '/', $root);
        $script = str_replace('\\', '/', $script);
        $realpath = str_replace('\\', '/', $realpath);
        
        $dir = str_replace($root, '', $script);
        $pos = false;
        $dir = self::getDir($dir);
        while (! empty($dir)) {
            $pos = strpos($realpath, $dir);
            if ($pos) {
                break;
            }
            $dir = self::getDir($dir);
        }
        if ($pos) {
            $realpath = $root . substr($realpath, $pos);
        }
        return $realpath;
    }
1108658
private function getRelativePathForResourceIcon($absolutePath)
    {
        if (empty($absolutePath)) {
            return null;
        }
        $pathInfo = pathinfo($absolutePath);

        return $this->fs->makePathRelative($pathInfo['dirname'], $this->webDir).$pathInfo['basename'];
    }
1368328
public function resolveResourcePath($path)
    {
        $matches = [];
        preg_match('/@(\w+)/', $path, $matches);
        if (isset($matches[0], $matches[1])) {
            if (false === isset($this->bundle_paths[$matches[1]])) {
                return false;
            }
            $template = realpath(
                str_replace(
                    $matches[0],
                    $this->bundle_paths[$matches[1]] . DIRECTORY_SEPARATOR . trim($this->asset_dir, "\\/"),
                    $path
                )
            );
            return $template;
        }

        return $path;
    }
735207
public function getPath ($relativePath = false) {
		$root = $this->getRoot();

		if ($relativePath === false) {
			$relativePath = Jodit::$app->request->path ?: '';
		}

		//always check whether we are below the root category is not reached
		if (realpath($root . $relativePath) && strpos(realpath($root . $relativePath) . Consts::DS, $root) !== false) {
			$root = realpath($root . $relativePath);
			if (is_dir($root)) {
				$root .= Consts::DS;
			}
		} else {
			throw new \Exception('Path does not exist', Consts::ERROR_CODE_NOT_EXISTS);
		}

		return $root;
	}
561898
public function getThemeUrl($path = '')
    {
        if (!is_null($path) && ! is_bool($path) && ! is_string($path) && !is_numeric($path)) {
            $path = is_resource($path) ? '' : gettype($path);
        }

        $path = (string) $path;
        if (!isset($this->cachedPath)) {
            $this->cachedPath = substr($this->getThemePath(), strlen(dirname($_SERVER['SCRIPT_FILENAME'])));
        }

        $path = $this->cachedPath . ltrim($path, '/');
        return $this->getBaseUrl($path);
    }
1183282
public function scanFilesInPath($sourcePath)
    {
        $filePattern = $this->filePattern;
        if (strpos($sourcePath, str_replace('*', null, $filePattern))) {
            $filePattern = $this->coverFishHelper->getFileNameFromPath($sourcePath);
        }

        $facade = new FinderFacade(
            array($sourcePath),
            $this->filePatternExclude,
            array($filePattern)
        );

        return $this->removeExcludedPath($facade->findFiles(), $this->testExcludePath);
    }
504026
public function setSourcesBasePath($sourcesBasePath) {
		$sourcesBasePath = realpath($sourcesBasePath);
		if(!$sourcesBasePath) {
			throw new \Exception('Path "' . $sourcesBasePath . '" not found');
		}
		$this->sourcesBasePath = $sourcesBasePath;
	}
897972
public function get($path, array $sourceConfig = null)
    {
        $config = Yaml::parse($this->getFileContent($path));
        
        if (false === empty($sourceConfig)) {
            return array_replace_recursive($sourceConfig, $config);
        }
        
        return $config;
    }
225661
public function resourcesPath(?string $resourcesPath = null) {
        if ($resourcesPath != null) {
            $this->resourcesPath = $resourcesPath;
        }
        else if (!isset($this->resourcesPath)) {
            $this->resourcesPath = get_property("app.resources_path", $this->basePath . DIRECTORY_SEPARATOR . "resources");
        }
        return $this->resourcesPath;
    }