Skip to main content

Zymba Documentation

Path

object @Path() {
DIRECTORYSEPARATOR;
MAXLENGTH;
PATHSEPARATOR;
getBase(string $path): string {}
getDirectory(string $path): string {}
getExtension(string $path): string {}
getFile(string $path): string {}
getTempDirectory(): string {}
getWorkingDirectory(): string {}
hasExtension(string $path): bool {}
isAbsolute(string $path): bool {}
isLocal(string $path): bool {}
normalize(string $path): string {}
parse(string $path): object {}
setWorkingDirectory(string $path) {}
toAbsolutePath(string $path): string {}
toRealPath(string $path): string {}
toURI(string $path): string {}
}

Static path related constants and functions.

Functions

Gets the base name component of a path (including extension).

@Path.getBase(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Gets the directory name component of a path.

@Path.getDirectory(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Gets the file extension component of a path.

@Path.getExtension(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Gets the filename component of a path (excluding extension).

@Path.getFile(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Gets the absolute path of the system's directory for temporary files.

@Path.getTempDirectory(): string
Returns
TypeValue
string

Gets the absolute path of the current working directory.

@Path.getWorkingDirectory(): string
Returns
TypeValue
string

Determines whether a path has a file extension component.

@Path.hasExtension(string $path): bool
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
bool

Determines whether a path is absolute.

@Path.isAbsolute(string $path): bool
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
bool

Determines whether a path is local.

@Path.isLocal(string $path): bool
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
bool

Normalizes a path to its canonicalized representation.

@Path.normalize(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string
@Path.parse(string $path): object
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
object["directory": ..., "file": ..., "extension": ...]

Sets the path of the working directory.

@Path.setWorkingDirectory(string $path): void
Parameters
NameTypeValueDefault
pathstring""

Converts a path to an absolute path, considering the current working directory.

@Path.toAbsolutePath(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Converts a path to the canonicalized absolute path of an existing file.

@Path.toRealPath(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string

Converts a path to a file URI.

@Path.toURI(string $path): string
Parameters
NameTypeValueDefault
pathstring""
Returns
TypeValue
string