apps/dav/lib/Comments/CommentsPlugin.php
/**
	 * 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.
	 *
	 * @param Server $server
	 * @return void
	 */
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.

@param Server $server
@return void
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 . @param Server $server @return void
function initialize(Server $server) {
		$this->server = $server;
		if(strpos($this->server->getRequestUri(), 'comments/') !== 0) {
			return;
		}
		$this->server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
		$this->server->xml->classMap['DateTime'] = function(Writer $writer, \DateTime $value) {
			$writer->write(\Sabre\HTTP\toDate($value));
		};
		$this->server->on('report', [$this, 'onReport']);
		$this->server->on('method:POST', [$this, 'httpPost']);
	}
function initialize ( Server $ server ) { $ this -> server = $ server ; if ( strpos ( $ this -> server -> getRequestUri ( ) , 'comments/' ) !== 0 ) { return ; } $ this -> server -> xml -> namespaceMap [ self :: NS_OWNCLOUD ] = 'oc' ; $ this -> server -> xml -> classMap [ 'DateTime' ] = function ( Writer $ writer , \ DateTime $ value ) { $ writer -> write ( \ Sabre \ HTTP \ toDate ( $ value ) ) ; } ; $ this -> server -> on ( 'report' , [ $ this , 'onReport' ] ) ; $ this -> server -> on ( 'method:POST' , [ $ this , 'httpPost' ] ) ; }
This initializes the plugin.
This initializes the plugin .