当前位置: 首页>>代码示例>>PHP>>正文


PHP Horde_Registry::appInit方法代码示例

本文整理汇总了PHP中Horde_Registry::appInit方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Registry::appInit方法的具体用法?PHP Horde_Registry::appInit怎么用?PHP Horde_Registry::appInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Horde_Registry的用法示例。


在下文中一共展示了Horde_Registry::appInit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param array $params  A hash containing connection parameters.
  * @throws Horde_Vfs_Exception
  */
 public function __construct($params = array())
 {
     parent::__construct($params);
     if (!isset($this->_params['horde_base'])) {
         throw new Horde_Vfs_Exception('Required "horde_base" not specified in VFS configuration.');
     }
     require_once $this->_params['horde_base'] . '/lib/Application.php';
     Horde_Registry::appInit('horde');
     // Create the Registry object.
     $this->_registry = $GLOBALS['registry'];
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:17,代码来源:Horde.php

示例2: 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);
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:19,代码来源:Bundle.php

示例3: 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);
开发者ID:horde,项目名称:horde,代码行数:31,代码来源:basic.php

示例4: 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':
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:cache.php

示例5: 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);
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:create.php

示例6:

<?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';
}
开发者ID:jubinpatel,项目名称:horde,代码行数:18,代码来源:index.php

示例7: 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();
开发者ID:raz0rsdge,项目名称:horde,代码行数:18,代码来源:edit.php

示例8: 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 {
开发者ID:raz0rsdge,项目名称:horde,代码行数:31,代码来源:viewgraph.php

示例9:

<?php

/**
 * Base redirection page for IMP.
 *
 * Copyright 1999-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    Chuck Hagenbuch <chuck@horde.org>
 * @category  Horde
 * @copyright 1999-2015 Horde LLC
 * @license   http://www.horde.org/licenses/gpl GPL
 * @package   IMP
 */
// Will redirect to login page if not authenticated.
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('imp');
IMP::getInitialPage()->url->redirect();
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:20,代码来源:index.php

示例10:

<?php

/**
 * The Hylax script to show a fax view.
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 */
require_once __DIR__ . '/lib/Application.php';
$hylax = Horde_Registry::appInit('hylax');
$fax_id = Horde_Util::getFormData('fax_id');
$url = Horde_Util::getFormData('url', 'folder.php');
$print = Hylax::printFax($fax_id);
if (is_a($print, 'PEAR_Error')) {
    $notification->push(sprintf(_("Could not print fax ID \"%s\". %s"), $fax_id, $print->getMessage()), 'horde.error');
} else {
    $notification->push(sprintf(_("Printed fax ID \"%s\"."), $fax_id), 'horde.success');
}
/* Redirect back. */
Horde::url($url, true)->redirect();
开发者ID:jubinpatel,项目名称:horde,代码行数:20,代码来源:print.php

示例11: catch

<?php

/**
 *
 * Copyright 2002-2016 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.
 *
 * @author Mike Cochrane <mike@graftonhall.co.nz>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('trean');
$vars = Horde_Variables::getDefaultVariables();
$bookmarks = null;
if (strlen($vars->searchfield)) {
    // Get the bookmarks.
    try {
        $bookmarks = $trean_gateway->searchBookmarks($vars->searchfield);
    } catch (Trean_Exception $e) {
        $notification->push($e);
    }
}
if ($GLOBALS['conf']['content_index']['enabled']) {
    $topbar = $GLOBALS['injector']->getInstance('Horde_View_Topbar');
    $topbar->search = true;
    $topbar->searchAction = Horde::url('search.php');
}
Trean::addFeedLink();
$page_output->header(array('title' => _("Search")));
$notification->notify(array('listeners' => 'status'));
开发者ID:horde,项目名称:horde,代码行数:31,代码来源:search.php

示例12:

<?php

/**
 * Copyright 2005-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://www.horde.org/licenses/bsdl.php.
 *
 * @author Chuck Hagenbuch <chuck@horde.org>
 * @author Jan Schneider <jan@horde.org>
 */
require_once __DIR__ . '/lib/Application.php';
$hermes = Horde_Registry::appInit('hermes');
$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Stop Watch"));
$form->addVariable(_("Stop watch description"), 'description', 'text', true);
if ($form->validate($vars)) {
    Hermes::newTimer($vars->get('description'));
    echo Horde::wrapInlineScript(array('var t = ' . Horde_Serialize::serialize(sprintf(_("The stop watch \"%s\" has been started and will appear in the menu at the next refresh."), $vars->get('description')), Horde_Serialize::JSON) . ';', 'alert(t);', 'window.close();'));
    exit;
}
$page_output->topbar = $page_output->sidebar = false;
$page_output->header(array('title' => _("Stop Watch")));
$form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('start.php'), 'post');
$page_output->footer();
开发者ID:raz0rsdge,项目名称:horde,代码行数:25,代码来源:start.php

示例13: array

<?php

/**
 * Copyright 2003-2016 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', array('permission' => array('jonah:news', Horde_Perms::EDIT)));
$params = array('notification' => $notification, 'prefs' => $prefs, 'registry' => $registry);
$view = new Jonah_View_ChannelList($params);
$view->run();
开发者ID:horde,项目名称:horde,代码行数:18,代码来源:index.php

示例14: array

/**
 * Horde redirection script.
 *
 * Copyright 1999-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   Chuck Hagenbuch <chuck@horde.org>
 * @category Horde
 * @license  http://www.horde.org/licenses/lgpl LGPL-2
 * @package  Horde
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('horde', array('authentication' => 'none', 'nologintasks' => true));
$main_page = Horde_Util::nonInputVar('horde_login_url', Horde_Util::getFormData('url'));
// Break up the requested URL in $main_page and run some sanity checks
// on it to prevent phishing and XSS attacks. If any of the checks
// fail, $main_page will be set to null.
if (!empty($main_page)) {
    // Mute errors in case of unparseable URLs
    $req = @parse_url($main_page);
    // We assume that any valid redirect URL will be in the same
    // cookie domain. This helps prevent rogue off-site Horde installs
    // from mimicking the real server.
    if (isset($req['host'])) {
        $qcookiedom = preg_quote($conf['cookie']['domain']);
        if (!preg_match('/' . $qcookiedom . '$/', $req['host'])) {
            $main_page = null;
        }
开发者ID:horde,项目名称:horde,代码行数:30,代码来源:index.php

示例15: _no_access

/**
 * Copyright 2008-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 Jan Schneider <jan@horde.org>
 */
function _no_access($status, $reason, $body)
{
    header('HTTP/1.0 ' . $status . ' ' . $reason);
    echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>{$status} {$reason}</title>\n</head><body>\n<h1>{$reason}</h1>\n<p>{$body}</p>\n</body></html>";
    exit;
}
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'readonly'));
$calendar = Horde_Util::getFormData('c');
try {
    $share = $injector->getInstance('Kronolith_Shares')->getShare($calendar);
} catch (Exception $e) {
    _no_access(404, 'Not Found', sprintf(_("The requested feed (%s) was not found on this server."), htmlspecialchars($calendar)));
}
if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
    if ($GLOBALS['registry']->getAuth()) {
        _no_access(403, 'Forbidden', sprintf(_("Permission denied for the requested feed (%s)."), htmlspecialchars($calendar)));
    } else {
        $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create();
        if (isset($_SERVER['PHP_AUTH_USER'])) {
            $user = $_SERVER['PHP_AUTH_USER'];
            $pass = $_SERVER['PHP_AUTH_PW'];
        } elseif (isset($_SERVER['Authorization'])) {
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:index.php


注:本文中的Horde_Registry::appInit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。