Difference between #249 and #261 of
Yii v2 snippet guide

Changes

Title unchanged

Yii v2 snippet guide

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

**Intro**
 
---
 
Hi all!
 
 
**This article had to be split as I reached the max length. Second part is here: **
 
## My articles
 
Articles are separated into more files as there is the max lenght for each file on wiki.
 
 
* [Yii v1 for beginners](https://www.yiiframework.com/wiki/250/yii-for-beginners)
 
* [Yii v1 for beginners 2](https://www.yiiframework.com/wiki/462/yii-for-beginners-2)
 
* [Yii v2 snippet guide I](https://www.yiiframework.com/wiki/2552/yii-v2-snippet-guide)
-* [Yii v2 snippet guide II](https://www.yiiframework.com/wiki/2558/yii-v2-snippet-guide-ii)
 
* [Yii v2 snippet guide III
](https://www.yiiframework.com/wiki/255867/yii-v2-snippet-guide-ii)i)
 
* [Začínáme s PHP frameworkem Yii2 (I) česky - YouTube](https://youtu.be/ub06hNoL8B8)
 
 
**Intro**
 
---
 
Hi all!
This snippet guide works with the basic Yii demo application and enhances it. It continues in my series of simple Yii tutorials. Previous two contain basic info about MVC concept, exporting to Excel and other topics so read them as well, but they are meant for Yii v1. I started with them cca in year 2011:
 
 
- [https://www.yiiframework.com/wiki/250/yii-for-beginners](https://www.yiiframework.com/wiki/250/yii-for-beginners)
 
- [https://www.yiiframework.com/wiki/462/yii-for-beginners-2](https://www.yiiframework.com/wiki/462/yii-for-beginners-2)


... and today I am beginning with Yii 2 so I will also gather my snippets and publish them here so we all can quickly setup the yii-basic-demo just by copying and pasting. This is my goal - to show how-to without long descriptions.
[...]
---

I found these two pages where things are explained: [link](https://www.savjee.be/2019/04/gitlab-ci-deploy-to-ftp-with-lftp/) [link](https://stackoverflow.com/questions/49632077/use-gitlab-pipeline-to-push-data-to-ftpserver)
 and I just copied something. You only need to create file in your GitLab repository. It is named .gitlab-ci.yml and it should contain following code:.gitlab-ci.yml in the root of your repository with following content. It will fire a Pipeline job on commit using "LFTP client" automatically. If you want to do it manually, add "when:manual", see below.

```
[...]
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 ./ $TARGETFOLDER --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/ --exclude vendor --exclude web/assets --exclude web/index.php --exclude web/index-test.php
 --exclude .gitlab-ci.yml" only: - master   when: manual
 
``` I just added some exclusions (listed belowsee the code) 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 with DEBUG mode enabled. You 

 
**Important info:** Your FTP server might block foreign IPs. If this happens, your transfer will fail with error 530. You must fin
donut wanna have this file in productive environment
 
- exclude web/index-test.php = tests are only on your computer and in GIT
 
 
.
 
 
GitLab's IPs and whitelist them. [This link]( https://docs.gitlab.com/ee/user/gitlab_com/#ip-range) might help.

**User management + DB creation + login via DB**
[...]
```

.
 
 
.
 
 
**Tests - unit + opa** --- ... text ...
 
 
.
 
 
see next chapters ...

**Adding a google-like calendar**
[...]
**Next chapters had to be moved to a new article!**
---

 
 
**See:**
 
 
- [https://www.yiiframework.com/wiki/2558/yii-v2-snippet-guide-ii](https://www.yiiframework.com/wiki/2558/yii-v2-snippet-guide-ii)
7 0
4 followers
Viewed: 254 810 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: 5 months ago
Update Article

Revisions

View all history