aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-16 01:32:48 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-16 01:32:48 -0500
commite6d95488be4310b8bd85854c541777bb26299658 (patch)
treea77802b60cc2c87414407170fd3528f83fe20638
parent0ca13d03f3bca48f1f50119bbc6887f5c0ce43ed (diff)
downloadedwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.tar.gz
edwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.tar.bz2
edwinmattiacci.com-e6d95488be4310b8bd85854c541777bb26299658.zip
app: Cleanup dead files and organize hierarchy
-rw-r--r--.gitignore10
-rw-r--r--app/Routes.php31
-rw-r--r--app/controllers/about.controller.php3
-rw-r--r--app/controllers/comments.controller.php (renamed from controllers/comments.controller.php)0
-rw-r--r--app/controllers/contact.controller.php (renamed from controllers/contact.controller.php)8
-rw-r--r--app/controllers/index.controller.php3
-rw-r--r--app/controllers/wall.controller.php3
-rw-r--r--app/model/Form.php (renamed from model/Form.php)0
-rw-r--r--app/model/Navigation.php (renamed from model/Navigation.php)0
-rw-r--r--app/views/about.view.php (renamed from views/about.view.php)0
-rw-r--r--app/views/components/AudioPlayer.php (renamed from views/components/AudioPlayer.php)0
-rw-r--r--app/views/contact.view.php (renamed from views/contact.view.php)0
-rw-r--r--app/views/index.view.php (renamed from views/index.view.php)0
-rw-r--r--app/views/partials/footer.php (renamed from views/partials/footer.php)0
-rw-r--r--app/views/partials/header.common.php (renamed from views/partials/header.common.php)2
-rw-r--r--app/views/partials/header.error.php3
-rw-r--r--app/views/partials/header.php (renamed from views/partials/header.php)6
-rw-r--r--app/views/partials/navigator.links.php (renamed from views/partials/navigator.links.php)0
-rw-r--r--app/views/partials/navigator.php (renamed from views/partials/navigator.php)0
-rw-r--r--app/views/wall.view.php (renamed from views/wall.view.php)0
-rw-r--r--assets/app.css0
-rw-r--r--assets/app.js13
-rw-r--r--bootstrap/Router.php6
-rw-r--r--bootstrap/Routes.php31
-rw-r--r--controllers/about.controller.php3
-rw-r--r--controllers/index.controller.php3
-rw-r--r--controllers/wall.controller.php3
-rw-r--r--generators/hugo/themes/edwin/layouts/partials/footer.html2
-rw-r--r--generators/hugo/themes/edwin/layouts/partials/header.html2
-rw-r--r--generators/hugo/themes/edwin/layouts/partials/navigator.html2
-rw-r--r--public/dist/app.css (renamed from public/css/app.css)0
-rw-r--r--public/index.php4
-rw-r--r--public/js/app.js0
-rw-r--r--views/partials/header.error.php3
34 files changed, 62 insertions, 79 deletions
diff --git a/.gitignore b/.gitignore
index 1d09c82..6d19387 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
-/vendor
-/public/posts
-/public/error/error.json
-/public/error/error.html
-generators/hugo/public
+.hugo_build.lock
/bootstrap/comments/comments
+/public/posts
+/vendor
config.php
+generators/hugo/public
+google[a-z0-9]*.html
diff --git a/app/Routes.php b/app/Routes.php
new file mode 100644
index 0000000..59c0f40
--- /dev/null
+++ b/app/Routes.php
@@ -0,0 +1,31 @@
+<?php
+
+/* public routes */
+
+$router->get('', '../app/controllers/index.controller.php');
+$router->get('contact', '../app/controllers/contact.controller.php');
+$router->get('wall', '../app/controllers/wall.controller.php');
+$router->get('comments', '../app/controllers/comments.controller.php');
+$router->get('about', '../app/controllers/about.controller.php');
+$router->get('hashget', '../app/controllers/comments.controller.php');
+$router->get('hashover', '../app/controllers/comments.controller.php');
+
+$router->head('', '../app/controllers/index.controller.php');
+$router->head('contact', '../app/controllers/contact.controller.php');
+$router->head('wall', '../app/controllers/wall.controller.php');
+$router->head('comments', '../app/controllers/comments.controller.php');
+$router->head('hashget', '../app/controllers/comments.controller.php');
+$router->head('hashover', '../app/controllers/comments.controller.php');
+
+$router->post('contact', '../app/controllers/contact.controller.php');
+$router->post('hashpost', '../app/controllers/comments.controller.php');
+
+/* backend routes */
+
+$router->get('latestajax', '../bootstrap/comments/backend/latest-ajax.php');
+$router->get('countlinkajax', '../bootstrap/comments/backend/count-link-ajax.php');
+
+$router->post('commentsajax', '../bootstrap/comments/backend/comments-ajax.php');
+$router->post('formactions', '../bootstrap/comments/backend/form-actions.php');
+$router->post('loadcomments', '../bootstrap/comments/backend/load-comments.php');
+$router->post('likecomment', '../bootstrap/comments/backend/like.php');
diff --git a/app/controllers/about.controller.php b/app/controllers/about.controller.php
new file mode 100644
index 0000000..cb58a14
--- /dev/null
+++ b/app/controllers/about.controller.php
@@ -0,0 +1,3 @@
+<?php
+
+require '../app/views/about.view.php';
diff --git a/controllers/comments.controller.php b/app/controllers/comments.controller.php
index 6f4abfa..6f4abfa 100644
--- a/controllers/comments.controller.php
+++ b/app/controllers/comments.controller.php
diff --git a/controllers/contact.controller.php b/app/controllers/contact.controller.php
index d953ff6..78d5c18 100644
--- a/controllers/contact.controller.php
+++ b/app/controllers/contact.controller.php
@@ -17,7 +17,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ((bool) empty($submit->email) == true
|| (bool) empty($submit->message) == true
) {
- include '../views/contact.view.php';
+ include '../app/views/contact.view.php';
return;
}
@@ -28,7 +28,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($validEmail === false ) {
$emailError = 'Invalid email: ' . "\r" . '<b>'. $submit->email . '</b>';
- include '../views/contact.view.php';
+ include '../app/views/contact.view.php';
return;
}
@@ -39,7 +39,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$message = null;
$spam = false;
- include '../views/contact.view.php';
+ include '../app/views/contact.view.php';
fastcgi_finish_request();
$contact['database']->insert(
@@ -53,4 +53,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
return sendMail($submit->name, $submit->email, $submit->message);
}
-require '../views/contact.view.php';
+require '../app/views/contact.view.php';
diff --git a/app/controllers/index.controller.php b/app/controllers/index.controller.php
new file mode 100644
index 0000000..7ec4a52
--- /dev/null
+++ b/app/controllers/index.controller.php
@@ -0,0 +1,3 @@
+<?php
+
+require '../app/views/index.view.php';
diff --git a/app/controllers/wall.controller.php b/app/controllers/wall.controller.php
new file mode 100644
index 0000000..896b2c3
--- /dev/null
+++ b/app/controllers/wall.controller.php
@@ -0,0 +1,3 @@
+<?php
+
+require '../app/views/wall.view.php';
diff --git a/model/Form.php b/app/model/Form.php
index d7cd5d9..d7cd5d9 100644
--- a/model/Form.php
+++ b/app/model/Form.php
diff --git a/model/Navigation.php b/app/model/Navigation.php
index 72ee891..72ee891 100644
--- a/model/Navigation.php
+++ b/app/model/Navigation.php
diff --git a/views/about.view.php b/app/views/about.view.php
index ae28201..ae28201 100644
--- a/views/about.view.php
+++ b/app/views/about.view.php
diff --git a/views/components/AudioPlayer.php b/app/views/components/AudioPlayer.php
index d3ba487..d3ba487 100644
--- a/views/components/AudioPlayer.php
+++ b/app/views/components/AudioPlayer.php
diff --git a/views/contact.view.php b/app/views/contact.view.php
index 4b4da41..4b4da41 100644
--- a/views/contact.view.php
+++ b/app/views/contact.view.php
diff --git a/views/index.view.php b/app/views/index.view.php
index 29f17b4..29f17b4 100644
--- a/views/index.view.php
+++ b/app/views/index.view.php
diff --git a/views/partials/footer.php b/app/views/partials/footer.php
index e2f2a6b..e2f2a6b 100644
--- a/views/partials/footer.php
+++ b/app/views/partials/footer.php
diff --git a/views/partials/header.common.php b/app/views/partials/header.common.php
index 4ea98df..3a21e8e 100644
--- a/views/partials/header.common.php
+++ b/app/views/partials/header.common.php
@@ -5,7 +5,7 @@
<!-- Stylesheets -->
<link href="/dist/tailwind.min.css" rel="stylesheet">
-<link href="/css/app.css" rel="stylesheet">
+<link href="/dist/app.css" rel="stylesheet">
<link href="/dist/bar-ui.css" rel="stylesheet">
<!-- Favicons -->
diff --git a/app/views/partials/header.error.php b/app/views/partials/header.error.php
new file mode 100644
index 0000000..9f00aa9
--- /dev/null
+++ b/app/views/partials/header.error.php
@@ -0,0 +1,3 @@
+
+<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Bootstrap.php'; ?>
+<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/header.php'; ?>
diff --git a/views/partials/header.php b/app/views/partials/header.php
index 6ddabcc..1809de0 100644
--- a/views/partials/header.php
+++ b/app/views/partials/header.php
@@ -1,7 +1,7 @@
<?php if (strpos($_SERVER['REQUEST_URI'], 'posts') !== false) { ?>
<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Bootstrap.php'; ?>
- <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/header.common.php'; ?>
+ <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/header.common.php'; ?>
</head>
@@ -17,7 +17,7 @@
<meta name="keywords" content="Edwin, Mattiacci, Voice, Voiceover, Narration, Trailers, Commercials">
<meta name="description" content="Edwin Mattiacci Voiceover. Narration, Trailers, Commercials, and More.">
- <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/header.common.php'; ?>
+ <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/header.common.php'; ?>
</head>
@@ -37,7 +37,7 @@
<div class="sticky top-0 z-10 bg-gray-100 border-b">
<div class="mx-auto px-4 max-w-md">
- <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/navigator.php'; ?>
+ <?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/navigator.php'; ?>
</div>
</div>
diff --git a/views/partials/navigator.links.php b/app/views/partials/navigator.links.php
index f023e32..f023e32 100644
--- a/views/partials/navigator.links.php
+++ b/app/views/partials/navigator.links.php
diff --git a/views/partials/navigator.php b/app/views/partials/navigator.php
index 78bb138..78bb138 100644
--- a/views/partials/navigator.php
+++ b/app/views/partials/navigator.php
diff --git a/views/wall.view.php b/app/views/wall.view.php
index 0635325..0635325 100644
--- a/views/wall.view.php
+++ b/app/views/wall.view.php
diff --git a/assets/app.css b/assets/app.css
deleted file mode 100644
index e69de29..0000000
--- a/assets/app.css
+++ /dev/null
diff --git a/assets/app.js b/assets/app.js
deleted file mode 100644
index 9e3b08a..0000000
--- a/assets/app.js
+++ /dev/null
@@ -1,13 +0,0 @@
-
-// Javascript
-
-require('./js/SoundManager2');
-require('./js/InlinePlayer');
-require('./js/Navigator');
-require('./js/Popup');
-require('./js/BackgroundFade');
-
-// CSS
-
-require('./css/edwin.css');
-require('./css/font-awesome.css');
diff --git a/bootstrap/Router.php b/bootstrap/Router.php
index 34e278c..c78ab8b 100644
--- a/bootstrap/Router.php
+++ b/bootstrap/Router.php
@@ -1,6 +1,6 @@
<?php
-class Router
+final class Router
{
protected $routes = [
'GET' => [],
@@ -26,7 +26,7 @@ class Router
public static function load($file)
{
$router = new static;
- require $file;
+ include $file;
return $router;
}
@@ -35,8 +35,6 @@ class Router
if (is_array($this->routes[$requestType]) && array_key_exists($uri, $this->routes[$requestType])) {
return $this->routes[$requestType][$uri];
}
- // throw new Exception('No route defined for this URI: "'.$uri.'"');
-
die(http_response_code(404));
}
}
diff --git a/bootstrap/Routes.php b/bootstrap/Routes.php
deleted file mode 100644
index 33576e4..0000000
--- a/bootstrap/Routes.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/* public routes */
-
-$router->get('', '../controllers/index.controller.php');
-$router->get('contact', '../controllers/contact.controller.php');
-$router->get('wall', '../controllers/wall.controller.php');
-$router->get('comments', '../controllers/comments.controller.php');
-$router->get('about', '../controllers/about.controller.php');
-$router->get('hashget', '../controllers/comments.controller.php');
-$router->get('hashover', '../controllers/comments.controller.php');
-
-$router->head('', '../controllers/index.controller.php');
-$router->head('contact', '../controllers/contact.controller.php');
-$router->head('wall', '../controllers/wall.controller.php');
-$router->head('comments', '../controllers/comments.controller.php');
-$router->head('hashget', '../controllers/comments.controller.php');
-$router->head('hashover', '../controllers/comments.controller.php');
-
-$router->post('contact', '../controllers/contact.controller.php');
-$router->post('hashpost', '../controllers/comments.controller.php');
-
-/* backend routes */
-
-$router->get('latestajax', '../bootstrap/comments/backend/latest-ajax.php');
-$router->get('countlinkajax', '../bootstrap/comments/backend/count-link-ajax.php');
-
-$router->post('commentsajax', '../bootstrap/comments/backend/comments-ajax.php');
-$router->post('formactions', '../bootstrap/comments/backend/form-actions.php');
-$router->post('loadcomments', '../bootstrap/comments/backend/load-comments.php');
-$router->post('likecomment', '../bootstrap/comments/backend/like.php');
diff --git a/controllers/about.controller.php b/controllers/about.controller.php
deleted file mode 100644
index e65098f..0000000
--- a/controllers/about.controller.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-require '../views/about.view.php';
diff --git a/controllers/index.controller.php b/controllers/index.controller.php
deleted file mode 100644
index a4fa714..0000000
--- a/controllers/index.controller.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-require '../views/index.view.php';
diff --git a/controllers/wall.controller.php b/controllers/wall.controller.php
deleted file mode 100644
index bee3263..0000000
--- a/controllers/wall.controller.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-require '../views/wall.view.php';
diff --git a/generators/hugo/themes/edwin/layouts/partials/footer.html b/generators/hugo/themes/edwin/layouts/partials/footer.html
index 2126899..8fd74bf 100644
--- a/generators/hugo/themes/edwin/layouts/partials/footer.html
+++ b/generators/hugo/themes/edwin/layouts/partials/footer.html
@@ -1 +1 @@
-{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/footer.php'; ?>" }}
+{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/footer.php'; ?>" }}
diff --git a/generators/hugo/themes/edwin/layouts/partials/header.html b/generators/hugo/themes/edwin/layouts/partials/header.html
index 8e8a798..a93da0f 100644
--- a/generators/hugo/themes/edwin/layouts/partials/header.html
+++ b/generators/hugo/themes/edwin/layouts/partials/header.html
@@ -8,4 +8,4 @@
<title>{{- block "title" . }}{{ partial "title.html" . -}}{{- end }}</title>
- {{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/header.php'; ?>" }}
+ {{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/header.php'; ?>" }}
diff --git a/generators/hugo/themes/edwin/layouts/partials/navigator.html b/generators/hugo/themes/edwin/layouts/partials/navigator.html
index dfb8d4c..1b1829c 100644
--- a/generators/hugo/themes/edwin/layouts/partials/navigator.html
+++ b/generators/hugo/themes/edwin/layouts/partials/navigator.html
@@ -1 +1 @@
-{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/navigator.php'; ?>" }}
+{{ safeHTML "<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/app/views/partials/navigator.php'; ?>" }}
diff --git a/public/css/app.css b/public/dist/app.css
index 2a57771..2a57771 100644
--- a/public/css/app.css
+++ b/public/dist/app.css
diff --git a/public/index.php b/public/index.php
index 4f61001..0311f71 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,8 +1,6 @@
<?php
-/* start application */
require '../bootstrap/Bootstrap.php';
-/* load routes */
-require Router::load('../bootstrap/Routes.php')
+require Router::load('../app/Routes.php')
->direct(Request::uri(), Request::method());
diff --git a/public/js/app.js b/public/js/app.js
deleted file mode 100644
index e69de29..0000000
--- a/public/js/app.js
+++ /dev/null
diff --git a/views/partials/header.error.php b/views/partials/header.error.php
deleted file mode 100644
index 2aa019a..0000000
--- a/views/partials/header.error.php
+++ /dev/null
@@ -1,3 +0,0 @@
-
-<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/bootstrap/Bootstrap.php'; ?>
-<?php require $_SERVER['DOCUMENT_ROOT'] . '/..' . '/views/partials/header.php'; ?>