X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/beae768cc711c728351b3dccdc780c60d59355a7..cea71d42c3eafae9cb41017f24a12d6c84d9c80a:/lib/functions.php
diff --git a/lib/functions.php b/lib/functions.php
index 546decc..a4f9ec6 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -788,6 +788,104 @@ 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 +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']);
+}