Error: Кто может объяснит мне ошибку ? Использую только данную компоненту без целого симфони.
There are no commands defined in the "/:" namespace.
class ConnectionCommand extends Command
{
public function configure()
{
$this->setName('db-connect');
$this->setDescription('command for connecting to database');
$this->setHelp('db-connect command allow you to connect to existing database');
$this->addArgument('usr',InputArgument::REQUIRED,'Database Username ..');
$this->addArgument('password',InputArgument::REQUIRED,'Database Password ..');
$this->addArgument('dsn',InputArgument::REQUIRED,'Database DSN ..');
}
public function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Welcome To Data Generator!');
$output->writeln('Before using the application, please fill in data for existing MySql connection to database!');
$output->writeln(['1.Username, 2.Password, 3.Dsn']);
$instance = new ConnectionInstance(
$input->getArgument('usr'),
$input->getArgument('password'),
$input->getArgument('dsn')
);
$connection = null;
$log = new Logger('Connection');
$log->pushHandler(new StreamHandler(__DIR__.'/connection.log'));
$log->info('Connecting to database');
try{
$connection = Connect::getInstance()->getConnection($instance);
}catch (PDOException $e){
$log->info('Connection error message ..'.$e->getMessage());
$log->info('Connection error trace ..'.$e->getTraceAsString());
}
Container::getContainer()->mapTo($connection,$input->getArgument('usr'));
}
}