Translated using Weblate (French)
[phpmyadmin.git] / server_replication.php
blobe9572c2aca89e87ff72007c186cd9785c59f4cfe
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Server replications
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Controllers\Server\ReplicationController;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\ReplicationGui;
13 use PhpMyAdmin\Response;
15 if (! defined('ROOT_PATH')) {
16 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
19 require_once ROOT_PATH . 'libraries/common.inc.php';
20 require_once ROOT_PATH . 'libraries/server_common.inc.php';
21 require_once ROOT_PATH . 'libraries/replication.inc.php';
23 /** @var Response $response */
24 $response = $containerBuilder->get(Response::class);
26 /** @var DatabaseInterface $dbi */
27 $dbi = $containerBuilder->get(DatabaseInterface::class);
29 /** @var ReplicationController $controller */
30 $controller = $containerBuilder->get(ReplicationController::class);
32 /** @var ReplicationGui $replicationGui */
33 $replicationGui = $containerBuilder->get('replication_gui');
35 $header = $response->getHeader();
36 $scripts = $header->getScripts();
37 $scripts->addFile('server/privileges.js');
38 $scripts->addFile('replication.js');
39 $scripts->addFile('vendor/zxcvbn.js');
41 if (isset($_POST['url_params']) && is_array($_POST['url_params'])) {
42 $GLOBALS['url_params'] = $_POST['url_params'];
45 if ($dbi->isSuperuser()) {
46 $replicationGui->handleControlRequest();
49 $response->addHTML(
50 $controller->index(
52 'mr_configure' => $_POST['mr_configure'] ?? null,
53 'sl_configure' => $_POST['sl_configure'] ?? null,
54 'repl_clear_scr' => $_POST['repl_clear_scr'] ?? null,
56 $replicationGui