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.

Problem with DevTools (model & scaffold) - "Cannot redeclare class Phalcon\Config"

Hi all!

I have installed Phalcon DevTools via composer. Then, I created my project via DevTools and I completed the file config.php with mysql's informations. The website works fine.

But, if I try use DevTools with command model or scaffold, I got this error :

PHP Fatal error: Cannot redeclare class Phalcon\Config in /home/www/project/vendor/phalcon/devtools/ide/0.5.0/Phalcon/Config.php on line 29

For information, my versions are : - PHP 5.4.30 - Phalcon 1.3.2 - Phalcon DevTools 1.3.2

Thanks for your help.



82.7k

This probably means someway IDE stubs are being included instead of using the PHP extension.



1.4k

Thank for you response.

But how I do to disabled IDE stubs includes?

For information, if I change my config.php file with wrong informations, DevTools says me that config is not correct, so that works.



82.7k

I'm not sure where it is exactly including the IDE stubs, what IDE are you using?



1.4k

I'm not using IDE. phalcon scaffold command is using directly in my terminal.



1.4k

A lead : it doesn't work because vendor folder is in the phalcon project folder (with app, public...) If I put vendor folder in the parent directory, it works.

Do you know how I can modify devtools for keep vendor folder in the same directory as app folder ?

Thanks



1.4k
Accepted
answer

I have my answer. If vendor folder is in the phalcon project folder, we have to do :

phalcon scaffold tablename --directory=

instead of

phalcon scaffold tablename