Browse Source

Create destination db directory if missing

master
Marsender 10 years ago
parent
commit
3629b42aa1
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      resources/epub-loader/app/index.php

+ 6
- 0
resources/epub-loader/app/index.php 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);


Loading…
Cancel
Save