Move sql entry points to libraries/entry_points

- sql.php -> libraries/entry_points/sql.php
- server_sql.php -> libraries/entry_points/server/sql.php
- db_sql.php -> libraries/entry_points/database/sql.php
- tbl_sql.php -> libraries/entry_points/table/sql.php

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2019-08-05 15:34:50 -03:00
parent 9846c5c782
commit 71a5c660df
11 changed files with 15 additions and 15 deletions

View File

@ -33,7 +33,7 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
require_once ROOT_PATH . 'libraries/entry_points/database/search.php';
});
$routes->addRoute(['GET', 'POST'], '/sql', function () {
require_once ROOT_PATH . 'db_sql.php';
require_once ROOT_PATH . 'libraries/entry_points/database/sql.php';
});
$routes->addRoute(['GET', 'POST'], '/structure', function () {
require_once ROOT_PATH . 'libraries/entry_points/database/structure.php';
@ -59,7 +59,7 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
require_once ROOT_PATH . 'libraries/entry_points/server/privileges.php';
});
$routes->addRoute(['GET', 'POST'], '/sql', function () {
require_once ROOT_PATH . 'server_sql.php';
require_once ROOT_PATH . 'libraries/entry_points/server/sql.php';
});
$routes->addGroup('/status', function (RouteCollector $routes) {
$routes->addRoute('GET', '', function () {
@ -74,7 +74,7 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
});
});
$routes->addRoute(['GET', 'POST'], '/sql', function () {
require_once ROOT_PATH . 'sql.php';
require_once ROOT_PATH . 'libraries/entry_points/sql.php';
});
$routes->addGroup('/table', function (RouteCollector $routes) {
$routes->addRoute(['GET', 'POST'], '/change', function () {
@ -84,7 +84,7 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
require_once ROOT_PATH . 'libraries/entry_points/table/select.php';
});
$routes->addRoute(['GET', 'POST'], '/sql', function () {
require_once ROOT_PATH . 'tbl_sql.php';
require_once ROOT_PATH . 'libraries/entry_points/table/sql.php';
});
$routes->addRoute(['GET', 'POST'], '/structure', function () {
require_once ROOT_PATH . 'libraries/entry_points/table/structure.php';

View File

@ -330,7 +330,7 @@ class StructureController extends AbstractController
$sql_query = $GLOBALS['sql_query'];
$cfg = $GLOBALS['cfg'];
$pmaThemeImage = $GLOBALS['pmaThemeImage'];
include ROOT_PATH . 'sql.php';
include ROOT_PATH . 'libraries/entry_points/sql.php';
$GLOBALS['reload'] = true;
}

View File

@ -2258,15 +2258,15 @@ class InsertEdit
} else {
$goto_include = $GLOBALS['goto'];
}
if ($GLOBALS['goto'] == 'db_sql.php' && strlen($GLOBALS['table']) > 0) {
if ($GLOBALS['goto'] == 'libraries/entry_points/database/sql.php' && strlen($GLOBALS['table']) > 0) {
$GLOBALS['table'] = '';
}
}
if (! $goto_include) {
if (strlen($GLOBALS['table']) === 0) {
$goto_include = 'db_sql.php';
$goto_include = 'libraries/entry_points/database/sql.php';
} else {
$goto_include = 'tbl_sql.php';
$goto_include = 'libraries/entry_points/table/sql.php';
}
}
return $goto_include;

View File

@ -102,7 +102,7 @@ if (empty($is_table)
}
if (! $is_table) {
include ROOT_PATH . 'db_sql.php';
include ROOT_PATH . 'libraries/entry_points/database/sql.php';
exit;
}
}

View File

@ -134,7 +134,7 @@ if (isset($_POST['submit_move']) || isset($_POST['submit_copy'])) {
* If the table has to be maintained
*/
if (isset($_POST['table_maintenance'])) {
include_once ROOT_PATH . 'sql.php';
include_once ROOT_PATH . 'libraries/entry_points/sql.php';
unset($result);
}
/**

View File

@ -21,4 +21,4 @@ RecentFavoriteTable::getInstance('recent')
RecentFavoriteTable::getInstance('favorite')
->removeIfInvalid($_REQUEST['db'], $_REQUEST['table']);
require ROOT_PATH . 'sql.php';
require ROOT_PATH . 'libraries/entry_points/sql.php';

View File

@ -2593,20 +2593,20 @@ class InsertEditTest extends TestCase
$GLOBALS['table'] = '';
$this->assertEquals(
'db_sql.php',
'libraries/entry_points/database/sql.php',
$this->insertEdit->getGotoInclude('index')
);
$GLOBALS['table'] = 'tbl';
$this->assertEquals(
'tbl_sql.php',
'libraries/entry_points/table/sql.php',
$this->insertEdit->getGotoInclude('index')
);
$GLOBALS['goto'] = 'db_sql.php';
$GLOBALS['goto'] = 'libraries/entry_points/database/sql.php';
$this->assertEquals(
'db_sql.php',
'libraries/entry_points/database/sql.php',
$this->insertEdit->getGotoInclude('index')
);