本文整理汇总了PHP中Horde_Registry::hasMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Registry::hasMethod方法的具体用法?PHP Horde_Registry::hasMethod怎么用?PHP Horde_Registry::hasMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Registry
的用法示例。
在下文中一共展示了Horde_Registry::hasMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChildren
/**
* Returns an array with all the child nodes
*
* @return DAV\INode[]
*/
public function getChildren()
{
$apps = $this->_collections;
foreach ($this->_registry->listApps() as $app) {
if ($this->_registry->hasMethod('browse', $app)) {
$apps[] = new Horde_Dav_Collection($app, array(), $this->_registry, $this->_mimedb);
}
}
return $apps;
}
示例2: deleteFolder
/**
* Delete a folder.
*
* @param string $class The EAS collection class.
* @param string $id The folder id
*
* @since 2.12.0
*/
public function deleteFolder($class, $id)
{
switch ($class) {
case Horde_ActiveSync::CLASS_TASKS:
if (!$this->_registry->horde->getPreference($this->_registry->hasInterface('tasks'), 'activesync_no_multiplex')) {
throw new Horde_ActiveSync_Exception('Deleting addressbooks not supported by the contacts API.', Horde_ActiveSync_Exception::UNSUPPORTED);
}
$this->_registry->tasks->deleteTasklist($id);
break;
case Horde_ActiveSync::CLASS_CONTACTS:
if (!$this->_registry->hasMethod('contacts/deleteAddressbook') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('contacts'), 'activesync_no_multiplex')) {
throw new Horde_ActiveSync_Exception('Deleting addressbooks not supported by the contacts API.', Horde_ActiveSync_Exception::UNSUPPORTED);
}
$this->_registry->contacts->deleteAddressbook($id);
break;
case Horde_ActiveSync::CLASS_CALENDAR:
if (!$this->_registry->hasMethod('calendar/deleteCalendar') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('calendar'), 'activesync_no_multiplex')) {
throw new Horde_ActiveSync_Exception('Deleting calendars not supported by the calendar API.', Horde_ActiveSync_Exception::UNSUPPORTED);
}
$this->_registry->calendar->deleteCalendar($id);
break;
case Horde_ActiveSync::CLASS_NOTES:
if (!$this->_registry->hasMethod('notes/deleteNotepad') || !$this->_registry->horde->getPreference($this->_registry->hasInterface('notes'), 'activesync_no_multiplex')) {
throw new Horde_ActiveSync_Exception('Deleting notepads not supported by the notes API.', Horde_ActiveSync_Exception::UNSUPPORTED);
}
$this->_registry->notes->deleteNotepad($id);
break;
}
}
示例3: _listFolder
/**
* Returns an unsorted file list of the specified directory.
*
* @param string $path The path of the directory.
* @param string|array $filter Regular expression(s) to filter
* file/directory name on.
* @param boolean $dotfiles Show dotfiles?
* @param boolean $dironly Show only directories?
*
* @return array File list.
* @throws Horde_Vfs_Exception
*/
protected function _listFolder($path, $filter = null, $dotfiles = true, $dironly = false)
{
$list = array();
if ($path == '/') {
try {
$apps = $this->_registry->listApps(null, false, Horde_Perms::READ);
} catch (Horde_Exception $e) {
throw new Horde_Vfs_Exception($e->getMessage());
}
foreach ($apps as $app) {
if ($this->_registry->hasMethod('browse', $app)) {
$file = array('name' => $app, 'date' => time(), 'type' => '**dir', 'size' => -1);
$list[] = $file;
}
}
return $list;
}
if (substr($path, 0, 1) == '/') {
$path = substr($path, 1);
}
$pieces = explode('/', $path);
try {
$items = $this->_registry->callByPackage($pieces[0], 'browse', array('path' => $path, 'properties' => array('name', 'browseable', 'contenttype', 'contentlength', 'modified')));
} catch (Horde_Exception $e) {
throw new Horde_Vfs_Exception($e->getMessage());
}
if (!is_array(reset($items))) {
/* We return an object's content. */
throw new Horde_Vfs_Exception('Unknown error');
}
foreach ($items as $sub_path => $i) {
if ($dironly && !$i['browseable']) {
continue;
}
$name = basename($sub_path);
if ($this->_filterMatch($filter, $name)) {
continue;
}
$type = class_exists('Horde_Mime_Magic') ? Horde_Mime_Magic::mimeToExt(empty($i['contenttype']) ? 'application/octet-stream' : $i['contenttype']) : '**none';
$file = array('name' => $name, 'date' => empty($i['modified']) ? 0 : $i['modified'], 'type' => $i['browseable'] ? '**dir' : $type, 'size' => empty($i['contentlength']) ? 0 : $i['contentlength']);
$list[] = $file;
}
return $list;
}