Skip to content

CottaCush/yii2-base-project

Repository files navigation

Yii2 Base Project

A Yii 2 Base Project Template

Latest Stable Version Total Downloads License

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.

Requirements

The minimum requirement by this project template that your Web server supports PHP 8.0.

Install via Composer

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

Virtual Host Setup

Windows Link 1 Link 2

Mac Link 1 Link 2

Debian Linux Link 1 Link 2

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>

Build

Dependencies

Run build

ant

Environment Variables

Make a copy of .env.sample to .env in the env directory.

Docker

This project is dockerized using the LEMP stack. The stack consists of:

  • PHP 8
  • nginx

Inspired by yii2-dockerized

Installation

Mac Windows Ubuntu

Running Containers

  • 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

Entering Container CLI

  • 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

Change log

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email developers@cottacush.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.