Add medium folder when missing #67

This commit is contained in:
Tobias Reich 2014-11-06 23:21:33 +01:00
parent 9bdb9174fd
commit b6123c8257

View File

@ -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);