mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-16 01:39:58 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,81 +1,88 @@
|
|||
<?php
|
||||
/**
|
||||
* @class session
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session module's high class
|
||||
* @version 0.1
|
||||
*
|
||||
* The session management class
|
||||
**/
|
||||
/**
|
||||
* @class session
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief session module's high class
|
||||
* @version 0.1
|
||||
*
|
||||
* The session management class
|
||||
*/
|
||||
class session extends ModuleObject
|
||||
{
|
||||
var $lifetime = 18000;
|
||||
var $session_started = false;
|
||||
|
||||
class session extends ModuleObject {
|
||||
function session()
|
||||
{
|
||||
if(Context::isInstalled()) $this->session_started= true;
|
||||
}
|
||||
|
||||
var $lifetime = 18000;
|
||||
var $session_started = false;
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
|
||||
function session() {
|
||||
if(Context::isInstalled()) $this->session_started= true;
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
**/
|
||||
function moduleInstall() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
/**
|
||||
* @brief A method to check if the installation has been successful
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) return true;
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) return true;
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
/**
|
||||
* @brief Execute update
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
/**
|
||||
* @brief A method to check if the installation has been successful
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('session')) return true;
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) return true;
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true;
|
||||
return false;
|
||||
}
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml');
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
|
||||
if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128);
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
}
|
||||
|
||||
if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid"));
|
||||
}
|
||||
/**
|
||||
* @brief session string decode
|
||||
*/
|
||||
function unSerializeSession($val)
|
||||
{
|
||||
$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief session string decode
|
||||
**/
|
||||
function unSerializeSession($val) {
|
||||
$vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]);
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* @brief session string encode
|
||||
*/
|
||||
function serializeSession($data)
|
||||
{
|
||||
if(!count($data)) return;
|
||||
|
||||
/**
|
||||
* @brief session string encode
|
||||
**/
|
||||
function serializeSession($data) {
|
||||
if(!count($data)) return;
|
||||
$str = '';
|
||||
foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
|
||||
return substr($str, 0, strlen($str)-1).'}';
|
||||
}
|
||||
|
||||
$str = '';
|
||||
foreach($data as $key => $val) $str .= $key.'|'.serialize($val);
|
||||
return substr($str, 0, strlen($str)-1).'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
/* End of file session.class.php */
|
||||
/* Location: ./modules/session/session.class.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue