Path Class

Aurora\Helpers Namespace


Methods

getSeparator

Get the platform directory separator

Return Value

  • string

Signature

public function getSeparator(): string

getDirectory

Get the directory for the given path

Parameters

  • string $path — Path to the file or directory

Return Value

  • string

Signature

public function getDirectory(string $path): string

getName

Get the file or directory name for the given path

Parameters

  • string $path — Path to the file or directory

Return Value

  • string

Signature

public function getName(string $path): string

getNameWithoutExtension

Get the file name without extension for the given path

Parameters

  • string $path — Path to the file

Return Value

  • string

Signature

public function getNameWithoutExtension(string $path): string

getExtension

Get the extension for the given path

Parameters

  • string $path — Path to the file

Return Value

  • string

Signature

public function getExtension(string $path): string

getFullPath

Get the full path for the given path

Parameters

  • string $path — Path to the file or directory

Return Value

  • string

Signature

public function getFullPath(string $path): string

hasExtension

Check whether the given path has an extension or not

Parameters

  • string $path — Path to the file

Return Value

  • bool

Signature

public function hasExtension(string $path): bool

trimEndingSeparator

Remove the trailing directory separator from the given path

Parameters

  • string $path — Path to the directory

Return Value

  • string

Signature

public function trimEndingSeparator(string $path): string

getRelativePath

Get the relative path between two absolute paths

Parameters

  • string $from — Absolute path from
  • string $to — Absolute path to

Return Value

  • string

Signature

public function getRelativePath(string $from, string $to): string

createTree

Create directory tree

Parameters

  • string $path — The directory tree to create

Return Value

  • bool

Signature

public function createTree(string $path): bool

join

Join two or more path components

Parameters

  • array $parts — Parts of the path

Return Value

  • string

Signature

public function join(array $parts): string

Go to top