本文整理汇总了PHP中logger::record方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::record方法的具体用法?PHP logger::record怎么用?PHP logger::record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::record方法的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;
}