/** * @using runkit pecl extension * if not define PMA_USR_OS, then define it as Win * if installed runkit, then constant will not change */ public function testWhichCrlf() { $runkit = function_exists('runkit_constant_redefine'); if ($runkit && defined('PMA_USR_OS')) { $pma_usr_os = PMA_USR_OS; } if (defined('PMA_USR_OS') && !$runkit) { if (PMA_USR_OS == 'Win') { $this->assertEquals("\r\n", PMA_whichCrlf()); } else { $this->assertEquals("\n", PMA_whichCrlf()); } $this->markTestIncomplete('Cannot redefine constant'); } else { if ($runkit) { define('PMA_USR_OS', 'Linux'); $this->assertEquals("\n", PMA_whichCrlf()); } if ($runkit) { runkit_constant_redefine('PMA_USR_OS', 'Win'); } else { define('PMA_USR_OS', 'Win'); } $this->assertEquals("\r\n", PMA_whichCrlf()); } if ($runkit) { if (isset($pma_usr_os)) { runkit_constant_redefine('PMA_USR_OS', 'Win'); } else { runkit_constant_remove('PMA_USR_OS'); } } }
} elseif (isset($ldi_ignore)) { $sql .= ' IGNORE'; } $sql .= ' INTO TABLE ' . PMA_backquote($table); if (strlen($ldi_terminated) > 0) { $sql .= ' FIELDS TERMINATED BY \'' . $ldi_terminated . '\''; } if (strlen($ldi_enclosed) > 0) { $sql .= ' ENCLOSED BY \'' . PMA_sqlAddslashes($ldi_enclosed) . '\''; } if (strlen($ldi_escaped) > 0) { $sql .= ' ESCAPED BY \'' . PMA_sqlAddslashes($ldi_escaped) . '\''; } if (strlen($ldi_new_line) > 0) { if ($ldi_new_line == 'auto') { $ldi_new_line = PMA_whichCrlf() == "\n" ? '\\n' : '\\r\\n'; } $sql .= ' LINES TERMINATED BY \'' . $ldi_new_line . '\''; } if ($skip_queries > 0) { $sql .= ' IGNORE ' . $skip_queries . ' LINES'; $skip_queries = 0; } if (strlen($ldi_columns) > 0) { $sql .= ' ('; $tmp = preg_split('/,( ?)/', $ldi_columns); $cnt_tmp = count($tmp); for ($i = 0; $i < $cnt_tmp; $i++) { if ($i > 0) { $sql .= ', '; }
// We export as file - output normally echo $line; } } else { // We export as html - replace special chars echo htmlspecialchars($line); } } return true; } // end of the 'PMA_exportOutputHandler()' function // Defines the default <CR><LF> format. For SQL always use \n as MySQL wants this on all platforms. if ($what == 'sql') { $crlf = "\n"; } else { $crlf = PMA_whichCrlf(); } $output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls'; // Do we need to convert charset? $output_charset_conversion = $asfile && $cfg['AllowAnywhereRecoding'] && isset($charset_of_file) && $charset_of_file != $charset && $type != 'xls'; // Use on the fly compression? $onfly_compression = $GLOBALS['cfg']['CompressOnFly'] && ($compression == 'gzip' || $compression == 'bzip'); if ($onfly_compression) { $memory_limit = trim(@ini_get('memory_limit')); // 2 MB as default if (empty($memory_limit)) { $memory_limit = 2 * 1024 * 1024; } if (strtolower(substr($memory_limit, -1)) == 'm') { $memory_limit = (int) substr($memory_limit, 0, -1) * 1024 * 1024; } elseif (strtolower(substr($memory_limit, -1)) == 'k') {
echo $cfg['Export']['csv_escaped']; ?> " class="textfield" style="vertical-align: middle" /> </td> </tr> <tr> <td> <?php echo $strLinesTerminatedBy; ?> </td> <td> <input type="text" name="add_character" size="2" value="<?php if ($cfg['Export']['csv_terminated'] == 'AUTO') { echo PMA_whichCrlf() == "\n" ? '\\n' : '\\r\\n'; } else { echo $cfg['Export']['csv_terminated']; } ?> " class="textfield" style="vertical-align: middle" /> </td> </tr> <tr> <td> <?php echo $strReplaceNULLBy; ?> </td> <td>