From 2edc35dcb90e4f0999037b5fc01c1d1974b15a18 Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Mon, 10 Jul 2023 14:21:15 +0200 Subject: [PATCH] Addng some comments --- item.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/item.php b/item.php index cd00f80..098a356 100644 --- a/item.php +++ b/item.php @@ -2,11 +2,13 @@ class Item implements JsonSerializable { - - // TODO: create a persist() method that updates the line if the offset where + // TODO: Create a persist() method that updates the line if the offset where // it originally existed in is given by 'ftell'. If it doesn't have an // ID, then try to find it in the file and if it doesn't exist, append // + // TODO: Mantain ":" between tags and subtags that can multiple subtags, use + // another character ("="?) to signal that it should be unique + // // TODO: Maybe implement tags as an associative array or somethign? // // TODO: Change to id here in all occurrences @@ -23,6 +25,7 @@ class Item implements JsonSerializable $db->map(function ($line) use (&$ret, $id) { if ($line[0] == $id) { $ret = Item::fromLine($line); + return true; } @@ -48,6 +51,9 @@ class Item implements JsonSerializable { $from_path = $php_file['tmp_name'] ?? null; + // TODO: If any step fails, nothing should be actually written to the + // media file or the image copied. Maybe revert the changes? + // --- CHECKS --- if (!is_string($from_path)) Json::error('Passed invalid upload structure')->die();