Replace hardcoded directory "src/" with constant APP_DIR
fabian-mcfly opened this issue · 2 comments
CakePHP always uses the APP_DIR
that allows the developer to chang the directoy from src/
to something different.
In /src/Shell/AnnotationsShell.php
in line 77/79 and 241/242 the path src
should not be hardcoded but use APP_DIR
instead, in case it's not a Plugin.
Line 77 should be: $path = ($plugin ? PluginPath::get($plugin) . 'src' : ROOT . DS . APP_DIR) . DS;
Remove Lines 78 & 79
Line 241 should look the same: $path = ($plugin ? PluginPath::get($plugin) . 'src' : ROOT . DS . APP_DIR) . DS;
Remove Line 242
Line 608 also has src/
hardcoded and should look like this:
$this->warn('You need to create
AppView.phpfirst in
' . APP_DIR . DS . 'View' . DS . '.');
For the remaining src
in Line 77 & 241, the PluginPath::get($plugin)
should use CakePHPs Plugin::classPath
instead (but not for every usage of PluginPath::get($plugin)
) . This way you wouldn't need to add the src
yourself.
Disclaimer: Sorry for not forking and creating a pull request but I'm not that familiar with Github and don't want to make a mistake here.
Feel free to make a PR here.
Is #237 what you had in mind?