Beispiel #1
0
     } else {
         $tables = array();
     }
 } elseif ($export_type == 'table' && mb_strlen($db) && mb_strlen($table)) {
     $err_url = 'tbl_export.php' . PMA_URL_getCommon(array('db' => $db, 'table' => $table));
 } else {
     PMA_fatalError(__('Bad parameters!'));
 }
 // Merge SQL Query aliases with Export aliases from
 // export page, Export page aliases are given more
 // preference over SQL Query aliases.
 if (!empty($_REQUEST['aliases'])) {
     $aliases = PMA_mergeAliases(PMA_SQP_getAliasesFromQuery($sql_query, $db), $_REQUEST['aliases']);
     $_SESSION['tmpval']['aliases'] = $_REQUEST['aliases'];
 } else {
     $aliases = PMA_SQP_getAliasesFromQuery($sql_query, $db);
 }
 /**
  * Increase time limit for script execution and initializes some variables
  */
 @set_time_limit($cfg['ExecTimeLimit']);
 if (!empty($cfg['MemoryLimit'])) {
     @ini_set('memory_limit', $cfg['MemoryLimit']);
 }
 register_shutdown_function('PMA_shutdownDuringExport');
 // Start with empty buffer
 $dump_buffer = '';
 $dump_buffer_len = 0;
 // We send fake headers to avoid browser timeout when buffering
 $time_start = time();
 // Defines the default <CR><LF> format.
 /**
  * Testing of PMA_SQP_getAliasesFromQuery.
  *
  * @param string $select_query The Select SQL Query
  * @param string $db           Current DB
  * @param array  $expected     Expected parse result
  *
  * @return void
  *
  * @dataProvider aliasDataProvider
  * @group medium
  */
 public function testPmaSqpGetAliasesFromQuery($select_query, $db, $expected)
 {
     $this->assertEquals($expected, PMA_SQP_getAliasesFromQuery($select_query, $db));
 }