Ejemplo n.º 1
0
 /**
  * Drop a table
  *
  * @param      string  $command  The command passed with its arguments
  */
 private function dropTable(string $command)
 {
     $args = $this->getArgs($command);
     if ($this->checkTableName($args)) {
         if ($this->confirmAction('DROP the table "' . $args['t'] . '" ? (Y/N)') === 'Y') {
             if (DB::dropTable($args['t'])) {
                 static::ok(static::ACTION_DONE . PHP_EOL);
             } else {
                 static::fail(static::ACTION_FAIL . PHP_EOL . static::tablePrettyPrint(DB::errorInfo()) . PHP_EOL);
             }
         } else {
             static::out(static::ACTION_CANCEL . PHP_EOL);
         }
     }
 }