phpmyadmin/libraries/entry_points/database/events.php
Maurício Meneghini Fauth 1a14b3e4d3 Remove vim modelines
These settings are no longer required as they are guaranteed through
other coding standard tools.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-09-02 09:43:21 -03:00

81 lines
2.0 KiB
PHP

<?php
/**
* Events management.
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Controllers\Database\EventsController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Response;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
if (! defined('PHPMYADMIN')) {
exit;
}
global $_PMA_RTE, $containerBuilder, $table, $db, $tables, $num_tables, $total_num_tables, $sub_part;
global $is_show_stats, $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos, $url_query;
/** @var Response $response */
$response = $containerBuilder->get(Response::class);
/** @var DatabaseInterface $dbi */
$dbi = $containerBuilder->get(DatabaseInterface::class);
$_PMA_RTE = 'EVN';
/** @var EventsController $controller */
$controller = $containerBuilder->get(EventsController::class);
/** @var string $db */
$db = $containerBuilder->getParameter('db');
/** @var string $table */
$table = $containerBuilder->getParameter('table');
if (! $response->isAjax()) {
/**
* Displays the header and tabs
*/
if (! empty($table) && in_array($table, $dbi->getTables($db))) {
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
} else {
$table = '';
include_once ROOT_PATH . 'libraries/db_common.inc.php';
list(
$tables,
$num_tables,
$total_num_tables,
$sub_part,
$is_show_stats,
$db_is_system_schema,
$tooltip_truename,
$tooltip_aliasname,
$pos
) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : '');
}
} else {
/**
* Since we did not include some libraries, we need
* to manually select the required database and
* create the missing $url_query variable
*/
if (strlen($db) > 0) {
$dbi->selectDb($db);
if (! isset($url_query)) {
$url_query = Url::getCommon(
[
'db' => $db,
'table' => $table,
]
);
}
}
}
$controller->index();