From 0f9beea9fdb11b00d3dca627720d7cf43e0eb0fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kezimana=20Aim=C3=A9=20Angelo?= Date: Thu, 14 Jan 2021 01:21:30 +0200 Subject: [PATCH] Change namespace into angelokezimana\elephpant --- composer.json | 2 +- controllers/AuthController.php | 10 +++++----- controllers/PageController.php | 8 ++++---- core/Application.php | 6 +++--- core/Controller.php | 8 ++++---- core/Model.php | 4 ++-- core/Request.php | 4 ++-- core/Response.php | 4 ++-- core/Router.php | 8 ++++---- core/Session.php | 4 ++-- core/UserModel.php | 6 +++--- core/View.php | 4 ++-- core/db/Database.php | 6 +++--- core/db/DbModel.php | 8 ++++---- core/exception/ForbiddenException.php | 4 ++-- core/exception/NotFoundException.php | 4 ++-- core/form/BaseField.php | 6 +++--- core/form/Form.php | 6 +++--- core/form/InputField.php | 6 +++--- core/form/TextareaField.php | 6 +++--- core/middlewares/AuthMiddleware.php | 8 ++++---- core/middlewares/BaseMiddleware.php | 4 ++-- migrations/m0001_initial.php | 4 ++-- migrations/m0002_add_password_column.php | 4 ++-- models/ContactForm.php | 2 +- models/LoginForm.php | 4 ++-- models/User.php | 2 +- public/index.php | 2 +- views/_error.phtml | 2 +- views/about.phtml | 2 +- views/contact.phtml | 8 ++++---- views/home.phtml | 2 +- views/layouts/main.phtml | 8 ++++---- views/login.phtml | 6 +++--- views/profile.phtml | 2 +- views/register.phtml | 6 +++--- 36 files changed, 90 insertions(+), 90 deletions(-) diff --git a/composer.json b/composer.json index 926cb6c..a2bb1a9 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "autoload": { "psr-4": { - "app\\": "./" + "angelokezimana\\elephpant": "." } }, "require": { diff --git a/controllers/AuthController.php b/controllers/AuthController.php index e9eb6f3..5bbf8d1 100644 --- a/controllers/AuthController.php +++ b/controllers/AuthController.php @@ -3,12 +3,12 @@ namespace app\controllers; use app\models\User; -use app\core\Request; -use app\core\Response; -use app\core\Controller; -use app\core\Application; +use angelokezimana\elephpant\Request; +use angelokezimana\elephpant\Response; +use angelokezimana\elephpant\Controller; +use angelokezimana\elephpant\Application; use app\models\LoginForm; -use app\core\middlewares\AuthMiddleware; +use angelokezimana\elephpant\middlewares\AuthMiddleware; /** * Class AuthController diff --git a/controllers/PageController.php b/controllers/PageController.php index 02eb2ba..cbf609e 100644 --- a/controllers/PageController.php +++ b/controllers/PageController.php @@ -2,10 +2,10 @@ namespace app\controllers; -use app\core\Request; -use app\core\Controller; -use app\core\Application; -use app\core\Response; +use angelokezimana\elephpant\Request; +use angelokezimana\elephpant\Controller; +use angelokezimana\elephpant\Application; +use angelokezimana\elephpant\Response; use app\models\ContactForm; /** diff --git a/core/Application.php b/core/Application.php index 247ea90..56f155d 100644 --- a/core/Application.php +++ b/core/Application.php @@ -1,14 +1,14 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Application { diff --git a/core/Controller.php b/core/Controller.php index 4c04e5f..95ba642 100644 --- a/core/Controller.php +++ b/core/Controller.php @@ -1,14 +1,14 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Controller { @@ -16,7 +16,7 @@ class Controller public string $action = ''; /** - * @var \app\core\middlewares\BaseMiddleware[] + * @var \angelokezimana\elephpant\middlewares\BaseMiddleware[] */ protected array $middlewares = []; diff --git a/core/Model.php b/core/Model.php index db8cf92..cc4ccb0 100644 --- a/core/Model.php +++ b/core/Model.php @@ -1,12 +1,12 @@ - * @package app\core + * @package angelokezimana\elephpant */ abstract class Model { diff --git a/core/Request.php b/core/Request.php index e16e836..49b6f44 100644 --- a/core/Request.php +++ b/core/Request.php @@ -1,12 +1,12 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Request { diff --git a/core/Response.php b/core/Response.php index 99e068d..dc5d4e4 100644 --- a/core/Response.php +++ b/core/Response.php @@ -1,12 +1,12 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Response { diff --git a/core/Router.php b/core/Router.php index 8a3a94b..5129b3f 100644 --- a/core/Router.php +++ b/core/Router.php @@ -1,14 +1,14 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Router { @@ -51,7 +51,7 @@ public function resolve() if (is_array($callback)) { /** - * @var \app\core\Controller $controller + * @var \angelokezimana\elephpant\Controller $controller */ $controller = new $callback[0](); Application::$app->controller = $controller; diff --git a/core/Session.php b/core/Session.php index 0df84b4..9259a27 100644 --- a/core/Session.php +++ b/core/Session.php @@ -1,12 +1,12 @@ - * @package app\core + * @package angelokezimana\elephpant */ class Session { diff --git a/core/UserModel.php b/core/UserModel.php index c41bc60..2b09297 100644 --- a/core/UserModel.php +++ b/core/UserModel.php @@ -1,14 +1,14 @@ - * @package app\core + * @package angelokezimana\elephpant */ abstract class UserModel extends DbModel { diff --git a/core/View.php b/core/View.php index 1b5e300..2483e6e 100644 --- a/core/View.php +++ b/core/View.php @@ -1,12 +1,12 @@ - * @package app\core + * @package angelokezimana\elephpant */ class View { diff --git a/core/db/Database.php b/core/db/Database.php index 2d6207b..840278b 100644 --- a/core/db/Database.php +++ b/core/db/Database.php @@ -1,14 +1,14 @@ - * @package app\core\db + * @package angelokezimana\elephpant\db */ class Database { diff --git a/core/db/DbModel.php b/core/db/DbModel.php index 9154275..0c1e2b1 100644 --- a/core/db/DbModel.php +++ b/core/db/DbModel.php @@ -1,15 +1,15 @@ - * @package app\core\db + * @package angelokezimana\elephpant\db */ abstract class DbModel extends Model { diff --git a/core/exception/ForbiddenException.php b/core/exception/ForbiddenException.php index a8cad96..7780ad6 100644 --- a/core/exception/ForbiddenException.php +++ b/core/exception/ForbiddenException.php @@ -1,12 +1,12 @@ - * @package app\core\exception + * @package angelokezimana\elephpant\exception */ class ForbiddenException extends \Exception { diff --git a/core/exception/NotFoundException.php b/core/exception/NotFoundException.php index 7206f18..48e3caa 100644 --- a/core/exception/NotFoundException.php +++ b/core/exception/NotFoundException.php @@ -1,12 +1,12 @@ - * @package app\core\exception + * @package angelokezimana\elephpant\exception */ class NotFoundException extends \Exception { diff --git a/core/form/BaseField.php b/core/form/BaseField.php index ed9c81d..d204eb1 100644 --- a/core/form/BaseField.php +++ b/core/form/BaseField.php @@ -1,14 +1,14 @@ - * @package app\core\form + * @package angelokezimana\elephpant\form */ abstract class BaseField { diff --git a/core/form/Form.php b/core/form/Form.php index d9931f2..c176a64 100644 --- a/core/form/Form.php +++ b/core/form/Form.php @@ -1,14 +1,14 @@ - * @package app\core\form + * @package angelokezimana\elephpant\form */ class Form { diff --git a/core/form/InputField.php b/core/form/InputField.php index 4cd1024..a7e1fda 100644 --- a/core/form/InputField.php +++ b/core/form/InputField.php @@ -1,14 +1,14 @@ - * @package app\core\form + * @package angelokezimana\elephpant\form */ class InputField extends BaseField { diff --git a/core/form/TextareaField.php b/core/form/TextareaField.php index 3ae4e59..ffe1de1 100644 --- a/core/form/TextareaField.php +++ b/core/form/TextareaField.php @@ -1,14 +1,14 @@ - * @package app\core\form + * @package angelokezimana\elephpant\form */ class TextareaField extends BaseField { diff --git a/core/middlewares/AuthMiddleware.php b/core/middlewares/AuthMiddleware.php index 27e541c..ef2dd6b 100644 --- a/core/middlewares/AuthMiddleware.php +++ b/core/middlewares/AuthMiddleware.php @@ -1,15 +1,15 @@ - * @package app\core\middlewares + * @package angelokezimana\elephpant\middlewares */ class AuthMiddleware extends BaseMiddleware { diff --git a/core/middlewares/BaseMiddleware.php b/core/middlewares/BaseMiddleware.php index 154a4e8..f4e8fff 100644 --- a/core/middlewares/BaseMiddleware.php +++ b/core/middlewares/BaseMiddleware.php @@ -1,12 +1,12 @@ - * @package app\core\middlewares + * @package angelokezimana\elephpant\middlewares */ abstract class BaseMiddleware { diff --git a/migrations/m0001_initial.php b/migrations/m0001_initial.php index 25dd659..1c4cf6c 100644 --- a/migrations/m0001_initial.php +++ b/migrations/m0001_initial.php @@ -4,7 +4,7 @@ class m0001_initial { public function up() { - $db = \app\core\Application::$app->db; + $db = \angelokezimana\elephpant\Application::$app->db; $SQL = "CREATE TABLE users ( `id` INT AUTO_INCREMENT, @@ -20,7 +20,7 @@ public function up() public function down() { - $db = \app\core\Application::$app->db; + $db = \angelokezimana\elephpant\Application::$app->db; $SQL = "DROP TABLE users;"; diff --git a/migrations/m0002_add_password_column.php b/migrations/m0002_add_password_column.php index a208281..e40f7c1 100644 --- a/migrations/m0002_add_password_column.php +++ b/migrations/m0002_add_password_column.php @@ -4,7 +4,7 @@ class m0002_add_password_column { public function up() { - $db = \app\core\Application::$app->db; + $db = \angelokezimana\elephpant\Application::$app->db; $SQL = "ALTER TABLE users ADD COLUMN `password` VARCHAR(512) NOT NULL;"; @@ -13,7 +13,7 @@ public function up() public function down() { - $db = \app\core\Application::$app->db; + $db = \angelokezimana\elephpant\Application::$app->db; $SQL = "ALTER TABLE users DROP COLUMN `password`;"; diff --git a/models/ContactForm.php b/models/ContactForm.php index 7372d14..c173ffd 100644 --- a/models/ContactForm.php +++ b/models/ContactForm.php @@ -2,7 +2,7 @@ namespace app\models; -use app\core\Model; +use angelokezimana\elephpant\Model; /** * Class ContactForm diff --git a/models/LoginForm.php b/models/LoginForm.php index 1142350..44926de 100644 --- a/models/LoginForm.php +++ b/models/LoginForm.php @@ -2,8 +2,8 @@ namespace app\models; -use app\core\Application; -use app\core\Model; +use angelokezimana\elephpant\Application; +use angelokezimana\elephpant\Model; /** * Class LoginForm diff --git a/models/User.php b/models/User.php index 0d1deb7..030cd4c 100644 --- a/models/User.php +++ b/models/User.php @@ -2,7 +2,7 @@ namespace app\models; -use app\core\UserModel; +use angelokezimana\elephpant\UserModel; /** * Class User diff --git a/public/index.php b/public/index.php index d76c3b4..29ae3ba 100644 --- a/public/index.php +++ b/public/index.php @@ -2,7 +2,7 @@ use app\controllers\AuthController; use app\controllers\PageController; -use app\core\Application; +use angelokezimana\elephpant\Application; require_once dirname(__DIR__) . '/vendor/autoload.php'; diff --git a/views/_error.phtml b/views/_error.phtml index 13c3492..94d1f5b 100644 --- a/views/_error.phtml +++ b/views/_error.phtml @@ -1,6 +1,6 @@ title = 'Error' ?> diff --git a/views/about.phtml b/views/about.phtml index 93a296c..67e2f8f 100644 --- a/views/about.phtml +++ b/views/about.phtml @@ -1,6 +1,6 @@ title = 'About' ?> diff --git a/views/contact.phtml b/views/contact.phtml index 0d909b5..fc1f85e 100644 --- a/views/contact.phtml +++ b/views/contact.phtml @@ -1,16 +1,16 @@ title = 'Contact' ?>

ELEPHPANT Project - contact

- + field($model, 'subject') ?> field($model, 'email') ?> - + - + diff --git a/views/home.phtml b/views/home.phtml index 7d61d21..e2c2610 100644 --- a/views/home.phtml +++ b/views/home.phtml @@ -1,6 +1,6 @@ title = 'Home' ?> diff --git a/views/layouts/main.phtml b/views/layouts/main.phtml index 2b35c95..37f3bdf 100644 --- a/views/layouts/main.phtml +++ b/views/layouts/main.phtml @@ -30,7 +30,7 @@ Contact us - +