| Conditions | 7 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | function dumpData($table, $style, $query) { |
||
| 28 | if ($_POST['format'] == 'xml') { |
||
| 29 | if (!$this->database) { |
||
| 30 | $this->database = true; |
||
| 31 | echo "<database name='" . h(DB) . "'>\n"; |
||
| 32 | register_shutdown_function(array($this, '_database')); |
||
| 33 | } |
||
| 34 | $connection = connection(); |
||
| 35 | $result = $connection->query($query, 1); |
||
| 36 | if ($result) { |
||
| 37 | while ($row = $result->fetch_assoc()) { |
||
| 38 | echo "\t<table name='" . h($table) . "'>\n"; |
||
| 39 | foreach ($row as $key => $val) { |
||
| 40 | echo "\t\t<column name='" . h($key) . "'" . (isset($val) ? '' : " null='null'") . '>' . h($val) . "</column>\n"; |
||
| 41 | } |
||
| 42 | echo "\t</table>\n"; |
||
| 43 | } |
||
| 44 | } |
||
| 45 | return true; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 57 |
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.