本文整理汇总了PHP中ErrorHandler::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP ErrorHandler::singleton方法的具体用法?PHP ErrorHandler::singleton怎么用?PHP ErrorHandler::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorHandler
的用法示例。
在下文中一共展示了ErrorHandler::singleton方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($storage_engine = "mysql", $mysql_server = "localhost", $mysql_username = "root", $mysql_password = "", $mysql_db = "phprd", $mysql_table = "users")
{
$this->error = ErrorHandler::singleton();
if (empty($storage_engine) || empty($mysql_server) || empty($mysql_username) || empty($mysql_db) || empty($mysql_table)) {
$this->error->add_error_die("Not enough parameters for connection to DB");
}
switch ($storage_engine) {
case "mysql":
$this->db_handle = new mysql();
$r = $this->db_handle->connect($mysql_server, $mysql_username, $mysql_password, $mysql_db);
if (!$r) {
$this->error->add_error_die("Server <strong>{$mysql_server}</strong> connect failure");
} else {
$query = 'CREATE TABLE IF NOT EXISTS `users`(`id` serial, `username` varchar(32) default "" not null, `password` varchar(32) default "" not null, `email` varchar(64) default "" not null, `group` varchar(32) default "" not null)';
$r = $this->db_handle->sql($query);
$this->storage = $storage_engine;
$this->db_table = $mysql_table;
}
break;
case "file":
$this->storage = $storage_engine;
break;
default:
break;
}
}
示例2: __construct
public function __construct()
{
if (!class_exists("ErrorHandler")) {
die("No error class, load+instantiate error class before template!");
}
$this->error_handler = ErrorHandler::singleton();
}
示例3: print_html_head
*/
global $config, $page_attributes, $smarty, $lang_str, $_SERWEB;
print_html_head($page_attributes);
unset($page_attributes['tab_collection']);
$page_attributes['logout'] = false;
$page_attributes['self_account_delete'] = false;
print_html_body_begin($page_attributes);
//create copy of some options from config in order to sensitive options will not accessible via templates
$cfg = new stdclass();
$cfg->img_src_path = $config->img_src_path;
$cfg->js_src_path = $config->js_src_path;
$cfg->style_src_path = $config->style_src_path;
$cfg->user_pages_path = $config->user_pages_path;
$cfg->admin_pages_path = $config->admin_pages_path;
$cfg->domains_path = $config->domains_path;
$eh =& ErrorHandler::singleton();
$page_attributes['errors'] =& $eh->get_errors_array();
// $page_attributes['message'] = &$message;
$smarty->assign_by_ref('parameters', $page_attributes);
$smarty->assign_by_ref("cfg", $cfg);
$smarty->assign_by_ref('lang_str', $lang_str);
$f_uname = $config->fully_qualified_name_on_login ? $this->auth['uname'] . '@' . $this->auth['realm'] : $this->auth['uname'];
/* create html form */
$form = array();
$form['start'] = '<form name="login_form" action="' . $this->url() . '" method=post>';
$form['username'] = '<input type="text" name="username" id="username" value="' . $f_uname . '" autocomplete="off" size=32 disabled>';
$form['password'] = '<input type="password" name="password" id="password" size=32 maxlength=128>';
$form['okey'] = '<input type="submit" name="okey_x" id="okey" value="' . $lang_str['b_login'] . '">';
$form['finish'] = '</form>';
$smarty->assign_by_ref("form", $form);
/*
示例4: log_errors
/**
* get error message from PEAR_Error object and write it to $errors array and to error log
*
* This method may be called staticaly e.g.: ErrorHandler::log_errors($err_object);
* or dynamicaly e.g. $e = &ErrorHandler::singleton(); $e->log_errors($err_object);
*
* @param object $err_object PEAR_Error object
* @return none
*/
function log_errors($err_object)
{
if (isset($this) and is_a($this, 'ErrorHandler')) {
$in =& $this;
} else {
$in =& ErrorHandler::singleton();
}
log_errors($err_object, $in->errors);
}
示例5: page_conroler
function page_conroler()
{
$this->reg = Creg::singleton();
// create regular expressions class
$eh =& ErrorHandler::singleton();
$eh->set_errors_ref($this->errors);
$this->errors_from_get_param();
$this->messages_from_get_param();
$this->session_init();
$this->init_this_uid_and_did();
$this->set_interapu_vars();
}
示例6: page_conroler
function page_conroler()
{
$this->reg = Creg::singleton();
// create regular expressions class
$eh =& ErrorHandler::singleton();
$eh->set_errors_ref($this->errors);
$this->errors_from_get_param();
$this->session_init();
$this->xxl_init();
$this->init_this_uid_and_did();
$this->set_interapu_vars();
// if $data_selected_proxy was not set, reference it to $data_auth
if (!isset($GLOBALS['data_selected_proxy']) or !$GLOBALS['data_selected_proxy']) {
$GLOBALS['data_selected_proxy'] =& $GLOBALS['data_auth'];
}
}