Server IP : 85.214.239.14 / Your IP : 3.145.107.223 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/wordpress/phpMyAdmin/libraries/classes/Controllers/Server/Status/ |
Upload File : |
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Holds the PhpMyAdmin\Controllers\Server\Status\MonitorController * * @package PhpMyAdmin\Controllers */ declare(strict_types=1); namespace PhpMyAdmin\Controllers\Server\Status; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Response; use PhpMyAdmin\Server\Status\Data; use PhpMyAdmin\Server\Status\Monitor; use PhpMyAdmin\SysInfo; use PhpMyAdmin\Template; /** * Class MonitorController * @package PhpMyAdmin\Controllers\Server\Status */ class MonitorController extends AbstractController { /** * @var Monitor */ private $monitor; /** * MonitorController constructor. * * @param Response $response Response object * @param DatabaseInterface $dbi DatabaseInterface object * @param Template $template Template object * @param Data $data Data object * @param Monitor $monitor Monitor object */ public function __construct($response, $dbi, Template $template, $data, $monitor) { parent::__construct($response, $dbi, $template, $data); $this->monitor = $monitor; } /** * @return string HTML */ public function index(): string { $form = [ 'server_time' => microtime(true) * 1000, 'server_os' => SysInfo::getOs(), 'is_superuser' => $this->dbi->isSuperuser(), 'server_db_isLocal' => $this->data->db_isLocal, ]; $javascriptVariableNames = []; foreach ($this->data->status as $name => $value) { if (is_numeric($value)) { $javascriptVariableNames[] = $name; } } return $this->template->render('server/status/monitor/index', [ 'image_path' => $GLOBALS['pmaThemeImage'], 'javascript_variable_names' => $javascriptVariableNames, 'form' => $form, ]); } /** * @param array $params Request parameters * @return array JSON */ public function chartingData(array $params): array { $json = []; $json['message'] = $this->monitor->getJsonForChartingData( $params['requiredData'] ?? '' ); return $json; } /** * @param array $params Request parameters * @return array JSON */ public function logDataTypeSlow(array $params): array { $json = []; $json['message'] = $this->monitor->getJsonForLogDataTypeSlow( (int) $params['time_start'], (int) $params['time_end'] ); return $json; } /** * @param array $params Request parameters * @return array JSON */ public function logDataTypeGeneral(array $params): array { $json = []; $json['message'] = $this->monitor->getJsonForLogDataTypeGeneral( (int) $params['time_start'], (int) $params['time_end'], (bool) $params['limitTypes'], (bool) $params['removeVariables'] ); return $json; } /** * @param array $params Request parameters * @return array JSON */ public function loggingVars(array $params): array { $json = []; $json['message'] = $this->monitor->getJsonForLoggingVars( $params['varName'], $params['varValue'] ); return $json; } /** * @param array $params Request parameters * @return array JSON */ public function queryAnalyzer(array $params): array { $json = []; $json['message'] = $this->monitor->getJsonForQueryAnalyzer( $params['database'] ?? '', $params['query'] ?? '' ); return $json; } }