Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / install-functions.php
index 3803f72be757f59672a0aefcb638be852d1de4dd..9e794c2ccd60b2b3b5c5c597fa5c4211881c312a 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -101,5 +102,24 @@ function addToInstallContent ($out) {
        } // END - if
 }
 
+// Read a given SQL dump
+function readSqlDump ($FQFN) {
+       // Sanity-check if file is there (should be there, but just to make it sure)
+       if (!isFileReadable($FQFN)) {
+               // This should not happen
+               debug_report_bug(__FUNCTION__.': File ' . basename($FQFN) . ' is not readable!');
+       } // END - if
+
+       // Load the file
+       $content = readFromFile($FQFN);
+
+       // Remove some unwanted chars
+       $content = str_replace("\r", '', $content);
+       $content = str_replace("\n\n", "\n", $content);
+
+       // Return the content
+       return $content;
+}
+
 // [EOF]
 ?>