Makes absolute file path easier to read

@param string $file Absolute file path
@return string short path
@link https://book.cakephp.org/3.0/en/console-and-shells.html#Shell::shortPath
357428
public function shortPath($file)
    {
        $shortPath = str_replace(ROOT, null, $file);
        $shortPath = str_replace('..' . DIRECTORY_SEPARATOR, '', $shortPath);
        $shortPath = str_replace(DIRECTORY_SEPARATOR, '/', $shortPath);

        return str_replace('//', DIRECTORY_SEPARATOR, $shortPath);
    }
139169
private function getRelativeFilePath($file)
    {
        $realPath = $file->getRealPath();
        $pathPrefix = $this->baseDir.'/';
        $pos = strpos($realPath, $pathPrefix);
        $relativePath = (false !== $pos) ? substr_replace($realPath, '', $pos, strlen($pathPrefix)) : $realPath;

        return strtr($relativePath, '\\', '/');
    }
1314733
public function realpath($file)
    {
        $prefix = preg_quote($this->_prefix, '~');
        $file = preg_replace("~^{$prefix}~", '', $file);
        if (!$this->_hasVolume) {
            return $file;
        }
        if (preg_match('~^[A-Z]+:~', $file)) {
            return $file;
        }
        $file = ltrim($file, DS);
        $pos = strpos($file, DS);
        if ($pos !== false) {
            $file = substr_replace($file, ':' . DS, $pos, 1);
        }
        return $file;
    }
1241466
private function filterTracePaths($file)
	{
		$file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
		$return = is_file($file);
		foreach ($this->skipPaths as $path) {
			if (!$return) {
				break;
			}
			$return = $return && strpos($file, '/' . trim($path, '/') . '/') === FALSE;
		}
		return $return;
	}
421111
public static function storage_path(?string $file = null)
  {
    $file = (substr($file, 0, 1) == DIRECTORY_SEPARATOR ? substr($file, 1) : $file);
    return config('app.dir') . 'storage' . DIRECTORY_SEPARATOR . $file;
  }
497023
public static function getExtension($file){

		$file = trim($file);
		$extension = strtolower(substr(strrchr($file, '.'), 1));

		if($extension == $file){

			return '';
		}
		else{

			return $extension;
		}
	}
1080980
protected function path($file)
    {
        return $this->root .
            str_replace('.', '/', $file) .
            $this->extensions[$this->type];
    }
643996
public function get_asset_url( $file ) {
		if ( $this->get_wp_filesystem()->is_file( $file ) ) {
			$file = str_replace( plugin_dir_path( $this->plugin_file ), '', $file );
		}

		return plugins_url( $file, $this->plugin_file );
	}
1179926
public function transformFileToFilePath($file)
    {
        //confirm we have a file
        $filePath = null;
        if (is_string($file)) {
            $filePath = $file;
        } elseif (is_object($file) && $file->is_a("File")) {
            $filePath = $file->Filename;
        }

        if (!$filePath) {
            throw new FileNotFoundException();
        }

        return $filePath;
    }
1229745
public function pathToFile($file, $locale): string
    {
        return resource_path('lang'.DIRECTORY_SEPARATOR.(is_a($locale, Locale::class) ? $locale->iso6391() : $locale).DIRECTORY_SEPARATOR.$file.'.php');
    }
691457
public static function urlencodeFilename($file) {
    $parts = explode('/', $file);
    $result = [];
    foreach ($parts as $part) {
      $result[] = rawurlencode($part);
    }
    return join('/', $result);
  }
1357988
protected function getPath($file = null)
    {
        $path = Configure::readOrFail('Thumber.target');

        return $file ? $path . DS . $file : $path;
    }
812651
protected function absolutePath(string $file, string $base): string
    {
        return $file[0] !== DIRECTORY_SEPARATOR && !str_contains($file, ':')
            ? $base . DIRECTORY_SEPARATOR . $file
            : $file;
    }
964483
protected function expandPath(
        /*# string */ $file,
        /*# string */ $path
    )/*# : string */ {
        // relative path found
        if (false !== strpos($file, './')) {
            // remember working dir
            $old = getcwd();

            // change to current file's directory
            chdir(dirname(realpath($path)));

            // expand file path
            $file = realpath($file);

            // back to working dir
            chdir($old);
        }

        return $file;
    }
217807
public function getFilePath($file): string
    {
        if (null === ($fileObj = $this->container->get('huh.utils.file')->getFileFromUuid($file))) {
            return '';
        }

        return $fileObj->path;
    }
406779
public static function filename($file, $last = true) {
        $pos = false;
        if ($last) {
            $pos = strrpos($file, '.');
        }
        else {
            $pos = strpos($file, '.');
        }
        if ($pos === false) {
            return $file;
        }
        return substr($file, 0, $pos);
    }
1119406
final public function getPath($file = "", $default = null)
    {

        $file = (empty($file) && isset($this->file)) ? $this->file : $file;

        if (empty($file)) {
            return $default;
        }

        //Determine the file extension
        return pathinfo($file, PATHINFO_DIRNAME);
    }