project yii1-to-yii2
Yii1 to Yii2 migration project
bariew/yii1-to-yii2
Yii1 to Yii2 migration project
- Friday, June 24, 2016
- by bariew
- Repository
- 1 Watchers
- 0 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
UPGRADE PLAN
1. Change upgrade.php content according to current project
2. Run upgrade script, (*1)
php vendor/bariew/yii2yii/script.php upgrade.php
- Fix manually
- UserIdentity
- WebUser, login
- CDbCriteria, (*2)
YII2 upgrade
- Check ->isNewRecord in beforeSave/afterSave
- Check 'condition' appearance
- Check rbac configs
- 'getFlash' does not delete flash by default
- search for "label for=" - since Html::checkbox no longer generates id automatically
- module->id does not have submodule (not == module/submodule, but just 'submodule')
- urls should start with / if not relative - replace 'module/controller/action' with '/module/controller/action'
- remove errorSummary(
- model rules first element to array and 'on', 'except' => 'asd,ads' to array
- ->update() not working for 1 attribute
- search for "js:" js usage
- $form->field()->label(false)->checkbox() will still render label
- find not echoing render: ^(?!.(echo|=|return)).\$this->render.*$
- createUrl
- look for CLASS , get_class( , new $class for it did not have namespaces
-
look for camelCase action call or rewrite controller action detect, (*3)
-
array([^\'\"]+) -> [$1] // to new array look, (*4)
- DatePicker -> 'model'=>$model // add model to options
- (createUrl\s)(\'[^\']+\') -> $1[$2] // use arrays for creating urls\s)(\'[^\']+\') -> $1[$2] // use arrays for creating urls