b2evolution PHP Cross Reference Blogging Systems

Source: /install/_functions_delete.php - 40 lines - 1149 bytes - Summary - Text - Print

Description: This file implements deletion of DB tables b2evolution - {@link http://b2evolution.net/} Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

   1  <?php
   2  /**
   3   * This file implements deletion of DB tables
   4   *
   5   * b2evolution - {@link http://b2evolution.net/}
   6   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   8   *
   9   * @package install
  10   */
  11  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  12  
  13  /**
  14   * db_delete(-)
  15   */
  16  function db_delete()
  17  {
  18      global $DB, $db_config, $tableprefix;
  19  
  20      echo "Disabling foreign key checks...<br />\n";
  21      $DB->query( 'SET FOREIGN_KEY_CHECKS=0' );
  22  
  23      foreach( $db_config['aliases'] as $alias => $tablename )
  24      {
  25          echo "Dropping $tablename table...<br />\n";
  26          evo_flush();
  27          $DB->query( 'DROP TABLE IF EXISTS '.$tablename );
  28      }
  29  
  30      // Get remaining tables with the same prefix and delete them as well. Probably these tables are some b2evolution plugins tables.
  31      $remaining_tables = $DB->get_col( 'SHOW TABLES FROM `'.$db_config['name'].'` LIKE "'.$tableprefix.'%"' );
  32      foreach( $remaining_tables as $tablename )
  33      {
  34          echo "Dropping $tablename table...<br />\n";
  35          evo_flush();
  36          $DB->query( 'DROP TABLE IF EXISTS '.$tablename );
  37      }
  38  }
  39  
  40  ?>

title

Description

title

Description

title

Description

title

title

Body