<commit_before><?php

  /*
   * Terminal Library
   */

  if( !defined('BASEPATH') ){ die(); }

  class Library_Terminal {

      /*
       * Check is command exists.
       */
      public function commandExists($name) {
        global $MYSQL;
        $MYSQL->where('command_name', $name);
        $query = $MYSQL->get('{prefix}terminal');
        if( $query ) {
          return true;
        } else {
          return false;
        }
      }

      /*
       * Create new command.
       * $name - Must be lowercase.
       * $syntax - %s for arguements, example "cugroup %s %s". cugroup must be the same as in $name.
       * $function - Function to be ran when the command is called out. Full function terminal_FUNCTION(). Only FUNCTION() is allowed
       */
      public function create($name, $syntax, $function) {
        if( $this->commandExists($name) ) {
          return false;
        } else {
          global $MYSQL;
          $data = array(
            'command_name' => $name,
            'command_syntax' => $syntax,
            'run_function' => $function
          );
          if( $MYSQL->insert('{prefix}terminal', $data) ) {
            return true;
          } else {
            return false;
          }
        }
      }

      public function delete($name) {
        global $MYSQL;
        if( $this->commandExists($name) ) {
          $MYSQL->where('command_name');
          if( $MYSQL->delete('{prefix}terminal') ) {
            return true;
          } else {
            return false;
          }
        } else {
          return true;
        }
      }

  }

?><commit_msg>Fixed bug where there is an error when deleting commands.<commit_after><?php

  /*
   * Terminal Library
   */

  if( !defined('BASEPATH') ){ die(); }

  class Library_Terminal {

      /*
       * Check is command exists.
       */
      public function commandExists($name) {
        global $MYSQL;
        $MYSQL->where('command_name', $name);
        $query = $MYSQL->get('{prefix}terminal');
        if( $query ) {
          return true;
        } else {
          return false;
        }
      }

      /*
       * Create new command.
       * $name - Must be lowercase.
       * $syntax - %s for arguements, example "cugroup %s %s". cugroup must be the same as in $name.
       * $function - Function to be ran when the command is called out. Full function terminal_FUNCTION(). Only FUNCTION() is allowed
       */
      public function create($name, $syntax, $function) {
        if( $this->commandExists($name) ) {
          return false;
        } else {
          global $MYSQL;
          $data = array(
            'command_name' => $name,
            'command_syntax' => $syntax,
            'run_function' => $function
          );
          if( $MYSQL->insert('{prefix}terminal', $data) ) {
            return true;
          } else {
            return false;
          }
        }
      }

      public function delete($name) {
        global $MYSQL;
        if( $this->commandExists($name) ) {
          $MYSQL->where('command_name', $name);
          if( $MYSQL->delete('{prefix}terminal') ) {
            return true;
          } else {
            return false;
          }
        } else {
          return true;
        }
      }

  }

?>
{'fraction_non_alphanumeric': 0.12992968511158667, 'fraction_numerical': 0.0, 'mean_word_length': 1.5285935085007727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3934012', 'n_tokens_mistral': 948, 'n_tokens_neox': 928, 'n_words': 240}