From a3534702cdb8f74b2414b66d7ae835f5887c0bcb Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 18 Dec 2019 16:02:37 +0300 Subject: [PATCH 001/101] release version 2.0.31 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 324bd02ea..75d9c29ec 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.14", From eaabb0fdb496d4e990dc35357174d18324d4cc56 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 18 Dec 2019 16:02:55 +0300 Subject: [PATCH 002/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 75d9c29ec..324bd02ea 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.4.0", "yiisoft/yii2": "~2.0.14", From d9dd911eee10cf833b844dba25aa38e61ce5c98a Mon Sep 17 00:00:00 2001 From: Robert Korulczyk Date: Tue, 24 Dec 2019 11:09:46 +0100 Subject: [PATCH 003/101] Update PHP requirements after bumping Codeception (#219) --- README.md | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 28b0c2ed3..fe3c1528f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ DIRECTORY STRUCTURE REQUIREMENTS ------------ -The minimum requirement by this project template that your Web server supports PHP 5.4.0. +The minimum requirement by this project template that your Web server supports PHP 5.6.0. INSTALLATION diff --git a/composer.json b/composer.json index 324bd02ea..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "minimum-stability": "dev", "require": { - "php": ">=5.4.0", + "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", "yiisoft/yii2-bootstrap": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0" @@ -23,7 +23,7 @@ "yiisoft/yii2-debug": "~2.1.0", "yiisoft/yii2-gii": "~2.1.0", "yiisoft/yii2-faker": "~2.0.0", - "codeception/codeception": "4.0.x-dev | ^4.0", + "codeception/codeception": "^4.0", "codeception/verify": "~0.5.0 || ~1.1.0", "codeception/specify": "~0.4.6", "symfony/browser-kit": ">=2.7 <=4.2.4", From d6a48353cc3b8a548556da5c1594411ec0cfb06d Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 22 Jan 2020 01:38:32 +0300 Subject: [PATCH 004/101] release version 2.0.32 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From bc5fae6cc0c495cce6d2c095c4b321ca3ebb4fc4 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 22 Jan 2020 01:38:53 +0300 Subject: [PATCH 005/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From f6683cd10da3d39fe54ed04bf363846db8a809cc Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 24 Mar 2020 23:33:58 +0300 Subject: [PATCH 006/101] release version 2.0.33 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From 7efa02c17534260dd2a95a5d0a882ce5831354c4 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 24 Mar 2020 23:34:15 +0300 Subject: [PATCH 007/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From e7a77ad5b195e04b673daf6184d96e530e94beee Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 26 Mar 2020 23:53:44 +0300 Subject: [PATCH 008/101] release version 2.0.34 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From aeda534dfdd7d080a0fcb8d3dcbb486796da0e08 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 26 Mar 2020 23:54:01 +0300 Subject: [PATCH 009/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From ead01a9e66d5c018a72c494f87309efdfbb28bad Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 2 May 2020 14:23:27 +0300 Subject: [PATCH 010/101] release version 2.0.35 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From db08432751ba63fe2fe079271b222c07ec53c89c Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sat, 2 May 2020 14:23:46 +0300 Subject: [PATCH 011/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From 8a50308e089f4aa7bbe36df73dce15a80bfc64a9 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 25 Jun 2020 17:25:16 +0300 Subject: [PATCH 012/101] Update meta --- .github/FUNDING.yml | 1 + .github/SECURITY.md | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 .github/SECURITY.md diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c0c1cacbc..692239301 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,4 @@ # These are supported funding model platforms open_collective: yiisoft +tidelift: "packagist/yiisoft/yii2-app-basic" diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 000000000..f71384759 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,6 @@ +# Security Policy + +Please use the [security issue form](https://www.yiiframework.com/security) to report to us any security issue you find in Yii. +DO NOT use the issue tracker or discuss it in the public forum as it will cause more damage than help. + +Please note that as a non-commerial OpenSource project we are not able to pay bounties at the moment. From 06a1e468dc1e18c460d40b503166d613bc9083b6 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 8 Jul 2020 00:55:17 +0300 Subject: [PATCH 013/101] release version 2.0.36 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From beffef99246369b18415c5e8295396b801f68f7d Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 8 Jul 2020 00:55:35 +0300 Subject: [PATCH 014/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From c76b9a3bb9d56c27805c3dd758f173fc7b0f5c20 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 7 Aug 2020 23:21:27 +0300 Subject: [PATCH 015/101] release version 2.0.37 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From f5f03e1dced295f2de6aed52b760793dfe4b4ee5 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 7 Aug 2020 23:21:43 +0300 Subject: [PATCH 016/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From 988e7283a630abdc8c7b7928a19f9f9e81dbfef7 Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Fri, 4 Sep 2020 18:33:21 +0100 Subject: [PATCH 017/101] Cleaner bash-shell instructions to install MySQL (#228) --- vagrant/provision/once-as-root.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vagrant/provision/once-as-root.sh b/vagrant/provision/once-as-root.sh index 311d77b4c..ad596039d 100644 --- a/vagrant/provision/once-as-root.sh +++ b/vagrant/provision/once-as-root.sh @@ -22,8 +22,8 @@ info "Configure timezone" timedatectl set-timezone ${timezone} --no-ask-password info "Prepare root password for MySQL" -debconf-set-selections <<< "mariadb-server-10.0 mysql-server/root_password password \"''\"" -debconf-set-selections <<< "mariadb-server-10.0 mysql-server/root_password_again password \"''\"" +debconf-set-selections <<< 'mariadb-server mysql-server/root_password password' +debconf-set-selections <<< 'mariadb-server mysql-server/root_password_again password' echo "Done!" info "Update OS software" @@ -34,11 +34,11 @@ info "Install additional software" apt-get install -y php7.0-curl php7.0-cli php7.0-intl php7.0-mysqlnd php7.0-gd php7.0-fpm php7.0-mbstring php7.0-xml unzip nginx mariadb-server-10.0 php.xdebug info "Configure MySQL" -sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mariadb.conf.d/50-server.cnf -mysql -uroot <<< "CREATE USER 'root'@'%' IDENTIFIED BY ''" -mysql -uroot <<< "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'" -mysql -uroot <<< "DROP USER 'root'@'localhost'" -mysql -uroot <<< "FLUSH PRIVILEGES" +sed -i 's/.*bind-address.*/bind-address = 0.0.0.0/' /etc/mysql/mariadb.conf.d/50-server.cnf +mysql <<< "CREATE USER 'root'@'%' IDENTIFIED BY ''" +mysql <<< "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'" +mysql <<< "DROP USER 'root'@'localhost'" +mysql <<< 'FLUSH PRIVILEGES' echo "Done!" info "Configure PHP-FPM" @@ -67,8 +67,8 @@ rm /etc/nginx/sites-enabled/default echo "Done!" info "Initailize databases for MySQL" -mysql -uroot <<< "CREATE DATABASE yii2basic" -mysql -uroot <<< "CREATE DATABASE yii2basic_test" +mysql <<< 'CREATE DATABASE yii2basic' +mysql <<< 'CREATE DATABASE yii2basic_test' echo "Done!" info "Install composer" From eb265a4edb6020d3439eb6f3c7a5d041141d4428 Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Fri, 4 Sep 2020 20:19:20 +0100 Subject: [PATCH 018/101] Add virtual machine IP to the Yii2 "allowedIPs" (#229) --- Vagrantfile | 2 +- vagrant/provision/once-as-root.sh | 4 +++ vagrant/provision/provision.awk | 50 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 vagrant/provision/provision.awk diff --git a/Vagrantfile b/Vagrantfile index 44fd76c6d..99c2a7831 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -72,7 +72,7 @@ Vagrant.configure(2) do |config| # config.vbguest.auto_update = false # provisioners - config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone']] + config.vm.provision 'shell', path: './vagrant/provision/once-as-root.sh', args: [options['timezone'], options['ip']] config.vm.provision 'shell', path: './vagrant/provision/once-as-vagrant.sh', args: [options['github_token']], privileged: false config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always' diff --git a/vagrant/provision/once-as-root.sh b/vagrant/provision/once-as-root.sh index ad596039d..689a7af39 100644 --- a/vagrant/provision/once-as-root.sh +++ b/vagrant/provision/once-as-root.sh @@ -3,6 +3,7 @@ #== Import script args == timezone=$(echo "$1") +readonly IP=$2 #== Bash helpers == @@ -21,6 +22,9 @@ export DEBIAN_FRONTEND=noninteractive info "Configure timezone" timedatectl set-timezone ${timezone} --no-ask-password +info "Add the VM IP to the list of allowed IPs" +awk -v ip=$IP -f /app/vagrant/provision/provision.awk /app/config/web.php + info "Prepare root password for MySQL" debconf-set-selections <<< 'mariadb-server mysql-server/root_password password' debconf-set-selections <<< 'mariadb-server mysql-server/root_password_again password' diff --git a/vagrant/provision/provision.awk b/vagrant/provision/provision.awk new file mode 100644 index 000000000..bcf44d3be --- /dev/null +++ b/vagrant/provision/provision.awk @@ -0,0 +1,50 @@ +### +# Modifying Yii2's files for Vagrant VM +# +# @author HA3IK +# @version 1.0.0 + +BEGIN { + print "AWK BEGINs its work:" + IGNORECASE = 1 + + # Correct IP - wildcard last octet + match(ip, /(([0-9]+\.)+)/, arr) + ip = arr[1] "*" +} +# BODY +{ + # Check if it's the same file + if (FILENAME != isFile["same"]){ + msg = "- Work with: " FILENAME + # Close a previous file + close(isFile["same"]) + # Delete previous data + delete isFile + # Save current file + isFile["same"] = FILENAME + # Define array index for the file + switch (FILENAME){ + case /config\/web\.php$/: + isFile["IsConfWeb"] = 1 + msg = msg " - add allowed IP: " ip + break + } + # Print the concatenated message for the file + print msg + } + + # IF config/web.php + if (isFile["IsConfWeb"]){ + # IF line has "allowedIPs" and doesn't has our IP + if (match($0, "allowedIPs") && !match($0, ip)){ + match($0, /([^\]]+)(.+)/, arr) + $0 = sprintf("%s, '%s'%s", arr[1], ip, arr[2]) + } + # Rewrite the file + print $0 > FILENAME + } +} +END { + print "AWK ENDs its work." +} From 9e0b45841baff3d212b0422e1d860f5eac98c20d Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Fri, 4 Sep 2020 23:42:12 +0100 Subject: [PATCH 019/101] Enh: Vagrant process is not interrupted, now, after the installation of each plugin (#227) --- Vagrantfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 99c2a7831..73a04c7c6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,9 +1,19 @@ require 'yaml' require 'fileutils' +required_plugins_installed = nil required_plugins = %w( vagrant-hostmanager vagrant-vbguest ) required_plugins.each do |plugin| - exec "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin + unless Vagrant.has_plugin? plugin + system "vagrant plugin install #{plugin}" + required_plugins_installed = true + end +end + +# IF plugin[s] was just installed - restart required +if required_plugins_installed + system "vagrant up" + exit end domains = { From 6c12534a70d23573a2e2a85cefaf53c76b29897e Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Sat, 5 Sep 2020 19:58:16 +0100 Subject: [PATCH 020/101] Bug: rm "blacklist" from the codeception.yml; corrected "TESTING" instruction in README.md (#231) --- README.md | 6 +++--- codeception.yml | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fe3c1528f..96832d7c1 100644 --- a/README.md +++ b/README.md @@ -221,13 +221,13 @@ to collect code coverage. You can run your tests and collect coverage with the f ``` #collect coverage for all tests -vendor/bin/codecept run -- --coverage-html --coverage-xml +vendor/bin/codecept run --coverage --coverage-html --coverage-xml #collect coverage only for unit tests -vendor/bin/codecept run unit -- --coverage-html --coverage-xml +vendor/bin/codecept run unit --coverage --coverage-html --coverage-xml #collect coverage for unit and functional tests -vendor/bin/codecept run functional,unit -- --coverage-html --coverage-xml +vendor/bin/codecept run functional,unit --coverage --coverage-html --coverage-xml ``` You can see code coverage output under the `tests/_output` directory. diff --git a/codeception.yml b/codeception.yml index d5aecb308..c8c21690d 100644 --- a/codeception.yml +++ b/codeception.yml @@ -25,12 +25,3 @@ modules: # - controllers/* # - commands/* # - mail/* -# blacklist: -# include: -# - assets/* -# - config/* -# - runtime/* -# - vendor/* -# - views/* -# - web/* -# - tests/* From e319588b18e9e056a714835190ab040887ec4319 Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Sun, 6 Sep 2020 13:54:51 +0100 Subject: [PATCH 021/101] Updated Vagrant box to Ubuntu 18.04 with PHP 7.2 etc (#176) (#230) --- Vagrantfile | 2 +- vagrant/nginx/app.conf | 2 +- vagrant/provision/always-as-root.sh | 4 ++-- vagrant/provision/once-as-root.sh | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 73a04c7c6..d752f5b92 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -41,7 +41,7 @@ end # vagrant configurate Vagrant.configure(2) do |config| # select the box - config.vm.box = 'bento/ubuntu-16.04' + config.vm.box = 'bento/ubuntu-18.04' # should we ask about box updates? config.vm.box_check_update = options['box_check_update'] diff --git a/vagrant/nginx/app.conf b/vagrant/nginx/app.conf index b22e66106..1bfc0d583 100644 --- a/vagrant/nginx/app.conf +++ b/vagrant/nginx/app.conf @@ -28,7 +28,7 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass 127.0.0.1:9000; - fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; try_files $uri =404; } diff --git a/vagrant/provision/always-as-root.sh b/vagrant/provision/always-as-root.sh index e5d8e33e1..17fb58421 100644 --- a/vagrant/provision/always-as-root.sh +++ b/vagrant/provision/always-as-root.sh @@ -13,6 +13,6 @@ function info { info "Provision-script user: `whoami`" info "Restart web-stack" -service php7.0-fpm restart +service php7.2-fpm restart service nginx restart -service mysql restart \ No newline at end of file +service mysql restart diff --git a/vagrant/provision/once-as-root.sh b/vagrant/provision/once-as-root.sh index 689a7af39..75cbf5a2c 100644 --- a/vagrant/provision/once-as-root.sh +++ b/vagrant/provision/once-as-root.sh @@ -35,7 +35,7 @@ apt-get update apt-get upgrade -y info "Install additional software" -apt-get install -y php7.0-curl php7.0-cli php7.0-intl php7.0-mysqlnd php7.0-gd php7.0-fpm php7.0-mbstring php7.0-xml unzip nginx mariadb-server-10.0 php.xdebug +apt-get install -y php7.2-curl php7.2-cli php7.2-intl php7.2-mysqlnd php7.2-gd php7.2-fpm php7.2-mbstring php7.2-xml unzip nginx mariadb-server-10.1 php.xdebug info "Configure MySQL" sed -i 's/.*bind-address.*/bind-address = 0.0.0.0/' /etc/mysql/mariadb.conf.d/50-server.cnf @@ -46,10 +46,10 @@ mysql <<< 'FLUSH PRIVILEGES' echo "Done!" info "Configure PHP-FPM" -sed -i 's/user = www-data/user = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf -sed -i 's/group = www-data/group = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf -sed -i 's/owner = www-data/owner = vagrant/g' /etc/php/7.0/fpm/pool.d/www.conf -cat << EOF > /etc/php/7.0/mods-available/xdebug.ini +sed -i 's/user = www-data/user = vagrant/g' /etc/php/7.2/fpm/pool.d/www.conf +sed -i 's/group = www-data/group = vagrant/g' /etc/php/7.2/fpm/pool.d/www.conf +sed -i 's/owner = www-data/owner = vagrant/g' /etc/php/7.2/fpm/pool.d/www.conf +cat << EOF > /etc/php/7.2/mods-available/xdebug.ini zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_connect_back=1 @@ -76,4 +76,4 @@ mysql <<< 'CREATE DATABASE yii2basic_test' echo "Done!" info "Install composer" -curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ No newline at end of file +curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer From 7cc58b3e39c80db99cdb1da0806847b05cabeb01 Mon Sep 17 00:00:00 2001 From: Nazar Holubovskyy Date: Tue, 8 Sep 2020 23:38:53 +0100 Subject: [PATCH 022/101] `yii2_basic_tests` database is renamed to `yii2basic_test` (#232) --- .travis.yml | 2 +- README.md | 2 +- config/test_db.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4583c1bf4..846a0ad8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ services: - mysql before_install: - - mysql -e 'CREATE DATABASE IF NOT EXISTS yii2_basic_tests;' + - mysql -e 'CREATE DATABASE IF NOT EXISTS yii2basic_test;' install: - travis_retry composer self-update && composer --version diff --git a/README.md b/README.md index 96832d7c1..116f82fd2 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ To execute acceptance tests do the following: docker run --net=host selenium/standalone-firefox:2.53.0 ``` -5. (Optional) Create `yii2_basic_tests` database and update it by applying migrations if you have them. +5. (Optional) Create `yii2basic_test` database and update it by applying migrations if you have them. ``` tests/bin/yii migrate diff --git a/config/test_db.php b/config/test_db.php index 5d213e135..f4290e0b0 100644 --- a/config/test_db.php +++ b/config/test_db.php @@ -1,6 +1,6 @@ Date: Thu, 10 Sep 2020 23:40:36 +0100 Subject: [PATCH 023/101] Bug: Repeat CLI command after Vagrant plugin[s] installation nonstop (#233) --- Vagrantfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index d752f5b92..258aea601 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,7 +12,8 @@ end # IF plugin[s] was just installed - restart required if required_plugins_installed - system "vagrant up" + # Get CLI command[s] and call again + system 'vagrant' + ARGV.to_s.gsub(/\[\"|\", \"|\"\]/, ' ') exit end From 60f6fa0f70738e54cb249a6e1635d37cb3577917 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Mon, 14 Sep 2020 07:14:26 -0300 Subject: [PATCH 024/101] Switch to GitHub actions (#234) --- .github/workflows/ci-linux.yml | 81 ++++++++++++++++++++++++++++++++ .github/workflows/ci-windows.yml | 76 ++++++++++++++++++++++++++++++ .travis.yml | 46 ------------------ README.md | 3 +- 4 files changed, 159 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/ci-linux.yml create mode 100644 .github/workflows/ci-windows.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 000000000..43b27b906 --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,81 @@ +on: + - pull_request + - push + +name: ci-linux + +jobs: + tests: + name: PHP ${{ matrix.php-version }} + env: + extensions: curl, dom, gd, imagick, intl, json, mbstring, libxml, xml, xmlwriter + key: cache-v1 + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: + - ubuntu-latest + + php-version: + - "5.6" + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup cache environment + id: cache-env + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + key: ${{ env.key }} + + - name: Cache extensions + uses: actions/cache@v1 + with: + path: ${{ steps.cache-env.outputs.dir }} + key: ${{ steps.cache-env.outputs.key }} + restore-keys: ${{ steps.cache-env.outputs.key }} + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + ini-values: date.timezone='UTC' + coverage: xdebug + tools: composer:v2, pecl + + - name: Determine composer cache directory on Linux + run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)" + + - name: Cache dependencies installed with composer + uses: actions/cache@v1 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + restore-keys: | + php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + + - name: Install dependencies with composer php PHP [5.6 - 7.4] + run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader + + - name: Run tests with codeception with coverage on Linux PHP [5.6 - 7.4] + run: | + sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php + php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & + vendor/bin/codecept run --coverage --coverage-xml + + - name: Upload code coverage scrutinizer on Linux PHP 7.4 + if: matrix.php-version == '7.4' + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml \ No newline at end of file diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 000000000..40a2a0c33 --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,76 @@ +on: + - pull_request + - push + +name: ci-windows + +jobs: + tests: + name: PHP ${{ matrix.php-version }} + env: + extensions: curl, dom, gd, intl, json, mbstring, libxml, xml, xmlwriter + key: cache-v1 + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: + - windows-latest + + php-version: + - "5.6" + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup cache environment + id: cache-env + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + key: ${{ env.key }} + + - name: Cache extensions + uses: actions/cache@v1 + with: + path: ${{ steps.cache-env.outputs.dir }} + key: ${{ steps.cache-env.outputs.key }} + restore-keys: ${{ steps.cache-env.outputs.key }} + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: ${{ env.extensions }} + ini-values: date.timezone='UTC' + coverage: xdebug + tools: composer:v2, pecl + + - name: Determine composer cache directory on Windows + run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer" + + - name: Cache dependencies installed with composer + uses: actions/cache@v1 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + restore-keys: | + php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + + - name: Install dependencies with composer php PHP [5.6 - 7.4] + run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader + + - name: Run tests with codeception on Windows PHP [5.6 - 7.4] + run: | + sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php + php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & + vendor/bin/codecept run + shell: bash \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 846a0ad8f..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: php - -matrix: - fast_finish: true - include: - - php: "7.3" - - php: "7.2" - - php: "7.1" - - php: "7.0" - - php: "5.6" - -# faster builds on new travis setup not using sudo -sudo: false - -# cache vendor dirs -cache: - directories: - - $HOME/.composer/cache - -services: - - mysql - -before_install: - - mysql -e 'CREATE DATABASE IF NOT EXISTS yii2basic_test;' - -install: - - travis_retry composer self-update && composer --version - - travis_retry composer update --dev --prefer-dist --no-interaction - # install php extensions - - | - if (php --version | grep -i HipHop > /dev/null); then - echo "Skipping imagick and gmagick tests on HHVM" - else - pear config-set preferred_state beta - printf "\n" | pecl install imagick - # gmagick is not installed on travis currently - #printf "\n" | pecl install gmagick - fi -# setup application: - - | - sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php - -script: - - | - php -S localhost:8080 -t web > /dev/null 2>&1 & - vendor/bin/codecept run diff --git a/README.md b/README.md index 116f82fd2..7674e3b62 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ features to your application. [![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) [![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) -[![Build Status](https://travis-ci.com/yiisoft/yii2-app-basic.svg?branch=master)](https://travis-ci.com/yiisoft/yii2-app-basic) +[![ci-linux](https://github.com/yiisoft/yii2-app-basic/workflows/ci-linux/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-linux) +[![ci-windows](https://github.com/yiisoft/yii2-app-basic/workflows/ci-windows/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-windows) DIRECTORY STRUCTURE ------------------- From e070a0ae31d156eb7211ec4fb50ed5bef414c1ff Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 15 Sep 2020 01:06:12 +0300 Subject: [PATCH 025/101] release version 2.0.38 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From b50d3e1dfe73985fb84b54a61a18eb74bb60b1fa Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 15 Sep 2020 01:06:27 +0300 Subject: [PATCH 026/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From d969d6cdf6bbd4be7052281c2a03da0e08b63f72 Mon Sep 17 00:00:00 2001 From: Gildus <72762+Gildus@users.noreply.github.com> Date: Wed, 28 Oct 2020 15:14:23 -0500 Subject: [PATCH 027/101] Upgrade PHP version in docker-compose to 7.2 (#238) --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c3800ff53..d943939f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ version: '2' services: php: - image: yiisoftware/yii2-php:7.1-apache + image: yiisoftware/yii2-php:7.2-apache volumes: - ~/.composer-docker/cache:/root/.composer/cache:delegated - ./:/app:delegated ports: - - '8000:80' \ No newline at end of file + - '8000:80' From f95f012873b7965d40a5fcf91fafff2db661c7a1 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 29 Oct 2020 10:59:47 +0300 Subject: [PATCH 028/101] Bump Docker PHP version --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d943939f7..86be3bd0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: php: - image: yiisoftware/yii2-php:7.2-apache + image: yiisoftware/yii2-php:7.4-apache volumes: - ~/.composer-docker/cache:/root/.composer/cache:delegated - ./:/app:delegated From 3fe4c34d62fb13ff69efd10a2fafda4433b251a7 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Sat, 31 Oct 2020 13:25:13 -0300 Subject: [PATCH 029/101] Update GitHub actions (#239) --- .github/workflows/{ci-linux.yml => build.yml} | 25 +++--- .github/workflows/ci-windows.yml | 76 ------------------- README.md | 3 +- 3 files changed, 11 insertions(+), 93 deletions(-) rename .github/workflows/{ci-linux.yml => build.yml} (69%) delete mode 100644 .github/workflows/ci-windows.yml diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/build.yml similarity index 69% rename from .github/workflows/ci-linux.yml rename to .github/workflows/build.yml index 43b27b906..848b870bf 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,11 @@ on: - pull_request - push -name: ci-linux +name: build jobs: tests: - name: PHP ${{ matrix.php-version }} + name: PHP ${{ matrix.php }} env: extensions: curl, dom, gd, imagick, intl, json, mbstring, libxml, xml, xmlwriter key: cache-v1 @@ -17,8 +17,9 @@ jobs: matrix: os: - ubuntu-latest + - windows-latest - php-version: + php: - "5.6" - "7.0" - "7.1" @@ -34,7 +35,7 @@ jobs: id: cache-env uses: shivammathur/cache-extensions@v1 with: - php-version: ${{ matrix.php-version }} + php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} key: ${{ env.key }} @@ -48,7 +49,7 @@ jobs: - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} + php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} ini-values: date.timezone='UTC' coverage: xdebug @@ -61,21 +62,15 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + key: php${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} restore-keys: | - php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + php${{ matrix.php }}-composer-${{ matrix.dependencies }}- - name: Install dependencies with composer php PHP [5.6 - 7.4] run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader - - name: Run tests with codeception with coverage on Linux PHP [5.6 - 7.4] + - name: Run tests with codeception run: | sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & - vendor/bin/codecept run --coverage --coverage-xml - - - name: Upload code coverage scrutinizer on Linux PHP 7.4 - if: matrix.php-version == '7.4' - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml \ No newline at end of file + vendor/bin/codecept run \ No newline at end of file diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml deleted file mode 100644 index 40a2a0c33..000000000 --- a/.github/workflows/ci-windows.yml +++ /dev/null @@ -1,76 +0,0 @@ -on: - - pull_request - - push - -name: ci-windows - -jobs: - tests: - name: PHP ${{ matrix.php-version }} - env: - extensions: curl, dom, gd, intl, json, mbstring, libxml, xml, xmlwriter - key: cache-v1 - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - windows-latest - - php-version: - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup cache environment - id: cache-env - uses: shivammathur/cache-extensions@v1 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - key: ${{ env.key }} - - - name: Cache extensions - uses: actions/cache@v1 - with: - path: ${{ steps.cache-env.outputs.dir }} - key: ${{ steps.cache-env.outputs.key }} - restore-keys: ${{ steps.cache-env.outputs.key }} - - - name: Install PHP with extensions - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: ${{ env.extensions }} - ini-values: date.timezone='UTC' - coverage: xdebug - tools: composer:v2, pecl - - - name: Determine composer cache directory on Windows - run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer" - - - name: Cache dependencies installed with composer - uses: actions/cache@v1 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- - - - name: Install dependencies with composer php PHP [5.6 - 7.4] - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader - - - name: Run tests with codeception on Windows PHP [5.6 - 7.4] - run: | - sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php - php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & - vendor/bin/codecept run - shell: bash \ No newline at end of file diff --git a/README.md b/README.md index 7674e3b62..6db290bfa 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ features to your application. [![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) [![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-app-basic.svg)](https://packagist.org/packages/yiisoft/yii2-app-basic) -[![ci-linux](https://github.com/yiisoft/yii2-app-basic/workflows/ci-linux/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-linux) -[![ci-windows](https://github.com/yiisoft/yii2-app-basic/workflows/ci-windows/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Aci-windows) +[![build](https://github.com/yiisoft/yii2-app-basic/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Abuild) DIRECTORY STRUCTURE ------------------- From 0df2109420576d4622d090da67594cd101f8fece Mon Sep 17 00:00:00 2001 From: Wilmer Arambula <42547589+terabytesoftw@users.noreply.github.com> Date: Sat, 31 Oct 2020 14:17:46 -0300 Subject: [PATCH 030/101] Add names to tests * Fix minor corrections. * Add shell bash. * Fix minor corrections. --- .github/workflows/build.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 848b870bf..c2b6bd92e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,9 +6,10 @@ name: build jobs: tests: - name: PHP ${{ matrix.php }} + name: PHP ${{ matrix.php }} - ${{ matrix.os }} + env: - extensions: curl, dom, gd, imagick, intl, json, mbstring, libxml, xml, xmlwriter + extensions: dom, json, gd, imagick key: cache-v1 runs-on: ${{ matrix.os }} @@ -52,12 +53,15 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} ini-values: date.timezone='UTC' - coverage: xdebug - tools: composer:v2, pecl - + - name: Determine composer cache directory on Linux + if: matrix.os == 'ubuntu-latest' run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)" + - name: Determine composer cache directory on Windows + if: matrix.os == 'windows-latest' + run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer" + - name: Cache dependencies installed with composer uses: actions/cache@v1 with: @@ -67,10 +71,11 @@ jobs: php${{ matrix.php }}-composer-${{ matrix.dependencies }}- - name: Install dependencies with composer php PHP [5.6 - 7.4] - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader + run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - name: Run tests with codeception run: | sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & - vendor/bin/codecept run \ No newline at end of file + vendor/bin/codecept run + shell: bash \ No newline at end of file From e27be4eaf4d7c7278ff596600521ce13d3e830e1 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 10 Nov 2020 14:07:36 +0300 Subject: [PATCH 031/101] release version 2.0.39 --- composer.json | 2 +- models/LoginForm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", diff --git a/models/LoginForm.php b/models/LoginForm.php index cc6af264c..66d658068 100644 --- a/models/LoginForm.php +++ b/models/LoginForm.php @@ -8,7 +8,7 @@ /** * LoginForm is the model behind the login form. * - * @property User|null $user This property is read-only. + * @property-read User|null $user This property is read-only. * */ class LoginForm extends Model From 7959d142a71ce598ee01cae3e81489d7de2be5b6 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 10 Nov 2020 14:07:54 +0300 Subject: [PATCH 032/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From a56693d88f893595d902c55f399355b80acbbac2 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 16 Nov 2020 16:22:10 +0300 Subject: [PATCH 033/101] Do not mock contact form in test --- tests/unit/models/ContactFormTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/unit/models/ContactFormTest.php b/tests/unit/models/ContactFormTest.php index 074448771..93313e4a6 100644 --- a/tests/unit/models/ContactFormTest.php +++ b/tests/unit/models/ContactFormTest.php @@ -7,7 +7,6 @@ class ContactFormTest extends \Codeception\Test\Unit { - private $model; /** * @var \UnitTester */ @@ -15,23 +14,17 @@ class ContactFormTest extends \Codeception\Test\Unit public function testEmailIsSentOnContact() { - /** @var ContactForm $model */ - $this->model = $this->getMockBuilder('app\models\ContactForm') - ->setMethods(['validate']) - ->getMock(); + $model = new ContactForm(); - $this->model->expects($this->once()) - ->method('validate') - ->willReturn(true); - - $this->model->attributes = [ + $model->attributes = [ 'name' => 'Tester', 'email' => 'tester@example.com', 'subject' => 'very important letter subject', 'body' => 'body of current message', + 'verifyCode' => 'testme', ]; - expect_that($this->model->contact('admin@example.com')); + expect_that($model->contact('admin@example.com')); // using Yii2 module actions to check email was sent $this->tester->seeEmailIsSent(); From 6b86dabfa33f93ccd3ae090dc95bd2cd1c8c356f Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 23 Dec 2020 18:52:36 +0300 Subject: [PATCH 034/101] release version 2.0.40 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From b1af6fa7f939281878551f5bed527144dfdc974b Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 23 Dec 2020 18:53:43 +0300 Subject: [PATCH 035/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From cc8f40eb7786c7c58f54bda2aca9e535ed3e6e69 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 4 Mar 2021 01:01:07 +0300 Subject: [PATCH 036/101] release version 2.0.41 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From 627f25c7b6caca80c14dd8307a6d124a4bf13c38 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 4 Mar 2021 01:01:53 +0300 Subject: [PATCH 037/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From d803a014050f53ad7d34a9d9670e973ac806b452 Mon Sep 17 00:00:00 2001 From: Toir427 Date: Wed, 17 Mar 2021 01:16:19 +0500 Subject: [PATCH 038/101] Fix GitHub action --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2b6bd92e..af144a0f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,16 +56,18 @@ jobs: - name: Determine composer cache directory on Linux if: matrix.os == 'ubuntu-latest' - run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)" + run: | + echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - name: Determine composer cache directory on Windows if: matrix.os == 'windows-latest' - run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer" + run: | + echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" >> $GITHUB_ENV - name: Cache dependencies installed with composer uses: actions/cache@v1 with: - path: ${{ env.COMPOSER_CACHE_DIR }} + path: ${{ steps.cache-env.outputs.dir }} key: php${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} restore-keys: | php${{ matrix.php }}-composer-${{ matrix.dependencies }}- @@ -78,4 +80,4 @@ jobs: sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" config/web.php php -S 127.0.0.1:8080 -t public > ./runtime/yii.log 2>&1 & vendor/bin/codecept run - shell: bash \ No newline at end of file + shell: bash From f9189eb40566ef1573a0a43eccf591520f8ea197 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 6 May 2021 00:17:22 +0300 Subject: [PATCH 039/101] release version 2.0.42 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..739328036 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "dev", + "minimum-stability": "stable", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From 53e83b061ca2fa4557de52b3d124e5c2634ab57a Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Thu, 6 May 2021 00:17:39 +0300 Subject: [PATCH 040/101] prepare for next release --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 739328036..d0a5e2889 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "minimum-stability": "stable", + "minimum-stability": "dev", "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", From e028d053c08abc15644261e77b5dae001c49d88b Mon Sep 17 00:00:00 2001 From: sinus Date: Sun, 9 May 2021 01:39:52 +0500 Subject: [PATCH 041/101] Update Gii (#247) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0a5e2889..1375c0105 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require-dev": { "yiisoft/yii2-debug": "~2.1.0", - "yiisoft/yii2-gii": "~2.1.0", + "yiisoft/yii2-gii": "~2.2.0", "yiisoft/yii2-faker": "~2.0.0", "codeception/codeception": "^4.0", "codeception/verify": "~0.5.0 || ~1.1.0", From 0f2ec249687180a87c95bbd0ca7acd88c67462ac Mon Sep 17 00:00:00 2001 From: Bizley Date: Wed, 19 May 2021 14:01:06 +0200 Subject: [PATCH 042/101] Fix #245: Use Bootstrap 4 (#248) --- .github/workflows/build.yml | 3 +- assets/AppAsset.php | 2 +- composer.json | 2 +- views/layouts/main.php | 36 +++++++++--------- views/site/contact.php | 6 +-- views/site/index.php | 10 ++--- views/site/login.php | 14 +++---- web/css/site.css | 73 +++++++++++-------------------------- widgets/Alert.php | 5 ++- 9 files changed, 61 insertions(+), 90 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af144a0f3..0671f8970 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: - "7.2" - "7.3" - "7.4" + - "8.0" steps: - name: Checkout @@ -72,7 +73,7 @@ jobs: restore-keys: | php${{ matrix.php }}-composer-${{ matrix.dependencies }}- - - name: Install dependencies with composer php PHP [5.6 - 7.4] + - name: Install dependencies with composer php PHP [5.6 - 8.0] run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - name: Run tests with codeception diff --git a/assets/AppAsset.php b/assets/AppAsset.php index 47932b165..3b950fe7d 100644 --- a/assets/AppAsset.php +++ b/assets/AppAsset.php @@ -26,6 +26,6 @@ class AppAsset extends AssetBundle ]; public $depends = [ 'yii\web\YiiAsset', - 'yii\bootstrap\BootstrapAsset', + 'yii\bootstrap4\BootstrapAsset', ]; } diff --git a/composer.json b/composer.json index 1375c0105..e3068b065 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "require": { "php": ">=5.6.0", "yiisoft/yii2": "~2.0.14", - "yiisoft/yii2-bootstrap": "~2.0.0", + "yiisoft/yii2-bootstrap4": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0" }, "require-dev": { diff --git a/views/layouts/main.php b/views/layouts/main.php index 87dfdcbc9..54d139995 100644 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -3,40 +3,39 @@ /* @var $this \yii\web\View */ /* @var $content string */ -use app\widgets\Alert; -use yii\helpers\Html; -use yii\bootstrap\Nav; -use yii\bootstrap\NavBar; -use yii\widgets\Breadcrumbs; use app\assets\AppAsset; +use app\widgets\Alert; +use yii\bootstrap4\Breadcrumbs; +use yii\bootstrap4\Html; +use yii\bootstrap4\Nav; +use yii\bootstrap4\NavBar; AppAsset::register($this); ?> beginPage() ?> - + - - + registerCsrfMetaTags() ?> <?= Html::encode($this->title) ?> head() ?> - + beginBody() ?> -
+
Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => [ - 'class' => 'navbar-inverse navbar-fixed-top', + 'class' => 'navbar navbar-expand-md navbar-dark bg-dark fixed-top', ], ]); echo Nav::widget([ - 'options' => ['class' => 'navbar-nav navbar-right'], + 'options' => ['class' => 'navbar-nav'], 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], @@ -45,7 +44,7 @@ ['label' => 'Login', 'url' => ['/site/login']] ) : ( '
  • ' - . Html::beginForm(['/site/logout'], 'post') + . Html::beginForm(['/site/logout'], 'post', ['class' => 'form-inline']) . Html::submitButton( 'Logout (' . Yii::$app->user->identity->username . ')', ['class' => 'btn btn-link logout'] @@ -57,7 +56,9 @@ ]); NavBar::end(); ?> +
  • +
    isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], @@ -65,13 +66,12 @@
    -
    + -