Documentation

Directory
in package
implements DirectoryInterface

FinalYes

Represents a shared directory.

Table of Contents

Interfaces

DirectoryInterface
Represents a shared directory.

Properties

$directory  : string
$filesystem  : FilesystemOperator
$share  : string

Methods

__construct()  : mixed
Create a Directory instance to represent a file share.
getSharePath()  : string
Get the full path to the directory on the file share.
has()  : bool
Check if a file exists.
write()  : $this
Write data to a file.

Properties

$directory

private string $directory

The name of the directory (to be appended to both $filesystem and $share).

$filesystem

private FilesystemOperator $filesystem

$share

private string $share

The full path to the share (including the hostname).

Methods

__construct()

Create a Directory instance to represent a file share.

public __construct(FilesystemOperator|string $filesystem, string $share, string $directory) : mixed
Parameters
$filesystem : FilesystemOperator|string

The full path to the share on the local filesystem.

$share : string

The full path to the share (including the hostname).

$directory : string

The name of the directory (to be appended to both $filesystem and $share).

getSharePath()

Get the full path to the directory on the file share.

public getSharePath() : string
Return values
string

has()

Check if a file exists.

public has(string $file) : bool
Parameters
$file : string
Return values
bool

write()

Write data to a file.

public write(string $file, string $contents) : $this
Parameters
$file : string

The path to the file

$contents : string

The contents to write to the file

Return values
$this
On this page

Search results