Yii v2 snippet guide

Comparing #136 with #137

Revision #137 was created by rackycz rackycz on Oct 4, 2019, 4:12:47 PM.

edit

Content

[...]
You only need to create 1 file in your GitLab repository. It is named .gitlab-ci.yml and it should contain following code:

```
variables:
HOST: "
url.to.my.ftpexample.com:21" USERNAME: "your_username" PASSWORD: "your_password" FOLDER: "relative path if needed or just ././project_root/web" deploy: script: - apt-get update -qq && apt-get install -y -qq lftp - lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST; mirror -Rnev ./ $FOLDER --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/" --exclude vendor --exclude web/assets --exclude web/index.php --exclude web/index-test.php"  only: - master ``` I just added **--exclude vendor**some exclusions (listed below) and will probably add **--delete** in the future. Read linked webs.  
- exclude vendor = huge folder with 3rd party SW which is not in GIT
 
- exclude web/assets = also some cache
 
- exclude web/index.php = in GIT is your devel index witn DEBU mode enabled. You dont wanna have this file in productive environment
 
- exclude web/index-test.php = tests are only on your computer and in GIT


**User management + DB creation + login via DB**
[...]
**Saving contact inqueries into DB**
---
```
SQLsql
DROP TABLE IF EXISTS `contact` ;

CREATE TABLE IF NOT EXISTS `contact` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
[...]