Used dirname instead of realpath to avoid extra FS operations
Fixes #1937: Fixed wrong behavior or advanced app's `init --env` when called without parameter actually specified
init of advanced application now allows to specify answer for overwriting files  via init --overwrite=n
Advanced app User model updated
Advanced app migrations updated
code style
Some Code style fixes
Merge pull request #2 from yiisoft/master

update from orig