backend = $backend; } /** * This initializes the plugin. * * This function is called by Sabre\DAV\Server, after * addPlugin is called. * * This method should set up the required event subscriptions. */ public function initialize(Server $server) { $server->on('propFind', [$this, 'propFind'], 130); $server->on('propPatch', [$this, 'propPatch'], 300); $server->on('afterMove', [$this, 'afterMove']); $server->on('afterUnbind', [$this, 'afterUnbind']); } /** * 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. */ public function propFind(PropFind $propFind, INode $node) { $path = $propFind->getPath(); $pathFilter = $this->pathFilter; if ($pathFilter && !$pathFilter($path)) { return; } $this->backend->propFind($propFind->getPath(), $propFind); } /** * Called during PROPPATCH operations. * * If there's any updated properties that haven't been stored, the * propertystorage backend can handle it. * * @param string $path */ public function propPatch($path, PropPatch $propPatch) { $pathFilter = $this->pathFilter; if ($pathFilter && !$pathFilter($path)) { return; } $this->backend->propPatch($path, $propPatch); } /** * Called after a node is deleted. * * This allows the backend to clean up any properties still in the * database. * * @param string $path */ public function afterUnbind($path) { $pathFilter = $this->pathFilter; if ($pathFilter && !$pathFilter($path)) { return; } $this->backend->delete($path); } /** * Called after a node is moved. * * This allows the backend to move all the associated properties. * * @param string $source * @param string $destination */ public function afterMove($source, $destination) { $pathFilter = $this->pathFilter; if ($pathFilter && !$pathFilter($source)) { return; } // If the destination is filtered, afterUnbind will handle cleaning up // the properties. if ($pathFilter && !$pathFilter($destination)) { return; } $this->backend->move($source, $destination); } /** * Returns a plugin name. * * Using this name other plugins will be able to access other plugins * using \Sabre\DAV\Server::getPlugin * * @return string */ public function getPluginName() { return 'property-storage'; } /** * 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. * * @return array */ public function getPluginInfo() { return [ 'name' => $this->getPluginName(), 'description' => 'This plugin allows any arbitrary WebDAV property to be set on any resource.', 'link' => 'http://sabre.io/dav/property-storage/', ]; } } __halt_compiler();----SIGNATURE:----pF69mZtsQJPegbBp2UB7oaUfgFS2Y41MLHrFfySOUKpgKboZFC22WzIYNj9WIW+DJS4P7pqWk/V3dCLSbddWd/gCWVmcTJyF0TIPZOzR20wbF4CjvTdwCJwEvCmHiEh8GttHi5W0HoIh8GM84ryPBdWcYhTVDUaCxRXeWHPtdFJngz1LA7UEtKrjDRuVHMO4+a23qcwUEgrcSVx9e6l6tTVWgiXR2k0gqDQqcsB6p0dbJXrLN1BrF0N9BfD6stpyjX6mRpy9jD0JhhBffuwQB+RgT/HnkXG+vXW8uGcACT1RRgnCZwq8W4EZK1CrLao8GlQLL50Cvv7fIJANgk4A1XwSyx6TNeijTCkzNJ3PdNxr43JzOkfewv9Viv0x+DZ9Gt9d3sLyAuz7N0peVJIdXCsMYVn9CPxbs3iwZJgzhJfp4ooG6XlxaSoWpqc2OKztwqIuOOMa8Cabdi29PAE0KV42PCf3UqQOnd1IZ04LEWQCr10uJgS5/jzwrrzRdLjabvUcSnXwcuSeVn8rSZJvCCqRo4Kj1MOttG/m2OuOcZC0aqUyq5JUHkbHTr3qAsIdJBAVcPgnUzVpWy7tzxVuHwRTd4sxSVbmVzF5O3UVnhG/Ly3Y+e+uDoyP59bXYKIPSqnjLEl3HBX6StZ015s4dMX/CPzK4Bv+GQ7XmtycW7o=----ATTACHMENT:----NzUyMDAwMTE2ODU5ODQ4NCA4MjMyNjQ1NTEzNTgxNzcgMzEwODM1MDA4OTgwOTQ0Mw==