diff options
author | Karl Vollmer <vollmer@ampache.org> | 2011-07-27 14:35:49 -0300 |
---|---|---|
committer | Karl Vollmer <vollmer@ampache.org> | 2011-07-27 14:35:49 -0300 |
commit | ffad56ec182f110c3511ce56d7a3cfe54a6b5de5 (patch) | |
tree | 57dafdf5979889dce1e84dbb11911e2c79870943 /lib/debug.lib.php | |
parent | 33c629f4ef5e0dfd0e9b6bc0deddb165ffe20df5 (diff) | |
download | ampache-ffad56ec182f110c3511ce56d7a3cfe54a6b5de5.tar.gz ampache-ffad56ec182f110c3511ce56d7a3cfe54a6b5de5.tar.bz2 ampache-ffad56ec182f110c3511ce56d7a3cfe54a6b5de5.zip |
Install now contains two buttons, Download & Write for the config file, there is also
an additional check before that if the config file is writeable
Diffstat (limited to 'lib/debug.lib.php')
-rw-r--r-- | lib/debug.lib.php | 11 |
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 |