The new code is not equivalent to the old one. Note that `YII_PATH` needs to be appended with `DIRECTORY_SEPARATOR`.
Also note that if `FileHelper::realpath()` always uses `/` as separator, the code may not work as expected since `YII_PATH` uses `DIRECTORY_SEPARATOR` as the separators.