__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Database\Structure;
use PhpMyAdmin\Controllers\Database\AbstractController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use function json_encode;
/**
* Handles request for real row count on database level view page.
*/
final class RealRowCountController extends AbstractController
{
/** @var DatabaseInterface */
private $dbi;
public function __construct(ResponseRenderer $response, Template $template, string $db, DatabaseInterface $dbi)
{
parent::__construct($response, $template, $db);
$this->dbi = $dbi;
}
public function __invoke(): void
{
global $cfg, $db, $errorUrl;
$parameters = [
'real_row_count_all' => $_REQUEST['real_row_count_all'] ?? null,
'table' => $_REQUEST['table'] ?? null,
];
Util::checkParameters(['db']);
$errorUrl = Util::getScriptNameForOption($cfg['DefaultTabDatabase'], 'database');
$errorUrl .= Url::getCommon(['db' => $db], '&');
if (! $this->hasDatabase() || ! $this->response->isAjax()) {
return;
}
[$tables] = Util::getDbInfo($this->db, '_structure');
// If there is a request to update all table's row count.
if (! isset($parameters['real_row_count_all'])) {
// Get the real row count for the table.
$realRowCount = (int) $this->dbi
->getTable($this->db, (string) $parameters['table'])
->getRealRowCountTable();
// Format the number.
$realRowCount = Util::formatNumber($realRowCount, 0);
$this->response->addJSON(['real_row_count' => $realRowCount]);
return;
}
// Array to store the results.
$realRowCountAll = [];
// Iterate over each table and fetch real row count.
foreach ($tables as $table) {
$rowCount = $this->dbi
->getTable($this->db, $table['TABLE_NAME'])
->getRealRowCountTable();
$realRowCountAll[] = [
'table' => $table['TABLE_NAME'],
'row_count' => $rowCount,
];
}
$this->response->addJSON(['real_row_count_all' => json_encode($realRowCountAll)]);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| CentralColumns | Folder | 0755 |
|
|
| AddPrefixController.php | File | 802 B | 0644 |
|
| AddPrefixTableController.php | File | 1.64 KB | 0644 |
|
| ChangePrefixFormController.php | File | 1.09 KB | 0644 |
|
| CopyFormController.php | File | 1.11 KB | 0644 |
|
| CopyTableController.php | File | 1.84 KB | 0644 |
|
| CopyTableWithPrefixController.php | File | 1.72 KB | 0644 |
|
| DropFormController.php | File | 2.21 KB | 0644 |
|
| DropTableController.php | File | 3.78 KB | 0644 |
|
| EmptyFormController.php | File | 1.12 KB | 0644 |
|
| EmptyTableController.php | File | 3.07 KB | 0644 |
|
| FavoriteTableController.php | File | 6.1 KB | 0644 |
|
| RealRowCountController.php | File | 2.35 KB | 0644 |
|
| ReplacePrefixController.php | File | 2.06 KB | 0644 |
|
| ShowCreateController.php | File | 1.71 KB | 0644 |
|