From b6123c8257f4aaa60b13b5a7245c194a5455303c Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 6 Nov 2014 23:21:33 +0100 Subject: [PATCH] Add medium folder when missing #67 --- php/database/update_020700.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/database/update_020700.php b/php/database/update_020700.php index 0322164..ab80677 100644 --- a/php/database/update_020700.php +++ b/php/database/update_020700.php @@ -16,6 +16,13 @@ if (!$database->query($query)) { } } +# Create medium folder +if (is_dir(LYCHEE_UPLOADS_MEDIUM)===false) { + # Only create the folder when it is missing + if (@mkdir(LYCHEE_UPLOADS_MEDIUM)===false) + Log::error($database, 'update_020700', __LINE__, 'Could not create medium-folder'); +} + # Add medium to settings $query = Database::prepare($database, "SELECT `key` FROM `?` WHERE `key` = 'medium' LIMIT 1", array(LYCHEE_TABLE_SETTINGS)); $result = $database->query($query);