짧은 주소 url 수정

This commit is contained in:
thisgun committed 2018-09-20 09:29:08 +09:00
1 parent 7547b6e0ab
commit cbeef0e453
22 files changed
+542 -144

No files matched your search

+30 -13
View File
@@ -3,21 +3,27 @@ if (!defined('_GNUBOARD_')) exit;
Class G5_object_store {
public $writes = array();
public $contents = array();
function get($type, $key, $group ='default') {
switch ($type) {
case 'bbs':
if( $this->exists('bbs', $key, $group) ){
if ( is_object($this->writes[$group][$key]) )
return clone $this->writes[$group][$key];
else
return $this->writes[$group][$key];
}
return false;
$datas = $this->writes;
break;
case 'content' :
$datas = $this->contents;
break;
}
if( $this->exists($type, $key, $group) ){
if ( is_object($datas[$group][$key]) )
return clone $datas[$group][$key];
else
return $datas[$group][$key];
}
return false;
}
function exists($type, $key, $group = 'default' ) {
@@ -28,6 +34,9 @@ Class G5_object_store {
case 'bbs':
$datas = $this->writes;
break;
case 'content':
$datas = $this->contents;
break;
}
return isset($datas[$group]) && ( isset($datas[$group][$key]) || array_key_exists($key, $datas[$group]) );
@@ -41,6 +50,9 @@ Class G5_object_store {
case 'bbs':
$this->writes[$group][$key] = $data;
break;
case 'content':
$this->contents[$group][$key] = $data;
break;
}
}
@@ -48,13 +60,18 @@ Class G5_object_store {
function delete($key, $group='default') {
switch ($type) {
case 'bbs':
if ( ! $this->exists('bbs', $key, $group) )
return false;
unset( $this->writes[$group][$key] );
return true;
$datas = $this->writes;
break;
case 'content':
$datas = $this->contents;
break;
}
if ( ! $this->exists('bbs', $key, $group) )
return false;
unset( $datas[$group][$key] );
return true;
}
} //end Class