original_string: public static function optimizeTables($tables, $force = false)
      {
          $optimize = Config::getInstance()->General['enable_sql_optimize_queries'];
  
          if (empty($optimize)
              && !$force
          ) {
              return false;
          }
  
          if (empty($tables)) {
              return false;
          }
  
          if (!is_array($tables)) {
              $tables = array($tables);
          }
  
          if (!self::isOptimizeInnoDBSupported()
              && !$force
          ) {
              // filter out all InnoDB tables
              $myisamDbTables = array();
              foreach (self::getTableStatus() as $row) {
                  if (strtolower($row['Engine']) == 'myisam'
                      && in_array($row['Name'], $tables)
                  ) {
                      $myisamDbTables[] = $row['Name'];
                  }
              }
  
              $tables = $myisamDbTables;
          }
  
          if (empty($tables)) {
              return false;
          }
  
          // optimize the tables
          return self::query("OPTIMIZE TABLE " . implode(',', $tables));
      }
code: public static function optimizeTables($tables, $force = false)
      {
          $optimize = Config::getInstance()->General['enable_sql_optimize_queries'];
  
          if (empty($optimize)
              && !$force
          ) {
              return false;
          }
  
          if (empty($tables)) {
              return false;
          }
  
          if (!is_array($tables)) {
              $tables = array($tables);
          }
  
          if (!self::isOptimizeInnoDBSupported()
              && !$force
          ) {
              // filter out all InnoDB tables
              $myisamDbTables = array();
              foreach (self::getTableStatus() as $row) {
                  if (strtolower($row['Engine']) == 'myisam'
                      && in_array($row['Name'], $tables)
                  ) {
                      $myisamDbTables[] = $row['Name'];
                  }
              }
  
              $tables = $myisamDbTables;
          }
  
          if (empty($tables)) {
              return false;
          }
  
          // optimize the tables
          return self::query("OPTIMIZE TABLE " . implode(',', $tables));
      }
code_tokens: public static function optimizeTables ( $ tables , $ force = false ) { $ optimize = Config :: getInstance ( ) -> General [ 'enable_sql_optimize_queries' ] ; if ( empty ( $ optimize ) && ! $ force ) { return false ; } if ( empty ( $ tables ) ) { return false ; } if ( ! is_array ( $ tables ) ) { $ tables = array ( $ tables ) ; } if ( ! self :: isOptimizeInnoDBSupported ( ) && ! $ force ) { // filter out all InnoDB tables $ myisamDbTables = array ( ) ; foreach ( self :: getTableStatus ( ) as $ row ) { if ( strtolower ( $ row [ 'Engine' ] ) == 'myisam' && in_array ( $ row [ 'Name' ] , $ tables ) ) { $ myisamDbTables [ ] = $ row [ 'Name' ] ; } } $ tables = $ myisamDbTables ; } if ( empty ( $ tables ) ) { return false ; } // optimize the tables return self :: query ( "OPTIMIZE TABLE " . implode ( ',' , $ tables ) ) ; }
docstring: Runs an `OPTIMIZE TABLE` query on the supplied table or tables.
  
  Tables will only be optimized if the `[General] enable_sql_optimize_queries` INI config option is
  set to **1**.
  
  @param string|array $tables The name of the table to optimize or an array of tables to optimize.
  Table names must be prefixed (see {@link Piwik\Common::prefixTable()}).
  @param bool $force If true, the `OPTIMIZE TABLE` query will be run even if InnoDB tables are being used.
  @return \Zend_Db_Statement
docstring_tokens: Runs an OPTIMIZE TABLE query on the supplied table or tables .