XoopsModules25x /
adminer
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /** Dump to Bzip2 format |
||
| 4 | * @link https://www.adminer.org/plugins/#use |
||
| 5 | * @uses bzopen(), tempnam("") |
||
| 6 | * @author Jakub Vrana, http://www.vrana.cz/ |
||
| 7 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 |
||
| 8 | * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) |
||
| 9 | */ |
||
| 10 | class AdminerDumpBz2 { |
||
| 11 | /** @access protected */ |
||
| 12 | var $filename, $fp; |
||
| 13 | |||
| 14 | function dumpOutput() { |
||
|
0 ignored issues
–
show
|
|||
| 15 | if (!function_exists('bzopen')) { |
||
| 16 | return array(); |
||
| 17 | } |
||
| 18 | return array('bz2' => 'bzip2'); |
||
| 19 | } |
||
| 20 | |||
| 21 | function _bz2($string, $state) { |
||
|
0 ignored issues
–
show
|
|||
| 22 | bzwrite($this->fp, $string); |
||
| 23 | if ($state & PHP_OUTPUT_HANDLER_END) { |
||
| 24 | bzclose($this->fp); |
||
| 25 | $return = file_get_contents($this->filename); |
||
| 26 | unlink($this->filename); |
||
| 27 | return $return; |
||
| 28 | } |
||
| 29 | return ''; |
||
| 30 | } |
||
| 31 | |||
| 32 | function dumpHeaders($identifier, $multi_table = false) { |
||
|
0 ignored issues
–
show
|
|||
| 33 | if ($_POST['output'] == 'bz2') { |
||
| 34 | $this->filename = tempnam('', 'bz2'); |
||
| 35 | $this->fp = bzopen($this->filename, 'w'); |
||
| 36 | header('Content-Type: application/x-bzip'); |
||
| 37 | ob_start(array($this, '_bz2'), 1e6); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | } |
||
| 42 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.