From 3629b42aa1946169abc00ec332ee64d0036adf49 Mon Sep 17 00:00:00 2001 From: Marsender Date: Thu, 10 Oct 2013 07:41:50 +0100 Subject: [PATCH] Create destination db directory if missing --- resources/epub-loader/app/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/epub-loader/app/index.php b/resources/epub-loader/app/index.php index 40527f3..ce78a1f 100644 --- a/resources/epub-loader/app/index.php +++ b/resources/epub-loader/app/index.php @@ -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);