memcache:wcf.acp.option.cache_source_type.memcache
apc:wcf.acp.option.cache_source_type.apc
no:wcf.acp.option.cache_source_type.no]]></selectoptions>
- <enableoptions><![CDATA[disk:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache
-memcache:cache_source_memcache_host,cache_source_memcache_use_pconnect,enable_session_data_cache
-apc:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache
-no:!cache_source_memcache_host,!cache_source_memcache_use_pconnect,!enable_session_data_cache]]></enableoptions>
- </option>
-
- <option name="enable_session_data_cache">
- <categoryname>general.cache.general</categoryname>
- <optiontype>boolean</optiontype>
+ <enableoptions><![CDATA[disk:!cache_source_memcache_host,!cache_source_memcache_use_pconnect
+memcache:cache_source_memcache_host,cache_source_memcache_use_pconnect
+apc:!cache_source_memcache_host,!cache_source_memcache_use_pconnect
+no:!cache_source_memcache_host,!cache_source_memcache_use_pconnect]]></enableoptions>
</option>
<option name="cache_source_memcache_host">
+++ /dev/null
-<?php
-namespace wcf\data\acp\session\data;
-use wcf\data\DatabaseObject;
-use wcf\system\WCF;
-
-/**
- * Represents ACP session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.acp.session.data
- * @category Community Framework
- */
-class ACPSessionData extends DatabaseObject {
- /**
- * @see wcf\data\DatabaseObject::$databaseTableName
- */
- protected static $databaseTableName = 'acp_session_data';
-
- /**
- * @see wcf\data\DatabaseObject::$databaseTableIndexIsIdentity
- */
- protected static $databaseTableIndexIsIdentity = false;
-
- /**
- * @see wcf\data\DatabaseObject::$databaseTableIndexName
- */
- protected static $databaseTableIndexName = 'sessionID';
-}
+++ /dev/null
-<?php
-namespace wcf\data\acp\session\data;
-use wcf\data\AbstractDatabaseObjectAction;
-
-/**
- * Executes ACP session data-related actions.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.acp.session.data
- * @category Community Framework
- */
-class ACPSessionDataAction extends AbstractDatabaseObjectAction {
- /**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
- */
- protected $className = 'wcf\data\acp\session\data\ACPSessionDataEditor';
-}
+++ /dev/null
-<?php
-namespace wcf\data\acp\session\data;
-use wcf\data\DatabaseObjectEditor;
-
-/**
- * Provides functions to edit ACP session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.acp.session.data
- * @category Community Framework
- */
-class ACPSessionDataEditor extends DatabaseObjectEditor {
- /**
- * @see wcf\data\DatabaseObjectDecorator::$baseClass
- */
- protected static $baseClass = 'wcf\data\acp\session\data\ACPSessionData';
-}
+++ /dev/null
-<?php
-namespace wcf\data\acp\session\data;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of ACP session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.acp.session.data
- * @category Community Framework
- */
-class ACPSessionDataList extends DatabaseObjectList {
- /**
- * @see wcf\data\DatabaseObjectList::$className
- */
- public $className = 'wcf\data\acp\session\data\ACPSessionData';
-}
+++ /dev/null
-<?php
-namespace wcf\data\session\data;
-use wcf\data\acp\session\data\ACPSessionData;
-
-/**
- * Represents session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.session.data
- * @category Community Framework
- */
-class SessionData extends ACPSessionData {
- /**
- * @see wcf\data\DatabaseObject::$databaseTableName
- */
- protected static $databaseTableName = 'session_data';
-
- /**
- * @see wcf\data\DatabaseObject::$databaseTableIndexName
- */
- protected static $databaseTableIndexName = 'sessionID';
-}
+++ /dev/null
-<?php
-namespace wcf\data\session\data;
-use wcf\data\AbstractDatabaseObjectAction;
-
-/**
- * Executes session data-related actions.
- *
- * @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.session.data
- * @category Community Framework
- */
-class SessionDataAction extends AbstractDatabaseObjectAction {
- /**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
- */
- protected $className = 'wcf\data\session\data\SessionDataEditor';
-}
+++ /dev/null
-<?php
-namespace wcf\data\session\data;
-use wcf\data\DatabaseObjectEditor;
-
-/**
- * Provides functions to edit session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.session.data
- * @category Community Framework
- */
-class SessionDataEditor extends DatabaseObjectEditor {
- /**
- * @see wcf\data\DatabaseObjectDecorator::$baseClass
- */
- protected static $baseClass = 'wcf\data\session\data\SessionData';
-}
+++ /dev/null
-<?php
-namespace wcf\data\session\data;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of session data.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage data.session.data
- * @category Community Framework
- */
-class SessionDataList extends DatabaseObjectList {
- /**
- * @see wcf\data\DatabaseObjectList::$className
- */
- public $className = 'wcf\data\session\data\SessionData';
-}
define('HTTP_ENABLE_GZIP', 0);
define('HTTP_GZIP_LEVEL', 0);
define('CACHE_SOURCE_TYPE', 'disk');
-define('ENABLE_SESSION_DATA_CACHE', 0);
define('MODULE_MASTER_PASSWORD', 1);
/**
*/
protected $sessionEditor = 'wcf\data\acp\session\ACPSessionEditor';
- /**
- * session data editor class name
- * @var string
- */
- protected $sessionDataEditor = 'wcf\data\acp\session\data\ACPSessionDataEditor';
-
/**
* Loads the object of the active session.
*/
public function load() {
// get session
$sessionID = $this->readSessionID();
- SessionHandler::getInstance()->load($this->sessionEditor, $this->sessionDataEditor, $sessionID);
+ SessionHandler::getInstance()->load($this->sessionEditor, $sessionID);
// call shouldInit event
if (!defined('NO_IMPORTS')) {
*/
protected $sessionEditor = 'wcf\data\session\SessionEditor';
- /**
- * @see wcf\system\session\ACPSessionFactory::$sessionDataEditor
- */
- protected $sessionDataEditor = 'wcf\data\session\data\SessionDataEditor';
-
/**
* @see wcf\system\session\ACPSessionFactory::readSessionID()
*/
*/
protected $session = null;
- /**
- * session data object
- * @var wcf\data\acp\session\data\ACPSessionData
- */
- protected $sessionData = null;
-
- /**
- * session data class name
- * @var string
- */
- protected $sessionDataClassName = '';
-
- /**
- * session data editor class name
- * @var string
- */
- protected $sessionDataEditorClassName = '';
-
/**
* session class name
* @var string
* Loads an existing session or creates a new one.
*
* @param string $sessionEditorClassName
- * @param string $sessionEditorDataClassName
* @param string $sessionID
*/
- public function load($sessionEditorClassName, $sessionEditorDataClassName, $sessionID) {
+ public function load($sessionEditorClassName, $sessionID) {
$this->sessionEditorClassName = $sessionEditorClassName;
$this->sessionClassName = call_user_func(array($sessionEditorClassName, 'getBaseClass'));
- $this->sessionDataEditorClassName = $sessionEditorDataClassName;
- $this->sessionDataClassName = call_user_func(array($sessionEditorDataClassName, 'getBaseClass'));
// try to get existing session
if (!empty($sessionID)) {
* Initializes session variables.
*/
protected function loadVariables() {
- @$this->variables = unserialize($this->sessionData->sessionVariables);
+ @$this->variables = unserialize($this->session->sessionVariables);
if (!is_array($this->variables)) {
$this->variables = array();
}
protected function getExistingSession($sessionID) {
$this->session = new $this->sessionClassName($sessionID);
if (!$this->session->sessionID || !$this->validate()) {
- $this->session = $this->sessionData = null;
+ $this->session = null;
return;
}
- // load session data
- $this->sessionData = new $this->sessionDataClassName($this->session->sessionID);
-
// load user
$this->user = new User($this->session->userID);
}
'requestURI' => UserUtil::getRequestURI(),
'requestMethod' => $requestMethod
));
-
- // creaty entry in session data
- $this->sessionData = call_user_func(array($this->sessionDataEditorClassName, 'create'), array(
- 'sessionID' => $this->session->sessionID
- ));
}
/**
*/
public function changeUser(User $user) {
$sessionTable = call_user_func(array($this->sessionClassName, 'getDatabaseTableName'));
- $sessionDataTable = call_user_func(array($this->sessionDataClassName, 'getDatabaseTableName'));
if ($user->userID) {
// user is not a gest, delete all other sessions of this user
$statement->execute(array(
$row['sessionID']
));
-
- // delete session data
- $sql = "DELETE FROM ".$sessionDataTable."
- WHERE sessionID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
- $row['sessionID']
- ));
}
}
public function update() {
if ($this->doNotUpdate) return;
- // update session
- $sessionEditor = new $this->sessionEditorClassName($this->session);
- $sessionEditor->update(array(
+ // set up data
+ $data = array(
'ipAddress' => $this->ipAddress,
'userAgent' => $this->userAgent,
'requestURI' => $this->requestURI,
'requestMethod' => $this->requestMethod,
'lastActivityTime' => TIME_NOW,
'packageID' => PACKAGE_ID
- ));
-
- // update session variables
+ );
if ($this->variablesChanged) {
- $sessionDataEditor = new $this->sessionDataEditorClassName($this->sessionData);
- $sessionDataEditor->update(array(
- 'sessionVariables' => serialize($this->variables)
- ));
+ $data['sessionVariables'] = serialize($this->variables);
}
+
+ // update session
+ $sessionEditor = new $this->sessionEditorClassName($this->session);
+ $sessionEditor->update($data);
}
/**
* Deletes this session and it's related data.
*/
public function delete() {
- // remove session data
- $sessionDataEditor = new $this->sessionDataEditorClassName($this->sessionData);
- $sessionDataEditor->delete();
-
// remove session
$sessionEditor = new $this->sessionEditorClassName($this->session);
$sessionEditor->delete();
define('SESSION_VALIDATE_USER_AGENT', 0);
define('CACHE_SOURCE_TYPE', 'disk');
-define('ENABLE_SESSION_DATA_CACHE', 0);
define('MODULE_MASTER_PASSWORD', 1);
define('TIMEZONE', 'Europe/Berlin');
requestURI VARCHAR(255) NOT NULL DEFAULT '',
requestMethod VARCHAR(4) NOT NULL DEFAULT '',
username VARCHAR(255) NOT NULL DEFAULT '',
+ sessionVariables MEDIUMTEXT,
KEY sessionID (sessionID, packageID)
);
KEY sessionLogID (sessionLogID)
);
-DROP TABLE IF EXISTS wcf1_acp_session_data;
-CREATE TABLE wcf1_acp_session_data (
- sessionID CHAR(40) NOT NULL PRIMARY KEY,
- sessionVariables MEDIUMTEXT
-);
-
DROP TABLE IF EXISTS wcf1_acp_session_log;
CREATE TABLE wcf1_acp_session_log (
sessionLogID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
requestURI VARCHAR(255) NOT NULL DEFAULT '',
requestMethod VARCHAR(4) NOT NULL DEFAULT '',
username VARCHAR(255) NOT NULL DEFAULT '',
+ sessionVariables MEDIUMTEXT,
spiderID INT(10) NOT NULL DEFAULT 0,
KEY packageID (packageID, lastActivityTime, spiderID)
);
-DROP TABLE IF EXISTS wcf1_session_data;
-CREATE TABLE wcf1_session_data (
- sessionID CHAR(40) NOT NULL PRIMARY KEY,
- sessionVariables MEDIUMTEXT
-);
-
DROP TABLE IF EXISTS wcf1_spider;
CREATE TABLE wcf1_spider (
spiderID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
ALTER TABLE wcf1_acp_session_access_log ADD FOREIGN KEY (sessionLogID) REFERENCES wcf1_acp_session_log (sessionLogID) ON DELETE CASCADE;
ALTER TABLE wcf1_acp_session_access_log ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE SET NULL;
-ALTER TABLE wcf1_acp_session_data ADD FOREIGN KEY (sessionID) REFERENCES wcf1_acp_session (sessionID) ON DELETE CASCADE;
-
ALTER TABLE wcf1_acp_session_log ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
ALTER TABLE wcf1_acp_template ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
ALTER TABLE wcf1_session ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
ALTER TABLE wcf1_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
-ALTER TABLE wcf1_session_data ADD FOREIGN KEY (sessionID) REFERENCES wcf1_session (sessionID) ON DELETE CASCADE;
-
ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
ALTER TABLE wcf1_user_storage ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;