]> git.mxchange.org Git - mailer.git/blobdiff - inc/install-functions.php
Huge patchset (I don't recall all details):
[mailer.git] / inc / install-functions.php
index 3803f72be757f59672a0aefcb638be852d1de4dd..525b8ae292fb6fea4ebde293fea24fd0e9193358 100644 (file)
@@ -101,5 +101,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]
 ?>