From efc805f8ce722e0c99f4e8646573d2b05eea29c3 Mon Sep 17 00:00:00 2001 From: till Date: Tue, 29 Jan 2008 20:35:02 +0000 Subject: * script to check an RoundCube install (to be worked on, see @todo) --- check.php | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 check.php (limited to 'check.php') diff --git a/check.php b/check.php new file mode 100644 index 000000000..4b8e27878 --- /dev/null +++ b/check.php @@ -0,0 +1,88 @@ + + * @license http://www.opensource.org/licenses/bsd-license.php The BSD License + * @version CVS: $Id$ + * @link https://svn.roundcube.net/trunk + * @todo Check IMAP settings. + * @todo Check SMTP settings. + * @todo HTML/CSS to make it pretty. + */ + +$writable_dirs = array('logs/', 'temp/'); +$create_files = array('config/db.inc.php', 'config/main.inc.php'); + +$path = dirname(__FILE__) . '/'; + +echo '

Check if directories are writable

'; +echo '

RoundCube may need to write/save files into these directories.

'; + +foreach ($writable_dirs AS $dir) { + echo "Directory $dir: "; + if (!is_writable($path . $dir)) { + echo 'NOT OK'; + } else { + echo 'OK'; + } + echo "
"; +} + +echo '

Check if you setup config files

'; +echo '

Checks if the files exist and if they are readable.

'; + +foreach ($create_files AS $file) { + echo "File $file: "; + if (file_exists($path . $file) && is_readable($path . $file)) { + echo 'OK'; + } else { + echo 'NOT OK'; + } + echo "
"; +} + +echo '

Check supplied DB settings

'; +@include $path . 'config/db.inc.php'; + +if (isset($rcmail_config)) { + echo 'DB settings: '; + include_once 'MDB2.php'; + $db = MDB2::connect($rcmail_config['db_dsnw']); + if (!MDB2::IsError($db)) { + echo 'OK'; + $db->disconnect(); + } else { + echo 'NOT OK'; + } +} else { + echo 'Could not open db.inc.php config file, or file is empty.
'; +} +?> -- cgit v1.2.3