This is an app designed to create exercices than other people can respond to.
- PHP 8.3.11
- MariaDB 11.5.2
- Composer 2.7.8
- Xdebug 3.3.2
- Git 2.46.0
- Git Flow 0.4.1
- IDE: PhpStorm 2024.1.6
- Install PHP
- Install MariaDB
- Install Composer
- Install Git
- Install Xdebug
For Git Flow, it depends on which OS you are. If you are using Windows, it's all good, it already comes installed with git. For the others, follow this tutorial.
In this project, we have been using PhpStorm as our main IDE. You can use whatever you want but we recommend using this one. All the configuration below will be for it.
- Clone the repo and install the required dependencies
git clone https://github.com/CPNV-ES/MAW_Looper_DDS-GWI.git
cd MAW_Looper_DDS-GWI/
composer install
- Run tests present in tests/ folder
- Define PSR-12 in PhpStorm
- CodeSniffer
Define "Coding standard:" to PSR-12
- Code Style
- CodeSniffer
- Define the environment variables
vi app/Models/.env
DB_HOST="localhost"
DB_PORT="3306" # Generally 3306
DB_NAME=""
DB_USER=""
DB_PASSWORD=""
-
Run DB creation script on your Database (db/db_creation.sql)
-
Run PHP server
php -S localhost:8080
- Web Server: Apache
- PHP: 8.3.11
- Database: MariaDB
- Composer: For managing project dependencies
- Clone the repo
git clone https://github.com/CPNV-ES/MAW_Looper_DDS-GWI.git
cd MAW_Looper_DDS-GWI/
- Install dependencies
composer install
- Set-up environment variables
vi app/Models/.env
DB_HOST="localhost"
DB_PORT="3306" # Generally 3306
DB_NAME=""
DB_USER=""
DB_PASSWORD=""
-
Run DB creation script on your Database (db/db_creation.sql)
-
Apache
- Enable rewrite mod
sudo a2enmod rewrite sudo systemctl start apache2.service
- Update .htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # Redirect all traffic to /public RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L] # If the file or folder doesn't exists, redirect to /public/index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ public/index.php [QSA,L] </IfModule>
-
Adjust file permissions if necessary
sudo chown -R www-data:www-data ../MAW_Looper_DDS-GWI/
sudo chmod 755 ../MAW_Looper_DDS-GWI/
└── MAW_Looper_DDS-GWI/
├── app/
├── Controllers
├── Models
├── Views
└── Core/
├── Router.php
├── Model.php # Base Model class for other Models
└── Controller.php # Base Controller class for other Controllers
├── db # Contains all DB related files
├── docs
├── public/
├── css
├── img
├── js
└── index.php
└── tests # Contains code tests
Collaboration on this project is warmly welcomed.
-
If you have an issue concerning the project, please open an issue explaining with the maximum of details and with screens if possible.
-
If you want to add new features, correct existing code or anything else, open a new pull request. It will be treated as soon as possible. If your code is accepted, it will be pulled.
Make sure to explain as much as you can the news features or issues that you have !
Diogo (diogof648-dev) da Silva Fernandes - DDS
Geoffroy (Wildigg) Lothar Wildi - GWI
You can contact us at anytime by email :