本文整理汇总了PHP中Sabre\DAV\Server::subscribeEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::subscribeEvent方法的具体用法?PHP Server::subscribeEvent怎么用?PHP Server::subscribeEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sabre\DAV\Server
的用法示例。
在下文中一共展示了Server::subscribeEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initializes the plugin and registers event handlers
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 90);
$this->server->subscribeEvent('afterCreateFile', array($this, 'afterCreateFile'), 90);
$this->server->subscribeEvent('afterWriteContent', array($this, 'afterWriteContent'), 90);
}
示例2: initialize
/**
* Initializes the plugin
*
* This method is automatically called by the Server class after addPlugin.
*
* @param DAV\Server $server
* @return void
*/
public function initialize(DAV\Server $server)
{
$this->server = $server;
$server->subscribeEvent('unknownMethod', array($this, 'unknownMethod'));
$server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'), 50);
$server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
}
示例3: initialize
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$server->subscribeEvent('beforeMethod', array($this, 'httpGetInterceptor'));
$server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
$server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile'));
}
示例4: initialize
/**
* Initializes the plugin
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$this->server->subscribeEvent('beforeMethod', array($this, 'beforeMethod'));
$this->server->subscribeEvent('beforeBind', array($this, 'beforeBind'), 30);
$this->server->subscribeEvent('afterUnbind', array($this, 'afterUnbind'), 30);
}
示例5: initialize
/**
* 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 \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc';
$server->propertyMap[self::TAGS_PROPERTYNAME] = 'OC\\Connector\\Sabre\\TagList';
$this->server = $server;
$this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$this->server->subscribeEvent('beforeGetPropertiesForPath', array($this, 'beforeGetPropertiesForPath'));
$this->server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
}
示例6: initialize
/**
* 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 \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc';
$server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}id';
$server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}permissions';
$this->server = $server;
$this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$this->server->subscribeEvent('afterCreateFile', array($this, 'sendFileIdHeader'));
$this->server->subscribeEvent('afterWriteContent', array($this, 'sendFileIdHeader'));
}
示例7: initialize
/**
* Initializes the plugin
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$this->server->subscribeEvent('unknownMethod', array($this, 'httpPOSTHandler'));
$server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALENDARSERVER] = 'cs';
$server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:PluginManagedAttachments.php
示例8: initialize
/**
* Initializes the plugin
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
$server->resourceTypeMapping['\\Sabre\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
// auto-scheduling extension
array_push($server->protectedProperties, '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-default-calendar-URL', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}schedule-tag');
}
示例9: initialize
/**
* Initializes the plugin
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALDAV] = 'cal';
$server->xmlNamespaces[\Sabre\CalDAV\Plugin::NS_CALENDARSERVER] = 'cs';
#$server->subscribeEvent('beforeGetProperties',array($this,'beforeGetProperties'));
$server->subscribeEvent('report', array($this, 'report'));
array_push($server->protectedProperties, '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}record-type', '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}first-name', '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}last-name');
}
示例10: testUpdatePropertiesEventSuccess
function testUpdatePropertiesEventSuccess()
{
$tree = array(new SimpleCollection('foo'));
$server = new Server($tree);
$server->subscribeEvent('updateProperties', array($this, 'updatepropsuccess'));
$result = $server->updateProperties('foo', array('{DAV:}foo' => 'bar', '{DAV:}foo2' => 'bla'));
$expected = array('href' => 'foo', '200' => array('{DAV:}foo' => null), '201' => array('{DAV:}foo2' => null));
$this->assertEquals($expected, $result);
}
示例11: initialize
/**
* Initializes the plugin
*
* @param \Sabre\DAV\Server $server
* @return void
*/
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$self = $this;
$server->subscribeEvent('report', function ($reportName, $dom, $uri) use($self, $server) {
if ($reportName === '{DAV:}sync-collection') {
$server->transactionType = 'report-sync-collection';
$self->syncCollection($uri, $dom);
return false;
}
});
}
示例12: initialize
/**
* Initializes the plugin
*
* @param DAV\Server $server
* @return void
*/
public function initialize(DAV\Server $server)
{
/* Events */
$server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
$server->subscribeEvent('updateProperties', array($this, 'updateProperties'));
$server->subscribeEvent('report', array($this, 'report'));
$server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'));
$server->subscribeEvent('onBrowserPostAction', array($this, 'browserPostAction'));
$server->subscribeEvent('beforeWriteContent', array($this, 'beforeWriteContent'));
$server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile'));
/* Namespaces */
$server->xmlNamespaces[self::NS_CARDDAV] = 'card';
/* Mapping Interfaces to {DAV:}resourcetype values */
$server->resourceTypeMapping['Sabre\\CardDAV\\IAddressBook'] = '{' . self::NS_CARDDAV . '}addressbook';
$server->resourceTypeMapping['Sabre\\CardDAV\\IDirectory'] = '{' . self::NS_CARDDAV . '}directory';
/* Adding properties that may never be changed */
$server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-address-data';
$server->protectedProperties[] = '{' . self::NS_CARDDAV . '}max-resource-size';
$server->protectedProperties[] = '{' . self::NS_CARDDAV . '}addressbook-home-set';
$server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-collation-set';
$server->propertyMap['{http://calendarserver.org/ns/}me-card'] = 'Sabre\\DAV\\Property\\Href';
$this->server = $server;
}
示例13: initialize
function initialize(Server $server)
{
$this->server = $server;
$server->subscribeEvent('beforeMethod', array($this, 'httpPostInterceptor'));
}
示例14: initialize
/**
* Initializes the plugin
*
* @param DAV\Server $server
* @return void
*/
public function initialize(DAV\Server $server)
{
// Using a relatively low priority (200) to allow other extensions
// to set the content-type first.
$server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'), 200);
}
示例15: initialize
public function initialize(\Sabre\DAV\Server $server)
{
$this->server = $server;
$server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties'));
$server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties'));
}