Directory
Node class.
- Full name:
\Zotlabs\Storage\Directory
- Parent class:
\Sabre\DAV\Node
- This class implements:
\Sabre\DAV\ICollection
,\Sabre\DAV\IQuota
,\Sabre\DAV\IMoveTarget
See Also:
- http://github.com/friendica/red -
Properties
red_path
folder_hash
data
ext_path
root_dir
auth
os_path
Methods
__construct
Parameters:
Parameter | Type | Description |
---|---|---|
$ext_path |
string | a full path |
$data |
mixed | |
$auth_plugin |
\Zotlabs\Storage\BasicAuth |
log
getChildren
Returns an array with all the child nodes.
Return Value:
\Sabre\DAV\INode[]
Throws:
getChild
Returns a specific child node, referenced by its name.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string |
Throws:
getName
Returns the name of the node.
setName
Renames the node.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | The new name of the directory. |
Throws:
createFile
Creates a new file in the directory.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Name of the file |
$data |
resource|string | Initial payload |
Return Value:
ETag
Throws:
createDirectory
Creates a new subdirectory.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | the directory to create |
delete
Deletes the current node.
childExists
Checks if a child-node with the specified name exists.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | The name to check if it exists. |
moveInto
Moves a node into this collection.
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
Throws:
getLastModified
Returns the last modification time as a unix timestamp.
Return Value:
last modification time in UNIX timestamp
CollectionData
Parameters:
Parameter | Type | Description |
---|---|---|
$file |
string | path to a directory |
$auth |
\Zotlabs\Storage\BasicAuth |
Throws:
ChannelList
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.
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.
If the information is not available, return null.
delete
Deletes the current node.
Throws:
setName
Renames the node.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | The new name |
Throws:
Automatically generated on 2025-03-18