Permalink
Browse files

Moved configuration settings out of processor and setup a sample glob…

…al config file, to make setups more intuitive and commits to Git less likely to break other installs.
  • Loading branch information...
1 parent cb3ace5 commit f66b3072c9ea27522fae393f58aa4dca547814d4 Eric Caron committed Nov 22, 2011
Showing with 16 additions and 6 deletions.
  1. +1 −0 .gitignore
  2. +7 −0 config.ini.php.dist
  3. +8 −6 processor.php
View
@@ -3,3 +3,4 @@ history.db
#Exclude any specific config files, except the distribution example
config.d/*.ini
+config.ini.php
View
@@ -0,0 +1,7 @@
+<?php
+define('ALERT_EMAIL', 'youremail@yourcompany.com'); //Default address to receive any alerts
+define('ARCHIVE_DIR', 'PUT-FULL-PATH-HERE');
+define('DEFAULT_DAILY_KEPT', 3);
+define('DEFAULT_WEEKLY_KEPT', 3);
+define('DEFAULT_MONTHLY_KEPT', 2);
+
View
@@ -3,12 +3,14 @@
* Master controller for performing all database backups.
*/
-//Misc. global configuration settings
-define('ALERT_EMAIL', 'youremail@yourcompany.com'); //Default address to receive any alerts
-define('ARCHIVE_DIR', '/mnt/sqlbackup/');
-define('DEFAULT_DAILY_KEPT', 3);
-define('DEFAULT_WEEKLY_KEPT', 3);
-define('DEFAULT_MONTHLY_KEPT', 2);
+//Load the misc. global configuration settings
+if (!file_exists(dirname(__FILE__).'/config.ini.php')) {
+ die("No config.ini.php file found. Exiting.\n");
+}
+include dirname(__FILE__).'/config.ini.php';
+if (!is_dir(ARCHIVE_DIR)) {
+ die("Archive directory - " . ARCHIVE_DIR . " - does not exist.\n");
+}
/**
* NO MODIFICATION REQUIRED PAST THIS POINT

0 comments on commit f66b307

Please sign in to comment.