diff --git a/apps/advanced/common/models/User.php b/apps/advanced/common/models/User.php
index b3156a2..6f43b28 100644
--- a/apps/advanced/common/models/User.php
+++ b/apps/advanced/common/models/User.php
@@ -45,6 +45,20 @@ class User extends ActiveRecord implements IdentityInterface
     }
 
     /**
+      * @inheritdoc
+      */
+     public function rules()
+     {
+         return [
+             ['status', 'default', 'value' => self::STATUS_ACTIVE],
+             ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]],
+
+             ['role', 'default', 'value' => self::ROLE_USER],
+             ['role', 'in', 'range' => [self::ROLE_USER]],
+         ];
+     }
+
+    /**
      * @inheritdoc
      */
     public static function findIdentity($id)
diff --git a/apps/advanced/frontend/models/SignupForm.php b/apps/advanced/frontend/models/SignupForm.php
index 0597cbc..17bcdeb 100644
--- a/apps/advanced/frontend/models/SignupForm.php
+++ b/apps/advanced/frontend/models/SignupForm.php
@@ -48,7 +48,7 @@ class SignupForm extends Model
             $user->email = $this->email;
             $user->setPassword($this->password);
             $user->generateAuthKey();
-            $user->save(false);
+            $user->save();
             return $user;
         }
 
diff --git a/apps/advanced/init b/apps/advanced/init
index a82de27..4858321 100755
--- a/apps/advanced/init
+++ b/apps/advanced/init
@@ -5,7 +5,7 @@
  *
  * In order to run in non-interactive mode:
  *
- * init --env=dev --overwrite=n
+ * init --env=Development --overwrite=n
  *
  * @author Alexander Makarov <sam@rmcreative.ru>
  *
diff --git a/docs/documentation_style_guide.md b/docs/documentation_style_guide.md
new file mode 100644
index 0000000..f26a54f
--- /dev/null
+++ b/docs/documentation_style_guide.md
@@ -0,0 +1,27 @@
+# Yii Documentation Style Guide
+
+Guidelines to go by when writing or editing any Yii documentation.
+
+*This needs to be expanded.*
+
+## General Style
+
+* Try to use an active voice.
+* Use short, declarative sentences.
+* Demonstrate ideas using code as much as possible.
+* Never use "we". It's the Yii development team or the Yii core team. Better yet to put things in terms of the framework or the guide.
+* Use the Oxford comma (e.g., "this, that, and the other" not "this, that and the other").
+* Numeric lists should be complete sentences that end with periods (or other punctuation).
+* Bullet lists should be fragments that don't end with periods.
+
+## Formatting
+
+## References
+
+* Yii 2.0 or Yii 2 (not Yii2 or Yii2.0)
+* Each "page" of the guide is referred to as a "section".
+
+## Capitalizations
+
+* Web, not web
+* the guide or this guide, not the Guide
\ No newline at end of file
diff --git a/docs/guide/README.md b/docs/guide/README.md
index e8c54f5..afe817e 100644
--- a/docs/guide/README.md
+++ b/docs/guide/README.md
@@ -18,11 +18,13 @@ Introduction
 Getting Started
 ---------------
 
-* [Preparing Your Environment](start-environment.md)
-* [Creating Your First Yii Application](start-basic.md)
-* [Application Structure](start-structure.md)
-* [Request Lifecycle](start-lifecycle.md)
-* **TBD** [Next Steps](start-next-steps.md)
+* [Installing Yii](start-installation.md)
+* [Running Applications](start-workflow.md)
+* [Saying "Hello World"](start-hello-world.md)
+* [Working with Forms](start-forms.md)
+* [Working with Databases](start-databases.md)
+* [Generating Code with Gii](start-gii.md)
+* [Looking Ahead](start-looking-head.md)
 
 
 Application Structure
@@ -77,8 +79,8 @@ Working with Databases
 * **TBD** [ElasticSearch](db-elastic-search.md)
 
 
-Getting User Inputs
--------------------
+Getting Data from Users
+-----------------------
 
 * [Creating Forms](input-forms.md)
 * [Input Validation](input-validation.md)
@@ -86,7 +88,7 @@ Getting User Inputs
 * **TBD** [Inputs for Multiple Models](input-multiple-models.md)
 
 
-Presenting Data
+Displaying Data
 ---------------
 
 * **TBD** [Data Formatting](output-formatting.md)
@@ -190,7 +192,6 @@ Widgets
 * **TBD** [Jquery UI Widgets](jui-widgets.md)
 
 
-
 Helpers
 -------
 
