Yii3 - How to start

Comparing #63 with #64

Revision #64 was created by rackycz rackycz on Aug 30, 2026, 12:47:50 PM.

update

Content

[...]
You need to add special "cycle" dependencies to use the annotations. See composer.json in the deprecated yii3 demo:
- https://github.com/yiisoft/demo/blob/master/blog/composer.json
- https://cycle-orm.dev/docs/annotated-entity/current/en


## Yii3 - How to start ======

Yii3 offers more basic applications: Web, Console, API. I will be using the WEB application:
[...]
In this text I am mainly working with API endpoints, but UI will be presented later as well.

## .env files
 
 
There are quite a lot of `.env` files which was confusing. But in short:
 
- File `/.env.example` should be copied and renamed to `/.env` only if you are NOT using Docker = on old webhostings, or if you are using local installation of PHP (xampp, wampp etc)
 
- Then there are the `.env` files in the docker folder. To understand, just study file `./Makefile`. It is important to know that this file is here to call docker commands for you. Do not call docker manually. This is the important philosophy!
 
- In the `./Makefile` you will see command `include docker/.env` and below more `compose.yml` are loaded using the `-f` argument
 
- So `docker/.env` is only visible in files `compose.yml`
 
- If you need to inject any environment variable into your PHP application, you can see all used `.env` files for example in `docker/dev/compose.yml`.
 
 
 
## Running the demo application

You may be surprised that docker-compose.yml is missing in the root. Instead the "make up", "make stop" and "make down" commands are prepared.
If you run both basic commands as mentioned in the documentation:

- make composer update
[...]