/** * Process the command entered by the user and output the result in the console * * @param string $command The command passed by the user * @param bool $executed True if the command is already executed, false otherwise DEFAULT false */ protected function processCommand(string $command, bool $executed = false) { $executed = true; preg_match('/^[a-zA-Z ]*/', $command, $commandName); static::out(PHP_EOL); switch (rtrim($commandName[0])) { case 'protocol': $this->protocolProcess($command); break; case 'deploy': $this->deployProcess($command); break; case 'configuration': $this->configurationProcess($command); break; default: $executed = false; break; } parent::processCommand($command, $executed); }
/** * Process the command entered by the user and output the result in the console * * @param string $command The command passed by the user * @param bool $executed True if the command is already executed, else false DEFAULT false */ protected function processCommand(string $command, bool $executed = false) { $executed = true; preg_match('/^[a-zA-Z ]*/', $command, $commandName); static::out(PHP_EOL); switch (rtrim($commandName[0])) { case 'tables': static::out('Tables name: ' . PHP_EOL . static::tablePrettyPrint(DB::getAllTables()) . PHP_EOL); break; case 'entities': $this->entitiesProcess($command); break; case 'entity': $this->entityProcess($command); break; case 'clean': $this->cleanTable($command); break; case 'drop': $this->dropTable($command); break; case 'show': $this->showTable($command); break; case 'desc': $this->descTable($command); break; case 'es': $this->elasticsearchProcess($command); break; case 'init': $this->init($command); break; default: $executed = false; break; } parent::processCommand($command, $executed); }