feat: Afficher des indications lorsqu’on compile avec --debug
parent
a167b19d1a
commit
35a179b7c0
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Spip\Loader;
|
||||
|
||||
class Debug {
|
||||
|
||||
public function phar_rewrite_debug($incomming_path, $calculated_path) {
|
||||
return [
|
||||
'incomming $path' => $incomming_path,
|
||||
'calculated $path' => $calculated_path,
|
||||
'PATH_INFO' => $_SERVER['PATH_INFO'],
|
||||
'REQUEST_URI' => $_SERVER['REQUEST_URI'],
|
||||
'SCRIPT_FILENAME' => $_SERVER['SCRIPT_FILENAME'],
|
||||
'SCRIPT_NAME' => $_SERVER['SCRIPT_NAME'],
|
||||
'PHP_SELF' => $_SERVER['PHP_SELF'],
|
||||
'HTTP_HOST' => $_SERVER['HTTP_HOST'],
|
||||
'Phar::running(false)' => \Phar::running(false)
|
||||
];
|
||||
}
|
||||
|
||||
public function table(array $data) {
|
||||
$box = "<div class='msg-alert notice' style='margin-bottom:0'><table>";
|
||||
foreach ($data as $key => $val) {
|
||||
$box .= "<tr><th>$key</th><td><code>" . var_export($val, true) . "</code></td></tr>\n";
|
||||
}
|
||||
$box .= "</table></div>\n";
|
||||
return $box;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue