You are here

protected function vfsStreamWrapper::resolvePath in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php \org\bovigo\vfs\vfsStreamWrapper::resolvePath()

helper method to resolve a path from /foo/bar/. to /foo/bar

Parameters

string $path:

Return value

string

8 calls to vfsStreamWrapper::resolvePath()
vfsStreamWrapper::dir_opendir in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
opens a directory
vfsStreamWrapper::mkdir in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
creates a new directory
vfsStreamWrapper::rename in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
rename from one path to another
vfsStreamWrapper::rmdir in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
removes a directory
vfsStreamWrapper::stream_metadata in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
sets metadata like owner, user or permissions

... See full list

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 254

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

protected function resolvePath($path) {
  $newPath = array();
  foreach (explode('/', $path) as $pathPart) {
    if ('.' !== $pathPart) {
      if ('..' !== $pathPart) {
        $newPath[] = $pathPart;
      }
      elseif (count($newPath) > 1) {
        array_pop($newPath);
      }
    }
  }
  return implode('/', $newPath);
}