Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

VÖKURÓ add phalcon dev tools

I pulled vokuro from git. And want to add several scaffold tables. Devtools not see the phalcon project, after creation folder .phalcon have another bug.

PHP Notice: Use of undefined constant BASEPATH - assumed 'BASEPATH' in /var/www/vokuro/app/config/config.php on line 42 PHP Stack trace: PHP 1. {main}() /home/moledet/vendor/phalcon/devtools/phalcon.php:0 PHP 2. Phalcon\Script->run() /home/moledet/vendor/phalcon/devtools/phalcon.php:83 PHP 3. Phalcon\Script->dispatch() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Script.php:146 PHP 4. Phalcon\Commands\Builtin\Scaffold->run() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Script.php:121 PHP 5. Phalcon\Builder\Scaffold->build() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Commands/Builtin/Scaffold.php:77 PHP 6. Phalcon\Builder\Model->build() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Scaffold.php:177 PHP 7. Phalcon\Builder\Component->getConfig() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Model.php:131 PHP 8. Phalcon\Builder\Path->getConfig() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Component.php:94 PHP 9. include() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Path.php:58 PHP Warning: fileputcontents(/var/www/vokuro/APPPATH/models/Banners.php): failed to open stream: No such file or directory in /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Model.php on line 519 PHP Stack trace: PHP 1. {main}() /home/moledet/vendor/phalcon/devtools/phalcon.php:0 PHP 2. Phalcon\Script->run() /home/moledet/vendor/phalcon/devtools/phalcon.php:83 PHP 3. Phalcon\Script->dispatch() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Script.php:146 PHP 4. Phalcon\Commands\Builtin\Scaffold->run() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Script.php:121 PHP 5. Phalcon\Builder\Scaffold->build() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Commands/Builtin/Scaffold.php:77 PHP 6. Phalcon\Builder\Model->build() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Scaffold.php:177 PHP 7. fileput_contents() /home/moledet/vendor/phalcon/devtools/scripts/Phalcon/Builder/Model.php:519

Error: Unable to write to /var/www/vokuro/APP_PATH/models/Banners.php



6.2k
Accepted
answer

was fixed by add path to config.php

define('BASEPATH', '/var/www/vokuro'); define('APPPATH', BASE_PATH . '/app');



46.7k

I'll try to add that when I have time to test it (shouldn't take too long). The dev tools scaffolds are using the following technique which might need to be adjusted for differences in the framework:

defined('BASE_PATH') || define('BASE_PATH', realpath('../..'));
defined('APP_PATH') || define('APP_PATH', BASE_PATH . '/app');

The Dev Tools project templates and Vokuro were modernized and they had their configuration system refactored so that they use the same constant names and this is a very nice side effect that I hadn't considered. I think that the Vokuro documentation could perhaps even improved to introduce new users to the dev tools. In fact this could probably be done in the Invo project as well. To do this we would just need to standarize the projects on the APP_PATH and BASE_PATH constants and what they mean exactly since before the APP_PATH was referring to what is now the BASE_PATH in some of the templates.