original_string: public function cmdSqlDatabase()
      {
          $sql = $this->getParam(0);
  
          if (empty($sql)) {
              $this->errorAndExit($this->text('Invalid command'));
          }
  
          $result = $this->db->query($sql);
  
          if ($this->getParam('fetch')) {
              $result = $result->fetchAll(\PDO::FETCH_ASSOC);
              $this->outputFormat($result);
              $this->outputFormatTableDatabase($result);
          }
  
          $this->output();
      }
code: public function cmdSqlDatabase()
      {
          $sql = $this->getParam(0);
  
          if (empty($sql)) {
              $this->errorAndExit($this->text('Invalid command'));
          }
  
          $result = $this->db->query($sql);
  
          if ($this->getParam('fetch')) {
              $result = $result->fetchAll(\PDO::FETCH_ASSOC);
              $this->outputFormat($result);
              $this->outputFormatTableDatabase($result);
          }
  
          $this->output();
      }
code_tokens: public function cmdSqlDatabase ( ) { $ sql = $ this -> getParam ( 0 ) ; if ( empty ( $ sql ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid command' ) ) ; } $ result = $ this -> db -> query ( $ sql ) ; if ( $ this -> getParam ( 'fetch' ) ) { $ result = $ result -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableDatabase ( $ result ) ; } $ this -> output ( ) ; }
docstring: Callback for "database-sql" command
docstring_tokens: Callback for database - sql command