IMPL: Add tags on upload
This commit is contained in:
parent
147d33d299
commit
e56d803823
3
item.php
3
item.php
|
@ -44,7 +44,7 @@ class Item implements JsonSerializable
|
|||
}
|
||||
|
||||
// ::upload() requires the PHP file upload ARRAY from $_FILES
|
||||
public static function upload(array $php_file): Item
|
||||
public static function upload(array $php_file, string $tags): Item
|
||||
{
|
||||
$from_path = $php_file['tmp_name'] ?? null;
|
||||
|
||||
|
@ -57,6 +57,7 @@ class Item implements JsonSerializable
|
|||
// --- INITIALIZE ---
|
||||
$item = new Item();
|
||||
$item->hash = hash_file('sha256', $from_path);
|
||||
$item->tags = explode(' ', $tags);
|
||||
$item->extensionFromUpload($php_file);
|
||||
|
||||
// --- ACTUALLY GRAB FILE ---
|
||||
|
|
Loading…
Reference in New Issue