Create destination db directory if missing

This commit is contained in:
Marsender 2013-10-10 07:41:50 +01:00
parent 6fdb2f9fff
commit 3629b42aa1

View file

@ -89,6 +89,12 @@ if (isset($action) && isset($dbNum)) {
die ('Incorrect database num: ' . $dbNum);
}
$dbConfig = $gConfig['databases'][$dbNum];
$dbPath = $dbConfig['db_path'];
if (!is_dir($dbPath)) {
if (!mkdir($dbPath, 0755, true)) {
die ('Cannot create directory: ' . $dbPath);
}
}
$fileName = sprintf('%s%saction_%s.php', __DIR__, DIRECTORY_SEPARATOR, $action);
if (!file_exists($fileName)) {
die ('Incorrect action file: ' . $fileName);