phalcon / phalcon-devtools

Phalcon Developer Tools
https://docs.phalcon.io/latest/en/devtools
Other
1.33k stars 630 forks source link

Error: Call to undefined function Vokuro\root_path() #1480

Closed assadnazar closed 3 years ago

assadnazar commented 3 years ago

When i use the following command to create a model:

phalcon model page --namespace=Vokuro\Models

I get the following error:

Error: Call to undefined function Vokuro\root_path() in D:\xampp\htdocs\vokuro\config\config.php on line 24

Here is my setup info

*Phalcon DevTools (4.1.0)

Environment: OS: Windows NT DESKTOP-HM725IV 10.0 build 19042 (Windows 10) AMD64 PHP Version: 7.4.14 PHP SAPI: cli PHP Bin: D:\xampp\php\php.exe PHP Extension Dir: C:\php\ext PHP Bin Dir: C:\php Loaded PHP config: D:\xampp\php\php.ini Versions: Phalcon DevTools Version: 4.1.0 Phalcon Version: 4.1.0 AdminLTE Version: 2.3.6

Any update will be appreciated.

BeMySlaveDarlin commented 3 years ago

This issue related to Vokuro way of getting BASE_PATH. Looks like you are using global devtools. Because of Vokuro function root_path() used in config.php, which is not autoloaded in cases of global devtools usage, this error occurs. You can try the way advised in issue https://github.com/phalcon/vokuro/issues/158. Or you can create webtools with default config, and after that using webtools instead of devtools. Another option to use local devtools (project composer required) instance, which has no issues with autoloading.