function _createContainer($data) { if ($this->need_serialization) { return lmbSerializable::serialize($data); } else { return $data; } }
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']); }
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; }
function testExtractSerializedClasses() { $stub = new SerializableTestChildStub(); $serialized = serialize($stub); $this->assertEqual(lmbSerializable::extractSerializedClasses($serialized), array('SerializableTestChildStub')); }