upgrade.md 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
Upgrading Instructions for Yii Framework v2
===========================================

!!!IMPORTANT!!!

The following upgrading instructions are cumulative. That is,
if you want to upgrade from version A to version C and there is
version B between A and C, you need to following the instructions
for both A and B.


mdomba (mdlap) committed
12
General upgrade instructions
Alexander Makarov committed
13
----------------------------
14 15 16

- Make a backup.
- Clean up your 'assets' folder.
Alexander Makarov committed
17 18 19
- Replace 'framework' dir with the new one or point Git to a fresh
  release tag and checkout.
- Check if everything is OK, if not — revert to previous stable version and post
Alexander Makarov committed
20
  issues to [Yii issue tracker](https://github.com/yiisoft/yii2/issues).
21 22 23 24 25 26


Upgrading from v1.1.x
---------------------

- All framework classes are now namespaced, and the name prefix `C` is removed.
Qiang Xue committed
27

28 29 30 31 32 33
- The format of path alias is changed to `@yii/base/Component`.
  In 1.x, this would be `system.base.CComponent`. See guide for more details.

- The root alias `@yii` now represents the framework installation directory.
   In 1.x, this is named as `system`. We also removed `zii` root alias.

Alexander Makarov committed
34 35 36
- `Object` serves as the base class that supports properties. And `Component` extends
  from `Object` and supports events and behaviors. Behaviors declared in
  `Component::behaviors()` are attached on demand.
37 38 39 40 41 42

- `CList` is renamed to `Vector`, and `CMap` is renamed to `Dictionary`.
  Other collection classes are dropped in favor of SPL classes.

- `CFormModel` is removed. Please use `yii\base\Model` instead.

Qiang Xue committed
43 44
- `CDbCriteria` is replaced by `yii\db\Query` which includes methods for
  building a query. `CDbCommandBuilder` is replaced by `yii\db\QueryBuilder`
Qiang Xue committed
45
  which has cleaner and more complete support of query building capabilities.
46