/** * Garbage collector method * * This is executed when the session garbage collector is executed and takes * the max session lifetime as its only parameter * * @param int $lifetime max session lifetime in seconds * * @return bool */ public function clean($lifetime) { $sessions = AeDirectory::getInstance($this->_storagePath); $expired = time() - $lifetime; foreach ($sessions as $session) { if (!$session->isFile() || $session->extension != $this->_extension) { continue; } if ($session->modifiedTime < $expired) { $session->delete(); } } return true; }
public function getParent() { return AeDirectory::getInstance(dirname($this->path)); }