Permalink
Browse files

Initial commit of project

  • Loading branch information...
0 parents commit be6e1959de2aafbb91b075e7d15bbb74581ed275 Eric Caron committed Nov 22, 2011
Showing with 510 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +76 −0 README.md
  3. +32 −0 includes/functions.inc.php
  4. +397 −0 processor.php
@@ -0,0 +1,5 @@
+#Skip the sqlite history file, since that's created as needed and nobody would want that shared
+history.db
+
+#Exclude any specific config files, except the distribution example
+config.d/*.ini
@@ -0,0 +1,76 @@
+PHP MySQL Backup
+=============
+
+A (mostly) self-contained GPL MySQL backup solution that is highly configurable and supports layers
+of archiving and support for multiple table types.
+
+Requirements
+-------
+
+The following standard components are required for the system to operate.
+
+(Document the things needed for PHP to operate, should just by PHP with mysqli - preferrably mysqlnd - and sqlite. Plus access to mysqldump)
+
+
+Installation
+-----------
+
+(Explain how to unzip the file and setup files in config.d, also the header config options in processor.php)
+
+
+Usage
+-----
+
+(Explain setting up the cron job and suggest various S3-based file systems for the archive path)
+
+Hat-tip
+-------
+
+Thanks to [GitHub's markup file](https://github.com/github/markup/blob/master/README.md) for a great example of how to make a README.md
+
+
+Giving Back
+------------
+
+ * [Submit new features](http://www.lornajane.net/posts/2010/contributing-to-projects-on-github)
+ * Tell us about bugs
+ * If you use this, tell people
+ * Fork it to support your own database
+ * Translations to other languages? Why not!
+
+License
+------------
+
+All files that are part of this project are covered by the following
+license, except where explicitly noted.
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ for the specific language governing rights and limitations under the
+ License.
+
+ The Initial Developer of the Original Code is LinkUp, Inc..
+
+ Portions created by the Initial Developer are Copyright (C) 2011
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
@@ -0,0 +1,32 @@
+<?php
+//Figure out what is the correct number of copies to keep
+function getRanges($iniSettings, $database) {
+ $dailyKept = DEFAULT_DAILY_KEPT;
+ if (isset($iniSettings['core']['daily_kept'])) {
+ $dailyKept = $iniSettings['core']['daily_kept'];
+ }
+ if (isset($iniSettings[$database]['daily_kept'])) {
+ $dailyKept = $iniSettings[$database]['daily_kept'];
+ }
+ $weeklyKept = DEFAULT_WEEKLY_KEPT;
+ if (isset($iniSettings['core']['weekly_kept'])) {
+ $weeklyKept = $iniSettings['core']['weekly_kept'];
+ }
+ if (isset($iniSettings[$database]['weekly_kept'])) {
+ $weeklyKept = $iniSettings[$database]['weekly_kept'];
+ }
+ $monthlyKept = DEFAULT_MONTHLY_KEPT;
+ if (isset($iniSettings['core']['monthly_kept'])) {
+ $monthlyKept = $iniSettings['core']['monthly_kept'];
+ }
+ if (isset($iniSettings[$database]['monthly_kept'])) {
+ $monthlyKept = $iniSettings[$database]['monthly_kept'];
+ }
+ return array($dailyKept, $weeklyKept, $monthlyKept);
+}
+
+//Simultaneously add the error message to the array and send it to stdout
+function logError($message) {
+ $GLOBALS['errors'][] = $message;
+ echo $message."\n";
+}
Oops, something went wrong.

0 comments on commit be6e195

Please sign in to comment.