X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/beae768cc711c728351b3dccdc780c60d59355a7..420be1d8b35ee5cd319662619365e091ef17e9f0:/lib/functions.php?ds=sidebyside
diff --git a/lib/functions.php b/lib/functions.php
index 546decc..53733ca 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -788,6 +788,95 @@ function jirafeau_admin_clean_async()
}
return $count;
}
+
+/**
+ * Better strval function for debug purposes
+ */
+function jirafeau_strval($value)
+{
+ if (gettype($value) == "boolean") {
+ return $value ? 'true' : 'false';
+ }
+ return strval($value);
+}
+
+/**
+ * Show file/folder permissions
+ */
+function jirafeau_fileperms($path)
+{
+ $out = substr(sprintf("%o", @fileperms($path)), -4) . ", ";
+ $out .= "read " . (is_readable($path) ? "OK" : "KO") . ", ";
+ $out .= "write " . (is_writable($path) ? "OK" : "KO");
+ return $out;
+}
+
+/**
+ * Show some useful informations for bug reporting.
+ */
+function jirafeau_admin_bug_report($cfg)
+{
+ $out = "
";
+ return $out;
+}
+
/**
* Read async transfert informations
* @return array containing informations.
@@ -1428,3 +1517,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']);
+}