A Yii 2 Base Project Template
Features
-
Yii framework as the PHP MVC framework.
-
Security - It sets some headers that projects applications against click-jacking and XSS.
-
Assets version - This fixes issue with updates to js and css files and cached browser files.
-
New Relic - Ensures that the proper routes show up in the new relic monitoring dashboard.
-
Continuous Integration - Sample ant build.xml file that can be easily modified.
The minimum requirement by this project template that your Web server supports PHP 8.0.
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this project template using the following command:
composer global require "fxp/composer-asset-plugin:~1.4"
composer create-project --prefer-dist cottacush/yii2-base-project new_project
Sample Virtual Host Config for Apache
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot "<WebServer Root Dir>/yii2-base-project/app/web"
ServerName local.yii2-base-template.com
<Directory <WebServer Root Dir>/yii2-base-project/app/web>
AllowOverride all
Options -MultiViews
Require all granted
</Directory>
</VirtualHost>
Dependencies
Run build
ant
Make a copy of .env.sample
to .env
in the env directory.
This project is dockerized using the LEMP stack. The stack consists of:
- PHP 8
- nginx
Inspired by yii2-dockerized
- Ensure docker is running
- Change directory to project directory
- Run the command
docker-compose up
- To rebuild the containers after updates to docker config files, run
docker-compose up --build
- Run the command
docker ps
- Check the Container ID for container with image ending with "_web"
- Run the command
docker exec -it [container_id] bash
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email developers@cottacush.com instead of using the issue tracker.
- Adegoke Obasa goke@cottacush.com
- All Contributors
The MIT License (MIT). Please see License File for more information.