ConfigException "conso config method doesn't exists"
NesCafe62 opened this issue · 8 comments
It seems Conf::add
uses filename as key for self::$configArray
. And later Conf::conso()
mthod is called. Does it mean I must call config file exactly as 'conso.php'? If so, there is no mention about that in documentation.
Yep ! you are right, it should be named conso.php
as the name of the application.
- You can add your
conso.php
config file and load it :
Conf::add('/path/to/your/conf');
// specify the config dir or just config file name conso.php - you can append to the default conso.php:
// in this case if you want to keep the default commands
Conf::add('vendor/lotfio/conso/src/Conso/conf');
Conf::append('conso', 'COMMANDS', __DIR__ . '/Commands');
Conf::append('conso', 'NAMESPACE','Commands\\');
I renamed the file and it works. But I tried to run php conso make:command model
but it says: "Command command not found". Should I register vendor/lotfio/conso/src/Conso/Commands
manually in config COMMANDS?
@NesCafe62 Yep for now you should register it manually ! but for the comming realeases there will be a provider that will take care of it :)
I registered it manually and it works. Another problem (maybe should create another issue) command was created in vendor directory, but I wanted it to be created in app/Commands
.
make sure that your configuration is correct !
please append a command path and command namespace where conso will create your commands
Conf::append('conso', 'COMMANDS', __DIR__ . '/Commands');
Conf::append('conso', 'NAMESPACE','Commands\\');
I have config and there is namespace 'NAMESPACE' => ['App\\Commands\\']
, but command was created in vendor, btw generate class namespace was correct. I saw it was array in demo config src/Conso/conf/conso.php
.
I think maybe it uses COMMANDS and I have 2 row there for now, maybe should swap them together
Yes, it works when I changed the order of registered commands