Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. vfsStreamWrapper.php

function 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 260

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal