The `CWebUser` class in 1.1 is now replaced by [[yii\web\User]], and there is no more
The `CWebUser` class in 1.1 is now replaced by [[yii\web\User]], and there is no more
`CUserIdentity` class. Instead, you should implement the [[yii\web\IdentityInterface]] which
`CUserIdentity` class. Instead, you should implement the [[yii\web\IdentityInterface]] which
is much more straightforward to use. The advanced application template provides such an example.
is much more straightforward to use. The advanced project template provides such an example.
Please refer to the [Authentication](security-authentication.md), [Authorization](security-authorization.md), and [Advanced Application Template](tutorial-advanced-app.md) sections for more details.
Please refer to the [Authentication](security-authentication.md), [Authorization](security-authorization.md), and [Advanced Project Template](tutorial-advanced-app.md) sections for more details.
@ -8,7 +8,7 @@ Authentication is the act of verifying who a user is, and is the basis of the lo
In Yii, this entire process is performed semi-automatically, leaving the developer to merely implement [[yii\web\IdentityInterface]], the most important class in the authentication system. Typically, implementation of `IdentityInterface` is accomplished using the `User` model.
In Yii, this entire process is performed semi-automatically, leaving the developer to merely implement [[yii\web\IdentityInterface]], the most important class in the authentication system. Typically, implementation of `IdentityInterface` is accomplished using the `User` model.
You can find a fully featured example of authentication in the
You can find a fully featured example of authentication in the
[advanced application template](tutorial-advanced-app.md). Below, only the interface methods are listed:
[advanced project template](tutorial-advanced-app.md). Below, only the interface methods are listed:
```php
```php
class User extends ActiveRecord implements IdentityInterface
class User extends ActiveRecord implements IdentityInterface
You can install Yii in two ways, using the [Composer](http://getcomposer.org/) package manager or by downloading an archive file.
You can install Yii in two ways, using the [Composer](http://getcomposer.org/) package manager or by downloading an archive file.
The former is the preferred way, as it allows you to install new [extensions](structure-extensions.md) or update Yii by simply running a single command.
The former is the preferred way, as it allows you to install new [extensions](structure-extensions.md) or update Yii by simply running a single command.
Standard installations of Yii result in both the framework and an application template being downloaded and installed.
Standard installations of Yii result in both the framework and a project template being downloaded and installed.
An application template is a working Yii application implementing some basic features, such as login, contact form, etc.
A project template is a working Yii project implementing some basic features, such as login, contact form, etc.
Its code is organized in a recommended way. Therefore, it can serve as a good starting point for your projects.
Its code is organized in a recommended way. Therefore, it can serve as a good starting point for your projects.
In this and the next few sections, we will describe how to install Yii with the so-called *Basic Application Template* and
In this and the next few sections, we will describe how to install Yii with the so-called *Basic Project Template* and
how to implement new features on top of this template. Yii also provides another template called
how to implement new features on top of this template. Yii also provides another template called
the [Advanced Application Template](tutorial-advanced-app.md) which is better used in a team development environment
the [Advanced Project Template](tutorial-advanced-app.md) which is better used in a team development environment
to develop applications with multiple tiers.
to develop applications with multiple tiers.
> Info: The Basic Application Template is suitable for developing 90 percent of Web applications. It differs
> Info: The Basic Project Template is suitable for developing 90 percent of Web applications. It differs
from the Advanced Application Template mainly in how their code is organized. If you are new to Yii, we strongly
from the Advanced Project Template mainly in how their code is organized. If you are new to Yii, we strongly
recommend you stick to the Basic Application Template for its simplicity yet sufficient functionalities.
recommend you stick to the Basic Project Template for its simplicity yet sufficient functionalities.
Installing via Composer <spanid="installing-via-composer"></span>
Installing via Composer <spanid="installing-via-composer"></span>
@ -84,7 +84,7 @@ But there are other installation options available:
* If you only want to install the core framework and would like to build an entire application from scratch,
* If you only want to install the core framework and would like to build an entire application from scratch,
you may follow the instructions as explained in [Building Application from Scratch](tutorial-start-from-scratch.md).
you may follow the instructions as explained in [Building Application from Scratch](tutorial-start-from-scratch.md).
* If you want to start with a more sophisticated application, better suited to team development environments,
* If you want to start with a more sophisticated application, better suited to team development environments,
you may consider installing the [Advanced Application Template](tutorial-advanced-app.md).
you may consider installing the [Advanced Project Template](tutorial-advanced-app.md).
Verifying the Installation <spanid="verifying-installation"></span>
Verifying the Installation <spanid="verifying-installation"></span>
@ -8,7 +8,7 @@ The structure of console applications is very similar to a Yii web application.
or more [[yii\console\Controller]] classes, which are often referred to as "commands" in the console environment.
or more [[yii\console\Controller]] classes, which are often referred to as "commands" in the console environment.
Each controller can also have one or more actions, just like web controllers.
Each controller can also have one or more actions, just like web controllers.
Both Application templates already have a console application with them.
Both project templates already have a console application with them.
You can run it by calling the `yii` script, which is located in the base directory of the repository.
You can run it by calling the `yii` script, which is located in the base directory of the repository.
This will give you a list of available commands when you run it without any further parameters:
This will give you a list of available commands when you run it without any further parameters:
@ -95,7 +95,8 @@ As can be seen in the code above, the console application uses its own configura
you should configure various [application components](structure-application-components.md) and properties for the console application in particular.
you should configure various [application components](structure-application-components.md) and properties for the console application in particular.
If your web application and console application share a lot of configuration parameters and values, you may consider moving the common
If your web application and console application share a lot of configuration parameters and values, you may consider moving the common
parts into a separate file, and including this file in both of the application configurations (web and console). You can see an example of this in the "advanced" application template.
parts into a separate file, and including this file in both of the application configurations (web and console).
You can see an example of this in the "advanced" project template.
> Tip: Sometimes, you may want to run a console command using an application configuration that is different
> Tip: Sometimes, you may want to run a console command using an application configuration that is different
> from the one specified in the entry script. For example, you may want to use the `yii migrate` command to
> from the one specified in the entry script. For example, you may want to use the `yii migrate` command to
@ -6,7 +6,7 @@ Shared hosting environments are often quite limited about configuration and dire
Deploying a basic application
Deploying a basic application
---------------------------
---------------------------
Since in a shared hosting environment there's typically only one webroot, use the basic application template if you can. Refer to the [Installing Yii chapter](start-installation.md) and install the basic application template locally. After you have the application working locally, we'll make some adjustments so it can be hosted on your shared hosting server.
Since in a shared hosting environment there's typically only one webroot, use the basic project template if you can. Refer to the [Installing Yii chapter](start-installation.md) and install the basic project template locally. After you have the application working locally, we'll make some adjustments so it can be hosted on your shared hosting server.
In the above, `www` is your webserver webroot directory. It could be named differently. Common names are: `www`, `htdocs`, and `public_html`.
In the above, `www` is your webserver webroot directory. It could be named differently. Common names are: `www`, `htdocs`, and `public_html`.
The webroot in our basic application template is named `web`. Before uploading the application to your webserver rename your local webroot to match your server, i.e., from `web` to `www`, `public_html` or whatever the name of your hosting webroot.
The webroot in our basic project template is named `web`. Before uploading the application to your webserver rename your local webroot to match your server, i.e., from `web` to `www`, `public_html` or whatever the name of your hosting webroot.
- Bug #5577: formatting date and time values for years >=2038 or <=1901 on 32bit systems will not use intl extension but fall back to the PHP implementation (cebe)
- Bug #5577: formatting date and time values for years >=2038 or <=1901 on 32bit systems will not use intl extension but fall back to the PHP implementation (cebe)
- Bug #6080: Oracle DB schema did not load column types correctly (wenbin1989)
- Bug #6080: Oracle DB schema did not load column types correctly (wenbin1989)
- Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
- Bug #6404: advanced project template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
- Bug #6557: Link URLs generated by `yii\widgets\Menu` are not encoded (qiangxue)
- Bug #6557: Link URLs generated by `yii\widgets\Menu` are not encoded (qiangxue)
- Bug #6632:`yii\di\Container::get()` did not handle config parameter correctly when it is passed as a constructor parameter (qiangxue)
- Bug #6632:`yii\di\Container::get()` did not handle config parameter correctly when it is passed as a constructor parameter (qiangxue)
- Bug #6648: Added explicit type casting to avoid dblib issues on SQL Server 2014 (o-rey)
- Bug #6648: Added explicit type casting to avoid dblib issues on SQL Server 2014 (o-rey)
@ -779,7 +779,7 @@ Yii Framework 2 Change Log
- Bug #1654: Fixed the issue that a new message source object is generated for every new message being translated (qiangxue)
- Bug #1654: Fixed the issue that a new message source object is generated for every new message being translated (qiangxue)
- Bug #1582: Error messages shown via client-side validation should not be double encoded (qiangxue)
- Bug #1582: Error messages shown via client-side validation should not be double encoded (qiangxue)
- Bug #1591: StringValidator is accessing undefined property (qiangxue)
- Bug #1591: StringValidator is accessing undefined property (qiangxue)
- Bug #1597: Added `enableAutoLogin` to basic and advanced application templates so "remember me" now works properly (samdark)
- Bug #1597: Added `enableAutoLogin` to basic and advanced project templates so "remember me" now works properly (samdark)
- Bug #1631: Charset is now explicitly set to UTF-8 when serving JSON (samdark)
- Bug #1631: Charset is now explicitly set to UTF-8 when serving JSON (samdark)
- Enh #1646: Added postgresql `QueryBuilder::checkIntegrity` and `QueryBuilder::resetSequence` (Ragazzo)
- Enh #1646: Added postgresql `QueryBuilder::checkIntegrity` and `QueryBuilder::resetSequence` (Ragazzo)
@ -930,7 +930,7 @@ Yii Framework 2 Change Log
- Enh #2892: ActiveRecord dirty attributes are now reset after call to `afterSave()` so information about changed attributes is available in `afterSave`-event (cebe)
- Enh #2892: ActiveRecord dirty attributes are now reset after call to `afterSave()` so information about changed attributes is available in `afterSave`-event (cebe)