当前位置: 首页>>代码示例>>PHP>>正文


PHP Key::validKey方法代码示例

本文整理汇总了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;
 }
开发者ID:25564,项目名称:Resume,代码行数:46,代码来源:Tracker.php

示例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");
     }
 }
开发者ID:25564,项目名称:Resume,代码行数:19,代码来源:Identity.php


注:本文中的Key::validKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。