Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.SessionCache.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Cache session date of validated
9  *
10  * @author Anakeen 2000
11  * @version $Id: Class.SessionCache.php,v 1.4 2005/06/28 13:53:24 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  */
16 /**
17  */
18 
19 include_once ('Class.DbObj.php');
20 
21 class SessionCache extends DbObj
22 {
23 
24  var $fields = array(
25  "index",
26  "lasttime"
27  );
28 
29  var $id_fields = array(
30  "index"
31  );
32 
33  var $dbtable = "session_cache";
34 
35  var $sqlcreate = "create table session_cache ( index varchar(100),
36  lasttime int);";
37  var $isCacheble = false;
38 
39  function __construct($dbaccess = '', $id = '', $res = '', $dbid = 0)
40  {
41  parent::__construct($dbaccess, $id, $res, $dbid);
42  if ((!$this->isAffected()) && ($id != '')) {
43  $this->index = $id;
44 
45  $date = gettimeofday();
46  $this->lasttime = $date['sec'];
47  $this->Add();
48  }
49  }
50  // modify with current date
51  function setTime()
52  {
53  $date = gettimeofday();
54  $this->lasttime = $date['sec'];
55  $this->Modify();
56  }
57 }
58 ?>
← centre documentaire © anakeen - published under CC License - Dynacase