/** * Test PMA_GIS_modifyQuery method * * @param string $sql_query query to modify * @param array $settings visualization settings * @param string $modified_query modified query * * @dataProvider provider * @return nothing */ public function testModifyQuery($sql_query, $settings, $modified_query) { $this->assertEquals( PMA_GIS_modifyQuery($sql_query, $settings), $modified_query ); }
// If spatial column is not set, use first geometric column as spatial column if (!isset($visualizationSettings['spatialColumn'])) { $visualizationSettings['spatialColumn'] = $spatialCandidates[0]; } // Convert geometric columns from bytes to text. $pos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : $_SESSION['tmpval']['pos']; if (isset($_REQUEST['session_max_rows'])) { $rows = $_REQUEST['session_max_rows']; } else { if ($_SESSION['tmpval']['max_rows'] != 'all') { $rows = $_SESSION['tmpval']['max_rows']; } else { $rows = $GLOBALS['cfg']['MaxRows']; } } $modified_query = PMA_GIS_modifyQuery($sql_query, $visualizationSettings, $rows, $pos); $modified_result = $GLOBALS['dbi']->tryQuery($modified_query); $data = array(); while ($row = $GLOBALS['dbi']->fetchAssoc($modified_result)) { $data[] = $row; } if (isset($_REQUEST['saveToFile'])) { $response->disable(); $file_name = $visualizationSettings['spatialColumn']; $save_format = $_REQUEST['fileFormat']; PMA_GIS_saveToFile($data, $visualizationSettings, $save_format, $file_name); exit; } $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('openlayers/OpenLayers.js');