diff options
Diffstat (limited to 'public/add/index.php')
| -rw-r--r-- | public/add/index.php | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/public/add/index.php b/public/add/index.php deleted file mode 100644 index 11ce9bb..0000000 --- a/public/add/index.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -declare(strict_types=1); - -use DTS\Bookmark; -use DTS\BookmarkRepository; -use DTS\Template; -use function DTS\Functions\respondAndExit; - -require_once(__DIR__.'/../../autoload.php'); - -$config = require_once(__DIR__.'/../../config.php'); - -$bookmarks = new BookmarkRepository($config['path_to_repository']); - -$template = new Template($config['path_to_templates']); - -if ('POST' === filter_input(INPUT_SERVER, 'REQUEST_METHOD')) { - $bookmark = new Bookmark( - bin2hex(random_bytes(32)), - $_POST['url'], - $_POST['title'], - $_POST['tag'], - date('Y-m-d H:i:s'), - true, - ); - - $bookmarks->add($bookmark); -} - -$html = $template->render('add'); - -respondAndExit(200, 'OK', $html); |
