Closed goldmont closed 3 years ago
I was able to recreate this on DevTools Version 3.4.11 as well as DevTools Version 3.4.12 (the latest which can be used with Phalcon 3)
The steps for me to recreate were:
phalcon project new
cd new
phalcon create-controller --name test
I also tried this on DevTools Version v4.1.0 and was not able to recreate it on v4.1.0.
The cause of the issue is related to devtools not being able to find the config.php in the usual place, due to the rootPath path somehow getting set to / in phalcon-devtools/scripts/Phalcon/Builder/Path.php, and it falls back to recursive directory searching and a regular expression:
preg_match('/config\.php$/i', $f->getPathName())
and this unexpectedly matches public/webtools.config.php
before app/config/config.php
, finding the wrong config file.
I was able to also get it working again with a quick and dirty fix by adding an if statement so it doesn't match the wrong config file:
if (preg_match('/webtools\.config\.php$/i', $f->getPathName())) {
continue;
}
I'm currently working on a more proper fix for this.
This is fixed in v3.4.13
Thank you.
I'm getting error while run "phalcon create-project test"
Phalcon DevTools (4.2.0)
PHP Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\xampp\htdocs\phalcon_dev\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48 Stack trace:
thrown in C:\xampp\htdocs\phalcon_dev\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\xampp\htdocs\phalcon_dev\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48 Stack trace:
thrown in C:\xampp\htdocs\phalcon_dev\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
but i installed below :
Phalcon DevTools (4.2.0)
Environment: OS: Windows NT DESKTOP-A40AND7 10.0 build 19044 (Windows 10) AMD64 PHP Version: 8.0.25 PHP SAPI: cli PHP Bin: C:\xampp\php\php.exe PHP Extension Dir: C:\php\ext PHP Bin Dir: C:\php Loaded PHP config: C:\xampp\php\php.ini Versions: Phalcon DevTools Version: 4.2.0 Phalcon Version: 5.0.0 AdminLTE Version: 3.0.1
so please kindly help me
Thank you for your efforts.
Actual Behavior
Command:
phalcon create-controller --name test
Phalcon DevTools cannot create a controller. Crash log:
My
config.php
Details