lajax / yii2-translate-manager

Translation Manager
MIT License
227 stars 90 forks source link

Root path problem #36

Closed etzzzz closed 9 years ago

etzzzz commented 9 years ago

I found a bug in file: services/scanners/ScannerFile.php.

On line 203 there is a function named "_getRoot".

It looks like this: private function _getRoot() { return dirname(Yii::getAlias($this->module->root)); }

But it should be: private function _getRoot() { return Yii::getAlias($this->module->root); }

You must not use the dirname function there because it cuts off the last folder from the path and starts scanning from 1 level higher folder. It scanned all my other projects aswell and the "dirname" function was the problem.

For example: $dir = '/var/www/projects/myapp'; echo dirname($dir); It will give you just '/var/www/projects' (last folder gets lost) so don't use dirname method here, Yii already provides valid path with Yii::getAlias.

lajax commented 9 years ago

Thanks for your feedback, we know about this issue. Altough I will fix it only in the 2.* version. More info: https://github.com/lajax/yii2-translate-manager/pull/12