summaryrefslogtreecommitdiffstats
path: root/lib/debug.lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debug.lib.php')
-rw-r--r--lib/debug.lib.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php
index 03f4de6d..5bdd6619 100644
--- a/lib/debug.lib.php
+++ b/lib/debug.lib.php
@@ -311,6 +311,17 @@ function check_mbstring() {
} // check_mbstring
/**
+ * check_config_writable
+ * This checks whether we can write the config file
+ */
+function check_config_writable() {
+
+ // file eixsts && is writable, or dir is writable
+ return ((file_exists(Config::get('prefix') . '/config/ampache.cfg.php') && is_writable(Config::get('prefix') . '/config/ampache.cfg.php'))
+ || (!file_exists(Config::get('prefix') . '/config/ampache.cfg.php') && is_writeable(Config::get('prefix') . '/config/')));
+}
+
+/**
* generate_config
* This takes an array of results and re-generates the config file
* this is used by the installer and by the admin/system page