I was unable to rebuild my model after upgrading from phalcon 1.3.2 to 1.3.4 and the latest (master) devtool
This is the error I received
C:\wamp\www\myproject\application\myapp>phalcon all-models --relations --fk --validations --get-set --doc --force --namespace=Myapp\Models --extends=\Myapp\Library\ModelBase
Phalcon DevTools (1.3.4)
Error: Unable to write to '.\public/C:\wamp\www\myproject\application\myapp\app\config/../../app/models\Admin.php'
I figured out it was going into a condition that I didn't need (i think) from the phalcon-dev-tools-master/scripts/Phalcon/commands/Builtin/AllModels.php line #86
if (file_exists($path.'public')) {
$modelsDir = 'public/'.$config->application->modelsDir;
} else {
$modelsDir = $config->application->modelsDir;
}
After commenting the "public" part it resolved my issue:
// if (file_exists($path.'public')) {
// $modelsDir = 'public/'.$config->application->modelsDir;
// } else {
$modelsDir = $config->application->modelsDir;
// }
I also tried to specify the path with the --directory=s parameter but it did even worst
Error: Unable to write to 'C:\wamp\www\myproject\application\myapp/\public/C:\wamp\www\myproject\application\myapp\app\config/../../app/models\Admin.php'
Am I missing something?
Thanks !