コード例 #1
0
 function _createContainer($data)
 {
     if ($this->need_serialization) {
         return lmbSerializable::serialize($data);
     } else {
         return $data;
     }
 }
コード例 #2
0
 function _getSingleKeyValue($resolved_key)
 {
     if (!($record = $this->db_table->selectFirstRecord($this->_getKeyCriteria($resolved_key)))) {
         return NULL;
     }
     $ttl = (int) $record['ttl'];
     if ($ttl && $ttl < time()) {
         return NULL;
     }
     return lmbSerializable::unserialize($record['value']);
 }
コード例 #3
0
 function _getSingleKeyValue($resolved_key)
 {
     if (is_null($value = $this->_getSession()->get($resolved_key))) {
         return NULL;
     }
     if ($this->need_serialization) {
         $value = lmbSerializable::unserialize($value);
     }
     $ttl = $this->_getSession()->get($resolved_key . 'ttl');
     return $ttl && $ttl <= time() ? NULL : $value;
 }
コード例 #4
0
 function testExtractSerializedClasses()
 {
     $stub = new SerializableTestChildStub();
     $serialized = serialize($stub);
     $this->assertEqual(lmbSerializable::extractSerializedClasses($serialized), array('SerializableTestChildStub'));
 }