當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Time::get方法代碼示例

本文整理匯總了PHP中Time::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Time::get方法的具體用法?PHP Time::get怎麽用?PHP Time::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Time的用法示例。


在下文中一共展示了Time::get方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Create

 public static function Create($Company = 1, $State = 1, $CustomRef = false)
 {
     $referenceKey = $CustomRef != false ? $CustomRef : \Hash::salt(6);
     if (count(\DB::getInstance()->table("keys")->where("key", $referenceKey)) == 0) {
         $key = \DB::getInstance()->table("keys")->insert(array("key" => $referenceKey, "companyID" => $Company, "state" => $State, "timeSent" => \Time::get()));
         return $referenceKey;
     }
     return -1;
 }
開發者ID:25564,項目名稱:Resume,代碼行數:9,代碼來源:Key.php

示例2: 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

示例3: shouldTrack

 protected function shouldTrack()
 {
     if (Session::exists(Config::get("session/session_name"))) {
         //Are they logged in?
         $this->reason = "Authenticated";
         return false;
     }
     if (Session::exists("LastVisited")) {
         /* 
         We don't want to track the user every time they open a page but rather every time they 
         open the site To achieve this we will only record the first page load every ten minutes
         */
         //----------- Currently 1 for testing -----------//
         if (Time::get() - Session::get("LastVisited") < 1) {
             $this->reason = "Last Visit";
             return false;
         }
     }
     return true;
 }
開發者ID:25564,項目名稱:Resume,代碼行數:20,代碼來源:Visitor.php

示例4: Create

 public static function Create(array $Data = array())
 {
     $Data["timeSent"] = \Time::get();
     $ID = \DB::getInstance()->table("company")->insertGetId($Data);
     return $ID;
 }
開發者ID:25564,項目名稱:Resume,代碼行數:6,代碼來源:Company.php

示例5: testSetTimeZone

 /**
  * Tests the setTimezone() method.
  *
  * @see \Jyxo\Time\Time::setTimezone()
  */
 public function testSetTimeZone()
 {
     $time = Time::get(time(), 'UTC');
     $this->assertNotSame('Europe/Prague', $time->getTimeZone()->getName());
     $time->setTimeZone('Europe/Prague');
     $this->assertSame('Europe/Prague', $time->getTimeZone()->getName());
     $timeZone = new \DateTimeZone('America/Santiago');
     $time->setTimeZone($timeZone);
     $this->assertSame('America/Santiago', $time->getTimeZone()->getName());
     // Invalid timezone
     try {
         $time->setTimeZone('Foo/Bar');
         $this->fail('Expected exception \\InvalidArgumentException.');
     } catch (\PHPUnit_Framework_AssertionFailedError $e) {
         throw $e;
     } catch (\Exception $e) {
         // Correctly thrown exception
         $this->assertInstanceOf('\\InvalidArgumentException', $e);
     }
 }
開發者ID:JerryCR,項目名稱:php-2,代碼行數:25,代碼來源:TimeTest.php


注:本文中的Time::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。