本文整理匯總了PHP中logger::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP logger::save方法的具體用法?PHP logger::save怎麽用?PHP logger::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類logger
的用法示例。
在下文中一共展示了logger::save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: import_user
/**
* 將當前係統的會員同步給UCenter
* 規則
* 1. 保證 easethink 中有的會員 ucenter 中必需存在,並同步密碼
* 2. 重名會員以 easethink 中的會員資料為準,並將原ucenter中的會員資料記錄到log中
* 3. ucenter中存在的會員。easethink中如不存在暫不處理。
*/
private function import_user()
{
if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
require_once APP_ROOT_PATH . "public/uc_config.php";
$ucdb = new mysql_db(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET);
$result = array('status' => 1, 'msg' => '');
/*$uc_user = $ucdb->getAll("select * from ".UC_DBTABLEPRE."members");
$et_user = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user");
print_r($uc_user);
print_r($et_user);
exit;*/
require_once APP_ROOT_PATH . "system/utils/logger.php";
$query = $GLOBALS['db']->query("SELECT * FROM " . DB_PREFIX . "user ORDER BY `id` ASC");
while ($data = $GLOBALS['db']->fetch_array($query)) {
if (UC_CHARSET != 'utf-8') {
$data['user_name'] = iconv("utf-8", UC_CHARSET, $data['user_name']);
$data['user_pwd'] = iconv("utf-8", UC_CHARSET, $data['user_pwd']);
$data['email'] = iconv("utf-8", UC_CHARSET, $data['email']);
}
$salt = rand(100000, 999999);
$password = md5($data['user_pwd'] . $salt);
$data['user_name'] = addslashes($data['user_name']);
$uc_userinfo = $ucdb->getRow("SELECT * FROM " . UC_DBTABLEPRE . "members WHERE `username`='" . $data['user_name'] . "'");
if (!$uc_userinfo) {
$ucdb->query("INSERT INTO " . UC_DBTABLEPRE . "members SET username='" . $data['user_name'] . "', password='{$password}', email='" . $data['email'] . "', regdate='" . $data['create_time'] . "', salt='{$salt}'", 'SILENT');
$integrate_id = intval($ucdb->insert_id());
$GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $integrate_id . " where id = " . $data['id']);
} else {
//存在同名會員
//開始記錄原係統同的同名數據
$data_str = implode("|", $data);
logger::record($data_str);
logger::save();
$GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $uc_userinfo['uid'] . ",user_pwd = '' where id = " . $data['id']);
//清空原密碼,等待同步登錄時與ucenter同步
}
}
unset($query);
}
return $result;
}