Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
60d89fc
Make template compatible with PHP 8.1 and Codeception 5 (#259)
developedsoftware Feb 24, 2022
94bfe89
Update to PHP 7.4 and codeception/verify 2.2 (#260)
developedsoftware Feb 25, 2022
6720c62
Add missing file '/mail/layouts/text.php' (#261)
WinterSilence Apr 26, 2022
24d97b9
Removed Swiftmailer dependency (#264)
luke- Jun 17, 2022
9d3b845
Update composer depedencies to be the same as the advanced applicatio…
developedsoftware Jun 17, 2022
69461fc
replace "codeception/codeception": "^5.0.0-alpha2" with "codeception/…
developedsoftware Jun 17, 2022
e30a4ab
Merge pull request #265 from developedsoftware/master
Jun 18, 2022
b306be7
update yii2 codeception module as its now a proper release (1.1.6)
developedsoftware Jun 21, 2022
024d638
Merge branch 'yiisoft:master' into master
developedsoftware Jun 21, 2022
27e20ee
Merge pull request #266 from developedsoftware/master
Jun 21, 2022
e35ea2e
Fix #267: Adjust main layout for Bootstrap5 (#268)
WinterSilence Aug 18, 2022
0bc68e8
release version 2.0.46
samdark Aug 18, 2022
d4d5c10
prepare for next release
samdark Aug 18, 2022
bfa08d4
Fix #275: Fix favicon link in views/layouts/main.php (#276)
WinterSilence Aug 24, 2022
da817e6
Fix #274: Fix PHP 8.0 dependency issue for new projects (#279)
lourdas Oct 13, 2022
ba107f7
Add debugger to console (#277)
nadar Oct 13, 2022
d85776a
Update PHP version in readme
samdark Oct 14, 2022
597e84a
Use https in links
samdark Nov 18, 2022
50d8576
release version 2.0.47
samdark Nov 18, 2022
adcbcfb
prepare for next release
samdark Nov 18, 2022
980c25e
Update codeception/module-filesystem to 3.0 (#283)
EmileBons Jan 17, 2023
6938fc4
Fix #285: Fix CSS issues in login form, homepage and form-group class…
lmsmartins Feb 27, 2023
943608d
update irc link
Arhell Apr 30, 2023
2dacc9f
Merge pull request #289 from Arhell/upd
Apr 30, 2023
332f794
update github folder link (#291)
Arhell May 2, 2023
5772c69
update assets folder links
Arhell May 3, 2023
0c4e780
Merge pull request #293 from Arhell/assets
May 4, 2023
1d80ebd
update commands folder links (#295)
Arhell May 7, 2023
37a259c
update tests folder links (#297)
Arhell May 10, 2023
7c56764
update views folder links (#299)
Arhell May 13, 2023
db7f923
update root folder links (#301)
Arhell May 15, 2023
eb38308
Update dependencies so app is installable with PHP 8.2
samdark May 22, 2023
d9b5bcc
prepare for next release
samdark May 22, 2023
6ee68d1
update irc link
Arhell Jun 14, 2023
150f77a
Merge pull request #302 from Arhell/upd
Jun 14, 2023
c083f40
release version 2.0.49
Aug 29, 2023
cf0fbf0
prepare for next release
Aug 29, 2023
645ec66
Remove explicit phpunit/phpunit requirement
particleflux Oct 13, 2023
c8ef769
Merge pull request #310 from particleflux/issue-308
bizley Oct 14, 2023
8dd081c
Fix #303: Remove composer.lock from .gitignore (#309)
particleflux Oct 19, 2023
530178d
release version 2.0.50
samdark May 30, 2024
a5a02bb
prepare for next release
samdark May 30, 2024
6073517
release version 2.0.51
samdark Jul 18, 2024
44e6fe4
prepare for next release
samdark Jul 18, 2024
510f0e2
Remove explicit version of symfony/browser-kit
samdark Sep 7, 2024
8a98089
Just adding space in comments for documentation
thtmorais Feb 13, 2025
9a211e7
Merge pull request #314 from thtmorais/patch-1
bizley Feb 13, 2025
fa65fe0
release version 2.0.52
samdark Feb 13, 2025
281a5dc
prepare for next release
samdark Feb 13, 2025
2b43020
Update cache version and PHP version in GH workflow action (#320)
fejan-malek Jun 9, 2025
2fedf51
release version 2.0.53
samdark Jun 27, 2025
9836ece
prepare for next release
samdark Jun 27, 2025
3c14e8b
Change: updated checkout version in GH from v2 to v5 (#321)
fejan-malek Aug 14, 2025
0f91f32
Fix codestyle (#322)
mspirkov Oct 27, 2025
db54e51
Exclude commits with CS changes from Git Blame (#323)
mspirkov Oct 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Reformat code te be PSR-2 compatible
93cc82c4bf42cea403e1acaab201338bea304b6e
# Convert to short syntax (array)
332030325fbad38a64c5e60980d3b14b6434d6dd
# Convert to short syntax
b0fcdfab1aecaeb620f75a83f15aa02bc25765a0
# Fix codestyle
0f91f32ecff52ef479addb0a5013342d59fe0697
11 changes: 6 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Ignore all test and documentation for archive
/.github export-ignore
/.gitattributes export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/docs export-ignore
/.github export-ignore
/.git-blame-ignore-revs export-ignore
/.gitattributes export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/docs export-ignore
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Contributing to Yii2

- [Report an issue](https://github.com/yiisoft/yii2/blob/master/docs/internals/report-an-issue.md)
- [Translate documentation or messages](https://github.com/yiisoft/yii2/blob/master/docs/internals/translation-workflow.md)
- [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Give us feedback or start a design discussion](https://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Contribute to the core code or fix bugs](https://github.com/yiisoft/yii2/blob/master/docs/internals/git-workflow.md)
17 changes: 8 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

env:
extensions: dom, json, gd, imagick
key: cache-v1
key: cache-v4

runs-on: ${{ matrix.os }}

Expand All @@ -21,17 +21,16 @@ jobs:
- windows-latest

php:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Setup cache environment
id: cache-env
Expand All @@ -42,7 +41,7 @@ jobs:
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
Expand All @@ -66,7 +65,7 @@ jobs:
echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ steps.cache-env.outputs.dir }}
key: php${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# phpstorm project files
.idea

# visual studio code project files
.vscode

# netbeans project files
nbproject

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<br>
</p>

Yii 2 Basic Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
Yii 2 Basic Project Template is a skeleton [Yii 2](https://www.yiiframework.com/) application best for
rapidly creating small projects.

The template contains the basic features including user login/logout and a contact page.
Expand Down Expand Up @@ -37,16 +37,16 @@ DIRECTORY STRUCTURE
REQUIREMENTS
------------

The minimum requirement by this project template that your Web server supports PHP 5.6.0.
The minimum requirement by this project template that your Web server supports PHP 7.4.


INSTALLATION
------------

### Install via Composer

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
If you do not have [Composer](https://getcomposer.org/), you may install it by following the instructions
at [getcomposer.org](https://getcomposer.org/doc/00-intro.md#installation-nix).

You can then install this project template using the following command:

Expand All @@ -63,7 +63,7 @@ http://localhost/basic/web/

### Install from an Archive File

Extract the archive file downloaded from [yiiframework.com](http://www.yiiframework.com/download/) to
Extract the archive file downloaded from [yiiframework.com](https://www.yiiframework.com/download/) to
a directory named `basic` that is directly under the Web root.

Set cookie validation key in `config/web.php` file to some random secret string:
Expand Down Expand Up @@ -131,7 +131,7 @@ return [
TESTING
-------

Tests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](http://codeception.com/).
Tests are located in `tests` directory. They are developed with [Codeception PHP Testing Framework](https://codeception.com/).
By default, there are 3 test suites:

- `unit`
Expand Down Expand Up @@ -164,7 +164,7 @@ To execute acceptance tests do the following:
composer update
```

4. Download [Selenium Server](http://www.seleniumhq.org/download/) and launch it:
4. Download [Selenium Server](https://www.seleniumhq.org/download/) and launch it:

```
java -jar ~/selenium-server-standalone-x.xx.x.jar
Expand Down
7 changes: 4 additions & 3 deletions assets/AppAsset.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @link http://www.yiiframework.com/
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @license https://www.yiiframework.com/license/
*/

namespace app\assets;
Expand All @@ -26,6 +27,6 @@ class AppAsset extends AssetBundle
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap4\BootstrapAsset',
'yii\bootstrap5\BootstrapAsset'
];
}
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ actor: Tester
bootstrap: _bootstrap.php
paths:
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
helpers: tests/_support
settings:
Expand Down
5 changes: 3 additions & 2 deletions commands/HelloController.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @link http://www.yiiframework.com/
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
* @license https://www.yiiframework.com/license/
*/

namespace app\commands;
Expand Down
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"homepage": "https://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"forum": "https://www.yiiframework.com/forum/",
"wiki": "https://www.yiiframework.com/wiki/",
"irc": "ircs://irc.libera.chat:6697/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.6.0",
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap4": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0"
"php": ">=7.4.0",
"yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-bootstrap5": "~2.0.2",
"yiisoft/yii2-symfonymailer": "~2.0.3"
},
"require-dev": {
"yiisoft/yii2-debug": "~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",
"codeception/specify": "~0.4.6",
"symfony/browser-kit": ">=2.7 <=4.2.4",
"codeception/module-filesystem": "^1.0.0",
"codeception/module-yii2": "^1.0.0",
"codeception/module-asserts": "^1.0.0"
"codeception/codeception": "^5.0.0 || ^4.0",
"codeception/lib-innerbrowser": "^4.0 || ^3.0 || ^1.1",
"codeception/module-asserts": "^3.0 || ^1.1",
"codeception/module-yii2": "^1.1",
"codeception/module-filesystem": "^3.0 || ^2.0 || ^1.1",
"codeception/verify": "^3.0 || ^2.2"
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer" : true
},
"process-timeout": 1800,
"fxp-asset": {
"enabled": false
Expand Down
12 changes: 7 additions & 5 deletions config/__autocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@
* }
* ```
*/
class Yii {
class Yii
{
/**
* @var \yii\web\Application|\yii\console\Application|__Application
*/
public static $app;
}

/**
* @property yii\rbac\DbManager $authManager
* @property yii\rbac\DbManager $authManager
* @property \yii\web\User|__WebUser $user
*
*/
class __Application {
class __Application
{
}

/**
* @property app\models\User $identity
*/
class __WebUser {
class __WebUser
{
}
8 changes: 8 additions & 0 deletions config/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
// configuration adjustments for 'dev' environment
// requires version `2.1.21` of yii2-debug module
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}

return $config;
5 changes: 5 additions & 0 deletions config/test.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/test_db.php';

Expand All @@ -16,7 +17,11 @@
'components' => [
'db' => $db,
'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true,
'messageClass' => 'yii\symfonymailer\Message'
],
'assetManager' => [
'basePath' => __DIR__ . '/../web/assets',
Expand Down
1 change: 1 addition & 0 deletions config/test_db.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

$db = require __DIR__ . '/db.php';
// test database! Important not to run tests on production or development databases
$db['dsn'] = 'mysql:host=localhost;dbname=yii2basic_test';
Expand Down
7 changes: 3 additions & 4 deletions config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure transport
// for the mailer to send real emails.
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true,
],
'log' => [
Expand Down
4 changes: 2 additions & 2 deletions controllers/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'class' => AccessControl::class,
'only' => ['logout'],
'rules' => [
[
Expand All @@ -30,7 +30,7 @@ public function behaviors()
],
],
'verbs' => [
'class' => VerbFilter::className(),
'class' => VerbFilter::class,
'actions' => [
'logout' => ['post'],
],
Expand Down
13 changes: 13 additions & 0 deletions mail/layouts/text.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/**
* @var yii\web\View $this view component instance
* @var yii\mail\BaseMessage $message the message being composed
* @var string $content main view render result
*/

$this->beginPage();
$this->beginBody();
echo $content;
$this->endBody();
$this->endPage();
2 changes: 1 addition & 1 deletion models/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function validatePassword($attribute, $params)
public function login()
{
if ($this->validate()) {
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
}
return false;
}
Expand Down
Loading