ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\PropertyStorage\Plugin Class Reference

PropertyStorage Plugin. More...

+ Inheritance diagram for Sabre\DAV\PropertyStorage\Plugin:
+ Collaboration diagram for Sabre\DAV\PropertyStorage\Plugin:

Public Member Functions

 __construct (Backend\BackendInterface $backend)
 Creates the plugin. More...
 
 initialize (Server $server)
 This initializes the plugin. More...
 
 propFind (PropFind $propFind, INode $node)
 Called during PROPFIND operations. More...
 
 propPatch ($path, PropPatch $propPatch)
 Called during PROPPATCH operations. More...
 
 afterUnbind ($path)
 Called after a node is deleted. More...
 
 afterMove ($source, $destination)
 Called after a node is moved. More...
 
 getPluginName ()
 Returns a plugin name. More...
 
 getPluginInfo ()
 Returns a bunch of meta-data about the plugin. More...
 
- Public Member Functions inherited from Sabre\DAV\ServerPlugin
 initialize (Server $server)
 This initializes the plugin. More...
 
 getFeatures ()
 This method should return a list of server-features. More...
 
 getHTTPMethods ($path)
 Use this method to tell the server this plugin defines additional HTTP methods. More...
 
 getPluginName ()
 Returns a plugin name. More...
 
 getSupportedReportSet ($uri)
 Returns a list of reports this plugin supports. More...
 
 getPluginInfo ()
 Returns a bunch of meta-data about the plugin. More...
 

Data Fields

 $pathFilter
 
 $backend
 

Detailed Description

PropertyStorage Plugin.

Adding this plugin to your server allows clients to store any arbitrary WebDAV property.

See: http://sabre.io/dav/property-storage/

for more information.

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 26 of file Plugin.php.

Constructor & Destructor Documentation

◆ __construct()

Sabre\DAV\PropertyStorage\Plugin::__construct ( Backend\BackendInterface  $backend)

Creates the plugin.

Parameters
Backend\BackendInterface$backend

Definition at line 50 of file Plugin.php.

References Sabre\DAV\PropertyStorage\Plugin\$backend.

50  {
51 
52  $this->backend = $backend;
53 
54  }

Member Function Documentation

◆ afterMove()

Sabre\DAV\PropertyStorage\Plugin::afterMove (   $source,
  $destination 
)

Called after a node is moved.

This allows the backend to move all the associated properties.

Parameters
string$source
string$destination
Returns
void

Definition at line 139 of file Plugin.php.

References $destination, Sabre\DAV\PropertyStorage\Plugin\$pathFilter, and $source.

139  {
140 
142  if ($pathFilter && !$pathFilter($source)) return;
143  // If the destination is filtered, afterUnbind will handle cleaning up
144  // the properties.
145  if ($pathFilter && !$pathFilter($destination)) return;
146 
147  $this->backend->move($source, $destination);
148 
149  }
$destination
$source
Definition: linkback.php:22

◆ afterUnbind()

Sabre\DAV\PropertyStorage\Plugin::afterUnbind (   $path)

Called after a node is deleted.

This allows the backend to clean up any properties still in the database.

Parameters
string$path
Returns
void

Definition at line 122 of file Plugin.php.

References $path, and Sabre\DAV\PropertyStorage\Plugin\$pathFilter.

122  {
123 
125  if ($pathFilter && !$pathFilter($path)) return;
126  $this->backend->delete($path);
127 
128  }
$path
Definition: aliased.php:25

◆ getPluginInfo()

Sabre\DAV\PropertyStorage\Plugin::getPluginInfo ( )

Returns a bunch of meta-data about the plugin.

Providing this information is optional, and is mainly displayed by the Browser plugin.

The description key in the returned array may contain html and will not be sanitized.

Returns
array

Definition at line 176 of file Plugin.php.

References Sabre\DAV\PropertyStorage\Plugin\getPluginName().

176  {
177 
178  return [
179  'name' => $this->getPluginName(),
180  'description' => 'This plugin allows any arbitrary WebDAV property to be set on any resource.',
181  'link' => 'http://sabre.io/dav/property-storage/',
182  ];
183 
184  }
getPluginName()
Returns a plugin name.
Definition: Plugin.php:159
+ Here is the call graph for this function:

◆ getPluginName()

Sabre\DAV\PropertyStorage\Plugin::getPluginName ( )

Returns a plugin name.

Using this name other plugins will be able to access other plugins using ::getPlugin

Returns
string

Definition at line 159 of file Plugin.php.

Referenced by Sabre\DAV\PropertyStorage\Plugin\getPluginInfo().

159  {
160 
161  return 'property-storage';
162 
163  }
+ Here is the caller graph for this function:

◆ initialize()

Sabre\DAV\PropertyStorage\Plugin::initialize ( Server  $server)

This initializes the plugin.

This function is called by Sabre, after addPlugin is called.

This method should set up the required event subscriptions.

Parameters
Server$server
Returns
void

Definition at line 67 of file Plugin.php.

References Sabre\Event\EventEmitterInterface\on().

67  {
68 
69  $server->on('propFind', [$this, 'propFind'], 130);
70  $server->on('propPatch', [$this, 'propPatch'], 300);
71  $server->on('afterMove', [$this, 'afterMove']);
72  $server->on('afterUnbind', [$this, 'afterUnbind']);
73 
74  }
$server
Definition: sabredav.php:48
+ Here is the call graph for this function:

◆ propFind()

Sabre\DAV\PropertyStorage\Plugin::propFind ( PropFind  $propFind,
INode  $node 
)

Called during PROPFIND operations.

If there's any requested properties that don't have a value yet, this plugin will look in the property storage backend to find them.

Parameters
PropFind$propFind
INode$node
Returns
void

Definition at line 86 of file Plugin.php.

References $path, Sabre\DAV\PropertyStorage\Plugin\$pathFilter, and Sabre\DAV\PropFind\getPath().

86  {
87 
88  $path = $propFind->getPath();
90  if ($pathFilter && !$pathFilter($path)) return;
91  $this->backend->propFind($propFind->getPath(), $propFind);
92 
93  }
$path
Definition: aliased.php:25
+ Here is the call graph for this function:

◆ propPatch()

Sabre\DAV\PropertyStorage\Plugin::propPatch (   $path,
PropPatch  $propPatch 
)

Called during PROPPATCH operations.

If there's any updated properties that haven't been stored, the propertystorage backend can handle it.

Parameters
string$path
PropPatch$propPatch
Returns
void

Definition at line 105 of file Plugin.php.

References $path, and Sabre\DAV\PropertyStorage\Plugin\$pathFilter.

105  {
106 
108  if ($pathFilter && !$pathFilter($path)) return;
109  $this->backend->propPatch($path, $propPatch);
110 
111  }
$path
Definition: aliased.php:25

Field Documentation

◆ $backend

Sabre\DAV\PropertyStorage\Plugin::$backend

Definition at line 43 of file Plugin.php.

Referenced by Sabre\DAV\PropertyStorage\Plugin\__construct().

◆ $pathFilter


The documentation for this class was generated from the following file: