Skip to content

Directory

Node class.

See Also:

  • http://github.com/friendica/red -

Properties

red_path

private string $red_path

folder_hash

public $folder_hash

data

public $data

ext_path

private string $ext_path

root_dir

private $root_dir

auth

private $auth

os_path

public string $os_path

Methods

__construct

public __construct(string $ext_path, mixed $data, \Zotlabs\Storage\BasicAuth& $auth_plugin): mixed

Parameters:

Parameter Type Description
$ext_path string a full path
$data mixed
$auth_plugin \Zotlabs\Storage\BasicAuth

log

private log(): mixed

getChildren

Returns an array with all the child nodes.

public getChildren(): array

Return Value:

\Sabre\DAV\INode[]

Throws:


getChild

Returns a specific child node, referenced by its name.

public getChild(string $name): \Sabre\DAV\INode

Parameters:

Parameter Type Description
$name string

Throws:


getName

Returns the name of the node.

public getName(): string

setName

Renames the node.

public setName(string $name): void

Parameters:

Parameter Type Description
$name string The new name of the directory.

Throws:


createFile

Creates a new file in the directory.

public createFile(string $name, resource|string $data = null): null|string

Parameters:

Parameter Type Description
$name string Name of the file
$data resource|string Initial payload

Return Value:

ETag

Throws:


createDirectory

Creates a new subdirectory.

public createDirectory(string $name): void

Parameters:

Parameter Type Description
$name string the directory to create

delete

Deletes the current node.

public delete(): mixed

childExists

Checks if a child-node with the specified name exists.

public childExists(string $name): bool

Parameters:

Parameter Type Description
$name string
The name to check if it exists.

moveInto

Moves a node into this collection.

public moveInto(mixed $targetName, mixed $sourcePath, \Sabre\DAV\INode $sourceNode): bool

It is up to the implementors to: 1. Create the new resource. 2. Remove the old resource. 3. Transfer any properties or other data.

Generally you should make very sure that your collection can easily move the move.

If you don't, just return false, which will trigger sabre/dav to handle the move itself. If you return true from this function, the assumption is that the move was successful.

Parameters:

Parameter Type Description
$targetName mixed new local file/collection name
$sourcePath mixed Full path to source node
$sourceNode \Sabre\DAV\INode Source node itself

getDir

public getDir(): void

Throws:


getLastModified

Returns the last modification time as a unix timestamp.

public getLastModified(): int

Return Value:

last modification time in UNIX timestamp


CollectionData

public CollectionData(string $file, \Zotlabs\Storage\BasicAuth& $auth): mixed

Parameters:

Parameter Type Description
$file string path to a directory
$auth \Zotlabs\Storage\BasicAuth

Throws:


ChannelList

public ChannelList(\Zotlabs\Storage\BasicAuth& $auth): array

Parameters:

Parameter Type Description
$auth \Zotlabs\Storage\BasicAuth

Return Value:

Directory[]


FileData

public FileData(string $file, \Zotlabs\Storage\BasicAuth& $auth, bool $test = false): \Zotlabs\Storage\File|\Zotlabs\Storage\Directory|bool|null

Parameters:

Parameter Type Description
$file string
path to file or directory
$auth \Zotlabs\Storage\BasicAuth
$test bool (optional) enable test mode

Throws:


getQuotaInfo

Returns the quota information.

public getQuotaInfo(): mixed

This method MUST return an array with 2 values, the first being the total used space, the second the available space (in bytes)


Inherited methods

getLastModified

Returns the last modification time as a unix timestamp.

public getLastModified(): int

If the information is not available, return null.


delete

Deletes the current node.

public delete(): mixed

Throws:


setName

Renames the node.

public setName(string $name): mixed

Parameters:

Parameter Type Description
$name string The new name

Throws:



Automatically generated on 2025-03-18