2727use function str_repeat ;
2828use function str_replace ;
2929
30- use const PHP_EOL ;
3130use const PHP_VERSION ;
3231
3332/**
@@ -204,20 +203,20 @@ protected function setProperties(): ExportPluginProperties
204203 */
205204 public function exportHeader (): bool
206205 {
207- $ head = '% phpMyAdmin LaTeX Dump ' . PHP_EOL
208- . '% version ' . Version::VERSION . PHP_EOL
209- . '% https://www.phpmyadmin.net/ ' . PHP_EOL
210- . '% ' . PHP_EOL
206+ $ head = '% phpMyAdmin LaTeX Dump ' . "\n"
207+ . '% version ' . Version::VERSION . "\n"
208+ . '% https://www.phpmyadmin.net/ ' . "\n"
209+ . '% ' . "\n"
211210 . '% ' . __ ('Host: ' ) . ' ' . $ GLOBALS ['cfg ' ]['Server ' ]['host ' ];
212211 if (! empty ($ GLOBALS ['cfg ' ]['Server ' ]['port ' ])) {
213212 $ head .= ': ' . $ GLOBALS ['cfg ' ]['Server ' ]['port ' ];
214213 }
215214
216- $ head .= PHP_EOL
215+ $ head .= "\n"
217216 . '% ' . __ ('Generation Time: ' ) . ' '
218- . Util::localisedDate () . PHP_EOL
219- . '% ' . __ ('Server version: ' ) . ' ' . $ GLOBALS ['dbi ' ]->getVersionString () . PHP_EOL
220- . '% ' . __ ('PHP Version: ' ) . ' ' . PHP_VERSION . PHP_EOL ;
217+ . Util::localisedDate () . "\n"
218+ . '% ' . __ ('Server version: ' ) . ' ' . $ GLOBALS ['dbi ' ]->getVersionString () . "\n"
219+ . '% ' . __ ('PHP Version: ' ) . ' ' . PHP_VERSION . "\n" ;
221220
222221 return $ this ->export ->outputHandler ($ head );
223222 }
@@ -242,9 +241,9 @@ public function exportDBHeader($db, $dbAlias = ''): bool
242241 $ dbAlias = $ db ;
243242 }
244243
245- $ head = '% ' . PHP_EOL
246- . '% ' . __ ('Database: ' ) . ' \'' . $ dbAlias . '\'' . PHP_EOL
247- . '% ' . PHP_EOL ;
244+ $ head = '% ' . "\n"
245+ . '% ' . __ ('Database: ' ) . ' \'' . $ dbAlias . '\'' . "\n"
246+ . '% ' . "\n" ;
248247
249248 return $ this ->export ->outputHandler ($ head );
250249 }
@@ -309,14 +308,14 @@ public function exportData(
309308 $ columns_alias [$ i ] = $ col_as ;
310309 }
311310
312- $ buffer = PHP_EOL . '% ' . PHP_EOL . '% ' . __ ('Data: ' ) . ' ' . $ table_alias
313- . PHP_EOL . '% ' . PHP_EOL . ' \\begin{longtable}{| ' ;
311+ $ buffer = "\n" . '% ' . "\n" . '% ' . __ ('Data: ' ) . ' ' . $ table_alias
312+ . "\n" . '% ' . "\n" . ' \\begin{longtable}{| ' ;
314313
315314 $ buffer .= str_repeat ('l| ' , $ columns_cnt );
316315
317- $ buffer .= '} ' . PHP_EOL ;
316+ $ buffer .= '} ' . "\n" ;
318317
319- $ buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . PHP_EOL ;
318+ $ buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . "\n" ;
320319 if (isset ($ GLOBALS ['latex_caption ' ])) {
321320 $ buffer .= ' \\caption{ '
322321 . Util::expandUserString (
@@ -349,7 +348,7 @@ public function exportData(
349348 }
350349
351350 $ buffer = mb_substr ($ buffer , 0 , -2 ) . '\\\\ \\hline \hline ' ;
352- if (! $ this ->export ->outputHandler ($ buffer . ' \\endfirsthead ' . PHP_EOL )) {
351+ if (! $ this ->export ->outputHandler ($ buffer . ' \\endfirsthead ' . "\n" )) {
353352 return false ;
354353 }
355354
@@ -369,7 +368,7 @@ public function exportData(
369368 }
370369 }
371370
372- if (! $ this ->export ->outputHandler ($ buffer . '\\endhead \\endfoot ' . PHP_EOL )) {
371+ if (! $ this ->export ->outputHandler ($ buffer . '\\endhead \\endfoot ' . "\n" )) {
373372 return false ;
374373 }
375374 } else {
@@ -397,13 +396,13 @@ public function exportData(
397396 }
398397 }
399398
400- $ buffer .= ' \\\\ \\hline ' . PHP_EOL ;
399+ $ buffer .= ' \\\\ \\hline ' . "\n" ;
401400 if (! $ this ->export ->outputHandler ($ buffer )) {
402401 return false ;
403402 }
404403 }
405404
406- $ buffer = ' \\end{longtable} ' . PHP_EOL ;
405+ $ buffer = ' \\end{longtable} ' . "\n" ;
407406
408407 return $ this ->export ->outputHandler ($ buffer );
409408 }
@@ -494,8 +493,8 @@ public function exportStructure(
494493 /**
495494 * Displays the table structure
496495 */
497- $ buffer = PHP_EOL . '% ' . PHP_EOL . '% ' . __ ('Structure: ' ) . ' '
498- . $ table_alias . PHP_EOL . '% ' . PHP_EOL . ' \\begin{longtable}{ ' ;
496+ $ buffer = "\n" . '% ' . "\n" . '% ' . __ ('Structure: ' ) . ' '
497+ . $ table_alias . "\n" . '% ' . "\n" . ' \\begin{longtable}{ ' ;
499498 if (! $ this ->export ->outputHandler ($ buffer )) {
500499 return false ;
501500 }
@@ -513,7 +512,7 @@ public function exportStructure(
513512 $ alignment .= 'l| ' ;
514513 }
515514
516- $ buffer = $ alignment . '} ' . PHP_EOL ;
515+ $ buffer = $ alignment . '} ' . "\n" ;
517516
518517 $ header = ' \\hline ' ;
519518 $ header .= '\\multicolumn{1}{|c|}{ \\textbf{ ' . __ ('Column ' )
@@ -551,11 +550,11 @@ public function exportStructure(
551550 'database ' => $ db_alias ,
552551 ]
553552 )
554- . '} \\\\' . PHP_EOL ;
553+ . '} \\\\' . "\n" ;
555554 }
556555
557- $ buffer .= $ header . ' \\\\ \\hline \\hline ' . PHP_EOL
558- . '\\endfirsthead ' . PHP_EOL ;
556+ $ buffer .= $ header . ' \\\\ \\hline \\hline ' . "\n"
557+ . '\\endfirsthead ' . "\n" ;
559558 // Table caption on next pages
560559 if (isset ($ GLOBALS ['latex_caption ' ])) {
561560 $ buffer .= ' \\caption{ '
@@ -564,10 +563,10 @@ public function exportStructure(
564563 [static ::class, 'texEscape ' ],
565564 ['table ' => $ table_alias , 'database ' => $ db_alias ]
566565 )
567- . '} \\\\ ' . PHP_EOL ;
566+ . '} \\\\ ' . "\n" ;
568567 }
569568
570- $ buffer .= $ header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . PHP_EOL ;
569+ $ buffer .= $ header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . "\n" ;
571570
572571 if (! $ this ->export ->outputHandler ($ buffer )) {
573572 return false ;
@@ -628,14 +627,14 @@ public function exportStructure(
628627 }
629628
630629 $ buffer = str_replace ("\000" , ' & ' , $ local_buffer );
631- $ buffer .= ' \\\\ \\hline ' . PHP_EOL ;
630+ $ buffer .= ' \\\\ \\hline ' . "\n" ;
632631
633632 if (! $ this ->export ->outputHandler ($ buffer )) {
634633 return false ;
635634 }
636635 }
637636
638- $ buffer = ' \\end{longtable} ' . PHP_EOL ;
637+ $ buffer = ' \\end{longtable} ' . "\n" ;
639638
640639 return $ this ->export ->outputHandler ($ buffer );
641640 }
0 commit comments