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


PHP Framework::start方法代码示例

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


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

示例1: stripslashes

            if (Config::get_config('ca_mode') != CA_COMODO) {
                $errorTag = PW::create();
                Logger::logEvent(LOG_NOTICE, "Accountant", "process()", "User " . stripslashes($this->person->getX509ValidCN()) . "tried to access the accountant, " . "even though Confusa is not using the Comodo CA.", __LINE__, $errorTag);
                $this->tpl->assign('reason', "[{$errorTag}] Confusa is not using Comodo CA");
                $this->tpl->assign('content', $this->tpl->fetch('restricted_access.tpl'));
                return;
            }
        }
        /* set fields in template */
        if (!$this->account->getLoginName()) {
            $this->tpl->assign('login_name', $this->translateTag('l10n_fieldval_undefined', 'accountant'));
        } else {
            $this->tpl->assign('login_name', $this->account->getLoginName());
        }
        if (!$this->account->getPassword()) {
            $this->tpl->assign('password', $this->translateTag('l10n_fieldval_undefined', 'accountant'));
        } else {
            $this->tpl->assign('password', $this->translateTag('l10n_label_passwhidden', 'accountant'));
        }
        if (!$this->account->getAPName()) {
            $this->tpl->assign('ap_name', $this->translateTag('l10n_fieldval_undefined', 'accountant'));
        } else {
            $this->tpl->assign('ap_name', $this->account->getAPName());
        }
        $this->tpl->assign('verify_ca', 'yes');
        $this->tpl->assign('content', $this->tpl->fetch('accountant.tpl'));
    }
}
$fw = new Framework(new CP_Accountant());
$fw->start();
开发者ID:henrikau,项目名称:confusa,代码行数:30,代码来源:accountant.php

示例2: define

 * @author Joe Stump <joe@joestump.net>
 * @global string FRAMEWORK_BASE_PATH Absolute path to our framework
 */
define('FRAMEWORK_BASE_PATH', dirname(__FILE__));
try {
    require_once 'Framework.php';
    // Load the Framework_Site_Example class and initialize modules, run
    // events, etc. You could create an array based on $_SERVER['SERVER_NAME']
    // that loads up different site drivers depending on the server name. For
    // instance, www.foo.com and foo.com load up Framework_Site_Foo, while
    // www.bar.com, www.baz.com, baz.com, and bar.com load up Bar
    // (Framework_Site_Bar).
    //
    // The second argument is the controller. Not all modules will support all
    // controllers. If that's the case an appropriate error will be output.
    $result = Framework::start('Example', 'CLI');
    if (PEAR::isError($result)) {
        switch ($result->getCode()) {
            case FRAMEWORK_ERROR_AUTH:
                // Redirect to your login page here?
                // $pg = urlencode($_SERVER['REQUEST_URI']);
                // header("Location: /Web/Login?pg=$pg");
                // break;
            // Redirect to your login page here?
            // $pg = urlencode($_SERVER['REQUEST_URI']);
            // header("Location: /Web/Login?pg=$pg");
            // break;
            default:
                // If a PEAR error is returned usually something catastrophic
                // happend like an event returning a PEAR_Error or throwing an
                // exception of some sort.
开发者ID:joestump,项目名称:framework,代码行数:31,代码来源:cli.php

示例3: header

if (!isset($_GET['module'])) {
    header("Location: ./?module=Login");
    exit;
}
define('FRAMEWORK_BASE_PATH', dirname(__FILE__) . '/..');
$ta_include_path = FRAMEWORK_BASE_PATH;
// Local copy of PEAR
$ta_include_path .= PATH_SEPARATOR . FRAMEWORK_BASE_PATH . '/PEAR';
ini_set('include_path', $ta_include_path . PATH_SEPARATOR . ini_get('include_path'));
try {
    require_once 'Framework.php';
    $controller = 'ToasterAdmin';
    if (isset($_GET['Controller'])) {
        $controller = $_GET['Controller'];
    }
    try {
        Framework::start('Default', $controller);
    } catch (Framework_Exception $e) {
        switch ($e->getCode()) {
            case FRAMEWORK_ERROR_AUTH:
                header('Location: ./?module=Login');
                break;
            default:
                die($e->getMessage());
        }
    }
    // Run shutdown functions and stop the Framework
    Framework::stop();
} catch (Exception $error) {
    echo $error->getMessage();
}
开发者ID:shupp,项目名称:toasteradmin,代码行数:31,代码来源:index.php

示例4: define

 * @author Joe Stump <joe@joestump.net>
 * @global string FRAMEWORK_BASE_PATH Absolute path to our framework
 */
define('FRAMEWORK_BASE_PATH', dirname(__FILE__));
try {
    require_once 'Framework.php';
    // Load the Framework_Site_Example class and initialize modules, run
    // events, etc. You could create an array based on $_SERVER['SERVER_NAME']
    // that loads up different site drivers depending on the server name. For
    // instance, www.foo.com and foo.com load up Framework_Site_Foo, while
    // www.bar.com, www.baz.com, baz.com, and bar.com load up Bar
    // (Framework_Site_Bar).
    //
    // The second argument is the controller. Not all modules will support all
    // controllers. If that's the case an appropriate error will be output.
    $result = Framework::start('Example', $_GET['controller']);
    if (PEAR::isError($result)) {
        switch ($result->getCode()) {
            case FRAMEWORK_ERROR_AUTH:
                // Redirect to your login page here?
                // $pg = urlencode($_SERVER['REQUEST_URI']);
                // header("Location: /Web/Login?pg=$pg");
                // break;
            // Redirect to your login page here?
            // $pg = urlencode($_SERVER['REQUEST_URI']);
            // header("Location: /Web/Login?pg=$pg");
            // break;
            default:
                // If a PEAR error is returned usually something catastrophic
                // happend like an event returning a PEAR_Error or throwing an
                // exception of some sort.
开发者ID:shupp,项目名称:Framework,代码行数:31,代码来源:index.php


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