Addng some comments
This commit is contained in:
parent
e56d803823
commit
2edc35dcb9
10
item.php
10
item.php
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
class Item implements JsonSerializable
|
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
|
// 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
|
// 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: Maybe implement tags as an associative array or somethign?
|
||||||
//
|
//
|
||||||
// TODO: Change to id here in all occurrences
|
// TODO: Change to id here in all occurrences
|
||||||
|
@ -23,6 +25,7 @@ class Item implements JsonSerializable
|
||||||
$db->map(function ($line) use (&$ret, $id) {
|
$db->map(function ($line) use (&$ret, $id) {
|
||||||
if ($line[0] == $id) {
|
if ($line[0] == $id) {
|
||||||
$ret = Item::fromLine($line);
|
$ret = Item::fromLine($line);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +51,9 @@ class Item implements JsonSerializable
|
||||||
{
|
{
|
||||||
$from_path = $php_file['tmp_name'] ?? null;
|
$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 ---
|
// --- CHECKS ---
|
||||||
if (!is_string($from_path))
|
if (!is_string($from_path))
|
||||||
Json::error('Passed invalid upload structure')->die();
|
Json::error('Passed invalid upload structure')->die();
|
||||||
|
|
Loading…
Reference in New Issue