tbl_gis_visualization.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * handles creation of the GIS visualizations.
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Controllers\Table\TableGisVisualizationController;
  9. use PhpMyAdmin\Di\Container;
  10. use PhpMyAdmin\Response;
  11. use PhpMyAdmin\Util;
  12. use PhpMyAdmin\Core;
  13. require_once 'libraries/common.inc.php';
  14. $container = Container::getDefaultContainer();
  15. $container->factory(
  16. 'PhpMyAdmin\Controllers\Table\TableGisVisualizationController'
  17. );
  18. $container->alias(
  19. 'TableGisVisualizationController',
  20. 'PhpMyAdmin\Controllers\Table\TableGisVisualizationController'
  21. );
  22. $container->set('PhpMyAdmin\Response', Response::getInstance());
  23. $container->alias('response', 'PhpMyAdmin\Response');
  24. $sqlQuery = null;
  25. if (isset($_GET['sql_query']) && isset($_GET['sql_signature'])) {
  26. if (Core::checkSqlQuerySignature($_GET['sql_query'], $_GET['sql_signature'])) {
  27. $sqlQuery = $_GET['sql_query'];
  28. }
  29. } elseif (isset($_POST['sql_query'])) {
  30. $sqlQuery = &$GLOBALS['sql_query'];
  31. }
  32. /* Define dependencies for the concerned controller */
  33. $dependency_definitions = array(
  34. "sql_query" => $sqlQuery,
  35. "url_params" => &$GLOBALS['url_params'],
  36. "goto" => Util::getScriptNameForOption(
  37. $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
  38. ),
  39. "back" => 'sql.php',
  40. "visualizationSettings" => array()
  41. );
  42. /** @var TableGisVisualizationController $controller */
  43. $controller = $container->get(
  44. 'TableGisVisualizationController', $dependency_definitions
  45. );
  46. $controller->indexAction();