From e75de72afd545c31e304ef366d99714a5828d0c8 Mon Sep 17 00:00:00 2001 From: xinatorus Date: Mon, 27 Apr 2020 21:07:31 +0200 Subject: [PATCH] project structure refactoring --- README.md | 1 - app/class/Route.php | 30 ------------------- app/{class => models}/AuthManager.php | 0 app/{class => models}/AutomationManager.php | 0 app/{class => models}/ChartJS.php | 0 app/{class => models}/ChartJS_Line.php | 0 app/{class => models}/ChartManager.php | 0 app/{class => models}/DB.php | 0 app/{class => models}/DashboardManager.php | 0 app/{class => models}/DeviceManager.php | 0 app/{class => models}/FallbackManager.php | 0 app/{class => models}/Form.php | 0 app/{class => models}/LanguageManager.php | 0 app/{class => models}/LogManager.php | 0 app/{class => models}/NetworkManager.php | 0 app/{class => models}/NotificationManager.php | 0 app/{class => models}/Partial.php | 0 app/{class => models}/RecordManager.php | 0 app/{class => models}/RoomManager.php | 0 app/{class => models}/SceneManager.php | 0 app/{class => models}/SubDeviceManager.php | 0 app/{class => models}/UserManager.php | 0 app/{class => models}/Utilities.php | 0 app/{ => views}/templates/automation.phtml | 0 app/{ => views}/templates/dashboard.phtml | 0 app/{ => views}/templates/home.phtml | 0 app/{ => views}/templates/loading.css | 0 app/{ => views}/templates/log.phtml | 0 app/{ => views}/templates/login.phtml | 0 .../templates/part/automationButton.phtml | 0 .../templates/part/automationCreate.phtml | 0 .../part/automationCreateFinal.phtml | 0 .../templates/part/automationEdit.phtml | 0 .../templates/part/dashboardButton.phtml | 0 .../templates/part/deviceButton.phtml | 0 .../templates/part/deviceDetail.phtml | 0 .../templates/part/deviceEdit.phtml | 0 app/{ => views}/templates/part/footer.phtml | 0 app/{ => views}/templates/part/head.phtml | 0 .../templates/part/loginForm.phtml | 0 app/{ => views}/templates/part/loginOta.phtml | 0 app/{ => views}/templates/part/menu.phtml | 0 .../templates/part/sceneButton.phtml | 0 .../templates/part/sceneCreate.phtml | 0 .../templates/part/sceneCreateFinal.phtml | 0 .../templates/part/sceneEdit.phtml | 0 app/{ => views}/templates/part/test.phtml | 0 app/{ => views}/templates/rooms.phtml | 0 app/{ => views}/templates/scene.phtml | 0 app/{ => views}/templates/setting.phtml | 0 .../vendor/GoogleAuthenticator.php | 0 {app/logs => logs}/.gitkeep | 0 52 files changed, 31 deletions(-) delete mode 100644 app/class/Route.php rename app/{class => models}/AuthManager.php (100%) rename app/{class => models}/AutomationManager.php (100%) rename app/{class => models}/ChartJS.php (100%) rename app/{class => models}/ChartJS_Line.php (100%) rename app/{class => models}/ChartManager.php (100%) rename app/{class => models}/DB.php (100%) rename app/{class => models}/DashboardManager.php (100%) rename app/{class => models}/DeviceManager.php (100%) rename app/{class => models}/FallbackManager.php (100%) rename app/{class => models}/Form.php (100%) rename app/{class => models}/LanguageManager.php (100%) rename app/{class => models}/LogManager.php (100%) rename app/{class => models}/NetworkManager.php (100%) rename app/{class => models}/NotificationManager.php (100%) rename app/{class => models}/Partial.php (100%) rename app/{class => models}/RecordManager.php (100%) rename app/{class => models}/RoomManager.php (100%) rename app/{class => models}/SceneManager.php (100%) rename app/{class => models}/SubDeviceManager.php (100%) rename app/{class => models}/UserManager.php (100%) rename app/{class => models}/Utilities.php (100%) rename app/{ => views}/templates/automation.phtml (100%) rename app/{ => views}/templates/dashboard.phtml (100%) rename app/{ => views}/templates/home.phtml (100%) rename app/{ => views}/templates/loading.css (100%) rename app/{ => views}/templates/log.phtml (100%) rename app/{ => views}/templates/login.phtml (100%) rename app/{ => views}/templates/part/automationButton.phtml (100%) rename app/{ => views}/templates/part/automationCreate.phtml (100%) rename app/{ => views}/templates/part/automationCreateFinal.phtml (100%) rename app/{ => views}/templates/part/automationEdit.phtml (100%) rename app/{ => views}/templates/part/dashboardButton.phtml (100%) rename app/{ => views}/templates/part/deviceButton.phtml (100%) rename app/{ => views}/templates/part/deviceDetail.phtml (100%) rename app/{ => views}/templates/part/deviceEdit.phtml (100%) rename app/{ => views}/templates/part/footer.phtml (100%) rename app/{ => views}/templates/part/head.phtml (100%) rename app/{ => views}/templates/part/loginForm.phtml (100%) rename app/{ => views}/templates/part/loginOta.phtml (100%) rename app/{ => views}/templates/part/menu.phtml (100%) rename app/{ => views}/templates/part/sceneButton.phtml (100%) rename app/{ => views}/templates/part/sceneCreate.phtml (100%) rename app/{ => views}/templates/part/sceneCreateFinal.phtml (100%) rename app/{ => views}/templates/part/sceneEdit.phtml (100%) rename app/{ => views}/templates/part/test.phtml (100%) rename app/{ => views}/templates/rooms.phtml (100%) rename app/{ => views}/templates/scene.phtml (100%) rename app/{ => views}/templates/setting.phtml (100%) rename {app => library}/vendor/GoogleAuthenticator.php (100%) rename {app/logs => logs}/.gitkeep (100%) diff --git a/README.md b/README.md index 08663a7..96ee397 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,6 @@ Project Link: [https://github.com/GamerClassN7/Smart_Home/](https://github.com/G - /controllers - UserController.php - /library # helpers etc. - - Mailer.php - /models - /types - Units.php diff --git a/app/class/Route.php b/app/class/Route.php deleted file mode 100644 index 17000c2..0000000 --- a/app/class/Route.php +++ /dev/null @@ -1,30 +0,0 @@ -urls[] = '/'.trim($url, '/'); - if (!empty($view)) { - $this->views[] = $view; - } - } - - function submit(){ - $urlGetParam = isset($_GET['url']) ? '/' . $_GET['url'] : '/'; - foreach ($this->urls as $urlKey => $urlValue) { - if ($urlValue === $urlGetParam) { - $useView = $this->views[$urlKey]; - new $useView(); - die(); - } - } - echo 'Not Fount 404'; - die(); - //TODO: 404 přidělat - } -} diff --git a/app/class/AuthManager.php b/app/models/AuthManager.php similarity index 100% rename from app/class/AuthManager.php rename to app/models/AuthManager.php diff --git a/app/class/AutomationManager.php b/app/models/AutomationManager.php similarity index 100% rename from app/class/AutomationManager.php rename to app/models/AutomationManager.php diff --git a/app/class/ChartJS.php b/app/models/ChartJS.php similarity index 100% rename from app/class/ChartJS.php rename to app/models/ChartJS.php diff --git a/app/class/ChartJS_Line.php b/app/models/ChartJS_Line.php similarity index 100% rename from app/class/ChartJS_Line.php rename to app/models/ChartJS_Line.php diff --git a/app/class/ChartManager.php b/app/models/ChartManager.php similarity index 100% rename from app/class/ChartManager.php rename to app/models/ChartManager.php diff --git a/app/class/DB.php b/app/models/DB.php similarity index 100% rename from app/class/DB.php rename to app/models/DB.php diff --git a/app/class/DashboardManager.php b/app/models/DashboardManager.php similarity index 100% rename from app/class/DashboardManager.php rename to app/models/DashboardManager.php diff --git a/app/class/DeviceManager.php b/app/models/DeviceManager.php similarity index 100% rename from app/class/DeviceManager.php rename to app/models/DeviceManager.php diff --git a/app/class/FallbackManager.php b/app/models/FallbackManager.php similarity index 100% rename from app/class/FallbackManager.php rename to app/models/FallbackManager.php diff --git a/app/class/Form.php b/app/models/Form.php similarity index 100% rename from app/class/Form.php rename to app/models/Form.php diff --git a/app/class/LanguageManager.php b/app/models/LanguageManager.php similarity index 100% rename from app/class/LanguageManager.php rename to app/models/LanguageManager.php diff --git a/app/class/LogManager.php b/app/models/LogManager.php similarity index 100% rename from app/class/LogManager.php rename to app/models/LogManager.php diff --git a/app/class/NetworkManager.php b/app/models/NetworkManager.php similarity index 100% rename from app/class/NetworkManager.php rename to app/models/NetworkManager.php diff --git a/app/class/NotificationManager.php b/app/models/NotificationManager.php similarity index 100% rename from app/class/NotificationManager.php rename to app/models/NotificationManager.php diff --git a/app/class/Partial.php b/app/models/Partial.php similarity index 100% rename from app/class/Partial.php rename to app/models/Partial.php diff --git a/app/class/RecordManager.php b/app/models/RecordManager.php similarity index 100% rename from app/class/RecordManager.php rename to app/models/RecordManager.php diff --git a/app/class/RoomManager.php b/app/models/RoomManager.php similarity index 100% rename from app/class/RoomManager.php rename to app/models/RoomManager.php diff --git a/app/class/SceneManager.php b/app/models/SceneManager.php similarity index 100% rename from app/class/SceneManager.php rename to app/models/SceneManager.php diff --git a/app/class/SubDeviceManager.php b/app/models/SubDeviceManager.php similarity index 100% rename from app/class/SubDeviceManager.php rename to app/models/SubDeviceManager.php diff --git a/app/class/UserManager.php b/app/models/UserManager.php similarity index 100% rename from app/class/UserManager.php rename to app/models/UserManager.php diff --git a/app/class/Utilities.php b/app/models/Utilities.php similarity index 100% rename from app/class/Utilities.php rename to app/models/Utilities.php diff --git a/app/templates/automation.phtml b/app/views/templates/automation.phtml similarity index 100% rename from app/templates/automation.phtml rename to app/views/templates/automation.phtml diff --git a/app/templates/dashboard.phtml b/app/views/templates/dashboard.phtml similarity index 100% rename from app/templates/dashboard.phtml rename to app/views/templates/dashboard.phtml diff --git a/app/templates/home.phtml b/app/views/templates/home.phtml similarity index 100% rename from app/templates/home.phtml rename to app/views/templates/home.phtml diff --git a/app/templates/loading.css b/app/views/templates/loading.css similarity index 100% rename from app/templates/loading.css rename to app/views/templates/loading.css diff --git a/app/templates/log.phtml b/app/views/templates/log.phtml similarity index 100% rename from app/templates/log.phtml rename to app/views/templates/log.phtml diff --git a/app/templates/login.phtml b/app/views/templates/login.phtml similarity index 100% rename from app/templates/login.phtml rename to app/views/templates/login.phtml diff --git a/app/templates/part/automationButton.phtml b/app/views/templates/part/automationButton.phtml similarity index 100% rename from app/templates/part/automationButton.phtml rename to app/views/templates/part/automationButton.phtml diff --git a/app/templates/part/automationCreate.phtml b/app/views/templates/part/automationCreate.phtml similarity index 100% rename from app/templates/part/automationCreate.phtml rename to app/views/templates/part/automationCreate.phtml diff --git a/app/templates/part/automationCreateFinal.phtml b/app/views/templates/part/automationCreateFinal.phtml similarity index 100% rename from app/templates/part/automationCreateFinal.phtml rename to app/views/templates/part/automationCreateFinal.phtml diff --git a/app/templates/part/automationEdit.phtml b/app/views/templates/part/automationEdit.phtml similarity index 100% rename from app/templates/part/automationEdit.phtml rename to app/views/templates/part/automationEdit.phtml diff --git a/app/templates/part/dashboardButton.phtml b/app/views/templates/part/dashboardButton.phtml similarity index 100% rename from app/templates/part/dashboardButton.phtml rename to app/views/templates/part/dashboardButton.phtml diff --git a/app/templates/part/deviceButton.phtml b/app/views/templates/part/deviceButton.phtml similarity index 100% rename from app/templates/part/deviceButton.phtml rename to app/views/templates/part/deviceButton.phtml diff --git a/app/templates/part/deviceDetail.phtml b/app/views/templates/part/deviceDetail.phtml similarity index 100% rename from app/templates/part/deviceDetail.phtml rename to app/views/templates/part/deviceDetail.phtml diff --git a/app/templates/part/deviceEdit.phtml b/app/views/templates/part/deviceEdit.phtml similarity index 100% rename from app/templates/part/deviceEdit.phtml rename to app/views/templates/part/deviceEdit.phtml diff --git a/app/templates/part/footer.phtml b/app/views/templates/part/footer.phtml similarity index 100% rename from app/templates/part/footer.phtml rename to app/views/templates/part/footer.phtml diff --git a/app/templates/part/head.phtml b/app/views/templates/part/head.phtml similarity index 100% rename from app/templates/part/head.phtml rename to app/views/templates/part/head.phtml diff --git a/app/templates/part/loginForm.phtml b/app/views/templates/part/loginForm.phtml similarity index 100% rename from app/templates/part/loginForm.phtml rename to app/views/templates/part/loginForm.phtml diff --git a/app/templates/part/loginOta.phtml b/app/views/templates/part/loginOta.phtml similarity index 100% rename from app/templates/part/loginOta.phtml rename to app/views/templates/part/loginOta.phtml diff --git a/app/templates/part/menu.phtml b/app/views/templates/part/menu.phtml similarity index 100% rename from app/templates/part/menu.phtml rename to app/views/templates/part/menu.phtml diff --git a/app/templates/part/sceneButton.phtml b/app/views/templates/part/sceneButton.phtml similarity index 100% rename from app/templates/part/sceneButton.phtml rename to app/views/templates/part/sceneButton.phtml diff --git a/app/templates/part/sceneCreate.phtml b/app/views/templates/part/sceneCreate.phtml similarity index 100% rename from app/templates/part/sceneCreate.phtml rename to app/views/templates/part/sceneCreate.phtml diff --git a/app/templates/part/sceneCreateFinal.phtml b/app/views/templates/part/sceneCreateFinal.phtml similarity index 100% rename from app/templates/part/sceneCreateFinal.phtml rename to app/views/templates/part/sceneCreateFinal.phtml diff --git a/app/templates/part/sceneEdit.phtml b/app/views/templates/part/sceneEdit.phtml similarity index 100% rename from app/templates/part/sceneEdit.phtml rename to app/views/templates/part/sceneEdit.phtml diff --git a/app/templates/part/test.phtml b/app/views/templates/part/test.phtml similarity index 100% rename from app/templates/part/test.phtml rename to app/views/templates/part/test.phtml diff --git a/app/templates/rooms.phtml b/app/views/templates/rooms.phtml similarity index 100% rename from app/templates/rooms.phtml rename to app/views/templates/rooms.phtml diff --git a/app/templates/scene.phtml b/app/views/templates/scene.phtml similarity index 100% rename from app/templates/scene.phtml rename to app/views/templates/scene.phtml diff --git a/app/templates/setting.phtml b/app/views/templates/setting.phtml similarity index 100% rename from app/templates/setting.phtml rename to app/views/templates/setting.phtml diff --git a/app/vendor/GoogleAuthenticator.php b/library/vendor/GoogleAuthenticator.php similarity index 100% rename from app/vendor/GoogleAuthenticator.php rename to library/vendor/GoogleAuthenticator.php diff --git a/app/logs/.gitkeep b/logs/.gitkeep similarity index 100% rename from app/logs/.gitkeep rename to logs/.gitkeep