diff --git a/docs/guide/bootstrap-widgets.md b/docs/guide/bootstrap-widgets.md
index a442989..ec33073 100644
--- a/docs/guide/bootstrap-widgets.md
+++ b/docs/guide/bootstrap-widgets.md
@@ -1,7 +1,7 @@
 Bootstrap Widgets
 =================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Out of the box, Yii includes support for the [Bootstrap 3](http://getbootstrap.com/) markup and components framework
 (also known as "Twitter Bootstrap"). Bootstrap is an excellent, responsive framework that can greatly speed up the
diff --git a/docs/guide/caching-overview.md b/docs/guide/caching-overview.md
index 5fcee7d..714cfd2 100644
--- a/docs/guide/caching-overview.md
+++ b/docs/guide/caching-overview.md
@@ -1,7 +1,7 @@
 Caching
 =======
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Caching is a cheap and effective way to improve the performance of a web application. By storing relatively
 static data in cache and serving it from cache when requested, the application saves the time required to generate the data from scratch. Caching is one of the best ways to improve the performance of your application, almost mandatory on any large-scale site.
diff --git a/docs/guide/concept-autoloading.md b/docs/guide/concept-autoloading.md
index 0e6bfb0..f6ca085 100644
--- a/docs/guide/concept-autoloading.md
+++ b/docs/guide/concept-autoloading.md
@@ -6,7 +6,7 @@ to locate and include required class files. It provides a high-performance class
 [PSR-4 standard](https://github.com/php-fig/fig-standards/blob/master/proposed/psr-4-autoloader/psr-4-autoloader.md).
 The autoloader is installed when you include the `Yii.php` file.
 
-> Note: For simplicity of description, in this chapter we will only talk about autoloading of classes. However, keep in
+> Note: For simplicity of description, in this section we will only talk about autoloading of classes. However, keep in
   mind that the content we are describing here applies to autoloading of interfaces and traits as well.
 
 
diff --git a/docs/guide/concept-behaviors.md b/docs/guide/concept-behaviors.md
index 28429ac..b18033f 100644
--- a/docs/guide/concept-behaviors.md
+++ b/docs/guide/concept-behaviors.md
@@ -15,7 +15,7 @@ Using Behaviors
 ---------------
 
 To use a behavior, you first need to attach it to a [[yii\base\Component|component]]. We will describe how to
-attach a behavior in the next section.
+attach a behavior in the next subsection.
 
 Once a behavior is attached to a component, its usage is straightforward.
 
@@ -129,7 +129,7 @@ $component->attachBehavior('myBehavior3', [
 ```
 
 You may also attach behaviors through [configurations](concept-configurations.md). For more details, please
-refer to the [Configurations](concept-configurations.md#configuration-format) chapter.
+refer to the [Configurations](concept-configurations.md#configuration-format) section.
 
 
 <a name="detaching-behaviors"></a>
@@ -184,7 +184,7 @@ class MyBehavior extends Behavior
 }
 ```
 
-The above code defines the behavior class `app\components\MyBehavior` which will provides two properties
+The above code defines the behavior class `app\components\MyBehavior` which will provide two properties
 `prop1` and `prop2`, and one method `foo()` to the component it is attached to. Note that property `prop2`
 is defined via the getter `getProp2()` and the setter `setProp2()`. This is so because [[yii\base\Object]]
 is an ancestor class of [[yii\base\Behavior]], which supports defining [properties](concept-properties.md) by getters/setters.
@@ -227,7 +227,7 @@ its handler `beforeValidate()`. When specifying an event handler, you may use on
 * an anonymous function.
 
 The signature of an event handler should be as follows, where `$event` refers to the event parameter. Please refer
-to the [Events](concept-events.md) chapter for more details about events.
+to the [Events](concept-events.md) section for more details about events.
 
 ```php
 function ($event) {
diff --git a/docs/guide/concept-configurations.md b/docs/guide/concept-configurations.md
index a846ad0..03ff3ce 100644
--- a/docs/guide/concept-configurations.md
+++ b/docs/guide/concept-configurations.md
@@ -58,7 +58,7 @@ where
   defined by getters/setters can be configured.
 * The `on eventName` elements specify what handlers should be attached to the object [events](concept-events.md).
   Notice that the array keys are formed by prefixing event names with `on `. Please refer to
-  the [Events](concept-events.md) chapter for supported event handler formats.
+  the [Events](concept-events.md) section for supported event handler formats.
 * And the `as behaviorName` elements specify what [behaviors](concept-behaviors.md) should be attached to the object.
   Notice that the array keys are formed by prefixing behavior names with `on `. `$behaviorConfig` represents
   the configuration for creating a behavior, like a normal configuration as we are describing here.
@@ -84,8 +84,8 @@ Below is an example showing a configuration with property initial values, event 
 Using Configurations
 --------------------
 
-Configurations are used in many places in Yii. At the beginning of this chapter, we have shown how to use
-create an object according to a configuration by using [[Yii::createObject()]]. In this section, we will
+Configurations are used in many places in Yii. At the beginning of this section, we have shown how to use
+create an object according to a configuration by using [[Yii::createObject()]]. In this subsection, we will
 describe application configurations and widget configurations - two major usages of configurations.
 
 
@@ -138,7 +138,7 @@ an [entry script](structure-entry-scripts.md), where the class name is already g
 ```
 
 For more details about configuring the `components` property of an application can be found
-in the [Applications](structure-applications.md) chapter and the [Service Locator](concept-service-locator.md) chapter.
+in the [Applications](structure-applications.md) section and the [Service Locator](concept-service-locator.md) section.
 
 
 <a name="widget-configurations"></a>
diff --git a/docs/guide/concept-di-container.md b/docs/guide/concept-di-container.md
index b175f5f..8c03e61 100644
--- a/docs/guide/concept-di-container.md
+++ b/docs/guide/concept-di-container.md
@@ -1,30 +1,104 @@
 Dependency Injection Container
 ==============================
 
-Both service locator and dependency injection are popular design patterns that allow building software
-in a loosely-coupled fashion. Yii uses service locator and dependency injection extensively,
-even though you may not be aware of them. In this tutorial, we will explore their implementation
-and support to help you write code more consciously. We also highly recommend you to read
-[Martin's article](http://martinfowler.com/articles/injection.html) to get a deeper understanding of
-service locator and dependency injection.
-
 A dependency injection (DI) container is an object that knows how to instantiate and configure objects and
 all their dependent objects. [Martin's article](http://martinfowler.com/articles/injection.html) has well
 explained why DI container is useful. Here we will mainly explain the usage of the DI container provided by Yii.
 
+
+<a name="dependency-injection"></a>
+Dependency Injection
+--------------------
+
 Yii provides the DI container feature through the class [[yii\di\Container]]. It supports the following kinds of
 dependency injection:
 
 * Constructor injection;
-* Setter injection;
+* Setter and property injection;
 * PHP callable injection.
 
 
-### Registering Dependencies
+<a name="constructor-injection"></a>
+### Constructor Injection
+
+The DI container supports constructor injection with the help of type hints for constructor parameters.
+The type hints tell the container which classes or interfaces are dependent when it is used to create a new object.
+The container will try to get the instances of the dependent classes or interfaces and then inject them
+into the new object through the constructor. For example,
+
+```php
+class Foo
+{
+    public function __construct(Bar $bar)
+    {
+    }
+}
+
+$foo = $container->get('Foo');
+// which is equivalent to the following:
+$bar = new Bar;
+$foo = new Foo($bar);
+```
+
+
+<a name="setter-and-property-injection"></a>
+### Setter and Property Injection
+
+Setter and property injection is supported through [configurations](concept-configurations.md).
+When registering a dependency or when creating a new object, you can provide a configuration which
+will be used by the container to inject the dependencies through the corresponding setters or properties.
+For example,
+
+```php
+use yii\base\Object;
+
+class Foo extends Object
+{
+    public $bar;
+
+    private $_qux;
+
+    public function getQux()
+    {
+        return $this->_qux;
+    }
+
+    public function setQux(Qux $qux)
+    {
+        $this->_qux = $qux;
+    }
+}
+
+$container->get('Foo', [], [
+    'bar' => $container->get('Bar'),
+    'qux' => $container->get('Qux'),
+]);
+```
+
+
+<a name="php-callable-injection"></a>
+### PHP Callable Injection
+
+In this case, the container will use a registered PHP callable to build new instances of a class.
+The callable is responsible to resolve the dependencies and inject them appropriately to the newly
+created objects. For example,
+
+```php
+$container->set('Foo', function () {
+    return new Foo(new Bar);
+});
+
+$foo = $container->get('Foo');
+```
+
+
+<a name="registering-dependencies"></a>
+Registering Dependencies
+------------------------
 
 You can use [[yii\di\Container::set()]] to register dependencies. The registration requires a dependency name
-as well as a dependency definition. The name can be a class name, an interface name, or an alias name;
-and the definition can be a class name, a configuration array, or a PHP callable.
+as well as a dependency definition. A dependency name can be a class name, an interface name, or an alias name;
+and a dependency definition can be a class name, a configuration array, or a PHP callable.
 
 ```php
 $container = new \yii\di\Container;
@@ -61,10 +135,14 @@ $container->set('db', [
 ]);
 
 // register a PHP callable
-// The callable will be executed when $container->get('db') is called
+// The callable will be executed each time when $container->get('db') is called
 $container->set('db', function ($container, $params, $config) {
     return new \yii\db\Connection($config);
 });
+
+// register a component instance
+// $container->get('pageCache') will return the same instance each time it is called
+$container->set('pageCache', new FileCache);
 ```
 
 > Tip: If a dependency name is the same as the corresponding dependency definition, you do not
@@ -84,28 +162,31 @@ $container->setSingleton('yii\db\Connection', [
 ```
 
 
-### Resolving Dependencies
+<a name="resolving-dependencies"></a>
+Resolving Dependencies
+----------------------
 
 Once you have registered dependencies, you can use the DI container to create new objects,
 and the container will automatically resolve dependencies by instantiating them and injecting
 them into the newly created objects. The dependency resolution is recursive, meaning that
 if a dependency has other dependencies, those dependencies will also be resolved automatically.
 
-You use [[yii\di\Container::get()]] to create new objects. The method takes a class name or
-a dependency name (class name, interface name or alias name) that you previously registered
-via `set()` or `setSingleton()`. You may optionally provide a list of class constructor parameters
-and a list of name-value pairs to configure the newly created object. For example,
+You can use [[yii\di\Container::get()]] to create new objects. The method takes a dependency name,
+which can be a class name, an interface name or an alias name. The dependency name may or may
+not be registered via `set()` or `setSingleton()`. You may optionally provide a list of class
+constructor parameters and a [configuration](concept-configurations.md) to configure the newly created object.
+For example,
 
 ```php
-// equivalent to: $map = new \app\components\GoogleMap($apiKey);
-$map = $container->get('app\components\GoogleMap', [$apiKey]);
-
 // "db" is a previously registered alias name
 $db = $container->get('db');
+
+// equivalent to: $engine = new \app\components\SearchEngine($apiKey, ['type' => 1]);
+$engine = $container->get('app\components\SearchEngine', [$apiKey], ['type' => 1]);
 ```
 
 Behind the scene, the DI container does much more work than just creating a new object.
-The container will inspect the class constructor to find out dependent class or interface names
+The container will first inspect the class constructor to find out dependent class or interface names
 and then automatically resolve those dependencies recursively.
 
 The following code shows a more sophisticated example. The `UserLister` class depends on an object implementing
@@ -114,7 +195,6 @@ a `Connection` object. All these dependencies are declared through type hinting 
 With property dependency registration, the DI container is able to resolve these dependencies automatically
 and creates a new `UserLister` instance with a simple call of `get('userLister')`.
 
-
 ```php
 namespace app\models;
 
@@ -172,11 +252,13 @@ $lister = new UserLister($finder);
 ```
 
 
-### Practical Usage
+<a name="practical-usages"></a>
+Practical Usages
+----------------
 
-Yii creates a DI container when you include the `yii.php` file in your application's entry script.
-The DI container is accessible via [[Yii::$container]]. When you call [[Yii::createObject()]], the method
-will actually call the container's [[yii\di\Container::get()|get()]] method to create a new object.
+Yii creates a DI container when you include the `Yii.php` file in the [entry script](structure-entry-scripts.md)
+of your application. The DI container is accessible via [[Yii::$container]]. When you call [[Yii::createObject()]],
+the method will actually call the container's [[yii\di\Container::get()|get()]] method to create a new object.
 As aforementioned, the DI container will automatically resolve the dependencies (if any) and inject them
 into the newly created object. Because Yii uses [[Yii::createObject()]] in most of its core code to create
 new objects, this means you can customize the objects globally by dealing with [[Yii::$container]].
@@ -188,13 +270,13 @@ For example, you can customize globally the default number of pagination buttons
 ```
 
 Now if you use the widget in a view with the following code, the `maxButtonCount` property will be initialized
-as 5 instead of 10 as defined in the class.
+as 5 instead of the default value 10 as defined in the class.
 
 ```php
 echo \yii\widgets\LinkPager::widget();
 ```
 
-You can still override the value set via DI container:
+You can still override the value set via DI container, though:
 
 ```php
 echo \yii\widgets\LinkPager::widget(['maxButtonCount' => 20]);
@@ -233,13 +315,29 @@ Now if you access the controller again, an instance of `app\components\BookingSe
 created and injected as the 3rd parameter to the controller's constructor.
 
 
-### When to Register Dependencies
+<a name="when-to-register-dependencies"></a>
+When to Register Dependencies
+-----------------------------
 
 Because dependencies are needed when new objects are being created, their registration should be done
 as early as possible. The followings are the recommended practices:
 
 * If you are the developer of an application, you can register dependencies in your
-  application's entry script or in a script that is included by the entry script.
-* If you are the developer of a redistributable extension, you can register dependencies
+  application's [entry script](structure-entry-scripts.md) or in a script that is included by the entry script.
+* If you are the developer of a redistributable [extension](structure-extensions.md), you can register dependencies
   in the bootstrap class of the extension.
 
+
+<a name="summary"></a>
+Summary
+-------
+
+Both dependency injection and [service locator](concept-service-locator.md) are popular design patterns
+that allow building software in a loosely-coupled and more testable fashion. We highly recommend you to read
+[Martin's article](http://martinfowler.com/articles/injection.html) to get a deeper understanding of
+dependency injection and service locator.
+
+Yii implements its [service locator](concept-service-locator.md) on top of the dependency injection (DI) container.
+When a service locator is trying to create a new object instance, it will forward the call to the DI container.
+The latter will resolve the dependencies automatically as described above.
+
diff --git a/docs/guide/concept-events.md b/docs/guide/concept-events.md
index 82449dd..3f50022 100644
--- a/docs/guide/concept-events.md
+++ b/docs/guide/concept-events.md
@@ -129,7 +129,7 @@ $foo->on(Foo::EVENT_HELLO, function ($event) {
 ```
 
 You may also attach event handlers through [configurations](concept-configurations.md). For more details, please
-refer to the [Configurations](concept-configurations.md#configuration-format) chapter.
+refer to the [Configurations](concept-configurations.md#configuration-format) section.
 
 
 When attaching an event handler, you may provide additional data as the third parameter to [[yii\base\Component::on()]].
@@ -201,7 +201,7 @@ $foo->off(Foo::EVENT_HELLO);
 Class-Level Event Handlers
 --------------------------
 
-In the above sections, we have described how to attach a handler to an event at *instance level*.
+In the above subsections, we have described how to attach a handler to an event at *instance level*.
 Sometimes, you may want to respond to an event triggered by EVERY instance of a class instead of
 a specific instance. Instead of attaching an event handler to every instance, you may attach the handler
 at *class level* by calling the static method [[yii\base\Event::on()]].
diff --git a/docs/guide/concept-service-locator.md b/docs/guide/concept-service-locator.md
index 4350981..cc9c3e1 100644
--- a/docs/guide/concept-service-locator.md
+++ b/docs/guide/concept-service-locator.md
@@ -1,24 +1,16 @@
 Service Locator
 ===============
 
-> Note: This chapter needs cleanup.
-
-Both service locator and dependency injection are popular design patterns that allow building software
-in a loosely-coupled fashion. Yii uses service locator and dependency injection extensively,
-even though you may not be aware of them. In this tutorial, we will explore their implementation
-and support to help you write code more consciously. We also highly recommend you to read
-[Martin's article](http://martinfowler.com/articles/injection.html) to get a deeper understanding of
-service locator and dependency injection.
-
 A service locator is an object that knows how to provide all sorts of services (or components) that an application
 might need. Within a service locator, each component has only a single instance which is uniquely identified by an ID.
-You use the ID to retrieve a component from the service locator. In Yii, a service locator is simply an instance 
-of [[yii\di\ServiceLocator]] or its child class.
+You use the ID to retrieve a component from the service locator.
+
+In Yii, a service locator is simply an instance of [[yii\di\ServiceLocator]] or its child class.
 
 The most commonly used service locator in Yii is the *application* object which can be accessed through
-`\Yii::$app`. The services it provides are called *application components*, such as `request`, `response`,
-`urlManager`. You may configure these components or replace them with your own implementations easily
-through functionality provided the service locator.
+`\Yii::$app`. The services it provides are called *application components*, such as the `request`, `response`,
+`urlManager` components. You may configure these components or even replace them with your own implementations easily
+through functionality provided by the service locator.
 
 Besides the application object, each module object is also a service locator.
 
@@ -26,7 +18,10 @@ To use a service locator, the first step is to register components. A component 
 via [[yii\di\ServiceLocator::set()]]. The following code shows different ways of registering components:
 
 ```php
-$locator = new \yii\di\ServiceLocator;
+use yii\di\ServiceLocator;
+use yii\caching\FileCache;
+
+$locator = new ServiceLocator;
 
 // register "cache" using a class name that can be used to create a component
 $locator->set('cache', 'yii\caching\ApcCache');
@@ -43,6 +38,9 @@ $locator->set('db', [
 $locator->set('search', function () {
     return new app\components\SolrService;
 });
+
+// register "pageCache" using a component
+$locator->set('pageCache', new FileCache);
 ```
 
 Once a component is registered, you can access it using its ID in one of the following two ways:
@@ -62,11 +60,10 @@ You may use [[yii\di\ServiceLocator::has()]] to check if a component ID has alre
 If you call [[yii\di\ServiceLocator::get()]] with an invalid ID, an exception will be thrown.
 
 
-Because service locators are often being configured using configuration arrays, a method named
-[[yii\di\ServiceLocator::setComponents()]] is provided to allow registering components in configuration arrays.
-The method is a setter which defines a writable property `components` that can be configured.
-The following code shows a configuration array that can be used to configure an application and register
-the "db", "cache" and "search" components:
+Because service locators are often being created with [configurations](concept-configurations.md),
+a writable property named [[yii\di\ServiceLocator::setComponents()|components]] is provided so that
+you can configure it and register multiple components at once. The following code shows a configuration array
+that can be used to configure an application and register the "db", "cache" and "search" components:
 
 ```php
 return [
diff --git a/docs/guide/db-active-record.md b/docs/guide/db-active-record.md
index 1057ef7..584f8c7 100644
--- a/docs/guide/db-active-record.md
+++ b/docs/guide/db-active-record.md
@@ -1,7 +1,7 @@
 Active Record
 =============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 [Active Record](http://en.wikipedia.org/wiki/Active_record_pattern) provides an object-oriented interface
 for accessing data stored in a database. An Active Record class is associated with a database table,
diff --git a/docs/guide/db-dao.md b/docs/guide/db-dao.md
index b7f1940..d5eac7d 100644
--- a/docs/guide/db-dao.md
+++ b/docs/guide/db-dao.md
@@ -1,7 +1,7 @@
 Database basics
 ===============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii has a database access layer built on top of PHP's [PDO](http://www.php.net/manual/en/book.pdo.php). It provides
 uniform API and solves some inconsistencies between different DBMS. By default Yii supports the following DBMS:
@@ -182,7 +182,7 @@ Quoting table and column names
 Most of the time you would use the following syntax for quoting table and column names:
 
 ```php
-$sql = "SELECT COUNT([[$column]]) FROM {{$table}}";
+$sql = "SELECT COUNT([[$column]]) FROM {{table}}";
 $rowCount = $connection->createCommand($sql)->queryScalar();
 ```
 
@@ -192,7 +192,7 @@ quoted table name.
 For table names there's a special variant `{{%Y}}` that allows you to automatically appending table prefix if it is set:
 
 ```php
-$sql = "SELECT COUNT([[$column]]) FROM {{%$table}}";
+$sql = "SELECT COUNT([[$column]]) FROM {{%table}}";
 $rowCount = $connection->createCommand($sql)->queryScalar();
 ```
 
diff --git a/docs/guide/db-migrations.md b/docs/guide/db-migrations.md
index afcb0e2..c591fa4 100644
--- a/docs/guide/db-migrations.md
+++ b/docs/guide/db-migrations.md
@@ -1,7 +1,7 @@
 Database Migration
 ==================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Like source code, the structure of a database evolves as a database-driven application is developed and maintained. For example, during development, a new table may be added; Or, after the application goes live, it may be discovered that an additional index is required. It is important to keep track of these structural database changes (called **migration**), just as changes to the source code is tracked using version control. If the source code and the database become out of sync, bugs will occur, or the whole application might break. For this reason, Yii provides a database migration
 tool that can keep track of database migration history, apply new migrations, or revert existing ones.
diff --git a/docs/guide/db-query-builder.md b/docs/guide/db-query-builder.md
index a73613a..b30aedf 100644
--- a/docs/guide/db-query-builder.md
+++ b/docs/guide/db-query-builder.md
@@ -1,7 +1,7 @@
 Query Builder and Query
 =======================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii provides a basic database access layer as described in the [Database basics](database-basics.md) section.
 The database access layer provides a low-level way to interact with the database. While useful in some situations,
diff --git a/docs/guide/extend-creating-extensions.md b/docs/guide/extend-creating-extensions.md
index cb5e6ab..d1ab25a 100644
--- a/docs/guide/extend-creating-extensions.md
+++ b/docs/guide/extend-creating-extensions.md
@@ -1,7 +1,7 @@
 Extending Yii
 =============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The Yii framework was designed to be easily extendable. Additional features can be added to your project and then reused, either by yourself on other projects or by sharing your work as a formal Yii extension.
 
diff --git a/docs/guide/extend-customizing-core.md b/docs/guide/extend-customizing-core.md
index ef05c91..e9e8d6c 100644
--- a/docs/guide/extend-customizing-core.md
+++ b/docs/guide/extend-customizing-core.md
@@ -1,7 +1,7 @@
 Helper Classes
 ==============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii provides many classes that help simplify  common coding tasks, such as string or array manipulations,
 HTML code generation, and so forth. These helper classes are organized under the `yii\helpers` namespace and
diff --git a/docs/guide/extend-using-composer.md b/docs/guide/extend-using-composer.md
index 2da5bf9..2058e3a 100644
--- a/docs/guide/extend-using-composer.md
+++ b/docs/guide/extend-using-composer.md
@@ -1,7 +1,7 @@
 Composer
 ========
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii2 uses Composer as its dependency management tool. Composer is a PHP utility that can automatically handle the installation of needed libraries and
 extensions, thereby keeping those third-party resources up to date while absolving you of the need to manually manage the project's dependencies.
diff --git a/docs/guide/extend-using-libs.md b/docs/guide/extend-using-libs.md
index 805ff47..27fd2d7 100644
--- a/docs/guide/extend-using-libs.md
+++ b/docs/guide/extend-using-libs.md
@@ -1,7 +1,7 @@
 Using 3rd-Party Libraries
 =========================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii is carefully designed so that third-party libraries can be
 easily integrated to further extend Yii's functionalities.
diff --git a/docs/guide/helper-overview.md b/docs/guide/helper-overview.md
index 78a6d97..df17c1f 100644
--- a/docs/guide/helper-overview.md
+++ b/docs/guide/helper-overview.md
@@ -1,7 +1,7 @@
 Helpers
 =======
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Helper classes typically contain static methods only and are used as follows:
 
diff --git a/docs/guide/input-forms.md b/docs/guide/input-forms.md
index 74dac43..144a07d 100644
--- a/docs/guide/input-forms.md
+++ b/docs/guide/input-forms.md
@@ -1,7 +1,7 @@
 Working with forms
 ==================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The primary way of using forms in Yii is through [[yii\widgets\ActiveForm]]. This approach should be preferred when
 the form is based upon  a model. Additionally, there are some useful methods in [[yii\helpers\Html]] that are typically
diff --git a/docs/guide/input-validation.md b/docs/guide/input-validation.md
index 9e775c6..31e0275 100644
--- a/docs/guide/input-validation.md
+++ b/docs/guide/input-validation.md
@@ -1,7 +1,7 @@
 Model validation reference
 ==========================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 As a model both represents data and defines the business rules to which that data must adhere, comprehending data validation is key to using Yii. In order to learn model validation basics, please refer to [Model, Validation subsection](model.md#Validation).
 
diff --git a/docs/guide/intro-upgrade-from-v1.md b/docs/guide/intro-upgrade-from-v1.md
index 62b9f98..b29d446 100644
--- a/docs/guide/intro-upgrade-from-v1.md
+++ b/docs/guide/intro-upgrade-from-v1.md
@@ -1,30 +1,29 @@
 Upgrading from Version 1.1
 ==========================
 
-There are many differences between Yii version 2.0 and 1.1, because Yii is completely rewritten for 2.0.
-As a result, upgrading from version 1.1 is not as trivial as upgrading between minor versions. In this chapter,
-we will summarize the major differences between the two versions.
+There are many differences between versions 1.1 and 2.0 of the Yii as the framework was completely rewritten for 2.0.
+As a result, upgrading from version 1.1 is not as trivial as upgrading between minor versions. In this guide you'll find the major differences between the two versions.
 
-Please note that Yii 2.0 introduces many new features which are not covered in this summary. It is highly recommended
-that you read through the whole definitive guide to learn about these features. Chances could be that
-some features you previously have to develop by yourself are already part of the core code now.
+Please note that Yii 2.0 introduces more new features than are covered in this summary. It is highly recommended
+that you read through the whole definitive guide to learn about them all. Chances are that
+some features you previously had to develop for yourself are now part of the core code.
 
 
 Installation
 ------------
 
-Yii 2.0 fully embraces [Composer](https://getcomposer.org/), a de facto PHP package manager. Installation
-of the core framework as well as extensions are all installed through Composer. Please refer to
-the [Starting from Basic App](start-basic.md) chapter to learn how to install Yii 2.0. If you want to
-create new extensions or turn your existing 1.1 extensions into 2.0, please refer to
-the [Creating Extensions](extend-creating-extensions.md) chapter.
+Yii 2.0 fully embraces [Composer](https://getcomposer.org/), the de facto PHP package manager. Installation
+of the core framework, as well as extensions, are handled through Composer. Please refer to
+the [Starting from Basic App](start-basic.md) section to learn how to install Yii 2.0. If you want to
+create new extensions, or turn your existing 1.1 extensions into 2.0-compatible extensions, please refer to
+the [Creating Extensions](extend-creating-extensions.md) section of the guide.
 
 
 PHP Requirements
 ----------------
 
-Yii 2.0 requires PHP 5.4 or above, which is a huge improvement over PHP 5.2 as required by Yii 1.1.
-As a result, there are many differences at language level that you should pay attention to.
+Yii 2.0 requires PHP 5.4 or above, which is a huge improvement over PHP version 5.2 that is required by Yii 1.1.
+As a result, there are many differences on the language level that you should pay attention to.
 Below is a summary of the major changes regarding PHP:
 
 - [Namespaces](http://php.net/manual/en/language.namespaces.php).
@@ -44,10 +43,11 @@ Namespace
 
 The most obvious change in Yii 2.0 is the use of namespaces. Almost every core class
 is namespaced, e.g., `yii\web\Request`. The "C" prefix is no longer used in class names.
-The naming of the namespaces follows the directory structure. For example, `yii\web\Request`
-indicates the corresponding class file is `web/Request.php` under the Yii framework folder.
-You can use any core class without explicitly including that class file, thanks to the Yii
-class loader.
+The naming scheme now follows the directory structure. For example, `yii\web\Request`
+indicates that the corresponding class file is `web/Request.php` under the Yii framework folder.
+
+(You can use any core class without explicitly including that class file, thanks to the Yii
+class loader.)
 
 
 Component and Object
@@ -90,12 +90,12 @@ class MyClass extends \yii\base\Object
 ```
 
 In the above, the last parameter of the constructor must take a configuration array
-which contains name-value pairs for initializing the properties at the end of the constructor.
+that contains name-value pairs for initializing the properties at the end of the constructor.
 You can override the [[yii\base\Object::init()|init()]] method to do initialization work that should be done after
-the configuration is applied.
+the configuration has been applied.
 
-By following this convention, you will be able to create and configure a new object
-using a configuration array like the following:
+By following this convention, you will be able to create and configure new objects
+using a configuration array:
 
 ```php
 $object = Yii::createObject([
@@ -105,14 +105,13 @@ $object = Yii::createObject([
 ], [$param1, $param2]);
 ```
 
-More details about configurations can be found in the [Object Configurations](concept-configurations.md) chapter.
+More details about configurations can be found in the [Object Configurations](concept-configurations.md) section.
 
 
 Events
 ------
 
-There is no longer the need to define an `on`-method in order to define an event in Yii 2.0.
-Instead, you can use whatever event names. You can trigger an event by calling
+In Yii 1, events were created by defining an `on`-method (e.g., `onBeforeSave`). In Yii 2, you can now use any event name. You trigger an event by calling
 the [[yii\base\Component::trigger()|trigger()]] method:
 
 ```php
@@ -120,7 +119,7 @@ $event = new \yii\base\Event;
 $component->trigger($eventName, $event);
 ```
 
-And to attach a handler to an event, you can use the [[yii\base\Component::on()|on()]] method:
+To attach a handler to an event, use the [[yii\base\Component::on()|on()]] method:
 
 ```php
 $component->on($eventName, $handler);
@@ -128,39 +127,38 @@ $component->on($eventName, $handler);
 // $component->off($eventName, $handler);
 ```
 
-There are many enhancements to the event features. For more details, please refer to the [Events](concept-events.md) chapter.
+There are many enhancements to the event features. For more details, please refer to the [Events](concept-events.md) section.
 
 
 Path Aliases
 ------------
 
-Yii 2.0 expands the usage of path aliases to both file/directory paths and URLs. It also requires
-an alias name to start with a `@` character so that it can be differentiated from normal file/directory paths and URLs.
+Yii 2.0 expands the usage of path aliases to both file/directory paths and URLs. Yii 2.0 also now requires
+an alias name to start with the `@` character, to differentiate aliases from normal file/directory paths or URLs.
 For example, the alias `@yii` refers to the Yii installation directory. Path aliases are
 supported in most places in the Yii core code. For example, [[yii\caching\FileCache::cachePath]] can take
 both a path alias and a normal directory path.
 
-Path alias is also closely related with class namespaces. It is recommended that a path
-alias be defined for each root namespace so that you can use Yii the class autoloader without
+A path alias is also closely related to a class namespace. It is recommended that a path
+alias be defined for each root namespace, thereby allowing you to use Yii the class autoloader without
 any further configuration. For example, because `@yii` refers to the Yii installation directory,
-a class like `yii\web\Request` can be autoloaded by Yii. If you use a third party library
-such as Zend Framework, you may define a path alias `@Zend` which refers to its installation
-directory and Yii will be able to autoload any class in this library.
+a class like `yii\web\Request` can be autoloaded. If you use a third party library,
+such as the Zend Framework, you may define a path alias `@Zend` that refers to that framework's installation
+directory. Once you've done that, Yii will be able to autoload any class in that Zend Framework library, too.
 
-More on path aliases can be found in the [Path Aliases](concept-aliases.md) chapter.
+More on path aliases can be found in the [Path Aliases](concept-aliases.md) section.
 
 
 Views
 -----
 
-The most significant change about views is that `$this` in a view no longer refers to
-the current controller or widget. Instead, it refers to a *view* object which is a new concept
-introduced in 2.0. The *view* object is of class [[yii\web\View]] which represents the view part
-of the MVC pattern. In you want to access the controller or widget in a view, you should use `$this->context`.
+The most significant change about views in Yii 2 is that the special variable `$this` in a view no longer refers to
+the current controller or widget. Instead, `$this` now refers to a *view* object, a new concept
+introduced in 2.0. The *view* object is of type [[yii\web\View]], which represents the view part
+of the MVC pattern. In you want to access the controller or widget in a view, you can use `$this->context`.
 
-To render a partial view within another view, you should use `$this->render()` now.
-And you have to echo it explicitly because the `render()` method will return the rendering
-result rather than directly displaying it. For example,
+To render a partial view within another view, you use `$this->render()`, not `$this->renderPartial()`. The call to `render` also now has to be explicitly echoed, as the `render()` method returns the rendering
+result, rather than directly displaying it. For example:
 
 ```php
 echo $this->render('_item', ['item' => $item]);
@@ -170,18 +168,17 @@ Besides using PHP as the primary template language, Yii 2.0 is also equipped wit
 support for two popular template engines: Smarty and Twig. The Prado template engine is no longer supported.
 To use these template engines, you need to configure the `view` application component by setting the
 [[yii\base\View::$renderers|View::$renderers]] property. Please refer to the [Template Engines](tutorial-template-engines.md)
-chapter for more details.
+section for more details.
 
 
 Models
 ------
 
-Yii 2.0 uses [[yii\base\Model]] as the base model class which is similar to `CModel` in 1.1.
-The class `CFormModel` is dropped. Instead, you should extend [[yii\base\Model]] to create a form model class.
+Yii 2.0 uses [[yii\base\Model]] as the base model, similar to `CModel` in 1.1.
+The class `CFormModel` has been dropped entirely. Instead, in Yii 2 you should extend [[yii\base\Model]] to create a form model class.
 
 Yii 2.0 introduces a new method called [[yii\base\Model::scenarios()|scenarios()]] to declare
-supported scenarios and under which scenario an attribute needs to be validated and can be considered as safe or not.
-For example,
+supported scenarios, and to indicate under which scenario an attribute needs to be validated, can be considered as safe or not, etc. For example:
 
 ```php
 public function scenarios()
@@ -193,28 +190,27 @@ public function scenarios()
 }
 ```
 
-In the above, two scenarios are declared: `backend` and `frontend`. For the `backend` scenario, both of the
-`email` and `role` attributes are safe and can be massively assigned; for the `frontend` scenario,
-`email` can be massively assigned while `role` cannot. Both `email` and `role` should be validated.
+In the above, two scenarios are declared: `backend` and `frontend`. For the `backend` scenario, both the
+`email` and `role` attributes are safe, and can be massively assigned. For the `frontend` scenario,
+`email` can be massively assigned while `role` cannot. Both `email` and `role` should be validated using rules.
 
-The [[yii\base\Model::rules()|rules()]] method is still used to declare validation rules. Note that because
-of the introduction of [[yii\base\Model::scenarios()|scenarios()]], there is no more `unsafe` validator.
+The [[yii\base\Model::rules()|rules()]] method is still used to declare the validation rules. Note that due to the introduction of [[yii\base\Model::scenarios()|scenarios()]], there is no longer an `unsafe` validator.
 
 In most cases, you do not need to override [[yii\base\Model::scenarios()|scenarios()]]
-if the [[yii\base\Model::rules()|rules()]] method fully specifies the scenarios and there is no need to declare
+if the [[yii\base\Model::rules()|rules()]] method fully specifies the scenarios that will exist, and if there is no need to declare
 `unsafe` attributes.
 
-To learn more details about models, please refer to the [Models](basic-models.md) chapter.
+To learn more details about models, please refer to the [Models](basic-models.md) section.
 
 
 Controllers
 -----------
 
-Yii 2.0 uses [[yii\web\Controller]] as the base controller class which is similar to `CWebController` in 1.1.
-And [[yii\base\Action]] is the base class for action classes.
+Yii 2.0 uses [[yii\web\Controller]] as the base controller class, similar to `CWebController` in Yii 1.1.
+[[yii\base\Action]] is the base class for action classes.
 
-The most obvious change when you write code in a controller action is that you should return the content
-that you want to render instead of echoing it. For example,
+The most obvious impact of these changes on your code is that a controller action should return the content
+that you want to render instead of echoing it:
 
 ```php
 public function actionView($id)
@@ -228,17 +224,17 @@ public function actionView($id)
 }
 ```
 
-Please refer to the [Controllers](structure-controllers.md) chapter for more details about controllers.
+Please refer to the [Controllers](structure-controllers.md) section for more details about controllers.
 
 
 Widgets
 -------
 
-Yii 2.0 uses [[yii\base\Widget]] as the base widget class which is similar to `CWidget` in 1.1.
+Yii 2.0 uses [[yii\base\Widget]] as the base widget class, similar to `CWidget` in Yii 1.1.
 
-To get better IDE support, Yii 2.0 introduces a new syntax for using widgets. The static methods
-[[yii\base\Widget::begin()|begin()]], [[yii\base\Widget::end()|end()]] and [[yii\base\Widget::widget()|widget()]]
-are introduced and can be used as follows,
+To get better support for the framework in IDEs, Yii 2.0 introduces a new syntax for using widgets. The static methods
+[[yii\base\Widget::begin()|begin()]], [[yii\base\Widget::end()|end()]], and [[yii\base\Widget::widget()|widget()]]
+have been introduced, to be used like so:
 
 ```php
 use yii\widgets\Menu;
@@ -256,29 +252,29 @@ $form = ActiveForm::begin([
 ActiveForm::end();
 ```
 
-Please refer to the [Widgets](structure-widgets.md) chapter for more details.
+Please refer to the [Widgets](structure-widgets.md) section for more details.
 
 
 Themes
 ------
 
-Themes work completely different in 2.0. They are now based on a path mapping mechanism which maps a source
+Themes work completely differently in 2.0. They are now based on a path mapping mechanism that maps a source
 view file path to a themed view file path. For example, if the path map for a theme is
-`['/web/views' => '/web/themes/basic']`, then the themed version for a view file
+`['/web/views' => '/web/themes/basic']`, then the themed version for the view file
 `/web/views/site/index.php` will be `/web/themes/basic/site/index.php`. For this reason, themes can now
-be applied to any view file, even if a view rendered outside of the context of a controller or a widget.
+be applied to any view file, even a view rendered outside of the context of a controller or a widget.
 
-Also, there is no more `CThemeManager`. Instead, `theme` is a configurable property of the `view`
+Also, there is no more `CThemeManager` component. Instead, `theme` is a configurable property of the `view`
 application component.
 
-Please refer to the [Theming](tutorial-theming.md) chapter for more details.
+Please refer to the [Theming](tutorial-theming.md) section for more details.
 
 
 Console Applications
 --------------------
 
 Console applications are now organized as controllers, like Web applications. Console controllers
-should extend from [[yii\console\Controller]] which is similar to `CConsoleCommand` in 1.1.
+should extend from [[yii\console\Controller]], similar to `CConsoleCommand` in 1.1.
 
 To run a console command, use `yii <route>`, where `<route>` stands for a controller route
 (e.g. `sitemap/index`). Additional anonymous arguments are passed as the parameters to the
@@ -287,27 +283,26 @@ the declarations in [[yii\console\Controller::options()]].
 
 Yii 2.0 supports automatic generation of command help information from comment blocks.
 
-Please refer to the [Console Commands](tutorial-console.md) chapter for more details.
+Please refer to the [Console Commands](tutorial-console.md) section for more details.
 
 
 I18N
 ----
 
-Yii 2.0 removes date formatter and number formatter in favor of the PECL intl PHP module.
+Yii 2.0 removes the built-in date formatter and number formatter pieces in favor of the [PECL intl PHP module](http://pecl.php.net/package/intl).
 
 Message translation is now performed via the `i18n` application component.
-The component manages a set of message sources, which allows you to use different message
+This component manages a set of message sources, which allows you to use different message
 sources based on message categories.
 
-Please refer to the [Internationalization](tutorial-i18n.md) chapter for more details.
+Please refer to the [Internationalization](tutorial-i18n.md) section for more details.
 
 
 Action Filters
 --------------
 
-Action filters are implemented via behaviors now. You should extend from [[yii\base\ActionFilter]] to
-define a new filter. To use a filter, you should attach the filter class to the controller
-as a behavior. For example, to use the [[yii\filters\AccessControl]] filter, you should have the following
+Action filters are implemented via behaviors now. To define a new, custom filter, extend from [[yii\base\ActionFilter]]. To use a filter, attach the filter class to the controller
+as a behavior. For example, to use the [[yii\filters\AccessControl]] filter, you would have the following
 code in a controller:
 
 ```php
@@ -324,27 +319,27 @@ public function behaviors()
 }
 ```
 
-Please refer to the [Filtering](runtime-filtering.md) chapter for more details.
+Please refer to the [Filtering](runtime-filtering.md) section for more details.
 
 
 Assets
 ------
 
-Yii 2.0 introduces a new concept called *asset bundle* which replaces the script package concept in 1.1.
+Yii 2.0 introduces a new concept called *asset bundle* that replaces the script package concept found in Yii 1.1.
 
 An asset bundle is a collection of asset files (e.g. JavaScript files, CSS files, image files, etc.)
-under a directory. Each asset bundle is represented as a class extending [[yii\web\AssetBundle]].
-By registering an asset bundle via [[yii\web\AssetBundle::register()]], you will be able to make
-the assets in that bundle accessible via Web, and the page registering the bundle will automatically
+within a directory. Each asset bundle is represented as a class extending [[yii\web\AssetBundle]].
+By registering an asset bundle via [[yii\web\AssetBundle::register()]], you make
+the assets in that bundle accessible via the Web. Unlike in Yii 1, the page registering the bundle will automatically
 contain the references to the JavaScript and CSS files specified in that bundle.
 
-Please refer to the [Managing Assets](output-assets.md) chapter for more details.
+Please refer to the [Managing Assets](output-assets.md) section for more details.
 
 
 Helpers
 -------
 
-Yii 2.0 introduces many commonly used static helper classes, such as
+Yii 2.0 introduces many commonly used static helper classes, including.
 
 * [[yii\helpers\Html]]
 * [[yii\helpers\ArrayHelper]]
@@ -353,13 +348,14 @@ Yii 2.0 introduces many commonly used static helper classes, such as
 * [[yii\helpers\Json]]
 * [[yii\helpers\Security]]
 
+Please refer to the [Helper Overview](helper-overview.md) section for more details.
 
 Forms
 -----
 
 Yii 2.0 introduces the *field* concept for building a form using [[yii\widgets\ActiveForm]]. A field
 is a container consisting of a label, an input, an error message, and/or a hint text.
-It is represented as an [[yii\widgets\ActiveField|ActiveField]] object.
+A field is represented as an [[yii\widgets\ActiveField|ActiveField]] object.
 Using fields, you can build a form more cleanly than before:
 
 ```php
@@ -372,13 +368,15 @@ Using fields, you can build a form more cleanly than before:
 <?php yii\widgets\ActiveForm::end(); ?>
 ```
 
+Please refer to the [Creating Forms](input-forms.md) section for more details.
+
 
 Query Builder
 -------------
 
-In 1.1, query building is scattered among several classes, including `CDbCommand`,
+In 1.1, query building was scattered among several classes, including `CDbCommand`,
 `CDbCriteria`, and `CDbCommandBuilder`. Yii 2.0 represents a DB query in terms of a [[yii\db\Query|Query]] object
-which can be turned into a SQL statement with the help of [[yii\db\QueryBuilder|QueryBuilder]] behind the scene.
+that can be turned into a SQL statement with the help of [[yii\db\QueryBuilder|QueryBuilder]] behind the scene.
 For example:
 
 ```php
@@ -394,28 +392,27 @@ $rows = $command->queryAll();
 
 Best of all, such query building methods can also be used when working with [Active Record](db-active-record.md).
 
-Please refer to the [Query Builder](db-query-builder.md) chapter for more details.
+Please refer to the [Query Builder](db-query-builder.md) section for more details.
 
 
 Active Record
 -------------
 
-Yii 2.0 introduces a lot of changes to [Active Record](db-active-record.md). Two most obvious ones are:
+Yii 2.0 introduces a lot of changes to [Active Record](db-active-record.md). The two most obvious ones involve
 query building and relational query handling.
 
-The `CDbCriteria` class in 1.1 is replaced by [[yii\db\ActiveQuery]] which extends from [[yii\db\Query]] and thus
-inherits all query building methods. You call [[yii\db\ActiveRecord::find()]] to start building a query.
-For example,
+The `CDbCriteria` class in 1.1 is replaced by [[yii\db\ActiveQuery]] in Yii 2. That class extends from [[yii\db\Query]], and thus
+inherits all query building methods. You call [[yii\db\ActiveRecord::find()]] to start building a query:
 
 ```php
-// to retrieve all *active* customers and order them by their ID:
+// To retrieve all *active* customers and order them by their ID:
 $customers = Customer::find()
     ->where(['status' => $active])
     ->orderBy('id')
     ->all();
 ```
 
-To declare a relation, you simply define a getter method that returns an [[yii\db\ActiveQuery|ActiveQuery]] object.
+To declare a relation, simply define a getter method that returns an [[yii\db\ActiveQuery|ActiveQuery]] object.
 The property name defined by the getter represents the relation name. For example, the following code declares
 an `orders` relation (in 1.1, you would have to declare relations in a central place `relations()`):
 
@@ -429,20 +426,20 @@ class Customer extends \yii\db\ActiveRecord
 }
 ```
 
-You can use `$customer->orders` to access the customer's orders. You can also use the following code
-to perform on-the-fly relational query with customized query conditions:
+Now you can use `$customer->orders` to access a customer's orders from the related table. You can also use the following code
+to perform an on-the-fly relational query with a customized query condition:
 
 ```php
 $orders = $customer->getOrders()->andWhere('status=1')->all();
 ```
 
 When eager loading a relation, Yii 2.0 does it differently from 1.1. In particular, in 1.1 a JOIN query
-would be created to bring both the primary and the relational records; in 2.0, two SQL statements are executed
+would be created to select both the primary and the relational records. In Yii 2.0, two SQL statements are executed
 without using JOIN: the first statement brings back the primary records and the second brings back the relational
 records by filtering with the primary keys of the primary records.
 
 Instead of returning [[yii\db\ActiveRecord|ActiveRecord]] objects, you may chain the [[yii\db\ActiveQuery::asArray()|asArray()]]
-method when building a query to return large number of records. This will cause the query result to be returned
+method when building a query to return a large number of records. This will cause the query result to be returned
 as arrays, which can significantly reduce the needed CPU time and memory if large number of records . For example,
 
 ```php
@@ -450,7 +447,7 @@ $customers = Customer::find()->asArray()->all();
 ```
 
 There are many other changes and enhancements to Active Record. Please refer to
-the [Active Record](db-active-record.md) chapter for more details.
+the [Active Record](db-active-record.md) section for more details.
 
 
 User and IdentityInterface
@@ -458,15 +455,17 @@ User and IdentityInterface
 
 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
-is much more straightforward to implement. The advanced application template provides such an example.
+is much more straightforward to use. The advanced application template provides such an example.
+
+Please refer to the [Authentication](security-authentication.md), [Authorization](security-authorization.md), and [Advanced Application Technique](tutorial-advanced-app.md) sections for more details.
 
 
 URL Management
 --------------
 
-URL management is similar to 1.1. A major enhancement is that it now supports optional
-parameters. For example, if you have rule declared as follows, then it will match
-both `post/popular` and `post/1/popular`. In 1.1, you would have to use two rules to achieve
+URL management in Yii 2 is similar to that in 1.1. A major enhancement is that URL management now supports optional
+parameters. For example, if you have a rule declared as follows, then it will match
+both `post/popular` and `post/1/popular`. In 1.1, you would have had to use two rules to achieve
 the same goal.
 
 ```php
@@ -477,12 +476,11 @@ the same goal.
 ]
 ```
 
-More details in the [Url manager docs](url.md).
-
+Please refer to the [Url manager docs](url.md) section for more details.
 
 Using Yii 1.1 and 2.x together
 ------------------------------
 
-If you have legacy Yii 1.1 code and you want to use it together with Yii 2.0, please refer to
-the [Using Yii 1.1 and 2.0 Together](extend-using-v1-v2.md) chapter.
+If you have legacy Yii 1.1 code that you want to use together with Yii 2.0, please refer to
+the [Using Yii 1.1 and 2.0 Together](extend-using-v1-v2.md) section.
 
diff --git a/docs/guide/intro-yii.md b/docs/guide/intro-yii.md
index 1c97908..41c1e4a 100644
--- a/docs/guide/intro-yii.md
+++ b/docs/guide/intro-yii.md
@@ -2,8 +2,8 @@ What is Yii
 ===========
 
 Yii is a high performance, component-based PHP framework for rapidly developing modern Web applications.
-The name Yii (pronounced `Yee` or `[ji:]`) means simple and evolutionary in Chinese. It can also
-be considered as the acronym for **Yes It Is**!
+The name Yii (pronounced `Yee` or `[ji:]`) means "simple and evolutionary" in Chinese. It can also
+be thought of as an acronym for **Yes It Is**!
 
 
 What is Yii Best for?
@@ -22,17 +22,17 @@ How does Yii Compare with Other Frameworks?
   organization based on this pattern.
 - Yii takes the philosophy that code should be written in a simple yet elegant way. It will never try to
   over-design things mainly for the purpose of following some design pattern.
-- Yii is a full-stack framework providing many proven and ready-to-use features, such as query builders
-  and ActiveRecord supporting relational and NoSQL databases, RESTful API development support, multi-tier
-  caching support, etc.
+- Yii is a full-stack framework providing many proven and ready-to-use features, such as: query builders
+  and ActiveRecord, for both relational and NoSQL databases; RESTful API development support; multi-tier
+  caching support; and more.
 - Yii is extremely extensible. You can customize or replace nearly every piece of core code. You can also
-  take advantage of its solid extension architecture, use or develop redistributable extensions.
+  take advantage of its solid extension architecture, to use or develop redistributable extensions.
 - High performance is always a primary goal of Yii.
 
 Yii is not a one-man show, it is backed up by a [strong core developer team][] as well as a large community
-with many professionals who are constantly contributing to the development of Yii. The Yii developer team
-is keeping a close eye on the latest trends of Web development and the best practices and features
-found in other frameworks and projects. They are being carefully incorporated into the core framework and exposed
+with many professionals constantly contributing to the development of Yii. The Yii developer team
+keeps a close eye on the latest trends of Web development, and on the best practices and features
+found in other frameworks and projects. The most relevant best practices and features found elsewhere are regularly incorporated into the core framework and exposed
 via simple and elegant interfaces.
 
 [strong core developer team]: http://www.yiiframework.com/about/
@@ -40,9 +40,8 @@ via simple and elegant interfaces.
 Yii Versions
 ------------
 
-Yii has two major versions available currently: 1.1 and 2.0. Version 1.1 is the old generation and is
-currently under maintenance mode. Version 2.0 is a complete rewrite of Yii by adopting the latest
-technologies and protocols, such as Composer, PSR, namespaces, traits, etc. Version 2.0 represents the latest
+Yii currently has two major versions available: 1.1 and 2.0. Version 1.1 is the old generation and is now in maintenance mode. Version 2.0 is a complete rewrite of Yii, adopting the latest
+technologies and protocols, including Composer, PSR, namespaces, traits, and so forth. Version 2.0 represents the latest
 generation of the framework and will receive our main development efforts in the next few years.
 This guide is mainly about version 2.0.
 
@@ -50,11 +49,10 @@ This guide is mainly about version 2.0.
 Requirements and Prerequisites
 ------------------------------
 
-Yii 2.0 requires PHP 5.4.0 or above. You may find out more detailed requirements for individual features
-by running the requirement checker included in every release.
+Yii 2.0 requires PHP 5.4.0 or above. You can find more detailed requirements for individual features
+by running the requirement checker included in every Yii release.
 
 Using Yii requires basic knowledge about object-oriented programming (OOP), as Yii is a pure OOP-based framework.
-Yii 2.0 also makes use of the latest features of PHP, such as [namespaces](http://www.php.net/manual/en/language.namespaces.php),
-[traits](http://www.php.net/manual/en/language.oop5.traits.php). Understanding these concepts will help
-you pick up Yii 2.0 more easily.
+Yii 2.0 also makes use of the latest features of PHP, such as [namespaces](http://www.php.net/manual/en/language.namespaces.php) and [traits](http://www.php.net/manual/en/language.oop5.traits.php). Understanding these concepts will help
+you more easily pick up Yii 2.0.
 
diff --git a/docs/guide/output-assets.md b/docs/guide/output-assets.md
index 74ce909..298655c 100644
--- a/docs/guide/output-assets.md
+++ b/docs/guide/output-assets.md
@@ -1,7 +1,7 @@
 Managing assets
 ===============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 An asset in Yii is a file that is included into the page. It could be CSS, JavaScript or
 any other file. The framework provides many ways to work with assets from basics such as adding `<script src="...">` tags
diff --git a/docs/guide/output-data-providers.md b/docs/guide/output-data-providers.md
index 686c89b..e2963cc 100644
--- a/docs/guide/output-data-providers.md
+++ b/docs/guide/output-data-providers.md
@@ -1,7 +1,7 @@
 Data providers
 ==============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Data provider abstracts data set via [[yii\data\DataProviderInterface]] and handles pagination and sorting.
 It can be used by [grids](data-grid.md), [lists and other data widgets](data-widgets.md).
diff --git a/docs/guide/output-data-widgets.md b/docs/guide/output-data-widgets.md
index 6b3b3ce..7df1a5e 100644
--- a/docs/guide/output-data-widgets.md
+++ b/docs/guide/output-data-widgets.md
@@ -1,7 +1,7 @@
 Data widgets
 ============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 ListView
 --------
diff --git a/docs/guide/rest-quick-start.md b/docs/guide/rest-quick-start.md
index f3170a7..ee44edd 100644
--- a/docs/guide/rest-quick-start.md
+++ b/docs/guide/rest-quick-start.md
@@ -1,7 +1,7 @@
 Implementing RESTful Web Service APIs
 =====================================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii provides a whole set of tools to greatly simplify the task of implementing RESTful Web Service APIs.
 In particular, Yii provides support for the following aspects regarding RESTful APIs:
@@ -315,7 +315,7 @@ For API endpoints about resource collections, pagination is supported out-of-box
 through query parameters `page` and `per-page`, an API consumer may specify which page of data
 to return and how many data items should be included in each page. The corresponding response
 will include the pagination information by the following HTTP headers (please also refer to the first example
-in this chapter):
+in this section):
 
 * `X-Pagination-Total-Count`: The total number of data items;
 * `X-Pagination-Page-Count`: The number of pages;
@@ -701,7 +701,7 @@ Authorization
 
 After a user is authenticated, you probably want to check if he has the permission to perform the requested
 action for the requested resource. This process is called *authorization* which is covered in detail in
-the [Authorization chapter](authorization.md).
+the [Authorization section](authorization.md).
 
 You may use the Role-Based Access Control (RBAC) component to implementation authorization.
 
diff --git a/docs/guide/runtime-url-handling.md b/docs/guide/runtime-url-handling.md
index 12d6064..03d921a 100644
--- a/docs/guide/runtime-url-handling.md
+++ b/docs/guide/runtime-url-handling.md
@@ -1,7 +1,7 @@
 URL Management
 ==============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The concept of URL management in Yii is fairly simple. URL management is based on the premise that the application uses
 internal routes and parameters everywhere. The framework itself will then translate routes into URLs, and vice versa, according to the URL manager's configuration. This approach allows you to change site-wide URLs merely by
diff --git a/docs/guide/security-authentication.md b/docs/guide/security-authentication.md
index 91217a5..7f24c9b 100644
--- a/docs/guide/security-authentication.md
+++ b/docs/guide/security-authentication.md
@@ -1,14 +1,14 @@
 Authentication
 ==============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Authentication is the act of verifying who a user is, and is the basis of the login process. Typically, authentication uses the combination of an identifier--a username or email address--and a password. The user submits these values  through a form, and the application then compares the submitted information against that previously stored (e.g., upon registration).
 
 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
-[advanced application template](installation.md). Below, only the interface methods are listed:
+[advanced application template](tutorial-advanced-app.md). Below, only the interface methods are listed:
 
 ```php
 class User extends ActiveRecord implements IdentityInterface
diff --git a/docs/guide/security-authorization.md b/docs/guide/security-authorization.md
index 39fadc5..d9bc358 100644
--- a/docs/guide/security-authorization.md
+++ b/docs/guide/security-authorization.md
@@ -1,7 +1,7 @@
 Authorization
 =============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Authorization is the process of verifying that a user has enough permission to do something. Yii provides two authorization
 methods: Access Control Filter (ACF) and Role-Based Access Control (RBAC).
diff --git a/docs/guide/security-passwords.md b/docs/guide/security-passwords.md
index b28e5fc..0995b45 100644
--- a/docs/guide/security-passwords.md
+++ b/docs/guide/security-passwords.md
@@ -1,7 +1,7 @@
 Security
 ========
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Good security is vital to the health and success of any application. Unfortunately, many developers cut corners when it comes to security, either due to a lack of understanding or because implementation is too much of a hurdle. To make your Yii powered application as secure as possible, Yii has included several excellent and easy to use security features.
 
diff --git a/docs/guide/start-basic.md b/docs/guide/start-basic.md
index 36310d1..e02ad70 100644
--- a/docs/guide/start-basic.md
+++ b/docs/guide/start-basic.md
@@ -1,7 +1,7 @@
 Basic application template
 ==========================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The basic Yii application template is a perfect fit for small projects or when you're just learning the framework.
 
diff --git a/docs/guide/start-environment.md b/docs/guide/start-environment.md
index 18ccbeb..723f994 100644
--- a/docs/guide/start-environment.md
+++ b/docs/guide/start-environment.md
@@ -1,7 +1,7 @@
 Installation
 ============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 There are two ways you can install the Yii framework:
 
diff --git a/docs/guide/start-lifecycle.md b/docs/guide/start-lifecycle.md
index c836146..0de5b34 100644
--- a/docs/guide/start-lifecycle.md
+++ b/docs/guide/start-lifecycle.md
@@ -1,7 +1,7 @@
 Request Lifecycle
 =================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The following diagram shows a typical workflow of a Yii application  handling a user request:
 
diff --git a/docs/guide/start-structure.md b/docs/guide/start-structure.md
index e72864b..80b5dd8 100644
--- a/docs/guide/start-structure.md
+++ b/docs/guide/start-structure.md
@@ -1,7 +1,7 @@
 Application Structure
 =====================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii implements the model-view-controller (MVC) design pattern, which is
 widely adopted in Web and other application programming. MVC aims to separate business logic from
diff --git a/docs/guide/structure-controllers.md b/docs/guide/structure-controllers.md
index 570e7a9..04ab6a2 100644
--- a/docs/guide/structure-controllers.md
+++ b/docs/guide/structure-controllers.md
@@ -1,7 +1,7 @@
 Controller
 ==========
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Controller is one of the key parts of the application. It determines how to handle incoming request and creates a response.
 
diff --git a/docs/guide/structure-entry.md b/docs/guide/structure-entry.md
index c8d3d52..2a12ac1 100644
--- a/docs/guide/structure-entry.md
+++ b/docs/guide/structure-entry.md
@@ -1,7 +1,7 @@
 Entry Scripts
 =============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Configuring options in the bootstrap file
 -----------------------------------------
diff --git a/docs/guide/structure-models.md b/docs/guide/structure-models.md
index b46a01c..c19b0ca 100644
--- a/docs/guide/structure-models.md
+++ b/docs/guide/structure-models.md
@@ -1,7 +1,7 @@
 Model
 =====
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 In keeping with the MVC approach, a model in Yii is intended for storing or temporarily representing application data, as well as defining the busines rules by which the data must abide.
 
diff --git a/docs/guide/structure-views.md b/docs/guide/structure-views.md
index 65407d6..3a5a2f1 100644
--- a/docs/guide/structure-views.md
+++ b/docs/guide/structure-views.md
@@ -1,7 +1,7 @@
 View
 ====
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The view component is an important part of MVC. The view acts as the interface to the application, making it responsible
 for presenting data to end users, displaying forms, and so forth.
diff --git a/docs/guide/test-fixtures.md b/docs/guide/test-fixtures.md
index 4760a0c..7e2591e 100644
--- a/docs/guide/test-fixtures.md
+++ b/docs/guide/test-fixtures.md
@@ -1,7 +1,7 @@
 Fixtures
 ========
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Fixtures are important part of testing. Their main purpose is to set up the environment in a fixed/known state
 so that your tests are repeatable and run in an expected way. Yii provides a fixture framework that allows
diff --git a/docs/guide/tool-debugger.md b/docs/guide/tool-debugger.md
index 276e78f..bca32a4 100644
--- a/docs/guide/tool-debugger.md
+++ b/docs/guide/tool-debugger.md
@@ -1,7 +1,7 @@
 Debug toolbar and debugger
 ==========================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii2 includes a handy toolbar, and built-in debugger, for faster development and debugging of your applications. The toolbar displays information
 about the currently opened page, while the debugger can be used to analyze data you've previously collected (i.e., to confirm the values of variables).
diff --git a/docs/guide/tool-gii.md b/docs/guide/tool-gii.md
index 4f39c7d..69506f2 100644
--- a/docs/guide/tool-gii.md
+++ b/docs/guide/tool-gii.md
@@ -1,7 +1,7 @@
 The Gii code generation tool
 ============================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii includes a handy tool, named Gii, that provides rapid prototyping by generating commonly used code snippets
 as well as complete CRUD controllers.
diff --git a/docs/guide/tutorial-advanced-app.md b/docs/guide/tutorial-advanced-app.md
index 88f0c10..4ff4d0f 100644
--- a/docs/guide/tutorial-advanced-app.md
+++ b/docs/guide/tutorial-advanced-app.md
@@ -1,7 +1,7 @@
 Advanced application template
 =============================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 This template is for large projects developed in teams where the backend is divided from the frontend, application is deployed
 to multiple servers etc. This application template also goes a bit further regarding features and provides essential
@@ -74,16 +74,20 @@ Root directory contains a set of files.
 Predefined path aliases
 -----------------------
 
-- @yii - framework directory.
-- @app - base path of currently running application.
-- @common - common directory.
-- @frontend - frontend web application directory.
-- @backend - backend web application directory.
-- @console - console directory.
-- @runtime - runtime directory of currently running web application.
-- @vendor - Composer vendor directory.
-- @web - base URL of currently running web application.
-- @webroot - web root directory of currently running web application.
+- `@yii` - framework directory.
+- `@app` - base path of currently running application.
+- `@common` - common directory.
+- `@frontend` - frontend web application directory.
+- `@backend` - backend web application directory.
+- `@console` - console directory.
+- `@runtime` - runtime directory of currently running web application.
+- `@vendor` - Composer vendor directory.
+- `@web` - base URL of currently running web application.
+- `@webroot` - web root directory of currently running web application.
+
+The aliases specific to the directory structure of the advanced application
+(`@common`,  `@frontend`, `@backend`, and `@console`) are defined in `common/config/aliases.php`.
+
 
 Applications
 ------------
diff --git a/docs/guide/tutorial-console.md b/docs/guide/tutorial-console.md
index 6ba63f0..af49f56 100644
--- a/docs/guide/tutorial-console.md
+++ b/docs/guide/tutorial-console.md
@@ -1,7 +1,7 @@
 Console applications
 ====================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii has full featured support for console applications, whose structure is very similar to a Yii web application. A console application
 consists of one 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.
diff --git a/docs/guide/tutorial-handling-errors.md b/docs/guide/tutorial-handling-errors.md
index c959dfb..db5e1fb 100644
--- a/docs/guide/tutorial-handling-errors.md
+++ b/docs/guide/tutorial-handling-errors.md
@@ -1,7 +1,7 @@
 Error Handling
 ==============
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Error handling in Yii is different than handling errors in plain PHP. First of all, Yii will convert all non-fatal errors
 to *exceptions*:
diff --git a/docs/guide/tutorial-i18n.md b/docs/guide/tutorial-i18n.md
index cf8c9eb..96a3625 100644
--- a/docs/guide/tutorial-i18n.md
+++ b/docs/guide/tutorial-i18n.md
@@ -1,7 +1,7 @@
 Internationalization
 ====================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Internationalization (I18N) refers to the process of designing a software application so that it can be adapted to
 various languages and regions without engineering changes. For Web applications, this is of particular importance
diff --git a/docs/guide/tutorial-logging.md b/docs/guide/tutorial-logging.md
index 8289535..c34daaf 100644
--- a/docs/guide/tutorial-logging.md
+++ b/docs/guide/tutorial-logging.md
@@ -1,7 +1,7 @@
 Logging
 =======
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 Yii provides flexible and extensible logger that is able to handle messages according to severity level or their type.
 You may filter messages by multiple criteria and forward them to files, email, debugger etc.
diff --git a/docs/guide/tutorial-performance-tuning.md b/docs/guide/tutorial-performance-tuning.md
index 56d7708..2cfba00 100644
--- a/docs/guide/tutorial-performance-tuning.md
+++ b/docs/guide/tutorial-performance-tuning.md
@@ -1,7 +1,7 @@
 Performance Tuning
 ==================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 The performance of your web application is based upon two parts. First is the framework performance
 and the second is the application itself. Yii has a pretty low performance impact
diff --git a/docs/guide/tutorial-start-from-scratch.md b/docs/guide/tutorial-start-from-scratch.md
index 8289555..650863e 100644
--- a/docs/guide/tutorial-start-from-scratch.md
+++ b/docs/guide/tutorial-start-from-scratch.md
@@ -1,7 +1,7 @@
 Creating your own Application structure
 =======================================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 While [basic](apps-basic.md) and [advanced](apps-advanced.md) application templates are great for most of your needs
 you may want to create your own application template to start your projects with.
diff --git a/docs/guide/tutorial-template-engines.md b/docs/guide/tutorial-template-engines.md
index 29aca04..5d693dc 100644
--- a/docs/guide/tutorial-template-engines.md
+++ b/docs/guide/tutorial-template-engines.md
@@ -1,7 +1,7 @@
 Using template engines
 ======================
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 By default, Yii uses PHP as its template language, but you can configure Yii to support other rendering engines, such as
 [Twig](http://twig.sensiolabs.org/) or [Smarty](http://www.smarty.net/).
@@ -44,36 +44,65 @@ That code would be added to the `require` section of `composer.json`. After maki
 Twig
 ----
 
-To use Twig, you need to create templates in files that have the `.twig` extension (or use another file extension but configure the component accordingly).
-Unlike standard view files, when using Twig you must include the extension in your `$this->render()`
-or `$this->renderPartial()` controller calls:
+To use Twig, you need to create templates in files that have the `.twig` extension (or use another file extension but
+configure the component accordingly). Unlike standard view files, when using Twig you must include the extension
+in your `$this->render()` or `$this->renderPartial()` controller calls:
 
 ```php
 echo $this->render('renderer.twig', ['username' => 'Alex']);
 ```
 
-### Additional syntax
+### Template syntax
 
-Yii adds some extra syntax constructs additionally to standard Twig ones.
+The best resource to learn Twig basics is its official documentation you can find at
+[twig.sensiolabs.org](http://twig.sensiolabs.org/documentation). Additionally there are Yii-specific addtions
+described below.
 
+#### Method and function calls
 
-###
+If you need result you can call a method or a function using the following syntax:
 
-{{registerAssetBundle('AppAsset')}} - Registers asset bundle of a given name
+```
+{% set result = my_function({'a' : 'b'}) %}
+{% set result = myObject.my_function({'a' : 'b'}) %}
+```
 
+If you need to echo result instead of assigning it to a variable:
 
-### Forms
+```
+{{ my_function({'a' : 'b'}) }}
+{{ myObject.my_function({'a' : 'b'}) }}
+```
+
+In case you don't need result you shoud use `void` wrapper:
 
 ```
-{% set form = form_begin({ ... }) %}
-{{ form.field(...) }}
-{% form.end() %}
+{{ void(my_function({'a' : 'b'})) }}
+{{ void(myObject.my_function({'a' : 'b'})} }}
 ```
 
+#### Forms
 
-#### Getting URL for a route
+There are two form helper functions `form_begin` and `form_end` to make using forms more convenient:
 
-There are two functions you can use for URLs:
+```
+{% set form = form_begin({
+    'id' : 'login-form',
+    'options' : {'class' : 'form-horizontal'},
+}) %}
+    {{ form.field(model, 'username') | raw }}
+    {{ form.field(model, 'password').passwordInput() | raw }}
+
+    <div class="form-group">
+        <input type="submit" value="Login" class="btn btn-primary" />
+    </div>
+{{ form_end() }}
+```
+
+
+#### URLs
+
+There are two functions you can use for building URLs:
 
 ```php
 <a href="{{ path('blog/view', {'alias' : post.alias}) }}">{{ post.title }}</a>
@@ -82,22 +111,28 @@ There are two functions you can use for URLs:
 
 `path` generates relative URL while `url` generates absolute one. Internally both are using [[\yii\helpers\Url]].
 
-### Additional variables
+#### Additional variables
 
-Within Twig templates, you can also make use of these variables:
+Within Twig templates the following variables are always defined:
 
 - `app`, which equates to `\Yii::$app`
 - `this`, which equates to the current `View` object
 
-### Globals
+### Additional configuration
+
+Yii Twig extension allows you to define your own syntax and bring regular helper classes into templates. Let's review
+configuration options.
 
-You can add global helpers or values via the application configuration's `globals` variable. You can define both Yii helpers and your own
-variables there:
+#### Globals
+
+You can add global helpers or values via the application configuration's `globals` variable. You can define both Yii
+helpers and your own variables there:
 
 ```php
 'globals' => [
     'html' => '\yii\helpers\Html',
     'name' => 'Carsten',
+    'GridView' => '\yii\grid\GridView',
 ],
 ```
 
@@ -105,9 +140,29 @@ Once configured, in your template you can use the globals in the following way:
 
 ```
 Hello, {{name}}! {{ html.a('Please login', 'site/login') | raw }}.
+
+{{ GridView.widget({'dataProvider' : provider}) | raw }}
+```
+
+#### Functions
+
+You can define additional functions like the following:
+
+```php
+'functions' => [
+    'rot13' => 'str_rot13',
+    'truncate' => '\yii\helpers\StringHelper::truncate',
+],
+```
+
+In template they could be used like the following:
+
+```
+`{{ rot13('test') }}`
+`{{ truncate(post.text, 100) }}`
 ```
 
-### Additional filters
+#### Filters
 
 Additional filters may be added via the application configuration's `filters` option:
 
@@ -117,7 +172,7 @@ Additional filters may be added via the application configuration's `filters` op
 ],
 ```
 
-Then in the template you can use:
+Then in the template you can apply filter using the following syntax:
 
 ```
 {{ model|jsonEncode }}
diff --git a/docs/guide/tutorial-theming.md b/docs/guide/tutorial-theming.md
index f4d4a80..bcb527f 100644
--- a/docs/guide/tutorial-theming.md
+++ b/docs/guide/tutorial-theming.md
@@ -1,7 +1,7 @@
 Theming
 =======
 
-> Note: This chapter is under development.
+> Note: This section is under development.
 
 A theme is a directory of view and layout files. Each file of the theme overrides corresponding file of an application
 when rendered. A single application may use multiple themes and each may provide totally different experience. At any
diff --git a/docs/internals/core-code-style.md b/docs/internals/core-code-style.md
index fae7fff..c67302a 100644
--- a/docs/internals/core-code-style.md
+++ b/docs/internals/core-code-style.md
@@ -139,7 +139,6 @@ class Foo
 ### 4.5 Constructors
 
 - `__construct` should be used instead of PHP 4 style constructors.
-- When instantiating class it should be `new MyClass();` instead of `new MyClass;`.
 
 ## 5 PHP
 
diff --git a/extensions/bootstrap/ActiveField.php b/extensions/bootstrap/ActiveField.php
index 1aa8c33..d5b578d 100644
--- a/extensions/bootstrap/ActiveField.php
+++ b/extensions/bootstrap/ActiveField.php
@@ -11,13 +11,13 @@ use yii\helpers\Html;
 use yii\helpers\ArrayHelper;
 
 /**
- * A Bootstrap 3 enhanced version of [[yii\widgets\ActiveField]].
+ * A Bootstrap 3 enhanced version of [[\yii\widgets\ActiveField]].
  *
- * This class adds some useful features to [[yii\widgets\ActiveField|ActiveField]] to render all
+ * This class adds some useful features to [[\yii\widgets\ActiveField|ActiveField]] to render all
  * sorts of Bootstrap 3 form fields in different form layouts:
  *
  * - [[inputTemplate]] is an optional template to render complex inputs, for example input groups
- * - [[horizontalClass]] defines the CSS grid classes to add to label, wrapper, error and hint
+ * - [[horizontalCssClasses]] defines the CSS grid classes to add to label, wrapper, error and hint
  *   in horizontal forms
  * - [[inline]]/[[inline()]] is used to render inline [[checkboxList()]] and [[radioList()]]
  * - [[enableError]] can be set to `false` to disable to the error
diff --git a/extensions/bootstrap/ActiveForm.php b/extensions/bootstrap/ActiveForm.php
index 58bbf54..5ac1b1a 100644
--- a/extensions/bootstrap/ActiveForm.php
+++ b/extensions/bootstrap/ActiveForm.php
@@ -12,7 +12,7 @@ use yii\helpers\Html;
 use yii\base\InvalidConfigException;
 
 /**
- * A Bootstrap 3 enhanced version of [[yii\widgets\ActiveForm]].
+ * A Bootstrap 3 enhanced version of [[\yii\widgets\ActiveForm]].
  *
  * This class mainly adds the [[layout]] property to choose a Bootstrap 3 form layout.
  * So for example to render a horizontal form you would:
diff --git a/extensions/gii/CHANGELOG.md b/extensions/gii/CHANGELOG.md
index 4a3ff11..bc2818e 100644
--- a/extensions/gii/CHANGELOG.md
+++ b/extensions/gii/CHANGELOG.md
@@ -6,6 +6,7 @@ Yii Framework 2 gii extension Change Log
 
 - Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
 - Bug #3265: Fixed incorrect controller class name validation (suralc)
+- Enh #2018: Search model is not required anymore in CRUD generator (johonunu)
 - Enh #3088: The gii module will manage their own URL rules now (qiangxue)
 - Enh #3222: Added `useTablePrefix` option to the model generator for Gii (horizons2)
 
diff --git a/extensions/gii/generators/crud/Generator.php b/extensions/gii/generators/crud/Generator.php
index 90901ec..aecc337 100644
--- a/extensions/gii/generators/crud/Generator.php
+++ b/extensions/gii/generators/crud/Generator.php
@@ -35,7 +35,7 @@ class Generator extends \yii\gii\Generator
     public $controllerClass;
     public $baseControllerClass = 'yii\web\Controller';
     public $indexWidgetType = 'grid';
-    public $searchModelClass;
+    public $searchModelClass = '';
 
     /**
      * @inheritdoc
@@ -61,7 +61,7 @@ class Generator extends \yii\gii\Generator
     {
         return array_merge(parent::rules(), [
             [['moduleID', 'controllerClass', 'modelClass', 'searchModelClass', 'baseControllerClass'], 'filter', 'filter' => 'trim'],
-            [['modelClass', 'searchModelClass', 'controllerClass', 'baseControllerClass', 'indexWidgetType'], 'required'],
+            [['modelClass', 'controllerClass', 'baseControllerClass', 'indexWidgetType'], 'required'],
             [['searchModelClass'], 'compare', 'compareAttribute' => 'modelClass', 'operator' => '!==', 'message' => 'Search Model Class must not be equal to Model Class.'],
             [['modelClass', 'controllerClass', 'baseControllerClass', 'searchModelClass'], 'match', 'pattern' => '/^[\w\\\\]*$/', 'message' => 'Only word characters and backslashes are allowed.'],
             [['modelClass'], 'validateClass', 'params' => ['extends' => BaseActiveRecord::className()]],
@@ -162,15 +162,22 @@ class Generator extends \yii\gii\Generator
     public function generate()
     {
         $controllerFile = Yii::getAlias('@' . str_replace('\\', '/', ltrim($this->controllerClass, '\\')) . '.php');
-        $searchModel = Yii::getAlias('@' . str_replace('\\', '/', ltrim($this->searchModelClass, '\\') . '.php'));
+
         $files = [
             new CodeFile($controllerFile, $this->render('controller.php')),
-            new CodeFile($searchModel, $this->render('search.php')),
         ];
 
+        if (!empty($this->searchModelClass)) {
+            $searchModel = Yii::getAlias('@' . str_replace('\\', '/', ltrim($this->searchModelClass, '\\') . '.php'));
+            $files[] = new CodeFile($searchModel, $this->render('search.php'));
+        }
+
         $viewPath = $this->getViewPath();
         $templatePath = $this->getTemplatePath() . '/views';
         foreach (scandir($templatePath) as $file) {
+            if (empty($this->searchModelClass) && $file === '_search.php') {
+                continue;
+            }
             if (is_file($templatePath . '/' . $file) && pathinfo($file, PATHINFO_EXTENSION) === 'php') {
                 $files[] = new CodeFile("$viewPath/$file", $this->render("views/$file"));
             }
@@ -438,7 +445,7 @@ class Generator extends \yii\gii\Generator
             if (is_subclass_of($class, 'yii\mongodb\ActiveRecord')) {
                 return "'id' => (string)\$model->{$pks[0]}";
             } else {
-                return "'id' => \$model->{$pks[0]}"; 
+                return "'id' => \$model->{$pks[0]}";
             }
         } else {
             $params = [];
@@ -446,7 +453,7 @@ class Generator extends \yii\gii\Generator
                 if (is_subclass_of($class, 'yii\mongodb\ActiveRecord')) {
                     $params[] = "'$pk' => (string)\$model->$pk";
                 } else {
-                    $params[] = "'$pk' => \$model->$pk";                   
+                    $params[] = "'$pk' => \$model->$pk";
                 }
             }
 
diff --git a/extensions/gii/generators/crud/default/controller.php b/extensions/gii/generators/crud/default/controller.php
index 9bfef66..e51e63d 100644
--- a/extensions/gii/generators/crud/default/controller.php
+++ b/extensions/gii/generators/crud/default/controller.php
@@ -31,7 +31,11 @@ namespace <?= StringHelper::dirname(ltrim($generator->controllerClass, '\\')) ?>
 
 use Yii;
 use <?= ltrim($generator->modelClass, '\\') ?>;
+<?php if (!empty($generator->searchModelClass)): ?>
 use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
+<?php else: ?>
+use yii\data\ActiveDataProvider;
+<?php endif; ?>
 use <?= ltrim($generator->baseControllerClass, '\\') ?>;
 use yii\web\NotFoundHttpException;
 use yii\filters\VerbFilter;
@@ -59,6 +63,7 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
      */
     public function actionIndex()
     {
+<?php if (!empty($generator->searchModelClass)): ?>
         $searchModel = new <?= isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>;
         $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
 
@@ -66,6 +71,15 @@ class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->bas
             'dataProvider' => $dataProvider,
             'searchModel' => $searchModel,
         ]);
+<?php else: ?>
+        $dataProvider = new ActiveDataProvider([
+            'query' => <?= $modelClass ?>::find(),
+        ]);
+
+        return $this->render('index', [
+            'dataProvider' => $dataProvider,
+        ]);
+<?php endif; ?>
     }
 
     /**
diff --git a/extensions/gii/generators/crud/default/views/index.php b/extensions/gii/generators/crud/default/views/index.php
index 0e61181..f56657b 100644
--- a/extensions/gii/generators/crud/default/views/index.php
+++ b/extensions/gii/generators/crud/default/views/index.php
@@ -20,7 +20,7 @@ use <?= $generator->indexWidgetType === 'grid' ? "yii\\grid\\GridView" : "yii\\w
 /**
  * @var yii\web\View $this
  * @var yii\data\ActiveDataProvider $dataProvider
- * @var <?= ltrim($generator->searchModelClass, '\\') ?> $searchModel
+<?= !empty($generator->searchModelClass) ? " * @var " . ltrim($generator->searchModelClass, '\\') . " \$searchModel\n" : '' ?>
  */
 
 $this->title = <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
@@ -29,8 +29,9 @@ $this->params['breadcrumbs'][] = $this->title;
 <div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-index">
 
     <h1><?= "<?= " ?>Html::encode($this->title) ?></h1>
-
-    <?= "<?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
+<?php if(!empty($generator->searchModelClass)): ?>
+<?= "    <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
+<?php endif; ?>
 
     <p>
         <?= "<?= " ?>Html::a(<?= $generator->generateString('Create {modelClass}', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?>, ['create'], ['class' => 'btn btn-success']) ?>
@@ -39,8 +40,7 @@ $this->params['breadcrumbs'][] = $this->title;
 <?php if ($generator->indexWidgetType === 'grid'): ?>
     <?= "<?= " ?>GridView::widget([
         'dataProvider' => $dataProvider,
-        'filterModel' => $searchModel,
-        'columns' => [
+        <?= !empty($generator->searchModelClass) ? "'filterModel' => \$searchModel,\n        'columns' => [\n" : "'columns' => [\n"; ?>
             ['class' => 'yii\grid\SerialColumn'],
 
 <?php
diff --git a/extensions/gii/generators/extension/Generator.php b/extensions/gii/generators/extension/Generator.php
index f6a1c9d..33ce047 100644
--- a/extensions/gii/generators/extension/Generator.php
+++ b/extensions/gii/generators/extension/Generator.php
@@ -112,7 +112,7 @@ class Generator extends \yii\gii\Generator
         return [
             'vendorName'  => 'This refers to the name of the publisher, your GitHub user name is usually a good choice, eg. <code>myself</code>.',
             'packageName' => 'This is the name of the extension on packagist, eg. <code>yii2-foobar</code>.',
-            'namespace'   => 'PSR-4, eg. <code>myself\foobar\</code> This will be added to your autoloading by composer. Do not use yii or yii2 in the namespace.',
+            'namespace'   => 'PSR-4, eg. <code>myself\foobar\</code> This will be added to your autoloading by composer. Do not use yii, yii2 or yiisoft in the namespace.',
             'keywords'    => 'Comma separated keywords for this extension.',
             'outputPath'  => 'The temporary location of the generated files.',
             'title'       => 'A more descriptive name of your application for the README file.',
diff --git a/extensions/gii/views/default/index.php b/extensions/gii/views/default/index.php
index 0ba6529..05ce312 100644
--- a/extensions/gii/views/default/index.php
+++ b/extensions/gii/views/default/index.php
@@ -11,7 +11,7 @@ $this->title = 'Welcome to Gii';
 ?>
 <div class="default-index">
     <div class="page-header">
-        <h1>Welcome to Gii <small>a magic tool that can write code for you</small></h1>
+        <h1>Welcome to Gii <small>a magical tool that can write code for you</small></h1>
     </div>
 
     <p class="lead">Start the fun with the following code generators:</p>
diff --git a/extensions/jui/Tabs.php b/extensions/jui/Tabs.php
index f6a5fb7..52d70dc 100644
--- a/extensions/jui/Tabs.php
+++ b/extensions/jui/Tabs.php
@@ -39,7 +39,7 @@ use yii\helpers\Html;
  *             'label' => 'Ajax tab',
  *             'url' => ['ajax/content'],
  *         ],
- *     ),
+ *     ],
  *     'options' => ['tag' => 'div'],
  *     'itemOptions' => ['tag' => 'div'],
  *     'headerOptions' => ['class' => 'my-class'],
diff --git a/extensions/twig/CHANGELOG.md b/extensions/twig/CHANGELOG.md
index 1ec55cc..6f98985 100644
--- a/extensions/twig/CHANGELOG.md
+++ b/extensions/twig/CHANGELOG.md
@@ -5,6 +5,7 @@ Yii Framework 2 twig extension Change Log
 --------------------------
 
 - Bug #2925: Fixed throwing exception when accessing AR property with null value (samdark)
+- Enh #1799: Added `form_begin`, `form_end` to twig extension (samdark)
 
 
 2.0.0-beta April 13, 2014
diff --git a/extensions/twig/README.md b/extensions/twig/README.md
index e7afabe..cf311a9 100644
--- a/extensions/twig/README.md
+++ b/extensions/twig/README.md
@@ -7,19 +7,20 @@ To use this extension, simply add the following code in your application configu
 
 ```php
 return [
-	//....
-	'components' => [
-		'view' => [
-			'renderers' => [
-				'twig' => [
-					'class' => 'yii\twig\ViewRenderer',
-					//'cachePath' => '@runtime/Twig/cache',
-					//'options' => [], /*  Array of twig options */
-					// ... see ViewRenderer for more options
-				],
-			],
-		],
-	],
+    //....
+    'components' => [
+        'view' => [
+            'renderers' => [
+                'twig' => [
+                    'class' => 'yii\twig\ViewRenderer',
+                    // set cachePath to false in order to disable template caching
+                    //'cachePath' => '@runtime/Twig/cache',
+                    //'options' => [], /*  Array of twig options */
+                    // ... see ViewRenderer for more options
+                ],
+            ],
+        ],
+    ],
 ];
 ```
 
diff --git a/extensions/twig/ViewRenderer.php b/extensions/twig/ViewRenderer.php
index 2f373a0..0d6ff9c 100644
--- a/extensions/twig/ViewRenderer.php
+++ b/extensions/twig/ViewRenderer.php
@@ -11,6 +11,7 @@ use Yii;
 use yii\base\View;
 use yii\base\ViewRenderer as BaseViewRenderer;
 use yii\helpers\Url;
+use yii\widgets\ActiveForm;
 
 /**
  * TwigViewRenderer allows you to use Twig templates in views.
@@ -115,11 +116,6 @@ class ViewRenderer extends BaseViewRenderer
             $this->setLexerOptions($this->lexerOptions);
         }
 
-//        $this->addFunctions([
-//            'rot13' => 'str_rot13',
-//            'jsonEncode' => '\yii\helpers\Json::encode',
-//        ]);
-
         // Adding global 'void' function (usage: {{void(App.clientScript.registerScriptFile(...))}})
         $this->twig->addFunction('void', new \Twig_Function_Function(function ($argument) {
         }));
@@ -132,6 +128,14 @@ class ViewRenderer extends BaseViewRenderer
             return Url::to(array_merge([$path], $args), true);
         }));
 
+        $this->twig->addFunction('form_begin', new \Twig_Function_Function(function ($args = []) {
+            return ActiveForm::begin($args);
+        }));
+
+        $this->twig->addFunction('form_end', new \Twig_Function_Function(function () {
+            ActiveForm::end();
+        }));
+
         $this->twig->addGlobal('app', \Yii::$app);
     }
 
diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md
index 20668b0..837657f 100644
--- a/framework/CHANGELOG.md
+++ b/framework/CHANGELOG.md
@@ -23,6 +23,8 @@ Yii Framework 2 Change Log
 - Bug #3236: Return value for DateTime->format('U') casted to double to allow correct date formatting (pgaultier)
 - Bug #3268: Fixed the bug that the schema name in a table name was not respected by `yii\db\mysql\Schema` (terazoid, qiangxue)
 - Bug #3311: Fixed the bug that `yii\di\Container::has()` did not return correct value (mgrechanik, qiangxue)
+- Bug #3327: Fixed "Unable to find debug data" when logging objects with circular references (jarekkozak, samdark)
+- Bug #3368: Fix for comparing numeric attributes in JavaScript (technixp)
 - Enh #2264: `CookieCollection::has()` will return false for expired or removed cookies (qiangxue)
 - Enh #2837: Error page now shows arguments in stack trace method calls (samdark)
 - Enh #2906: Added support for using conditional comments for js and css files registered through asset bundles and Html helper (exromany, qiangxue)
@@ -42,6 +44,7 @@ Yii Framework 2 Change Log
 - Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
 - Enh: Added `yii\web\UrlManager::addRules()` to simplify adding new URL rules (qiangxue)
 - Enh: Added support to insert an event handler at the beginning of class-level event handler queue (qiangxue)
+- Chg #2913: RBAC `DbManager` is now initialized via migration (samdark)
 - Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
 - Chg #3175: InvalidCallException, InvalidParamException, UnknownMethodException are now extended from SPL BadMethodCallException (samdark)
 - Chg: Replaced `clearAll()` and `clearAllAssignments()` in `yii\rbac\ManagerInterface` with `removeAll()`, `removeAllRoles()`, `removeAllPermissions()`, `removeAllRules()` and `removeAllAssignments()` (qiangxue)
diff --git a/framework/assets/yii.validation.js b/framework/assets/yii.validation.js
index bfa1a92..d6855c0 100644
--- a/framework/assets/yii.validation.js
+++ b/framework/assets/yii.validation.js
@@ -203,16 +203,16 @@ yii.validation = (function ($) {
                     valid = value !== compareValue;
                     break;
                 case '>':
-                    valid = value > compareValue;
+                    valid = value > parseFloat(compareValue);
                     break;
                 case '>=':
-                    valid = value >= compareValue;
+                    valid = value >= parseFloat(compareValue);
                     break;
                 case '<':
-                    valid = value < compareValue;
+                    valid = value < parseFloat(compareValue);
                     break;
                 case '<=':
-                    valid = value <= compareValue;
+                    valid = value <= parseFloat(compareValue);
                     break;
                 default:
                     valid = false;
diff --git a/framework/console/Controller.php b/framework/console/Controller.php
index cf39ed1..a927692 100644
--- a/framework/console/Controller.php
+++ b/framework/console/Controller.php
@@ -49,7 +49,7 @@ class Controller extends \yii\base\Controller
      * @param resource $stream the stream to check.
      * @return boolean Whether to enable ANSI style in output.
      */
-    public function isColorEnabled($stream = STDOUT)
+    public function isColorEnabled($stream = \STDOUT)
     {
         return $this->color ===  null ? Console::streamSupportsAnsiColors($stream) : $this->color;
     }
@@ -192,13 +192,13 @@ class Controller extends \yii\base\Controller
      */
     public function stderr($string)
     {
-        if ($this->isColorEnabled(STDERR)) {
+        if ($this->isColorEnabled(\STDERR)) {
             $args = func_get_args();
             array_shift($args);
             $string = Console::ansiFormat($string, $args);
         }
 
-        return fwrite(STDERR, $string);
+        return fwrite(\STDERR, $string);
     }
 
     /**
diff --git a/framework/console/ErrorHandler.php b/framework/console/ErrorHandler.php
index f9cf74c..3b4761a 100644
--- a/framework/console/ErrorHandler.php
+++ b/framework/console/ErrorHandler.php
@@ -64,7 +64,7 @@ class ErrorHandler extends \yii\base\ErrorHandler
      */
     protected function formatMessage($message, $format = [Console::FG_RED, Console::BOLD])
     {
-        $stream = (PHP_SAPI === 'cli') ? STDERR : STDOUT;
+        $stream = (PHP_SAPI === 'cli') ? \STDERR : \STDOUT;
         // try controller first to allow check for --color switch
         if (Yii::$app->controller instanceof \yii\console\Controller && Yii::$app->controller->isColorEnabled($stream)
             || Yii::$app instanceof \yii\console\Application && Console::streamSupportsAnsiColors($stream)) {
diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php
index 55b7b40..08015fd 100644
--- a/framework/db/BaseActiveRecord.php
+++ b/framework/db/BaseActiveRecord.php
@@ -114,7 +114,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
 
     /**
      * @inheritdoc
-     * @return static[]|array an array of ActiveRecord instance, or an empty array if nothing matches.
+     * @return static[] an array of ActiveRecord instance, or an empty array if nothing matches.
      */
     public static function findAll($condition)
     {
diff --git a/framework/helpers/BaseArrayHelper.php b/framework/helpers/BaseArrayHelper.php
index 1ff90bc..77f8007 100644
--- a/framework/helpers/BaseArrayHelper.php
+++ b/framework/helpers/BaseArrayHelper.php
@@ -401,7 +401,7 @@ class BaseArrayHelper
      * `SORT_REGULAR`, `SORT_NUMERIC`, `SORT_STRING`, `SORT_LOCALE_STRING`, `SORT_NATURAL` and `SORT_FLAG_CASE`.
      * Please refer to [PHP manual](http://php.net/manual/en/function.sort.php)
      * for more details. When sorting by multiple keys with different sort flags, use an array of sort flags.
-     * @throws InvalidParamException if the $descending or $sortFlag parameters do not have
+     * @throws InvalidParamException if the $direction or $sortFlag parameters do not have
      * correct number of elements as that of $key.
      */
     public static function multisort(&$array, $key, $direction = SORT_ASC, $sortFlag = SORT_REGULAR)
@@ -414,7 +414,7 @@ class BaseArrayHelper
         if (is_scalar($direction)) {
             $direction = array_fill(0, $n, $direction);
         } elseif (count($direction) !== $n) {
-            throw new InvalidParamException('The length of $descending parameter must be the same as that of $keys.');
+            throw new InvalidParamException('The length of $direction parameter must be the same as that of $keys.');
         }
         if (is_scalar($sortFlag)) {
             $sortFlag = array_fill(0, $n, $sortFlag);
diff --git a/framework/helpers/BaseConsole.php b/framework/helpers/BaseConsole.php
index 178bbcd..aafeeff 100644
--- a/framework/helpers/BaseConsole.php
+++ b/framework/helpers/BaseConsole.php
@@ -628,7 +628,7 @@ class BaseConsole
      */
     public static function stdin($raw = false)
     {
-        return $raw ? fgets(STDIN) : rtrim(fgets(STDIN), PHP_EOL);
+        return $raw ? fgets(\STDIN) : rtrim(fgets(\STDIN), PHP_EOL);
     }
 
     /**
@@ -639,7 +639,7 @@ class BaseConsole
      */
     public static function stdout($string)
     {
-        return fwrite(STDOUT, $string);
+        return fwrite(\STDOUT, $string);
     }
 
     /**
@@ -650,7 +650,7 @@ class BaseConsole
      */
     public static function stderr($string)
     {
-        return fwrite(STDERR, $string);
+        return fwrite(\STDERR, $string);
     }
 
     /**
diff --git a/framework/log/Target.php b/framework/log/Target.php
index c355c15..950852f 100644
--- a/framework/log/Target.php
+++ b/framework/log/Target.php
@@ -10,6 +10,7 @@ namespace yii\log;
 use Yii;
 use yii\base\Component;
 use yii\base\InvalidConfigException;
+use yii\helpers\VarDumper;
 use yii\web\Request;
 
 /**
@@ -115,7 +116,7 @@ abstract class Target extends Component
         $context = [];
         foreach ($this->logVars as $name) {
             if (!empty($GLOBALS[$name])) {
-                $context[] = "\${$name} = " . var_export($GLOBALS[$name], true);
+                $context[] = "\${$name} = " . VarDumper::dumpAsString($GLOBALS[$name]);
             }
         }
 
diff --git a/framework/messages/ca/yii.php b/framework/messages/ca/yii.php
new file mode 100644
index 0000000..62d2ffe
--- /dev/null
+++ b/framework/messages/ca/yii.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Message translations.
+ *
+ * This file is automatically generated by 'yii message' command.
+ * It contains the localizable messages extracted from source code.
+ * You may modify this file by translating the extracted messages.
+ *
+ * Each array element represents the translation (value) of a message (key).
+ * If the value is empty, the message is considered as not translated.
+ * Messages that no longer need translation will have their translations
+ * enclosed between a pair of '@@' marks.
+ *
+ * Message string can be used with plural forms format. Check i18n section
+ * of the guide for details.
+ *
+ * NOTE: this file must be saved in UTF-8 encoding.
+ */
+return array (
+  'An internal server error occurred.' => 'S\'ha produït un error intern al servidor.',
+  'Are you sure to delete this item?' => '¿Estás segur d\'eliminar aquest element?',
+  'Are you sure you want to delete this item?' => 'Estas segur que vols eliminar aquest element?',
+  '{attribute} cannot be blank.' => '{attribute} no pot estar buit.',
+  '{attribute} is invalid.' => '{attribute} és invalid.',
+  '{attribute} is not a valid email address.' => '{attribute} no es una direcció de correu valida.',
+  '{attribute} is not a valid URL.' => '{attribute} no és una URL valida.',
+  '{attribute} must be an integer.' => '{attribute} ha de ser un nombre enter.',
+  '{attribute} must be a number.' => '{attribute} ha de  ser un nombre.',
+  '{attribute} must be a string.' => '{attribute} ha de ser una cadena de caràcters.',
+  '{attribute} must be either "{true}" or "{false}".' => '{attribute} ha de ser "{true}" o "{false}".',
+  '{attribute} must be greater than "{compareValue}".' => '{attribute} ha de ser major que "{compareValue}',
+  '{attribute} must be greater than or equal to "{compareValue}".' => '{attribute} ha de ser major o igual que "{compareValue}".',
+  '{attribute} must be less than "{compareValue}".' => '{attribute} ha de ser menor que "{compareValue}".',
+  '{attribute} must be less than or equal to "{compareValue}".' => '{attribute} ha de ser menor o igual que "{compareValue}".',
+  '{attribute} must be no greater than {max}.' => '{attribute} no pot ser major que {max}.',
+  '{attribute} must be no less than {min}.' => '{attribute} no pot ser menor que {min}.',
+  '{attribute} must be repeated exactly.' => '{attribute} ha de ser repetit exactament igual.',
+  '{attribute} must be "{requiredValue}".' => '{attribute} ha de ser "{requiredValue}".',
+  '{attribute} must not be equal to "{compareValue}".' => '{attribute} no pot ser igual que "{compareValue}".',
+  '{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => '{attribute} hauria de contenir com a mínim {min, number} {min, plural, one{lletra} other{lletres}}.',
+  '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} hauria de contenir com a màxim {max, number} {max, plural, one{lletra} other{lletres}}.',
+  '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute} hauria contenir {length, number} {length, plural, one{lletra} other{lletres}}.',
+  '{attribute} "{value}" has already been taken.' => '{attribute} "{value}" ja ha sigut utilitzat.',
+  'Delete' => 'Eliminar',
+  '{delta, plural, =1{a day} other{# days}} ago' => 'hace {delta, plural, =1{un dia} other{# dies}}',
+  '{delta, plural, =1{a minute} other{# minutes}} ago' => 'fa {delta, plural, =1{un minut} other{# minuts}}',
+  '{delta, plural, =1{a month} other{# months}} ago' => 'fa {delta, plural, =1{un mes} other{# mesos}}',
+  '{delta, plural, =1{an hour} other{# hours}} ago' => 'fa {delta, plural, =1{una hora} other{# hores}}',
+  '{delta, plural, =1{a second} other{# seconds}} ago' => 'fa {delta, plural, =1{un segon} other{# segons}}',
+  '{delta, plural, =1{a year} other{# years}} ago' => 'fa {delta, plural, =1{un any} other{# anys}}',
+  'Error' => 'Error',
+  'File upload failed.' => 'Ha fallat la pujada del fitxer.',
+  'Home' => 'Inici',
+  'in {delta, plural, =1{a day} other{# days}}' => 'en {delta, plural, =1{un dia} other{# dies}}',
+  'in {delta, plural, =1{a minute} other{# minutes}}' => 'en {delta, plural, =1{un minut} other{# minuts}}',
+  'in {delta, plural, =1{a month} other{# months}}' => 'en {delta, plural, =1{un mes} other{# mesos}}',
+  'in {delta, plural, =1{an hour} other{# hours}}' => 'en {delta, plural, =1{una hora} other{# hores}}',
+  'in {delta, plural, =1{a second} other{# seconds}}' => 'en {delta, plural, =1{un segon} other{# segons}}',
+  'in {delta, plural, =1{a year} other{# years}}' => 'en {delta, plural, =1{un any} other{# anys}}',
+  'Invalid data received for parameter "{param}".' => 'S\'han rebut dades errònies pel paràmetre "{param}"',
+  'Login Required' => 'Login Requerit',
+  'Missing required arguments: {params}' => 'Falten arguments requerits: {params}',
+  'Missing required parameters: {params}' => 'Falten paràmetres requerits: {params}',
+  '{n} B' => '{n} B',
+  '{n} GB' => '{n} GB',
+  '{n} KB' => '{n} KB',
+  '{n} MB' => '{n} MB',
+  'No help for unknown command "{command}".' => 'No hi ha ajuda per l\'ordre desconeguda "{command}"',
+  'No help for unknown sub-command "{command}".' => 'No hi ha ajuda per la sub-ordre desconeguda "{command}"',
+  'No' => 'No',
+  'No results found.' => 'No s\'han trobat resultats.',
+  '(not set)' => '(no establert)',
+  '{n} PB' => '{n} PB',
+  '{n, plural, =1{# byte} other{# bytes}}' => '{n, plural, =1{# byte} other{# bytes}}',
+  '{n, plural, =1{# gigabyte} other{# gigabytes}}' => '{n, plural, =1{# gigabyte} other{# gigabytes}}',
+  '{n, plural, =1{# kilobyte} other{# kilobytes}}' => '{n, plural, =1{# kilobyte} other{# kilobytes}}',
+  '{n, plural, =1{# megabyte} other{# megabytes}}' => '{n, plural, =1{# megabyte} other{# megabytes}}',
+  '{n, plural, =1{# petabyte} other{# petabytes}}' => '{n, plural, =1{# petabyte} other{# petabytes}}',
+  '{n, plural, =1{# terabyte} other{# terabytes}}' => '{n, plural, =1{# terabyte} other{# terabytes}}',
+  '{n} TB' => '{n} TB',
+  'Only files with these extensions are allowed: {extensions}.' => 'Només s\'accepten arxius amb les seguents extensions: {extensions}',
+  'Only files with these mimeTypes are allowed: {mimeTypes}.' => 'Només s\'accepten arxius amb els seguents tipus MIME: {mimeTypes}',
+  'Only files with these MIME types are allowed: {mimeTypes}.' => 'Només s\'accepten arxius amb els següents tipus MIME: {mimeTypes}.',
+  'Page not found.' => 'No s\'ha trobat la pàgina.',
+  'Please fix the following errors:' => 'Si us plau corregeix els següents errors:',
+  'Please upload a file.' => 'Si us plau puja un arxiu.',
+  'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => 'Mostrant  <b>{begin, number}-{end, number}</b> de <b>{totalCount, number}</b> {totalCount, plural, one{element} other{elements}}.',
+  'The file "{file}" is not an image.' => 'L\'arxiu "{file}" no és una imatge.',
+  'The file "{file}" is too big. Its size cannot exceed {limit, number} {limit, plural, one{byte} other{bytes}}.' => 'L\'arxiu "{file}" és massa gran. El seu tamany no pot excedir {limit, number} {limit, plural, one{byte} other{bytes}}.',
+  'The file "{file}" is too small. Its size cannot be smaller than {limit, number} {limit, plural, one{byte} other{bytes}}.' => 'L\'arxiu "{file}" és massa petit. El seu tamany no pot ser menor que {limit, number} {limit, plural, one{byte} other{bytes}}.',
+  'The format of {attribute} is invalid.' => 'El format de {attribute} és invalid.',
+  'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'La imatge "{file}" és massa gran. L\'altura no pot ser major que {limit, number} {limit, plural, one{píxel} other{píxels}}.',
+  'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'La imatge "{file}" és massa gran. L\'amplada no pot ser major que  {limit, number} {limit, plural, one{píxel} other{píxels}}.',
+  'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'La imatge  "{file}" és massa petita. L\'altura no pot ser menor que {limit, number} {limit, plural, one{píxel} other{píxels}}.',
+  'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'La imatge "{file}" és massa petita. L\'amplada no pot ser menor que {limit, number} {limit, plural, one{píxel} other{píxels}}.',
+  'the input value' => 'el valor d\'entrada',
+  'The verification code is incorrect.' => 'El codi de verificació és incorrecte.',
+  'Total <b>{count, number}</b> {count, plural, one{item} other{items}}.' => 'Total <b>{count, number}</b> {count, plural, one{element} other{elements}}.',
+  'Unable to verify your data submission.' => 'No s\'ha pogut verificar les dades enviades.',
+  'Unknown command "{command}".' => 'Ordre desconeguda "{command}".',
+  'Unknown option: --{name}' => 'Opció desconeguda: --{name}',
+  'Update' => 'Actualitzar',
+  'View' => 'Veure',
+  'Yes' => 'Sí',
+  'You are not allowed to perform this action.' => 'No tems permís per executar aquesta acció.',
+  'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Pots pujar com a màxim {limit, number} {limit, plural, one{arxiu} other{arxius}}.',
+);
diff --git a/framework/messages/config.php b/framework/messages/config.php
index 56bed56..c9f3279 100644
--- a/framework/messages/config.php
+++ b/framework/messages/config.php
@@ -7,7 +7,7 @@ return [
     'messagePath' => __DIR__,
     // array, required, list of language codes that the extracted messages
     // should be translated to. For example, ['zh-CN', 'de'].
-    'languages' => ['ar', 'bg', 'da', 'de', 'el', 'es', 'fa-IR', 'fi', 'fr', 'hu', 'it', 'ja', 'kk', 'lv', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sr', 'sr-Latn', 'uk', 'vi', 'zh-CN'],
+    'languages' => ['ar', 'bg', 'ca', 'da', 'de', 'el', 'es', 'fa-IR', 'fi', 'fr', 'hu', 'it', 'ja', 'kk', 'lt', 'lv', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk', 'sr', 'sr-Latn', 'uk', 'vi', 'zh-CN'],
     // string, the name of the function for translating messages.
     // Defaults to 'Yii::t'. This is used as a mark to find the messages to be
     // translated. You may use a string for single function name or an array for
diff --git a/framework/messages/lt/yii.php b/framework/messages/lt/yii.php
new file mode 100644
index 0000000..b33f987
--- /dev/null
+++ b/framework/messages/lt/yii.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Message translations.
+ *
+ * This file is automatically generated by 'yii message' command.
+ * It contains the localizable messages extracted from source code.
+ * You may modify this file by translating the extracted messages.
+ *
+ * Each array element represents the translation (value) of a message (key).
+ * If the value is empty, the message is considered as not translated.
+ * Messages that no longer need translation will have their translations
+ * enclosed between a pair of '@@' marks.
+ *
+ * Message string can be used with plural forms format. Check i18n section
+ * of the guide for details.
+ *
+ * NOTE: this file must be saved in UTF-8 encoding.
+ */
+return [
+  '(not set)' => '(nenustatyta)',
+  'An internal server error occurred.' => 'Įvyko vidinė serverio klaida',
+  'Are you sure you want to delete this item?' => 'Ar tikrai norite ištrinti šį elementą?',
+  'Delete' => 'Ištrinti',
+  'Error' => 'Klaida',
+  'File upload failed.' => 'Nepavyko įkelti failo.',
+  'Home' => 'Pradžia',
+  'Invalid data received for parameter "{param}".' => 'Gauti neteisingi "{param}" parametro duomenys.',
+  'Login Required' => 'Būtina prisijungti',
+  'Missing required arguments: {params}' => 'Trūksta privalomų argumentų: {params}',
+  'Missing required parameters: {params}' => 'Trūksta privalomų parametrų: {params}',
+  'No' => 'Ne',
+  'No help for unknown command "{command}".' => 'Nėra informacijos apie nežinomą "{command}" komandą.',
+  'No help for unknown sub-command "{command}".' => 'Nėra informacijos apie nežinomą "{command}" sub komandą',
+  'No results found.' => 'Nerasta rezultatų.',
+  'Only files with these MIME types are allowed: {mimeTypes}.' => 'Leidžiama įkelti tik šių MIME tipų failus: {mimeTypes}.',
+  'Only files with these extensions are allowed: {extensions}.' => 'Leidžiama įkelti failus tik su šiais plėtiniais: {extensions}.',
+  'Page not found.' => 'Puslapis nerastas.',
+  'Please fix the following errors:' => 'Prašytume ištaisyti nurodytas klaidas:',
+  'Please upload a file.' => 'Prašome įkelti failą.',
+  'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.' => 'Rodomi rezultatai <b>{begin, number}-{end, number}</b> iš <b>{totalCount, number}</b>.',
+  'The file "{file}" is not an image.' => 'Failas „{file}“ nėra paveikslėlis.',
+  'The file "{file}" is too big. Its size cannot exceed {limit, number} {limit, plural, one{byte} other{bytes}}.' => 'Failas „{file}“ yra per didelis. Dydis negali viršyti {limit, number} {limit, plural, one{baito} few{baitų} other{baitų}}.',
+  'The file "{file}" is too small. Its size cannot be smaller than {limit, number} {limit, plural, one{byte} other{bytes}}.' => 'Failas „{file}“ yra per mažas. Dydis negali būti mažesnis už {limit, number} {limit, plural, one{baitą} few{baitus} other{baitų}}.',
+  'The format of {attribute} is invalid.' => 'Atributo „{attribute}“ formatas yra netinkamas.',
+  'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Paveikslėlis „{file}“ yra per didelis. Aukštis negali viršyti {limit, number} {limit, plural, one{taško} few{taškų} other{taškų}}.',
+  'The image "{file}" is too large. The width cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Paveikslėlis „{file}“ yra per didelis. Plotis negali viršyti {limit, number} {limit, plural, one{taško} few{taškų} other{taškų}}.',
+  'The image "{file}" is too small. The height cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Paveikslėlis „{file}“ yra per mažas. Aukštis turi viršyti {limit, number} {limit, plural, one{tašką} few{taškus} other{taškų}}.',
+  'The image "{file}" is too small. The width cannot be smaller than {limit, number} {limit, plural, one{pixel} other{pixels}}.' => 'Paveikslėlis „{file}“ yra per mažas. Plotis turi viršyti {limit, number} {limit, plural, one{tašką} few{taškus} other{taškų}}.',
+  'The requested view "{name}" was not found.' => 'Nerastas „{name}“ rodinys',
+  'The verification code is incorrect.' => 'Neteisingas patikrinimo kodas.',
+  'Total <b>{count, number}</b> {count, plural, one{item} other{items}}.' => 'Iš viso <b>{count, number}</b> {count, plural, one{elementas} few{elementai} other{elementų}}.',
+  'Unable to verify your data submission.' => 'Neįmanoma patikrinti jūsų siunčiamų duomenų.',
+  'Unknown command "{command}".' => 'Nežinoma komanda "{command}".',
+  'Unknown option: --{name}' => 'Nežinomas pasirinkimas: --{name}',
+  'Update' => 'Atnaujinti',
+  'View' => 'Peržiūrėti',
+  'Yes' => 'Taip',
+  'You are not allowed to perform this action.' => 'Jums neleidžiama atlikti šio veiksmo.',
+  'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'Leidžiama įkelti ne daugiau nei {limit, number} {limit, plural, one{failą} few{failus} other{failų}}.',
+  'in {delta, plural, =1{a day} other{# days}}' => 'po {delta, plural, =1{dienos} one{# dienos} other{# dienų}}',
+  'in {delta, plural, =1{a minute} other{# minutes}}' => 'po {delta, plural, =1{minutės} one{# minutės} other{# minučių}}',
+  'in {delta, plural, =1{a month} other{# months}}' => 'po {delta, plural, =1{mėnesio} one{# mėnesio} other{# mėnesių}}',
+  'in {delta, plural, =1{a second} other{# seconds}}' => 'po {delta, plural, =1{sekundės} one{# sekundės} other{# sekundžių}}',
+  'in {delta, plural, =1{a year} other{# years}}' => 'po {delta, plural, =1{metų} other{# metų}}',
+  'in {delta, plural, =1{an hour} other{# hours}}' => 'po {delta, plural, =1{valandos} one{# valandos} other{# valandų}}',
+  'the input value' => 'įvesties reikšmė',
+  '{attribute} "{value}" has already been taken.' => '{attribute} reikšmė „{value}“ jau naudojama.',
+  '{attribute} cannot be blank.' => '„{attribute}“ negali būti tuščias.',
+  '{attribute} is invalid.' => '„{attribute}“ reikšmė netinkama.',
+  '{attribute} is not a valid URL.' => '„{attribute}“ įvestas netinkamas URL.',
+  '{attribute} is not a valid email address.' => '„{attribute}“ įvestas netinkamas el. pašto adresas.',
+  '{attribute} must be "{requiredValue}".' => '„{attribute}“ privalo būti „{requiredValue}“.',
+  '{attribute} must be a number.' => '„{attribute}“ privalo būti skaičius.',
+  '{attribute} must be a string.' => '„{attribute}“ privalo būti eilutė.',
+  '{attribute} must be an integer.' => '„{attribute}“ privalo būti sveikas skaičius.',
+  '{attribute} must be either "{true}" or "{false}".' => '„{attribute}“ privalo būti „{true}“ arba „{false}“.',
+  '{attribute} must be greater than "{compareValue}".' => 'Laukelio „{attribute}“ reikšmė privalo būti didesnė nei „{compareValue}“.',
+  '{attribute} must be greater than or equal to "{compareValue}".' => 'Laukelio „{attribute}“ reikšmė privalo būti didesnė arba lygi „{compareValue}“.',
+  '{attribute} must be less than "{compareValue}".' => 'Laukelio „{attribute}“ reikšmė privalo būti mažesnė nei „{compareValue}“.',
+  '{attribute} must be less than or equal to "{compareValue}".' => 'Laukelio „{attribute}“ reikšmė privalo būti mažesnė arba lygi „{compareValue}“.',
+  '{attribute} must be no greater than {max}.' => 'Laukelio „{attribute}“ reikšmė privalo būti ne didesnė nei {max}.',
+  '{attribute} must be no less than {min}.' => 'Laukelio „{attribute}“  reikšmė privalo būti ne mažesnė nei {min}.',
+  '{attribute} must be repeated exactly.' => 'Laukelio „{attribute}“ reikšmė privalo būti pakartota tiksliai.',
+  '{attribute} must not be equal to "{compareValue}".' => 'Laukelio „{attribute}“ reikšmė negali būti lygi „{compareValue}“.',
+  '{attribute} should contain at least {min, number} {min, plural, one{character} other{characters}}.' => 'Laukelio „{attribute}“ reikšmę privalo sudaryti mažiausiai {min, number} {min, plural, one{ženklas} few{ženklai} other{ženklų}}.',
+  '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => 'Laukelio „{attribute}“ reikšmę privalo sudaryti daugiausiai {max, number} {max, plural, one{ženklas} few{ženklai} other{ženklų}}.',
+  '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => 'Laukelio „{attribute}“ reikšmę privalo sudaryti {length, number} {length, plural, one{ženklas} few{ženklai} other{ženklų}}.',
+  '{delta, plural, =1{a day} other{# days}} ago' => 'prieš {delta, plural, =1{dieną} one{# dieną} few{# dienas} other{# dienų}}',
+  '{delta, plural, =1{a minute} other{# minutes}} ago' => 'prieš {delta, plural, =1{minutę} one{# minutę} few{# minutes} other{# minučių}}',
+  '{delta, plural, =1{a month} other{# months}} ago' => 'prieš {delta, plural, =1{mėnesį} one{# mėnesį} few{# mėnesius} other{# mėnesių}}',
+  '{delta, plural, =1{a second} other{# seconds}} ago' => 'prieš {delta, plural, =1{sekundę} one{# sekundę} few{# sekundes} other{# sekundžių}}',
+  '{delta, plural, =1{a year} other{# years}} ago' => 'prieš {delta, plural, =1{metus} one{# metus} few{# metus} other{# metų}}',
+  '{delta, plural, =1{an hour} other{# hours}} ago' => 'prieš {delta, plural, =1{valandą} one{# valandą} few{# valandas} other{# valandų}}',
+  '{n, plural, =1{# byte} other{# bytes}}' => '{n, number} {n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n, plural, =1{# gigabyte} other{# gigabytes}}' => '{n, number} giga{n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n, plural, =1{# kilobyte} other{# kilobytes}}' => '{n, number} kilo{n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n, plural, =1{# megabyte} other{# megabytes}}' => '{n, number} mega{n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n, plural, =1{# petabyte} other{# petabytes}}' => '{n, number} peta{n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n, plural, =1{# terabyte} other{# terabytes}}' => '{n, number} tera{n, plural, one{baitas} few{baitai} other{baitų}}',
+  '{n} B' => '{n} B',
+  '{n} GB' => '{n} GB',
+  '{n} KB' => '{n} KB',
+  '{n} MB' => '{n} MB',
+  '{n} PB' => '{n} PB',
+  '{n} TB' => '{n} TB',
+];
diff --git a/framework/messages/nl/yii.php b/framework/messages/nl/yii.php
index 4985b83..96d8ea8 100644
--- a/framework/messages/nl/yii.php
+++ b/framework/messages/nl/yii.php
@@ -17,10 +17,35 @@
  * NOTE: this file must be saved in UTF-8 encoding.
  */
 return array (
-  'the input value' => 'de invoerwaarde',
+  'Are you sure you want to delete this item?' => 'Ben je zeker dat je dit item wilt verwijderen?',
+  'Only files with these MIME types are allowed: {mimeTypes}.' => 'Alleen bestanden met de volgende MIME types zijn toegelaten: {mimeTypes}',
+  'The requested view "{name}" was not found.' => 'De gevraagde view "{view}" werd niet gevonden.',
+  'in {delta, plural, =1{a day} other{# days}}' => 'binnen {delta, plural, =1{een dag} other{# dagen}}',
+  'in {delta, plural, =1{a minute} other{# minutes}}' => 'binnen {delta, plural, =1{een minuut} other{# minuten}}',
+  'in {delta, plural, =1{a month} other{# months}}' => 'binnen {delta, plural, =1{een maand} other{# maanden}}',
+  'in {delta, plural, =1{a second} other{# seconds}}' => 'binnen {delta, plural, =1{een seconde} other{# seconden}}',
+  'in {delta, plural, =1{a year} other{# years}}' => 'binnen {delta, plural, =1{een jaar} other{# jaren}}',
+  'in {delta, plural, =1{an hour} other{# hours}}' => 'binnen {delta, plural, =1{een uur} other{# uren}}',
+  '{delta, plural, =1{a day} other{# days}} ago' => '{delta, plural, =1{een dag} other{# dagen}} geleden',
+  '{delta, plural, =1{a minute} other{# minutes}} ago' => '{delta, plural, =1{een minuut} other{# minuten}} geleden',
+  '{delta, plural, =1{a month} other{# months}} ago' => '{delta, plural, =1{a month} other{# months}} geleden',
+  '{delta, plural, =1{a second} other{# seconds}} ago' => '{delta, plural, =1{een seconde} other{# seconden}} geleden',
+  '{delta, plural, =1{a year} other{# years}} ago' => '{delta, plural, =1{een jaar} other{# jaren}} geleden',
+  '{delta, plural, =1{an hour} other{# hours}} ago' => '{delta, plural, =1{een uur} other{# uren}} geleden',
+  '{n, plural, =1{# byte} other{# bytes}}' => '{n, plural, =1{# byte} other{# bytes}}',
+  '{n, plural, =1{# gigabyte} other{# gigabytes}}' => '{n, plural, =1{# gigabyte} other{# gigabytes}}',
+  '{n, plural, =1{# kilobyte} other{# kilobytes}}' => '{n, plural, =1{# kilobyte} other{# kilobytes}}',
+  '{n, plural, =1{# megabyte} other{# megabytes}}' => '{n, plural, =1{# megabyte} other{# megabytes}}',
+  '{n, plural, =1{# petabyte} other{# petabytes}}' => '{n, plural, =1{# petabyte} other{# petabytes}}',
+  '{n, plural, =1{# terabyte} other{# terabytes}}' => '{n, plural, =1{# terabyte} other{# terabytes}}',
+  '{n} B' => '{n} B',
+  '{n} GB' => '{n} GB',
+  '{n} KB' => '{n} KB',
+  '{n} MB' => '{n} MB',
+  '{n} PB' => '{n} PB',
+  '{n} TB' => '{n} TB',
   '(not set)' => '(niet ingesteld)',
   'An internal server error occurred.' => 'Er is een interne serverfout opgetreden.',
-  'Are you sure to delete this item?' => 'Weet u zeker dat u dit item wilt verwijderen?',
   'Delete' => 'Verwijderen',
   'Error' => 'Fout',
   'File upload failed.' => 'Bestand uploaden mislukt.',
@@ -34,7 +59,6 @@ return array (
   'No help for unknown sub-command "{command}".' => 'Geen hulp voor onbekend sub-commando "{command}".',
   'No results found.' => 'Geen resultaten gevonden',
   'Only files with these extensions are allowed: {extensions}.' => 'Alleen bestanden met de volgende extensies zijn toegestaan: {extensions}.',
-  'Only files with these mimeTypes are allowed: {mimeTypes}.' => 'Alleen bestanden met de volgende mimeTypes zijn toegestaan: {mimeTypes}.',
   'Page not found.' => 'Pagina niet gevonden.',
   'Please fix the following errors:' => 'Corrigeer de volgende fouten:',
   'Please upload a file.' => 'Upload een bestand.',
@@ -57,6 +81,7 @@ return array (
   'Yes' => 'Ja',
   'You are not allowed to perform this action.' => 'U bent niet gemachtigd om deze actie uit te voeren.',
   'You can upload at most {limit, number} {limit, plural, one{file} other{files}}.' => 'U kunt maximaal {limit, number} {limit, plural, one{ander bestand} other{andere bestander}} uploaden.',
+  'the input value' => 'de invoerwaarde',
   '{attribute} "{value}" has already been taken.' => '{attribute} "{value}" is reeds in gebruik.',
   '{attribute} cannot be blank.' => '{attribute} mag niet leeg zijn.',
   '{attribute} is invalid.' => '{attribute} is ongeldig.',
diff --git a/framework/rbac/DbManager.php b/framework/rbac/DbManager.php
index 1a1ec71..c2d31df 100644
--- a/framework/rbac/DbManager.php
+++ b/framework/rbac/DbManager.php
@@ -18,9 +18,13 @@ use yii\di\Instance;
 /**
  * DbManager represents an authorization manager that stores authorization information in database.
  *
- * The database connection is specified by [[db]]. And the database schema
- * should be as described in "framework/rbac/*.sql". You may change the names of
- * the three tables used to store the authorization data by setting [[itemTable]],
+ * The database connection is specified by [[db]]. The database schema could be initialized by applying migration:
+ *
+ * ```
+ *  yii migrate --migrationPath=/vendor/yiisoft/yii2/rbac/migrations/
+ * ```
+ *
+ * You may change the names of the three tables used to store the authorization data by setting [[itemTable]],
  * [[itemChildTable]] and [[assignmentTable]].
  *
  * @author Qiang Xue <qiang.xue@gmail.com>
diff --git a/framework/rbac/migrations/m140506_102106_rbac_init.php b/framework/rbac/migrations/m140506_102106_rbac_init.php
new file mode 100644
index 0000000..a05d94d
--- /dev/null
+++ b/framework/rbac/migrations/m140506_102106_rbac_init.php
@@ -0,0 +1,59 @@
+<?php
+
+use yii\db\Schema;
+
+class m140506_102106_rbac_init extends \yii\db\Migration
+{
+    public function up()
+    {
+        $tableOptions = null;
+        if ($this->db->driverName === 'mysql') {
+            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
+        }
+
+        $this->createTable('{{%auth_rule}}', [
+            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
+            'data' => Schema::TYPE_TEXT,
+            'created_at' => Schema::TYPE_INTEGER,
+            'updated_at' => Schema::TYPE_INTEGER,
+        ], $tableOptions);
+        $this->addPrimaryKey('pk-auth_rule', '{{%auth_rule}}', 'name');
+
+        $this->createTable('{{%auth_item}}', [
+            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
+            'type' => Schema::TYPE_INTEGER . ' NOT NULL',
+            'description' => Schema::TYPE_TEXT,
+            'rule_name' => Schema::TYPE_STRING . '(64)',
+            'data' => Schema::TYPE_TEXT,
+            'created_at' => Schema::TYPE_INTEGER,
+            'updated_at' => Schema::TYPE_INTEGER,
+        ], $tableOptions);
+        $this->addPrimaryKey('pk-auth_item', '{{%auth_item}}', 'name');
+        $this->addForeignKey('fk-auth_item-rule_name', '{{%auth_item}}', 'rule_name', '{{%auth_rule}}', 'name', 'SET NULL', 'CASCADE');
+        $this->createIndex('idx-auth_item-type', '{{%auth_item}}', 'type');
+
+        $this->createTable('{{%auth_item_child}}', [
+            'parent' => Schema::TYPE_STRING . '(64) NOT NULL',
+            'child' => Schema::TYPE_STRING . '(64) NOT NULL',
+        ], $tableOptions);
+        $this->addPrimaryKey('pk-auth_item_child', '{{%auth_item_child}}', ['parent', 'child']);
+        $this->addForeignKey('fk-auth_item_child-parent', '{{%auth_item_child}}', 'parent', '{{%auth_item}}', 'name', 'CASCADE', 'CASCADE');
+        $this->addForeignKey('fk-auth_item_child-child', '{{%auth_item_child}}', 'child', '{{%auth_item}}', 'name', 'CASCADE', 'CASCADE');
+
+        $this->createTable('{{%auth_assignment}}', [
+            'item_name' => Schema::TYPE_STRING . '(64) NOT NULL',
+            'user_id' => Schema::TYPE_STRING . '(64) NOT NULL',
+            'created_at' => Schema::TYPE_INTEGER,
+        ], $tableOptions);
+        $this->addPrimaryKey('pk-auth_assignment', '{{%auth_assignment}}', ['item_name', 'user_id']);
+        $this->addForeignKey('fk-auth_assignment-item_name', '{{%auth_assignment}}', 'item_name', '{{%auth_item}}', 'name', 'CASCADE', 'CASCADE');
+    }
+
+    public function down()
+    {
+        $this->dropTable('{{%auth_assignment}}');
+        $this->dropTable('{{%auth_item_child}}');
+        $this->dropTable('{{%auth_item}}');
+        $this->dropTable('{{%auth_rule}}');
+    }
+}
diff --git a/framework/rbac/schema-mssql.sql b/framework/rbac/schema-mssql.sql
deleted file mode 100644
index 4862011..0000000
--- a/framework/rbac/schema-mssql.sql
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Database schema required by \yii\rbac\DbManager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @author Alexander Kochetov <creocoder@gmail.com>
- * @link http://www.yiiframework.com/
- * @copyright 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- * @since 2.0
- */
-
-drop table if exists [auth_assignment];
-drop table if exists [auth_item_child];
-drop table if exists [auth_item];
-drop table if exists [auth_rule];
-
-create table [auth_rule]
-(
-    [name]  varchar(64) not null,
-    [data]  text,
-    [created_at]           integer,
-    [updated_at]           integer,
-    primary key ([name])
-);
-
-create table [auth_item]
-(
-   [name]                 varchar(64) not null,
-   [type]                 integer not null,
-   [description]          text,
-   [rule_name]            varchar(64),
-   [data]                 text,
-   [created_at]           integer,
-   [updated_at]           integer,
-   primary key ([name]),
-   foreign key ([rule_name]) references [auth_rule] ([name]) on delete set null on update cascade,
-   key [type] ([type])
-);
-
-create table [auth_item_child]
-(
-   [parent]               varchar(64) not null,
-   [child]                varchar(64) not null,
-   primary key ([parent],[child]),
-   foreign key ([parent]) references [auth_item] ([name]) on delete cascade on update cascade,
-   foreign key ([child]) references [auth_item] ([name]) on delete cascade on update cascade
-);
-
-create table [auth_assignment]
-(
-   [item_name]            varchar(64) not null,
-   [user_id]              varchar(64) not null,
-   [created_at]           integer,
-   primary key ([item_name], [user_id]),
-   foreign key ([item_name]) references [auth_item] ([name]) on delete cascade on update cascade
-);
diff --git a/framework/rbac/schema-mysql.sql b/framework/rbac/schema-mysql.sql
deleted file mode 100644
index 1a44a78..0000000
--- a/framework/rbac/schema-mysql.sql
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Database schema required by \yii\rbac\DbManager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @author Alexander Kochetov <creocoder@gmail.com>
- * @link http://www.yiiframework.com/
- * @copyright 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- * @since 2.0
- */
-
-drop table if exists `auth_assignment`;
-drop table if exists `auth_item_child`;
-drop table if exists `auth_item`;
-drop table if exists `auth_rule`;
-
-create table `auth_rule`
-(
-   `name`                 varchar(64) not null,
-   `data`                 text,
-   `created_at`           integer,
-   `updated_at`           integer,
-    primary key (`name`)
-) engine InnoDB;
-
-create table `auth_item`
-(
-   `name`                 varchar(64) not null,
-   `type`                 integer not null,
-   `description`          text,
-   `rule_name`            varchar(64),
-   `data`                 text,
-   `created_at`           integer,
-   `updated_at`           integer,
-   primary key (`name`),
-   foreign key (`rule_name`) references `auth_rule` (`name`) on delete set null on update cascade,
-   key `type` (`type`)
-) engine InnoDB;
-
-create table `auth_item_child`
-(
-   `parent`               varchar(64) not null,
-   `child`                varchar(64) not null,
-   primary key (`parent`, `child`),
-   foreign key (`parent`) references `auth_item` (`name`) on delete cascade on update cascade,
-   foreign key (`child`) references `auth_item` (`name`) on delete cascade on update cascade
-) engine InnoDB;
-
-create table `auth_assignment`
-(
-   `item_name`            varchar(64) not null,
-   `user_id`              varchar(64) not null,
-   `created_at`           integer,
-   primary key (`item_name`, `user_id`),
-   foreign key (`item_name`) references `auth_item` (`name`) on delete cascade on update cascade
-) engine InnoDB;
diff --git a/framework/rbac/schema-oci.sql b/framework/rbac/schema-oci.sql
deleted file mode 100644
index 44fca9e..0000000
--- a/framework/rbac/schema-oci.sql
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Database schema required by \yii\rbac\DbManager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @author Alexander Kochetov <creocoder@gmail.com>
- * @link http://www.yiiframework.com/
- * @copyright 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- * @since 2.0
- */
-
-drop table if exists "auth_assignment";
-drop table if exists "auth_item_child";
-drop table if exists "auth_item";
-drop table if exists "auth_rule";
-
-create table "auth_rule"
-(
-   "name"  varchar(64) not null,
-   "data"  text,
-   "created_at"           integer,
-   "updated_at"           integer,
-    primary key ("name")
-);
-
-create table "auth_item"
-(
-   "name"                 varchar(64) not null,
-   "type"                 integer not null,
-   "description"          text,
-   "rule_name"            varchar(64),
-   "data"                 text,
-   "created_at"           integer,
-   "updated_at"           integer,
-   primary key ("name"),
-   foreign key ("rule_name") references "auth_rule" ("name") on delete set null on update cascade,
-   key "type" ("type")
-);
-
-create table "auth_item_child"
-(
-   "parent"               varchar(64) not null,
-   "child"                varchar(64) not null,
-   primary key ("parent","child"),
-   foreign key ("parent") references "auth_item" ("name") on delete cascade on update cascade,
-   foreign key ("child") references "auth_item" ("name") on delete cascade on update cascade
-);
-
-create table "auth_assignment"
-(
-   "item_name"            varchar(64) not null,
-   "user_id"              varchar(64) not null,
-   "created_at"           integer,
-   primary key ("item_name","user_id"),
-   foreign key ("item_name") references "auth_item" ("name") on delete cascade on update cascade
-);
diff --git a/framework/rbac/schema-pgsql.sql b/framework/rbac/schema-pgsql.sql
deleted file mode 100644
index f2d77a4..0000000
--- a/framework/rbac/schema-pgsql.sql
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Database schema required by \yii\rbac\DbManager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @author Alexander Kochetov <creocoder@gmail.com>
- * @link http://www.yiiframework.com/
- * @copyright 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- * @since 2.0
- */
-
-drop table if exists "auth_assignment";
-drop table if exists "auth_item_child";
-drop table if exists "auth_item";
-drop table if exists "auth_rule";
-
-create table "auth_rule"
-(
-    "name"  varchar(64) not null,
-    "data"  text,
-    "created_at"           integer,
-    "updated_at"           integer,
-    primary key ("name")
-);
-
-create table "auth_item"
-(
-   "name"                 varchar(64) not null,
-   "type"                 integer not null,
-   "description"          text,
-   "rule_name"            varchar(64),
-   "data"                 text,
-   "created_at"           integer,
-   "updated_at"           integer,
-   primary key ("name"),
-   foreign key ("rule_name") references "auth_rule" ("name") on delete set null on update cascade
-);
-
-create index auth_item_type_idx on "auth_item" ("type");
-
-create table "auth_item_child"
-(
-   "parent"               varchar(64) not null,
-   "child"                varchar(64) not null,
-   primary key ("parent","child"),
-   foreign key ("parent") references "auth_item" ("name") on delete cascade on update cascade,
-   foreign key ("child") references "auth_item" ("name") on delete cascade on update cascade
-);
-
-create table "auth_assignment"
-(
-   "item_name"            varchar(64) not null,
-   "user_id"              varchar(64) not null,
-   "created_at"           integer,
-   primary key ("item_name","user_id"),
-   foreign key ("item_name") references "auth_item" ("name") on delete cascade on update cascade
-);
diff --git a/framework/rbac/schema-sqlite.sql b/framework/rbac/schema-sqlite.sql
deleted file mode 100644
index f494185..0000000
--- a/framework/rbac/schema-sqlite.sql
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Database schema required by \yii\rbac\DbManager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @author Alexander Kochetov <creocoder@gmail.com>
- * @link http://www.yiiframework.com/
- * @copyright 2008 Yii Software LLC
- * @license http://www.yiiframework.com/license/
- * @since 2.0
- */
-
-drop table if exists "auth_assignment";
-drop table if exists "auth_item_child";
-drop table if exists "auth_item";
-drop table if exists "auth_rule";
-
-create table "auth_rule"
-(
-    "name"  varchar(64) not null,
-    "data"  text,
-    "created_at"           integer,
-    "updated_at"           integer,
-    primary key ("name")
-);
-
-create table "auth_item"
-(
-   "name"                 varchar(64) not null,
-   "type"                 integer not null,
-   "description"          text,
-   "rule_name"            varchar(64),
-   "data"                 text,
-   "created_at"           integer,
-   "updated_at"           integer,
-   primary key ("name"),
-   foreign key ("rule_name") references "auth_rule" ("name") on delete set null on update cascade
-);
-
-create index "auth_item_type_idx" on "auth_item" ("type");
-
-create table "auth_item_child"
-(
-   "parent"               varchar(64) not null,
-   "child"                varchar(64) not null,
-   primary key ("parent","child"),
-   foreign key ("parent") references "auth_item" ("name") on delete cascade on update cascade,
-   foreign key ("child") references "auth_item" ("name") on delete cascade on update cascade
-);
-
-create table "auth_assignment"
-(
-   "item_name"            varchar(64) not null,
-   "user_id"              varchar(64) not null,
-   "created_at"           integer,
-   primary key ("item_name","user_id"),
-   foreign key ("item_name") references "auth_item" ("name") on delete cascade on update cascade
-);
diff --git a/tests/unit/framework/di/ContainerTest.php b/tests/unit/framework/di/ContainerTest.php
index ab2447d..4098ebc 100644
--- a/tests/unit/framework/di/ContainerTest.php
+++ b/tests/unit/framework/di/ContainerTest.php
@@ -36,6 +36,8 @@ class ContainerTest extends TestCase
         $this->assertTrue($foo instanceof $Foo);
         $this->assertTrue($foo->bar instanceof $Bar);
         $this->assertTrue($foo->bar->qux instanceof $Qux);
+        $foo2 = $container->get($Foo);
+        $this->assertFalse($foo === $foo2);
 
         // full wiring
         $container = new Container;
@@ -80,5 +82,12 @@ class ContainerTest extends TestCase
         $this->assertTrue($foo instanceof $Foo);
         $this->assertTrue($foo->bar instanceof $Bar);
         $this->assertTrue($foo->bar->qux instanceof $Qux);
+
+        // wiring by closure
+        $container = new Container;
+        $container->set('qux', new Qux);
+        $qux1 = $container->get('qux');
+        $qux2 = $container->get('qux');
+        $this->assertTrue($qux1 === $qux2);
     }
 }