Return the path of the file

@param bool $withName
@return array|mixed|string
166833
protected function getArgumentPath($withName = false)
    {
        $name = $this->argumentName();

        if (str_contains($name, '.')) {
            $name = str_replace('.', '/', $name);
        }

        if (str_contains($name, '\\')) {
            $name = str_replace('\\', '/', $name);
        }

        // ucfirst char, for correct namespace
        $name = implode('/', array_map('ucfirst', explode('/', $name)));

        // if we need to keep lowercase
        if ($this->settingsDirectoryFormat() === 'strtolower') {
            $name = implode('/', array_map('strtolower', explode('/', $name)));
        }

        // if we want the path with name
        if ($withName) {
            return $name . '/';
        }

        if (str_contains($name, '/')) {
            return substr($name, 0, strripos($name, '/') + 1);
        }

        return '';
    }
891748
public function getLeftColumnName(bool $withTableName = false): string
    {
        return ($withTableName) ? $this->addTableName($this->leftColumnName) : $this->leftColumnName;
    }
720172
public function getModuleDirectory($moduleName)
    {
        if ($this->files->exists($this->path.'/'.$moduleName))
            return $this->path.'/'.$moduleName;

        else
            return false;
    }
9337
public function getFileByName($filename)
    {
        $files = $this->getFiles();
        foreach ($files as $file) {
            if ($filename == $file->file) {
                return $file;
            }
        }

        return null;
    }
1273866
public function getFilePathWithFallback($filename)
    {
        $emailPath = $this->getOutputFolder() . DIRECTORY_SEPARATOR . $filename;
        $archivePath = $this->getArchiveFolder() . DIRECTORY_SEPARATOR . $filename;
        return is_file($emailPath) ? $emailPath : $archivePath;
    }
1366409
public function getLocalFilePath($filename, $route, &$isTempFile, $includeStoragePath = false)
  {
    $isTempFile = false;

    if($this->Config->get('filesystems.default') == 'gcs')
    {
      $isTempFile = true;

      $this->Storage->disk('local')->put('//temp/' . $filename, $this->Storage->read($route));

      $route = 'temp/' . $filename;
    }

    if($includeStoragePath)
    {
      return storage_path('app') . '/' . $route;
    }

    return $route;
  }
646068
public function urlPath($withParams = false)
    {
        $path = $this->server('request_uri');

        if (!$withParams)
        {
            $position = mb_strpos($path, '?');
            if ($position !== false)
            {
                $path = mb_substr($path, 0, $position);
            }
        }

        return $path;
    }
504196
protected function getNewKeyPath($number = 1)
    {
        $basename = self::DEFAULT_BASENAME;
        if ($number > 1) {
            $basename = strpos($basename, '.key')
                ? str_replace('.key', '.' . $number . 'key', $basename)
                : $basename . '.' . $number;
        }
        /** @var \Platformsh\Cli\Service\Filesystem $fs */
        $fs = $this->getService('fs');
        $filename = $fs->getHomeDirectory() . '/.ssh/' . $basename;
        if (file_exists($filename)) {
            return $this->getNewKeyPath(++$number);
        }

        return $filename;
    }
434820
public function getUri($withBaseUrl = false)
    {
        $prefix = $withBaseUrl ? $this->getBaseUrl() : '';
        $uri = $prefix . $this->uri;
        $uri = '/' . ltrim($uri, '/');
        return $uri;
    }
1073313
public function getPath()
	{
		$realpath	= realpath( $this->fileName );
		$path	= dirname( $realpath );
		$path	= str_replace( "\\", "/", $path );
		$path	.= "/";
		return	$path;
	}
504737
public function path($filename)
    {
        if (preg_match('~^' . $this->base_directory . '~', $filename)) {
            return $filename;
        }

        return rtrim($this->base_directory, '/') . '/' . ltrim($filename, '/');
    }
505603
private function getShortPath($filename)
    {
        if (getcwd() === dirname($filename)) {
            return basename($filename);
        }
        $homeDir = Filesystem::getHomeDirectory();
        if (strpos($filename, $homeDir) === 0) {
            return str_replace($homeDir, '~', $filename);
        }

        return $filename;
    }
1325586
public function getFromPath($path, $depth=0, $withParents=false)
    {

         if(isset($this->fs[$path])){
            return $this->fs[$path];
         }

    }
1248311
public function getFilePath($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        $component = $this->component;
        $path = $component->getPath().'/'.$fileName;

        /*
         * Check the shared "/partials" directory for the partial
         */
        if (!File::isFile($path)) {
            $sharedDir = dirname($component->getPath()).'/partials';
            $sharedPath = $sharedDir.'/'.$fileName;
            if (File::isFile($sharedPath)) {
                return $sharedPath;
            }
        }

        return $path;
    }
75804
public static function path($filename, $relativeTo = null, $checkExists = true, $ds = null)
    {
        $ds = $ds ?: DIRECTORY_SEPARATOR;

        if (is_array($filename)) {
            $pathnames = array();
            foreach ($filename as $k => $f) {
                $pathnames[$k] = self::path($f, $relativeTo, $checkExists);
            }
            return $pathnames;
        }

        $relativeTo = $relativeTo ?: self::$rootDirectory;
        $pathname = $filename;
        if ($filename{0} != '/' && !preg_match('#^[A-Z]:(\\\\|/)#', $filename)) {
            if (strlen($filename) >= 2 && substr($filename, 0, 2) == './') {
                $filename = substr($filename, 2);
            }
            $pathname = rtrim($relativeTo, $ds) . $ds . $filename;
        }
        if ($checkExists) {
            return realpath($pathname);
        }
        return $pathname;
    }
1052540
private function getFilename($name)
    {
        if (file_exists($name)) {
            return $name;
        }

        [$plugin, $file] = pluginSplit($name);
        foreach ([null, $plugin] as $scope) {
            $paths = $this->getPaths($scope);
            foreach ($paths as $path) {
                $filePath = $path . $file;
                if (is_file($filePath)) {
                    return $filePath;
                }

                $filePath = $path . $file . TwigView::EXT;
                if (is_file($filePath)) {
                    return $filePath;
                }
            }
        }

        return false;
    }
59852
public function getFilePath($fieldName = null, $createPath = true)
    {
        $path = realpath(AppComponent::getUploadsDir($this->container)) . "/" . $this->getFileUri($fieldName);

        foreach ($this->getFileInfo() as $fileInfo) {
            if (isset($fileInfo["field"]) && isset($fileInfo["path"]) && $fieldName == $fileInfo["field"]) {
                $path = $fileInfo["path"];
                break;
            }
        }

        if ($createPath && !is_dir($path)) {
            mkdir($path, 0775, true);
        }

        return $path;
    }