コード例 #1
0
 /**
  * Test for whichCrlf
  *
  * @return void
  *
  * @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()
 {
     if (PMA_HAS_RUNKIT && defined('PMA_USR_OS')) {
         $pma_usr_os = PMA_USR_OS;
     }
     if (defined('PMA_USR_OS') && !PMA_HAS_RUNKIT) {
         if (PMA_USR_OS == 'Win') {
             $this->assertEquals("\r\n", PMA\libraries\Util::whichCrlf());
         } else {
             $this->assertEquals("\n", PMA\libraries\Util::whichCrlf());
         }
         $this->markTestIncomplete('Cannot redefine constant');
     } else {
         if (PMA_HAS_RUNKIT) {
             if (!defined('PMA_USR_OS')) {
                 define('PMA_USR_OS', 'Linux');
             } else {
                 runkit_constant_redefine('PMA_USR_OS', 'Linux');
             }
             $this->assertEquals("\n", PMA\libraries\Util::whichCrlf());
         }
         if (PMA_HAS_RUNKIT) {
             runkit_constant_redefine('PMA_USR_OS', 'Win');
         } else {
             define('PMA_USR_OS', 'Win');
         }
         $this->assertEquals("\r\n", PMA\libraries\Util::whichCrlf());
     }
     if (PMA_HAS_RUNKIT) {
         if (isset($pma_usr_os)) {
             runkit_constant_redefine('PMA_USR_OS', 'Win');
         } else {
             runkit_constant_remove('PMA_USR_OS');
         }
     }
 }
コード例 #2
0
ファイル: export.php プロジェクト: iShareLife/phpmyadmin
     @ini_set('memory_limit', $cfg['MemoryLimit']);
 }
 register_shutdown_function('PMA_shutdownDuringExport');
 // Start with empty buffer
 $dump_buffer = '';
 $dump_buffer_len = 0;
 // Array of dump_buffers - used in separate file exports
 $dump_buffer_objects = array();
 // We send fake headers to avoid browser timeout when buffering
 $time_start = time();
 // 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\libraries\Util::whichCrlf();
 }
 $output_kanji_conversion = function_exists('PMA_Kanji_strConv') && $type != 'xls';
 // Do we need to convert charset?
 $output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset) && $charset != 'utf-8' && $type != 'xls';
 // Use on the fly compression?
 $GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly'] && $compression == 'gzip';
 if ($GLOBALS['onfly_compression']) {
     $GLOBALS['memory_limit'] = PMA_getMemoryLimitForExport();
 }
 // Generate filename and mime type if needed
 if ($asfile) {
     if (empty($remember_template)) {
         $remember_template = '';
     }
     list($filename, $mime_type) = PMA_getExportFilenameAndMimetype($export_type, $remember_template, $export_plugin, $compression, $filename_template);