diff --git a/Application.php b/Application.php index 457b0e9..4d58452 100644 --- a/Application.php +++ b/Application.php @@ -5,9 +5,9 @@ * Time: 9:57 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; -use app\core\db\Database; +use thecodeholic\phpmvc\db\Database; /** * Class Application diff --git a/Controller.php b/Controller.php index 580ab22..c1da480 100644 --- a/Controller.php +++ b/Controller.php @@ -5,14 +5,14 @@ * Time: 8:43 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; -use app\core\middlewares\BaseMiddleware; +use thecodeholic\phpmvc\middlewares\BaseMiddleware; /** * Class Controller * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class Controller { @@ -20,7 +20,7 @@ class Controller public string $action = ''; /** - * @var \app\core\BaseMiddleware[] + * @var \thecodeholic\phpmvc\BaseMiddleware[] */ protected array $middlewares = []; @@ -40,7 +40,7 @@ public function registerMiddleware(BaseMiddleware $middleware) } /** - * @return \app\core\middlewares\BaseMiddleware[] + * @return \thecodeholic\phpmvc\middlewares\BaseMiddleware[] */ public function getMiddlewares(): array { diff --git a/Model.php b/Model.php index 547c8b9..685bc61 100644 --- a/Model.php +++ b/Model.php @@ -5,14 +5,14 @@ * Time: 9:16 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; /** * Class Model * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class Model { diff --git a/Request.php b/Request.php index 9e1f726..1e4c7b8 100644 --- a/Request.php +++ b/Request.php @@ -5,7 +5,7 @@ * Time: 10:23 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; /** diff --git a/Response.php b/Response.php index 58249d8..5c40141 100644 --- a/Response.php +++ b/Response.php @@ -5,14 +5,14 @@ * Time: 10:53 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; /** * Class Response * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class Response { diff --git a/Router.php b/Router.php index db7b02f..d957999 100644 --- a/Router.php +++ b/Router.php @@ -5,9 +5,9 @@ * Time: 10:01 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; -use app\core\exception\NotFoundException; +use thecodeholic\phpmvc\exception\NotFoundException; /** * Class Router @@ -50,7 +50,7 @@ public function resolve() } if (is_array($callback)) { /** - * @var $controller \app\core\Controller + * @var $controller \thecodeholic\phpmvc\Controller */ $controller = new $callback[0]; $controller->action = $callback[1]; diff --git a/Session.php b/Session.php index 5d10c63..a114585 100644 --- a/Session.php +++ b/Session.php @@ -5,14 +5,14 @@ * Time: 11:18 PM */ -namespace app\core; +namespace thecodeholic\phpmvc; /** * Class Session * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class Session { diff --git a/UserModel.php b/UserModel.php index 70a4a75..b9576c0 100644 --- a/UserModel.php +++ b/UserModel.php @@ -5,15 +5,15 @@ * Time: 10:13 AM */ -namespace app\core; +namespace thecodeholic\phpmvc; -use app\core\db\DbModel; +use thecodeholic\phpmvc\db\DbModel; /** * Class UserModel * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ abstract class UserModel extends DbModel { diff --git a/View.php b/View.php index 478bd90..2645fc3 100644 --- a/View.php +++ b/View.php @@ -5,14 +5,14 @@ * Time: 2:45 PM */ -namespace app\core; +namespace thecodeholic\phpmvc; /** * Class View * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class View { diff --git a/composer.json b/composer.json index 65173c3..355340c 100644 --- a/composer.json +++ b/composer.json @@ -6,5 +6,10 @@ "email": "zurasekhniashvili@gmail.com" } ], - "require": {} + "require": {}, + "autoload": { + "psr-4": { + "thecodeholic\\phpmvc": "." + } + } } diff --git a/db/Database.php b/db/Database.php index 9113f17..45796ff 100644 --- a/db/Database.php +++ b/db/Database.php @@ -5,16 +5,16 @@ * Time: 8:09 AM */ -namespace app\core\db; +namespace thecodeholic\phpmvc\db; -use app\core\Application; +use thecodeholic\phpmvc\Application; /** * Class Database * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class Database { diff --git a/db/DbModel.php b/db/DbModel.php index f3fcd8f..d65a42c 100644 --- a/db/DbModel.php +++ b/db/DbModel.php @@ -5,16 +5,16 @@ * Time: 9:19 AM */ -namespace app\core\db; +namespace thecodeholic\phpmvc\db; -use app\core\Application; -use app\core\Model; +use thecodeholic\phpmvc\Application; +use thecodeholic\phpmvc\Model; /** * Class DbModel * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ abstract class DbModel extends Model { diff --git a/exception/ForbiddenException.php b/exception/ForbiddenException.php index 9a931c3..20d1a2b 100644 --- a/exception/ForbiddenException.php +++ b/exception/ForbiddenException.php @@ -5,16 +5,16 @@ * Time: 11:35 AM */ -namespace app\core\exception; +namespace thecodeholic\phpmvc\exception; -use app\core\Application; +use thecodeholic\phpmvc\Application; /** * Class ForbiddenException * * @author Zura Sekhniashvili - * @package app\core\exception + * @package thecodeholic\phpmvc\exception */ class ForbiddenException extends \Exception { diff --git a/exception/NotFoundException.php b/exception/NotFoundException.php index c083a66..09484e2 100644 --- a/exception/NotFoundException.php +++ b/exception/NotFoundException.php @@ -5,14 +5,14 @@ * Time: 11:43 AM */ -namespace app\core\exception; +namespace thecodeholic\phpmvc\exception; /** * Class NotFoundException * * @author Zura Sekhniashvili - * @package app\core\exception + * @package thecodeholic\phpmvc\exception */ class NotFoundException extends \Exception { diff --git a/form/BaseField.php b/form/BaseField.php index 375d442..17c244a 100644 --- a/form/BaseField.php +++ b/form/BaseField.php @@ -5,16 +5,16 @@ * Time: 3:49 PM */ -namespace app\core\form; +namespace thecodeholic\phpmvc\form; -use app\core\Model; +use thecodeholic\phpmvc\Model; /** * Class BaseField * * @author Zura Sekhniashvili - * @package app\core\form + * @package thecodeholic\phpmvc\form */ abstract class BaseField { @@ -26,7 +26,7 @@ abstract class BaseField /** * Field constructor. * - * @param \app\core\Model $model + * @param \thecodeholic\phpmvc\Model $model * @param string $attribute */ public function __construct(Model $model, string $attribute) diff --git a/form/Field.php b/form/Field.php index 1e2dd6b..7c9bf04 100644 --- a/form/Field.php +++ b/form/Field.php @@ -5,10 +5,10 @@ * Time: 7:05 AM */ -namespace app\core\form; +namespace thecodeholic\phpmvc\form; -use app\core\Model; +use thecodeholic\phpmvc\Model; /** * Class Field @@ -25,7 +25,7 @@ class Field extends BaseField /** * Field constructor. * - * @param \app\core\Model $model + * @param \thecodeholic\phpmvc\Model $model * @param string $attribute */ public function __construct(Model $model, string $attribute) diff --git a/form/Form.php b/form/Form.php index e208b5b..7a926ff 100644 --- a/form/Form.php +++ b/form/Form.php @@ -5,10 +5,10 @@ * Time: 7:05 AM */ -namespace app\core\form; +namespace thecodeholic\phpmvc\form; -use app\core\Model; +use thecodeholic\phpmvc\Model; /** * Class Form diff --git a/form/TextareaField.php b/form/TextareaField.php index 19524ce..4f7a7b7 100644 --- a/form/TextareaField.php +++ b/form/TextareaField.php @@ -5,14 +5,14 @@ * Time: 3:49 PM */ -namespace app\core\form; +namespace thecodeholic\phpmvc\form; /** * Class TextareaField * * @author Zura Sekhniashvili - * @package app\core\form + * @package thecodeholic\phpmvc\form */ class TextareaField extends BaseField { diff --git a/middlewares/AuthMiddleware.php b/middlewares/AuthMiddleware.php index 6dfd7f3..1f8220e 100644 --- a/middlewares/AuthMiddleware.php +++ b/middlewares/AuthMiddleware.php @@ -5,17 +5,17 @@ * Time: 11:33 AM */ -namespace app\core\middlewares; +namespace thecodeholic\phpmvc\middlewares; -use app\core\Application; -use app\core\exception\ForbiddenException; +use thecodeholic\phpmvc\Application; +use thecodeholic\phpmvc\exception\ForbiddenException; /** * Class AuthMiddleware * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ class AuthMiddleware extends BaseMiddleware { diff --git a/middlewares/BaseMiddleware.php b/middlewares/BaseMiddleware.php index d8263ee..b1cba3c 100644 --- a/middlewares/BaseMiddleware.php +++ b/middlewares/BaseMiddleware.php @@ -5,14 +5,14 @@ * Time: 11:33 AM */ -namespace app\core\middlewares; +namespace thecodeholic\phpmvc\middlewares; /** * Class BaseMiddleware * * @author Zura Sekhniashvili - * @package app\core + * @package thecodeholic\phpmvc */ abstract class BaseMiddleware {