'err', 'message' => 'Duplicate key ' . $post['id']]; $keys []= $post['id']; if ($post['cat'] !== 'log' && $post['cat'] !== 'blog') return ['result'=>'err', 'message' => 'Unknown cat ' . $post['cat']]; if ($post['type'] === 'markdown') { if (!file_exists($post['file_fragment'])) return ['result'=>'err', 'message' => 'Fragment not found ' . $post['fragment']]; } else if ($post['type'] === 'plain') { if (!file_exists($post['file_fragment'])) return ['result'=>'err', 'message' => 'Fragment not found ' . $post['fragment']]; } else if ($post['type'] === 'euler') { // aok } else if ($post['type'] === 'aoc') { if (!array_key_exists('aoc:year', $post['extras'])) return ['result'=>'err', 'message' => 'AdventOfCode metadata [aoc:year] missing: ' . $post['title']]; // aok } else { return ['result'=>'err', 'message' => 'Unknown type ' . $post['type']]; } } return ['result'=>'ok', 'message' => '']; } }