X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/9a51f6fc76ce0b60829cc31ccab9643c73b26440..2bc76d8baee16b7ba0814c12da52c665158a6d98:/lib/functions.php?ds=sidebyside
diff --git a/lib/functions.php b/lib/functions.php
index e72359e..f564db6 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -28,7 +28,7 @@ function s2p($s)
$block_size = 8;
$p = '';
for ($i = 0; $i < strlen($s); $i++) {
- $p .= $s{$i};
+ $p .= $s[$i];
if (($i + 1) % $block_size == 0) {
$p .= '/';
}
@@ -68,16 +68,16 @@ function base_16_to_64($num)
# Convert long hex string to bin.
$size = strlen($num);
for ($i = 0; $i < $size; $i++) {
- $b .= $hex2bin{hexdec($num{$i})};
+ $b .= $hex2bin[hexdec($num[$i])];
}
# Convert long bin to base 64.
$size *= 4;
for ($i = $size - 6; $i >= 0; $i -= 6) {
- $o = $m{bindec(substr($b, $i, 6))} . $o;
+ $o = $m[bindec(substr($b, $i, 6))] . $o;
}
# Some few bits remaining ?
if ($i < 0 && $i > -6) {
- $o = $m{bindec(substr($b, 0, $i + 6))} . $o;
+ $o = $m[bindec(substr($b, 0, $i + 6))] . $o;
}
return $o;
}
@@ -843,12 +843,16 @@ function jirafeau_admin_bug_report($cfg)
$out .= "- mcrypt version: " . phpversion('mcrypt') . "
";
$php_options = [
'post_max_size',
- 'upload_max_filesize'
+ 'upload_max_filesize',
+ 'safe_mode',
+ 'max_execution_time',
+ 'max_input_time'
];
foreach ($php_options as &$o) {
$v = ini_get($o);
$out .= "- $o: " . jirafeau_strval($v) . " (" . gettype($v). ")
";
}
+ $out .= "- can set_time_limit: " . (set_time_limit(0) ? "yes" : "no") . "
";
$out .= "
";
$out .= "# File permissions
";
@@ -869,10 +873,15 @@ function jirafeau_admin_bug_report($cfg)
$out .= "# Browser details
";
$out .= "";
+ $out .= "
";
+
+ $out .= "# Memory
";
+ $out .= "- memory_get_peak_usage: " . jirafeau_human_size(memory_get_peak_usage()) . "
";
+
$out .= "";
return $out;
}
@@ -1517,3 +1526,8 @@ function jirafeau_add_ending_slash($path)
{
return $path . ((substr($path, -1) == '/') ? '' : '/');
}
+
+function jirafeau_default_web_root()
+{
+ return $_SERVER['HTTP_HOST'] . str_replace(basename(__FILE__), '', $_SERVER['REQUEST_URI']);
+}