lib/VirtFs.php
public function getPath($file)
    {
        $file = "/".ltrim($file,"/");

        $best = null;
        foreach($this->nodes as $node) {
            $mount = $node->getMountPoint();
            if (strncmp($mount, $file, strlen($mount)) === 0) {
                $nodefile = substr($file, strlen($mount));
                //printf("nodefile=%s mount=%s file=%s\n", $nodefile, $mount, $file);
                if ($node->has($nodefile)) {
                    return $node->getPath($nodefile);
                }
                if (!$best) {
                    $best = $node->getPath($nodefile);
                }
                if ($node->getIsWritable($nodefile)) {
                    $best = $node->getPath($nodefile);
                }
            }
        }
        return $best;

    }
public function getPath($file)
    {
        $file = "/".ltrim($file,"/");

        $best = null;
        foreach($this->nodes as $node) {
            $mount = $node->getMountPoint();
            if (strncmp($mount, $file, strlen($mount)) === 0) {
                $nodefile = substr($file, strlen($mount));
                //printf("nodefile=%s mount=%s file=%s\n", $nodefile, $mount, $file);
                if ($node->has($nodefile)) {
                    return $node->getPath($nodefile);
                }
                if (!$best) {
                    $best = $node->getPath($nodefile);
                }
                if ($node->getIsWritable($nodefile)) {
                    $best = $node->getPath($nodefile);
                }
            }
        }
        return $best;

    }
public function getPath ( $ file ) { $ file = "/" . ltrim ( $ file , "/" ) ; $ best = null ; foreach ( $ this -> nodes as $ node ) { $ mount = $ node -> getMountPoint ( ) ; if ( strncmp ( $ mount , $ file , strlen ( $ mount ) ) === 0 ) { $ nodefile = substr ( $ file , strlen ( $ mount ) ) ; //printf("nodefile=%s mount=%s file=%s\n", $nodefile, $mount, $file); if ( $ node -> has ( $ nodefile ) ) { return $ node -> getPath ( $ nodefile ) ; } if ( ! $ best ) { $ best = $ node -> getPath ( $ nodefile ) ; } if ( $ node -> getIsWritable ( $ nodefile ) ) { $ best = $ node -> getPath ( $ nodefile ) ; } } } return $ best ; }
Get the canonical path to a file in the virtual filesystem.

@param string The file to get the path of
@return string The full path or URI to the file
Get the canonical path to a file in the virtual filesystem .