nation_env 수정, $connect 일부 제거

This commit is contained in:
2020-05-06 01:53:00 +09:00
parent 562c69307e
commit e0c908d88f
26 changed files with 416 additions and 811 deletions
+13 -2
View File
@@ -11,7 +11,7 @@ class KVStorage{
static private $storageList = [];
static public function getStorage(\MeekroDB $db, string $storNamespace, string $tableName='storage'):self{
static public function getStorage(\MeekroDB $db, $storNamespace, string $tableName='storage'):self{
$obj_id = spl_object_hash($db);
$fullKey = $obj_id.','.$storNamespace.','.$tableName;
if(key_exists($fullKey, static::$storageList)){
@@ -22,12 +22,23 @@ class KVStorage{
return $obj;
}
public function __construct(\MeekroDB $db, string $storNamespace, string $tableName='storage'){
public function __construct(\MeekroDB $db, $storNamespace, string $tableName='storage'){
$this->db = $db;
$this->storNamespace = $storNamespace;
$this->tableName = $tableName;
}
public static function getValuesFromInterNamespace(\MeekroDB $db, string $tableName, $key):array{
$result = [];
foreach($db->queryAllLists(
'SELECT `namespace`, `value` FROM %b WHERE `key`=%s', $tableName, $key
) as [$namespaceName, $value])
{
$result[$namespaceName] = Json::decode($value);
}
return $result;
}
public function __get($key) {
return $this->getValue($key);
}