本文整理匯總了PHP中Key::validKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP Key::validKey方法的具體用法?PHP Key::validKey怎麽用?PHP Key::validKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Key
的用法示例。
在下文中一共展示了Key::validKey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Create
public static function Create($Key = 0, $Company = false)
{
$Return = false;
if ($Key !== 0) {
if (\Session::exists("refKey")) {
if (\Session::get("refKey") != $Key) {
//This computer has multiple Keys? I'm not sure how or why this would happen.
//It is a possibility so I guess I should probably plan for it
$SavedKey = new Key(\Session::get("refKey"));
if ($SavedKey->validKey()) {
//Has two valid keys? What on earth? I will have to account for this later
} else {
\Session::put("refKey", $Key);
$Return = true;
}
}
} else {
\Session::put("refKey", $Key);
$Return = true;
}
if (\Cookie::exists("refKey")) {
if (\Cookie::get("refKey") != $Key) {
$SavedKey = new Key(\Cookie::get("refKey"));
if ($SavedKey->validKey()) {
//Has two valid keys? What on earth? I will have to account for this later
} else {
\Cookie::put("refKey", $Key, \Config::get("tracking/cookie_expiry"));
$Return = true;
}
}
} else {
\Cookie::put("refKey", $Key, \Config::get("tracking/cookie_expiry"));
$Return = true;
}
if ($Company != false) {
if (count(\DB::getInstance()->table("companyip")->where("IP", \Connection::IP())->where("Company", $Company->ID())) == 0) {
\DB::getInstance()->table("companyip")->insert(array("IP" => \Connection::IP(), "Company" => $Company->ID(), "LastScene" => \Time::get(), "Hits" => 1));
} else {
\DB::getInstance()->table("companyip")->where("IP", \Connection::IP())->increment("Hits");
}
}
//IP Based Search will go here
return $Return;
}
return false;
}
示例2: __construct
public function __construct()
{
$this->IP = \Connection::IP();
//Allows for spoofing IP
$refKey = $this->getKey();
if ($refKey != false) {
$Key = new Key($refKey);
if ($Key->validKey($refKey)) {
$Company = $this->getCompany($Key);
Tracker::Create($refKey, $Company);
$this->Valid = true;
} else {
Tracker::Clear();
throw new \Exception("Key is Invalid");
}
} else {
throw new \Exception("No Key");
}
}