This is a basic and simple project structure of MVC Design Pattern in PHP using Twig Template Engine, with other functions (Optional), as database connection Oracle (10g or 11g), MySQL (^5.5), MongoDB (^3.6), and authentication with MySQL.
[note] In this project, It's not focusing on front-end, and used only basic components of Bootstrap 4.3.
- PHP 7.0 or higher
- Composer Dependency Manager
- PHP Module PDO(mysql and oci)
- PHP Module mongodb
- App
- controller
- core
- model
- db
- entity
- finder
- view
- public
- css
- fonts
- img
- js
- vendor
- bin
- composer
- mongod
- symphony
- twig
- ...
For authentication with MySQL(inform the correct params in \php-mvc\App\core\config.ini), and follow these commands:
CREATE database yourdbname;(In insert command, You can use Controller Bcryptgenerator on the project to generate a bcryptedPassword, or other Bcrypter on the internet.)USE yourdbname;
CREATE TABLE users ( id bigint(20) NOT NULL AUTO_INCREMENT, username varchar(30) NOT NULL, password varchar(500) NOT NULL, status bit(1) NOT NULL DEFAULT 1, PRIMARY KEY (id) );
INSERT INTO users (username, password, status) VALUES ('yourusername', 'bcryptedPassword', 1);
composer updaterun project, and go to http://localhost/php-mvc