Update functions.php

pull/13/head
qkqpttgf 2020-01-03 18:23:34 +08:00 committed by GitHub
parent dafd3624c1
commit b8590b2cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 2 deletions

View File

@ -451,8 +451,37 @@ function getConfig($str)
$s = file_get_contents('config.json'); $s = file_get_contents('config.json');
if ($s!='') { if ($s!='') {
$envs = json_decode($s, true); $envs = json_decode($s, true);
return $envs[$str]; if (isset($envs[$str])) return $envs[$str];
} else return ''; }
return '';
/*
if (!class_exists('mydbreader')) {
class mydbreader extends SQLite3
{
function __construct()
{
$this->open( __DIR__ .'/.ht.db');
}
}
}
$db = new mydbreader();
if(!$db){
echo $db->lastErrorMsg();
} else {
//echo "Opened database successfully<br>\n";
$id=rand(1,309);
$sql="select * from config where id=".$str.";";
$ret = $db->query($sql);
if(!$ret){
echo $db->lastErrorMsg();
} else {
$row = $ret->fetchArray(SQLITE3_ASSOC);
$value1 = $row['value'];
}
$db->close();
}
return $value1;
*/
} }
function array_value_isnot_null($arr) function array_value_isnot_null($arr)