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


PHP CakeSession::init方法代碼示例

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


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

示例1: userAgent

 /**
  * Get / Set the user agent
  *
  * @param string $userAgent Set the user agent
  * @return string Current user agent
  */
 public static function userAgent($userAgent = null)
 {
     if ($userAgent) {
         self::$_userAgent = $userAgent;
     }
     if (empty(self::$_userAgent)) {
         CakeSession::init(self::$path);
     }
     return self::$_userAgent;
 }
開發者ID:kyme-online,項目名稱:Ramesh-Photography,代碼行數:16,代碼來源:CakeSession.php

示例2: testAuthorizeFor_Admin

 /**
  * @return void
  */
 public function testAuthorizeFor_Admin()
 {
     // can see link to the project for system admin.
     CakeSession::id('testsess');
     CakeSession::init();
     CakeSession::write('user_id', 1);
     $project = ClassRegistry::init('Project')->findById(1);
     $result = $this->Candy->authorize_for(array('controller' => 'members', 'action' => 'edit'), $project);
     $this->assertTrue($result);
 }
開發者ID:gildonei,項目名稱:candycane,代碼行數:13,代碼來源:CandyHelperTest.php

示例3: read

     * @param mixed $id The key of the value to read
     * @return mixed The value of the key or false if it does not exist
     */
    public function read($id);
    /**
     * Helper function called on write for sessions.
     *
     * @param integer $id ID that uniquely identifies session in database
     * @param mixed $data The value of the data to be saved.
     * @return boolean True for successful write, false otherwise.
     */
    public function write($id, $data);
    /**
     * Method called on the destruction of a session.
     *
     * @param integer $id ID that uniquely identifies session in database
     * @return boolean True for successful delete, false otherwise.
     */
    public function destroy($id);
    /**
     * Run the Garbage collection on the session storage.  This method should vacuum all
     * expired or dead sessions.
     *
     * @param integer $expires Timestamp (defaults to current time)
     * @return boolean Success
     */
    public function gc($expires = null);
}
// Initialize the session
CakeSession::init();
開發者ID:Nervie,項目名稱:Beta,代碼行數:30,代碼來源:CakeSession.php

示例4: userAgent

 /**
  * Get / Set the user agent
  *
  * @param string|null $userAgent Set the user agent
  *
  * @return string Current user agent.
  */
 public static function userAgent($userAgent = NULL)
 {
     if ($userAgent) {
         static::$_userAgent = $userAgent;
     }
     if (empty(static::$_userAgent)) {
         CakeSession::init(static::$path);
     }
     return static::$_userAgent;
 }
開發者ID:mrbadao,項目名稱:api-official,代碼行數:17,代碼來源:CakeSession.php


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