wcf1_acp_session_data and wcf1_session_data removed; sessionVariables is now a column...
authorMarcel Werk <burntime@woltlab.com>
Mon, 26 Sep 2011 17:32:36 +0000 (19:32 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 26 Sep 2011 17:32:36 +0000 (19:32 +0200)
15 files changed:
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/data/acp/session/data/ACPSessionData.class.php [deleted file]
wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataAction.class.php [deleted file]
wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataEditor.class.php [deleted file]
wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataList.class.php [deleted file]
wcfsetup/install/files/lib/data/session/data/SessionData.class.php [deleted file]
wcfsetup/install/files/lib/data/session/data/SessionDataAction.class.php [deleted file]
wcfsetup/install/files/lib/data/session/data/SessionDataEditor.class.php [deleted file]
wcfsetup/install/files/lib/data/session/data/SessionDataList.class.php [deleted file]
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/session/ACPSessionFactory.class.php
wcfsetup/install/files/lib/system/session/SessionFactory.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/options.inc.php
wcfsetup/setup/db/install.sql

index d68febfd1db52720f7f3e71660912f67c24fa51e..a2b7589ccfe71cd618bbc3a242ea2e857a1a1b9d 100644 (file)
@@ -314,15 +314,10 @@ debug:mail_debug_logfile_path,!mail_use_f_param,!mail_smtp_host,!mail_smtp_port,
 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">
diff --git a/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionData.class.php b/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionData.class.php
deleted file mode 100644 (file)
index 7c4e4d0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataAction.class.php b/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataAction.class.php
deleted file mode 100644 (file)
index 06cc7e6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataEditor.class.php b/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataEditor.class.php
deleted file mode 100644 (file)
index c983148..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataList.class.php b/wcfsetup/install/files/lib/data/acp/session/data/ACPSessionDataList.class.php
deleted file mode 100644 (file)
index 147970b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/session/data/SessionData.class.php b/wcfsetup/install/files/lib/data/session/data/SessionData.class.php
deleted file mode 100644 (file)
index bee3947..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/session/data/SessionDataAction.class.php b/wcfsetup/install/files/lib/data/session/data/SessionDataAction.class.php
deleted file mode 100644 (file)
index 008ca67..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/session/data/SessionDataEditor.class.php b/wcfsetup/install/files/lib/data/session/data/SessionDataEditor.class.php
deleted file mode 100644 (file)
index b138de6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
diff --git a/wcfsetup/install/files/lib/data/session/data/SessionDataList.class.php b/wcfsetup/install/files/lib/data/session/data/SessionDataList.class.php
deleted file mode 100644 (file)
index 8ec8ab6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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';
-}
index 91ef937ea4d9e6892d5e762d5dfb26f851790d80..9dd0722a946fec8f0e72098f1b3e9deb40f0cbc6 100644 (file)
@@ -29,7 +29,6 @@ define('HTTP_ENABLE_NO_CACHE_HEADERS', 0);
 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);
 
 /**
index a79af9ea11473c1d65c63a39c6cb40172a810dc5..7a368ee0428e4f604e619f88cd9a62708b3cb889 100644 (file)
@@ -19,19 +19,13 @@ class ACPSessionFactory {
         */     
        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')) {
index d1ed5c27fac181d8a3a136621dc7bebca26ae20c..7936c2234f4cd66b53727b9c720749a86cb45153 100644 (file)
@@ -18,11 +18,6 @@ class SessionFactory extends ACPSessionFactory {
         */     
        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()
         */     
index 7df2f252e2c01172ab83171ed81cf907b404ae17..fa5fee9ed3ab0a055bbbbef7f64d62dc3603af31 100644 (file)
@@ -58,24 +58,6 @@ class SessionHandler extends SingletonFactory {
         */     
        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
@@ -130,14 +112,11 @@ class SessionHandler extends SingletonFactory {
         * 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)) {
@@ -285,7 +264,7 @@ class SessionHandler extends SingletonFactory {
         * 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();
                }
@@ -309,13 +288,10 @@ class SessionHandler extends SingletonFactory {
        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);
        }
@@ -371,11 +347,6 @@ class SessionHandler extends SingletonFactory {
                        'requestURI' => UserUtil::getRequestURI(),
                        'requestMethod' => $requestMethod
                ));
-               
-               // creaty entry in session data
-               $this->sessionData = call_user_func(array($this->sessionDataEditorClassName, 'create'), array(
-                       'sessionID' => $this->session->sessionID
-               ));
        }
        
        /**
@@ -490,7 +461,6 @@ class SessionHandler extends SingletonFactory {
         */     
        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
@@ -509,14 +479,6 @@ class SessionHandler extends SingletonFactory {
                                $statement->execute(array(
                                        $row['sessionID']
                                ));
-                               
-                               // delete session data
-                               $sql = "DELETE FROM     ".$sessionDataTable."
-                                       WHERE           sessionID = ?";
-                               $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
-                                       $row['sessionID']
-                               ));
                        }
                }
                
@@ -539,34 +501,28 @@ class SessionHandler extends SingletonFactory {
        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();
index c1aecf729781a5afa2c873a39a9fcbfde0fe3686..ddbe25a06a4f886aba6bd6ab9675d69eada98996 100644 (file)
@@ -23,6 +23,5 @@ define('SESSION_VALIDATE_IP_ADDRESS', 0);
 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');
index 374374f68b376bec9fc0733f1ea6b1eb8b28dc09..f571904e802ed4f94e0ee80d4a6b1adffacdfb5b 100644 (file)
@@ -23,6 +23,7 @@ CREATE TABLE wcf1_acp_session (
        requestURI VARCHAR(255) NOT NULL DEFAULT '',
        requestMethod VARCHAR(4) NOT NULL DEFAULT '',
        username VARCHAR(255) NOT NULL DEFAULT '',
+       sessionVariables MEDIUMTEXT,
        KEY sessionID (sessionID, packageID)
 );
 
@@ -39,12 +40,6 @@ CREATE TABLE wcf1_acp_session_access_log (
        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,
@@ -487,16 +482,11 @@ CREATE TABLE wcf1_session (
        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,
@@ -719,8 +709,6 @@ ALTER TABLE wcf1_acp_session ADD FOREIGN KEY (packageID) REFERENCES wcf1_package
 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;
@@ -803,8 +791,6 @@ ALTER TABLE wcf1_search ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) O
 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;