Skip to content

Commit

Permalink
env adjustments and readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dersonsena committed Mar 3, 2022
1 parent a301b46 commit 89282ba
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 75 deletions.
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ YII_ENV=dev
YII_DEBUG=true
REQUEST_COOKIE_VALIDATION_KEY=YOUR_VALIDATION_KEY
ADMIN_PASSWORD=
APP_TIMEZONE=America/Sao_Paulo
# APP_TIMEZONE=America/Sao_Paulo
# APP_LANGUAGE=pt_BR
APP_BASE_URL=http://localhost:8088

# ---------
Expand Down
43 changes: 27 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ The motivation to make this new template was to try to organize the packages ins
REQUIREMENTS
------------

The minimum requirement by this project template that your Web server supports PHP 7+.
The minimum requirement by this project template that your Web server supports PHP 8+.

RESOURCES
------------

- Nginx + PHP 8.1 with Docker using [Webdevops Images](https://github.com/webdevops/Dockerfile)
- PHP Unit 9.5
- Yii2 Bootstrap 5 Extension
- PHP Codesniffer 3.5
- PHP Codesniffer Fixer 3

INSTALLATION
------------
Expand All @@ -36,48 +45,48 @@ Make a copy of the `.env.sample` file, you can use `cp .env.sample .env` in your
You can place your environment settings in `.env` file, as below (note the sample file is ready to basic usage):

```bash
# ---------
# Project
# ---------
PROJECT_NAME=yii2-skeleton

# ---------
# Docker
# ---------
PROJECT_NAME=yii2-skeleton
DOCKER_APP_PORT=8080
DOCKER_APP_SSL_PORT=443
DOCKER_MYSQL_PORT=3306
XDEBUG_REMOTE_PORT=9000
XDEBUG_REMOTE_HOST=host.docker.internal

# ---------
# Yii Framework
# Application
# ---------
YII_DEBUG=true
YII_ENV=dev
YII_DEBUG=true
REQUEST_COOKIE_VALIDATION_KEY=YOUR_VALIDATION_KEY
ADMIN_PASSWORD=
# APP_TIMEZONE=America/Sao_Paulo
# APP_LANGUAGE=pt_BR
APP_BASE_URL=http://localhost:8088

# ---------
# Database
# ---------
DB_DSN=mysql:host=your-db-host;dbname=yii2_skeleton
DB_HOST=your-db-host
DB_USERNAME=root
DB_PASSWORD=secret
DB_DATABASE=yii2_skeleton
DB_CHARSET=utf8
DB_ENABLE_SCHEMA_CACHE=false
DB_DATABASE=your-db-name
DB_DATABASE_TEST=your-test-db-name
DB_SCHEMA_CACHE_DURATION=60
DB_SCHEMA_CACHE_NAME=cache

# ---------
# Mailer
# ---------
SMTP_HOST=
SMTP_PORT=
SMTP_PORT=465
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_ENCRYPTION=
SMTP_ENCRYPTION=ssl
```

**NOTE:** the commented environment variables are optional and your values set here is its default value.

### Run your Application

Before anything change `PROJECT_NAME` env variable to your project name/alias. This one it will be used to prefixed the application containers and other stuff.
Expand All @@ -88,6 +97,8 @@ To start your application and start up your containers just run the follow comma
make run
```

The command above will start 2 docker containers: `yii2-skeleton-app` (Nginx + PHP 8.1) and `yii2-skeleton-db` (MySQL)

If you have set a `DOCKER_APP_PORT` environment variable to `8000`, you will can then access the yout application through the following URL:

```
Expand Down
36 changes: 0 additions & 36 deletions codeception.yml

This file was deleted.

4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"phpcs": "phpcs --standard=phpcs.xml",
"phpcs:fix": "php-cs-fixer fix --config=.php-cs-fixer.php --allow-risky yes",
"phpcbf": "phpcbf -w -q > /dev/null || true",
"psalm": "psalm --show-info=true --threads=8",
"psalm:fix": "psalm --alter --issues=all",
"post-install-cmd": [
"yii\\composer\\Installer::postInstall"
],
Expand All @@ -27,7 +25,7 @@
]
},
"require": {
"php": "^8.1",
"php": ">=8",
"ext-intl": "*",
"ext-json": "*",
"yiisoft/yii2": "~2.0.45",
Expand Down
39 changes: 20 additions & 19 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
$config = [
'id' => 'yii2-skeleton',
'name' => 'Yii2 Skeleton',
'language' => $_ENV['APP_LANGUAGE'] ?? 'pt_BR',
'charset' => 'utf-8',
'timeZone' => $_ENV['APP_TIMEZONE'] ?? 'America/Sao_Paulo',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'App\Controllers',
Expand Down

0 comments on commit 89282ba

Please sign in to comment.