Update functions.php
parent
30c9e23e38
commit
d4324ffc2d
|
@ -248,7 +248,6 @@ function get_refresh_token()
|
||||||
$tmp['client_id'] = $_POST['client_id'];
|
$tmp['client_id'] = $_POST['client_id'];
|
||||||
$tmp['client_secret'] = $_POST['client_secret'];
|
$tmp['client_secret'] = $_POST['client_secret'];
|
||||||
}
|
}
|
||||||
//echo '<pre>'. json_encode($tmp, JSON_PRETTY_PRINT).'</pre>';
|
|
||||||
$response = setConfig($tmp);
|
$response = setConfig($tmp);
|
||||||
$title = $constStr['MayinEnv'][$constStr['language']];
|
$title = $constStr['MayinEnv'][$constStr['language']];
|
||||||
$html = $constStr['Wait'][$constStr['language']] . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '?install2">';
|
$html = $constStr['Wait'][$constStr['language']] . ' 3s<meta http-equiv="refresh" content="3;URL=' . $url . '?install2">';
|
||||||
|
@ -434,17 +433,12 @@ function array_value_isnot_null($arr)
|
||||||
|
|
||||||
function setConfig($arr)
|
function setConfig($arr)
|
||||||
{
|
{
|
||||||
//echo '<pre>'. json_encode($arr, JSON_PRETTY_PRINT).'</pre>';
|
|
||||||
$envs = json_decode(file_get_contents('config.json'));
|
$envs = json_decode(file_get_contents('config.json'));
|
||||||
if ($envs=='') $envs = [];
|
|
||||||
foreach ($arr as $k1 => $v1) {
|
foreach ($arr as $k1 => $v1) {
|
||||||
echo $k1 . '=' . $v1 .'<br>';
|
|
||||||
$envs[$k1] = $v1;
|
$envs[$k1] = $v1;
|
||||||
}
|
}
|
||||||
//echo '<pre>'. json_encode($envs, JSON_PRETTY_PRINT).'</pre>';
|
|
||||||
$envs = array_filter($envs, 'array_value_isnot_null');
|
$envs = array_filter($envs, 'array_value_isnot_null');
|
||||||
ksort($envs);
|
ksort($envs);
|
||||||
echo '<pre>'. json_encode($envs, JSON_PRETTY_PRINT).'</pre>';
|
|
||||||
return file_put_contents('config.json', json_encode($envs, JSON_PRETTY_PRINT));
|
return file_put_contents('config.json', json_encode($envs, JSON_PRETTY_PRINT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue