Some getStaticProperty calls to PEAR globalized

This commit is contained in:
Mikael Nordfeldth 2013-10-28 19:03:09 +01:00
parent fd0a16ba04
commit fa91bc7132
4 changed files with 12 additions and 4 deletions

View File

@ -68,6 +68,8 @@ class IMChannel extends Channel
function setNotify($user, $notify)
{
global $_PEAR;
$user_im_prefs = new User_im_prefs();
$user_im_prefs->transport = $this->imPlugin->transport;
$user_im_prefs->user_id = $user->id;
@ -81,7 +83,7 @@ class IMChannel extends Channel
$result = $user_im_prefs->update($original);
if (!$result) {
$last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
$last_error = &$_PEAR->getStaticProperty('DB_DataObject','lastError');
common_log(LOG_ERR,
'Could not set notify flag to ' . $notify .
' for user ' . common_log_objstring($user) .

View File

@ -1678,8 +1678,10 @@ function common_debug($msg, $filename=null)
function common_log_db_error(&$object, $verb, $filename=null)
{
global $_PEAR;
$objstr = common_log_objstring($object);
$last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
$last_error = &$_PEAR->getStaticProperty('DB_DataObject','lastError');
if (is_object($last_error)) {
$msg = $last_error->message;
} else {

View File

@ -85,6 +85,8 @@ class OpenidtrustAction extends Action
function handleSubmit()
{
global $_PEAR;
unset($_SESSION['openid_trust_root']);
unset($_SESSION['openid_allow_url']);
unset($_SESSION['openid_deny_url']);
@ -96,7 +98,7 @@ class OpenidtrustAction extends Action
$user_openid_trustroot->trustroot = $this->trust_root;
$user_openid_trustroot->created = common_sql_now();
if (!$user_openid_trustroot->insert()) {
$err = PEAR::getStaticProperty('DB_DataObject','lastError');
$err = &$_PEAR->getStaticProperty('DB_DataObject','lastError');
}
common_redirect($this->allowUrl, $code=302);
}else{

View File

@ -85,6 +85,8 @@ function oid_get_last()
function oid_link_user($id, $canonical, $display)
{
global $_PEAR;
$oid = new User_openid();
$oid->user_id = $id;
$oid->canonical = $canonical;
@ -92,7 +94,7 @@ function oid_link_user($id, $canonical, $display)
$oid->created = common_sql_now();
if (!$oid->insert()) {
$err = PEAR::getStaticProperty('DB_DataObject','lastError');
$err = &$_PEAR->getStaticProperty('DB_DataObject','lastError');
return false;
}