Example #1
0
 /**
  * Set the desired lifetime in seconds for a record before it's considered
  * stale.
  * Once it's stale it will be eventually wiped out next time you try to 
  * retrieve it or call refresh().
  * IMPORTANT: if you want records to last forever, set this value to zero.
  * 
  *
  * @param unknown_type $time
  * @return void
  */
 public static function setLifetime($time)
 {
     if (is_integer($time) && $time >= 0) {
         self::$stale_age = $time;
         return true;
     }
     return false;
 }
Example #2
0
 private static function extractContext($label)
 {
     if (is_null($label)) {
         return "_global_context_";
     }
     if (is_object($label)) {
         $label = sha1(serialize($label));
         return $label;
     }
     if (PersistenceEngine::validateContext($label)) {
         return $label;
     }
     return false;
 }
Example #3
0
 public function __construct($ctx, $connectionString)
 {
     $this->dbc = DBCFactory::getConnector($ctx, $connectionString);
     parent::__construct($ctx);
     $this->dbc->createTable($ctx);
 }
Example #4
0
 public function __construct($context)
 {
     parent::__construct($context);
 }