本文整理汇总了PHP中Horde_Registry类的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Registry类的具体用法?PHP Horde_Registry怎么用?PHP Horde_Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Horde_Registry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Creates and loads a basic conf.php configuration file.
*/
public function init()
{
// Check if conf.php is writeable.
if (file_exists(HORDE_BASE . '/config/conf.php') && !is_writable(HORDE_BASE . '/config/conf.php') || !is_writable(HORDE_BASE . '/config')) {
$this->_cli->message(Horde_Util::realPath(HORDE_BASE . '/config/conf.php') . ' is not writable.', 'cli.error');
}
// We need a valid conf.php to instantiate the registry.
if (!file_exists(HORDE_BASE . '/config/conf.php')) {
copy(HORDE_BASE . '/config/conf.php.dist', HORDE_BASE . '/config/conf.php');
}
// Initialization
$umask = umask();
Horde_Registry::appInit('horde', array('nocompress' => true, 'authentication' => 'none'));
$this->_config = new Horde_Config();
umask($umask);
}
示例2: array
* - page: (string) The current page view.
*
* Copyright 2013-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2013-2016 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*/
require_once __DIR__ . '/lib/Application.php';
$vars = Horde_Variables::getDefaultVariables();
Horde_Registry::appInit('imp', array('session_control' => $vars->page == 'compose' ? 'netscape' : null, 'timezone' => in_array($vars->page, array('compose', 'mailbox', 'message'))));
$class = 'IMP_Basic_' . Horde_String::ucfirst($vars->page);
switch ($class) {
case 'IMP_Basic_Compose':
IMP_Dynamic_Compose::url()->add($_GET)->redirect();
default:
if (!class_exists($class)) {
throw new IMP_Exception('Page not found: ' . $vars->page);
}
break;
}
try {
$ob = new $class($vars);
} catch (Exception $e) {
if ($registry->getView() == $registry::VIEW_BASIC) {
$notification->push($e);
示例3: explode
exit;
}
$path = explode('/', ltrim($path, '/'));
$type = array_shift($path);
$args = array();
foreach ($path as $pair) {
list($name, $val) = explode('=', $pair);
$args[$name] = $val;
}
if (empty($args['nocache'])) {
$session_cache_limiter = 'public';
session_cache_expire($expire_time);
} else {
$session_cache_limiter = 'nocache';
}
Horde_Registry::appInit('horde', array('authentication' => 'none', 'session_cache_limiter' => $session_cache_limiter, 'session_control' => 'readonly'));
switch ($type) {
case 'app':
if (empty($args['app'])) {
exit;
}
try {
$result = $registry->callAppMethod($args['app'], 'cacheOutput', array('args' => array($args)));
$data = $result['data'];
$type = $result['type'];
} catch (Horde_Exception $e) {
exit;
}
break;
case 'css':
case 'js':
示例4: array
<?php
/**
* Copyright 2001-2002 Robert E. Coyle <robertecoyle@hotmail.com>
* Copyright 2001-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://www.horde.org/licenses/bsdl.php.
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('whups');
$empty = '';
$beendone = 0;
$wereerrors = 0;
$vars = Horde_Variables::getDefaultVariables($empty);
$formname = $vars->get('formname');
Whups::addTopbarSearch();
$form1 = new Whups_Form_Ticket_CreateStepOne($vars);
$form2 = new Whups_Form_Ticket_CreateStepTwo($vars);
$form3 = new Whups_Form_Ticket_CreateStepThree($vars);
$form4 = new Whups_Form_Ticket_CreateStepFour($vars);
$r = new Horde_Form_Renderer(array('varrenderer_driver' => array('whups', 'whups')));
$valid4 = $form4->validate($vars) && $formname == 'whups_form_ticket_createstepfour';
$valid3 = $form3->validate($vars, true);
$valid2 = $form2->validate($vars, !$form1->isSubmitted());
$valid1 = $form1->validate($vars, true);
$doAssignForm = $GLOBALS['registry']->getAuth() && $whups_driver->isCategory('assigned', $vars->get('state'));
if ($valid1 && $valid2 && $valid3 && (!$doAssignForm || $valid4)) {
$form1->getInfo($vars, $info);
$form2->getInfo($vars, $info);
$form3->getInfo($vars, $info);
示例5:
<?php
/*
* Copyright 2002-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Chris Bowlby <cbowlby@tenthpowertech.com>
* @author Jan Schneider <jan@horde.org>
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('sam');
if ($conf['enable']['rules']) {
require SAM_BASE . '/spam.php';
} else {
require SAM_BASE . '/blacklist.php';
}
示例6: array
<?php
/**
* Copyright 2003-2015 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE.
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @author Marko Djukic <marko@oblo.com>
* @author Michael J. Rubinsky <mrubinsk@horde.org>
* @package Jonah
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('jonah');
$params = array('vars' => Horde_Variables::getDefaultVariables(), 'registry' => &$registry, 'notification' => &$notification);
$view = new Jonah_View_ChannelEdit($params);
$view->run();
示例7: GraphCDRForm
<?php
/**
* Copyright 2008-2015 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Ben Klang <ben@alkaloid.net>
*/
require_once __DIR__ . '/lib/Application.php';
$operator = Horde_Registry::appInit('operator');
require_once OPERATOR_BASE . '/lib/Form/SearchCDR.php';
$cache = $GLOBALS['cache'];
$renderer = new Horde_Form_Renderer();
$vars = Horde_Variables::getDefaultVariables();
$form = new GraphCDRForm(_("Graph CDR Data"), $vars);
if ($form->isSubmitted() && $form->validate($vars, true)) {
$accountcode = $vars->get('accountcode');
$dcontext = $vars->get('dcontext');
if (empty($dcontext)) {
$dcontext = '%';
}
try {
$start = new Horde_Date($vars->get('startdate'));
$end = new Horde_Date($vars->get('enddate'));
if ($end->month - $start->month == 0 && $end->year - $start->year == 0) {
// FIXME: This should not cause an error but is due to a bug in
// Image_Graph.
$notification->push(_("You must select a range that includes more than one month to view these graphs."), 'horde.warning');
} else {
示例8: htmlspecialchars
<?php
/**
* Copyright 2003-2015 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL-2). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl.
*
* @author Mike Cochrane <mike@graftonhall.co.nz>
* @category Horde
* @license http://www.horde.org/licenses/lgpl LGPL-2
* @package Horde
*/
require_once __DIR__ . '/../../lib/Application.php';
Horde_Registry::appInit('horde');
// Make sure we don't need the mobile view.
if ($registry->getView() == Horde_Registry::VIEW_SMARTMOBILE) {
$registry->getServiceLink('portal')->redirect();
exit;
}
// Get refresh interval.
if (($r_time = $prefs->getValue('summary_refresh_time')) && !$browser->hasFeature('xmlhttpreq')) {
$page_output->metaRefresh($r_time, Horde::url('services/portal/'));
}
// Render layout.
$view = new Horde_Core_Block_Layout_View($injector->getInstance('Horde_Core_Factory_BlockCollection')->create()->getLayout(), Horde::url('services/portal/edit.php'), Horde::url('services/portal/index.php', true));
$layout_html = $view->toHtml();
$injector->getInstance('Horde_View_Topbar')->subinfo = htmlspecialchars($injector->getInstance('Horde_Core_Factory_Identity')->create()->getDefaultFromAddress(true));
foreach ($view->getStylesheets() as $val) {
$page_output->addStylesheet($val['fs'], $val['uri']);
}
示例9: catch
<?php
/**
* Copyright 2003-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you did not
* did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE.
*
* @author Marko Djukic <marko@oblo.com>
*/
require_once __DIR__ . '/../lib/Application.php';
$vilma = Horde_Registry::appInit('vilma');
/* Only admin should be using this. */
if (!Vilma::hasPermission()) {
throw new Horde_Exception_AuthenticationFailure();
}
// Having a current domain doesn't make sense on this page
Vilma::setCurDomain();
try {
$domains = $vilma->driver->getDomains();
} catch (Exception $e) {
$notification->push($e, 'horde.error');
$domains = array();
}
$editurl = Horde::url('domains/edit.php');
$deleteurl = Horde::url('domains/delete.php');
$userurl = Horde::url('users/index.php');
foreach ($domains as &$domain) {
$domain['edit_url'] = $editurl->copy()->add('domain_id', $domain['domain_id']);
$domain['del_url'] = $deleteurl->copy()->add('domain_id', $domain['domain_id']);
$domain['view_url'] = $userurl->copy()->add('domain_id', $domain['domain_id']);
示例10: array
<?php
/**
* Copyright 1999-2015 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* not receive such a file, see also http://www.horde.org/licenses/gpl.
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('kronolith', array('nodynamicinit' => true));
/* Determine View */
switch ($registry->getView()) {
case Horde_Registry::VIEW_MINIMAL:
case Horde_Registry::VIEW_SMARTMOBILE:
include KRONOLITH_BASE . '/smartmobile.php';
exit;
case Horde_Registry::VIEW_BASIC:
case Horde_Registry::VIEW_DYNAMIC:
if ($registry->getView() == Horde_Registry::VIEW_DYNAMIC && $prefs->getValue('dynamic_view')) {
break;
}
include KRONOLITH_BASE . '/' . $prefs->getValue('defaultview') . '.php';
exit;
}
/* Load Ajax interface. */
$today = new Horde_Date($_SERVER['REQUEST_TIME']);
$ampm = !$prefs->getValue('twentyFour');
$eventAlarmMethods = $eventAlarmParams = $taskAlarmMethods = $taskAlarmParams = '';
foreach ($injector->getInstance('Horde_Alarm')->handlers() as $method => $handler) {
$eventAlarmMethods .= ' <input type="checkbox" name="event_alarms[]" id="kronolithEventAlarm' . $method . '" value="' . $method . '" /> <label for="kronolithEventAlarm' . $method . '">' . $handler->getDescription() . '</label>';
$taskAlarmMethods .= ' <input type="checkbox" name="task[alarm_methods][]" id="kronolithTaskAlarm' . $method . '" value="' . $method . '" /> <label for="kronolithTaskAlarm' . $method . '">' . $handler->getDescription() . '</label>';
示例11: array
/**
* Hashtable management.
*
* Copyright 2014-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL-2). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2014-2016 Horde LLC
* @license http://www.horde.org/licenses/lgpl LGPL-2
* @package Horde
*/
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('horde', array('permission' => array('horde:administration:hashtable')));
$ht = $injector->getInstance('Horde_HashTable');
$vars = $injector->getInstance('Horde_Variables');
if ($vars->clearht) {
$ht->clear();
$notification->push(_("Hashtable data cleared"), 'cli.success');
}
$view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/admin'));
$view->addHelper('Text');
$view->action = Horde::url('admin/hashtable.php');
$view->driver = get_class($ht);
$view->locking = $ht->locking;
$view->persistent = $ht->persistent;
$test_key = '__horde_ht_admin_test';
$ht->delete($test_key);
$view->rw = $ht->set($test_key, 'test') && $ht->get($test_key) === 'test';
示例12: array
/**
* Example list script.
*
* Copyright 2007-2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Your Name <you@example.com>
* @category Horde
* @copyright 2007-2014 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package Skeleton
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('skeleton');
/* Example of how to use Horde_View. If getting a Horde_View instance via
* createInstance() from the injector, the template path already defaults to
* the application's templates/ folder. */
$view = $injector->createInstance('Horde_View');
$view->header = _("Header");
$view->content = _("Some Content");
$view->list = array(array('One', 'Foo'), array('Two', 'Bar'));
/* Load JavaScript for sortable table. */
$page_output->addScriptFile('tables.js', 'horde');
/* Here starts the actual page output. First we output the complete HTML
* header, CSS files, the topbar menu, and the sidebar menu. */
$page_output->header(array('title' => _("List")));
/* Next we output any notification messages. This is not done automatically
* because on some pages you might not want to have notifications. */
$notification->notify(array('listeners' => 'status'));
示例13: 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;
}
示例14: _contacts
/**
* Returns the name of the application providing the 'contacts' interface.
*
* @return string An application name.
* @throws Sabre\DAV\Exception if no contacts application is installed.
*/
protected function _contacts()
{
$contacts = $this->_registry->hasInterface('contacts');
if (!$contacts) {
throw new DAV\Exception('No contacts application installed');
}
return $contacts;
}
示例15: deleteCalendarObject
/**
* Deletes an existing calendar object.
*
* @param mixed $calendarId
* @param string $objectUri
* @return void
*/
public function deleteCalendarObject($calendarId, $objectUri)
{
try {
return $this->_registry->callAppMethod($this->_interface($calendarId), 'davDeleteObject', array('args' => array($calendarId, $objectUri)));
} catch (Horde_Exception $e) {
throw new DAV\Exception($e->getMessage(), $e->getCode(), $e);
}
}