<commit_before><?php
/**
* 登录状态检查类
*/
class YaloginStatus
{
	function loaduserstatus()
	{
		require 'yaloginSQLSetting.php';
		$sqlSetting = new YaloginSQLSetting();
		
	}
}
$loginStatus = new YaloginStatus();
$loginStatus->loaduserstatus();
?><commit_msg>制作登录状态查询类<commit_after><?php
/**
* 登录状态检查类
*/
require 'yaloginUserInfo.php';
require 'YaloginSQLSetting.php';
class YaloginStatus
{
	private $user;
	private $sqlset;

	function init()
	{
		$this->user = new YaloginUserInfo();
		$this->sqlset = new YaloginSQLSetting();
	}

	//登录状态
	function loginuser() {
		//检查登录 SESSION
		$cookiejson = isset($_SESSION["logininfo"]) ? $_SESSION["logininfo"] : null;
		if ($cookiejson == null) {
			//检查登录 COOKIE
			$cookiename = $this->cookiename();
			$cookiejson = isset($_COOKIE[$cookiename]) ? $_COOKIE[$cookiename] : null;
			if ($cookiejson == null) {
				return null
			} else {
				$_SESSION["logininfo"] = $cookiejson;
			}
		}
		//取登录信息
		$cookiejsonarr = json_decode($cookiejson);
		if (isset($_SESSION["sessiontoken"]) && 
		isset($_SESSION["sessionname"]) && 
		isset($_SESSION["sessionid"]) && 
		isset($_SESSION["username"]) && 
		isset($_SESSION["userhash"]) && 
		isset($_SESSION["lifetime"]))
		return $cookiejsonarr;
	}

	function cookiename($key = "") {
		if (strlen($key) > 0) {
			$key = "_".$key;
		}
		return "yalogin_".$this->sqlset->db_app.$key;
	}
}
?>
{'fraction_non_alphanumeric': 0.18686131386861313, 'fraction_numerical': 0.00072992700729927, 'mean_word_length': 4.440476190476191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5485431', 'n_tokens_mistral': 572, 'n_tokens_neox': 551, 'n_words': 84}