本文整理汇总了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();
示例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.
示例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();
}
示例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.