X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fsql-functions.php;h=e61f3938041f1fbd57f12cc4327744f1167fe54e;hb=0b4c98232a5c9c5b934a5049dc3c84ad32ab1125;hp=c1840fa1bcb278ccfeabe081afc20c7b6600bdbe;hpb=12cb1277f6f069b1cf9d536f9add2cd7e62eace4;p=mailer.git diff --git a/inc/sql-functions.php b/inc/sql-functions.php index c1840fa1bc..e61f393804 100644 --- a/inc/sql-functions.php +++ b/inc/sql-functions.php @@ -260,5 +260,23 @@ function initSqlLink () { } } +// Imports given SQL dump from given (relative) path and adds them to $sqlPool +function importSqlDump ($path, $dumpName, $sqlPool) { + // Construct FQFN + $FQFN = getPath() . $path . '/' . $dumpName . '.sql'; + + // Is the file readable? + if (!isFileReadable($FQFN)) { + // Not found, which is bad + reportBug(__FILE__, __LINE__, sprintf("SQL dump %s/%s.sql is not readable.", $path, $dumpName)); + } // END - if + + // Then read it + $fileContent = readSqlDump($FQFN); + + // Merge it with existing SQL statements + mergeSqls(explode(";\n", $fileContent), $sqlPool); +} + // [EOF] ?>