当前位置: 首页>>代码示例>>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;未经允许,请勿转载。