You are here

protected function vfsStreamWrapper::splitPath in Zircon Profile 8

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

splits path into its dirname and the basename

Parameters

string $path:

Return value

string[]

6 calls to vfsStreamWrapper::splitPath()
vfsStreamWrapper::createFile in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
creates a file at given path
vfsStreamWrapper::doPermChange in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
executes given permission change when necessary rights allow such a change
vfsStreamWrapper::doUnlink in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php
removes a path
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

... See full list

File

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

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

protected function splitPath($path) {
  $lastSlashPos = strrpos($path, '/');
  if (false === $lastSlashPos) {
    return array(
      'dirname' => '',
      'basename' => $path,
    );
  }
  return array(
    'dirname' => substr($path, 0, $lastSlashPos),
    'basename' => substr($path, $lastSlashPos + 1),
  );
}