mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@907 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7b70b78379
commit
76cea54d92
2 changed files with 0 additions and 66 deletions
|
|
@ -1,56 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @class SessionHandler
|
|
||||||
* @author zero (zero@nzeo.com)
|
|
||||||
* @brief 세션 핸들링 클래스
|
|
||||||
**/
|
|
||||||
|
|
||||||
class SessionHandler extends Handler {
|
|
||||||
|
|
||||||
var $lifetime = 3600;
|
|
||||||
var $ipaddress = '';
|
|
||||||
var $session_path = './files/session/';
|
|
||||||
|
|
||||||
function open($path, $session_name) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSessionFile($session_key) {
|
|
||||||
$session_file = sprintf('%szbxe_session_%s.php', $this->session_path, $session_key);
|
|
||||||
return $session_file;
|
|
||||||
}
|
|
||||||
|
|
||||||
function read($session_key) {
|
|
||||||
$filename = $this->getSessionFile($session_key);
|
|
||||||
if(!file_exists($filename)) return '';
|
|
||||||
$buff = FileHandler::readFile($filename);
|
|
||||||
return substr($buff, strlen('<?php if(!__ZBXE__) exit(); ?>'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function write($session_key, $val) {
|
|
||||||
if(!$val) return true;
|
|
||||||
|
|
||||||
$filename = $this->getSessionFile($session_key);
|
|
||||||
|
|
||||||
$buff = '<?php if(!__ZBXE__) exit(); ?>'.$val;
|
|
||||||
return FileHandler::writeFile($filename, $buff);
|
|
||||||
}
|
|
||||||
|
|
||||||
function destroy($session_key) {
|
|
||||||
$filename = $this->getSessionFile($session_key);
|
|
||||||
@unlink( $filename);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function gc($maxlifetime) {
|
|
||||||
foreach (glob($this->session_path.'zbxe_session_*.php') as $filename) {
|
|
||||||
if (filemtime($filename) + $this->lifetime < time()) @unlink($filename);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
@ -53,16 +53,6 @@
|
||||||
/**
|
/**
|
||||||
* @brief 세션 설정
|
* @brief 세션 설정
|
||||||
**/
|
**/
|
||||||
/*
|
|
||||||
$oSessionHandler = new SessionHandler();
|
|
||||||
$aa = session_set_save_handler(
|
|
||||||
array(&$oSessionHandler,"open"),
|
|
||||||
array(&$oSessionHandler,"close"),
|
|
||||||
array(&$oSessionHandler,"read"),
|
|
||||||
array(&$oSessionHandler,"write"),
|
|
||||||
array(&$oSessionHandler,"destroy"),
|
|
||||||
array(&$oSessionHandler,"gc"));
|
|
||||||
*/
|
|
||||||
session_cache_limiter('no-cache, must-revalidate');
|
session_cache_limiter('no-cache, must-revalidate');
|
||||||
session_start();
|
session_start();
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue