Files
OMS/app/base/lib/status/system.php
2025-12-28 23:13:25 +08:00

49 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class base_status_system extends base_status_abstract{
function get_cache_status(){
$ret = array(
'cache.engine'=>CACHE_STORAGE,
);
if(method_exists(CACHE_STORAGE,'status')){
foreach(kernel::single(CACHE_STORAGE) as $k=>$v){
$ret['cache.'.$k] = $v;
}
}
return $ret;
}
function get_kvstore_status(){
$ret = array(
'kvstore.engine'=>KVSTORE_STORAGE,
);
if(method_exists(KVSTORE_STORAGE,'status')){
foreach(kernel::single(KVSTORE_STORAGE) as $k=>$v){
$ret['kvstore.'.$k] = $v;
}
}
return $ret;
}
function get_mysql_status(){
$aResult = array(
'mysql.server_host'=>DB_HOST,
'mysql.server_dbname'=>DB_NAME,
'mysql.server_user'=>DB_USER,
);
foreach(kernel::database()->select("show status") as $row)
{
$aResult['mysql.'.strtolower($row["Variable_name"])] = $row["Value"];
}
return $aResult;
}
}