the file resolver

@param PhingFile $f

@return string
186071
public function resolveFile(PhingFile $f)
    {
        // resolve if parent is a file oject only
        if ($this->isAbsolute($f)) {
            return $f->getPath();
        } else {
            return $this->resolve(Phing::getProperty("user.dir"), $f->getPath());
        }
    }
792159
private function getOutputWriter()
    {
        if ($this->useFile) {
            $of = $this->getOutfile();
            if (!$of) {
                $of = new PhingFile($this->formatter->getPreferredOutfile());
            }

            return new FileWriter($of, $this->append);
        } else {
            return $this->getDefaultOutput();
        }
    }
1256268
public function getLastModifiedTime(PhingFile $f)
    {
        if (!$f->exists()) {
            return 0;
        }

        @clearstatcache();
        $strPath = (string) $f->getPath();

        if (@is_link($strPath)) {
            $stats = @lstat($strPath);

            if (!isset($stats['mtime'])) {
                $mtime = false;
            } else {
                $mtime = $stats['mtime'];
            }
        } else {
            $mtime = @filemtime($strPath);
        }

        if (false === $mtime) {
            $msg = "FileSystem::getLastModifiedTime() FAILED. Can not get modified time of $strPath. $php_errormsg";
            throw new IOException($msg);
        }

        return (int) $mtime;
    }
489122
protected function resolveImageDestination(): PhingFile
    {
        $phingFile = $this->getProject()->getProperty('phing.file');
        $format = $this->getFormat();
        $candidate = $this->getDestination();
        $path = $this->resolveDestination($phingFile, $format, $candidate);

        return new PhingFile($path);
    }
946964
public function listContents(PhingFile $f)
    {
        return array_keys(
            iterator_to_array(
                new FilesystemIterator(
                    $f->getAbsolutePath(),
                    FilesystemIterator::KEY_AS_FILENAME
                )
            )
        );
    }
770918
private function getFilenames()
    {
        $files = [];

        foreach ($this->filelists as $fl) {
            try {
                $list = $fl->getFiles($this->project);
                foreach ($list as $file) {
                    $fs = new PhingFile((string) $fl->getDir($this->project), $file);
                    $files[] = ['key' => strtolower($fs->getAbsolutePath()), 'fullname' => $fs->getAbsolutePath()];
                }
            } catch (BuildException $be) {
                $this->log($be->getMessage(), Project::MSG_WARN);
            }
        }

        foreach ($this->filesets as $fileset) {
            $ds = $fileset->getDirectoryScanner($this->project);
            $ds->scan();

            $includedFiles = $ds->getIncludedFiles();

            foreach ($includedFiles as $file) {
                $fs = new PhingFile(realpath($ds->getBaseDir()), $file);

                $files[] = ['key' => strtolower($fs->getAbsolutePath()), 'fullname' => $fs->getAbsolutePath()];
            }
        }

        return $files;
    }
1099396
public function getLength(PhingFile $f)
    {
        $strPath = (string) $f->getAbsolutePath();
        $fs = filesize((string) $strPath);
        if ($fs !== false) {
            return $fs;
        } else {
            $msg = "FileSystem::Read() FAILED. Cannot get filesize of $strPath. $php_errormsg";
            throw new IOException($msg);
        }
    }
501437
public function getRelativeLinkFor($f)
    {
        $fn = is_object($f) ? $f->getFilename() : $f;
        return trim(str_replace($this->localPath, '', $fn), '/');
    }
829378
public static function resolvetoFIDtoURI(int $fid) {

        if (!is_integer($fid)) {
            return null;
        }
        /* @var \Drupal\file\FileInterface $file */
        $file = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
        return $file;
    }
1363313
private function resolveFilename($file)
    {
        if (empty($file)) {
            return null;
        }

        if (
            ($file instanceof UploadedFileInterface && $file->getError() === 0)
            || $file instanceof StreamableInterface
        ) {
            return StreamWrapper::getFilename($file->getStream());
        }

        if (is_array($file)) {
            if (!isset($file['tmp_name'])) {
                return null;
            }

            $file = $file['tmp_name'];
        }

        if (!is_string($file) || !$this->files->exists($file)) {
            return null;
        }

        return $file;
    }
1026679
public function getFileContents()
    {
        $result = null;
        $fsl = $this->getFile()->getFileStorageLocationObject();
        if ($fsl !== null) {
            $app = Application::getFacadeApplication();
            $cf = $app->make('helper/concrete/file');
            try {
                $result = $fsl->getFileSystemObject()->read($cf->prefix($this->fvPrefix, $this->fvFilename));
                if ($result === false) {
                    $result = null;
                }
            } catch (FileNotFoundException $x) {
            }
        }

        return $result;
    }
286568
private function resolve(SplFileInfo $file): Closure
    {
        return function(IServerRequest $request, IResponse $response, callable $next) use ($file)
        {
            return $this->container->call(import($file->getRealPath()),
            [
                'request' => $request,
                'response' => $response,
                'next' => $next,
                'config' => $this->config
            ]);
        };
    }
873460
protected function getFilesToParse()
    {
        $filesToParse = [];

        if ($this->file instanceof PhingFile) {
            $filesToParse[] = $this->file->getPath();
        } else {
            // append any files in filesets
            foreach ($this->filesets as $fs) {
                $dir = $fs->getDir($this->project)->getAbsolutePath();
                foreach ($fs->getDirectoryScanner($this->project)->getIncludedFiles() as $filename) {
                    $fileAbsolutePath = $dir . DIRECTORY_SEPARATOR . $filename;
                    if ($this->cache) {
                        $lastMTime = $this->cache->get($fileAbsolutePath);
                        $currentMTime = filemtime($fileAbsolutePath);
                        if ($lastMTime >= $currentMTime) {
                            continue;
                        } else {
                            $this->cache->put($fileAbsolutePath, $currentMTime);
                        }
                    }
                    $filesToParse[] = $fileAbsolutePath;
                }
            }
        }
        return $filesToParse;
    }
982262
private function getFilenameFromFile(SplFileInfo $file) : string
    {
        return substr($file->getRelativePathname(), 0, -(strlen($this->fileExtension) + 1));
    }
662488
def _resolve_file(file_name):
    
    if not file_name:
        return None

    path = os.path.realpath(file_name)
    if os.path.isfile(path):
        return path

    return None
1277630
static function parse_file( $f ){
		$src = file_get_contents( $f, true );
		if( $src === false ){
			throw new Exception("Cannot read file $f");
		}
		return self::parse_string( $src );
	}
289228
def resolve_file(fname, paths):
  """"""
  fpath = path.abspath(fname)
  for p in paths:
    spath = path.abspath(p)
    if fpath.startswith(spath):
      return fpath[len(spath) + 1:]
  return fname