[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/admin/classes/ -> class-bbp-converter-db.php (source)

   1  <?php
   2  
   3  /**
   4   * bbPress Converter Database
   5   *
   6   * @package bbPress
   7   * @subpackage Administration
   8   */
   9  
  10  // Exit if accessed directly
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  if ( ! class_exists( 'BBP_Converter_DB' ) && class_exists( 'wpdb' ) ) :
  14  /**
  15   * bbPress Converter Database Access Abstraction Object
  16   *
  17   * @since 2.6.0 bbPress (r6784)
  18   */
  19  class BBP_Converter_DB extends wpdb {
  20  
  21      /**
  22       * Sets up the credentials used to connect to the database server, but does
  23       * not actually connect to the database on construct.
  24       *
  25       * @since 2.6.0 bbPress (r6784)
  26       *
  27       * @param string $dbuser     MySQL database user
  28       * @param string $dbpassword MySQL database password
  29       * @param string $dbname     MySQL database name
  30       * @param string $dbhost     MySQL database host
  31       */
  32  	public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
  33          register_shutdown_function( array( $this, '__destruct' ) );
  34  
  35          if ( WP_DEBUG && WP_DEBUG_DISPLAY ) {
  36              $this->show_errors();
  37          }
  38  
  39          // Use ext/mysqli if it exists unless WP_USE_EXT_MYSQL is defined as true
  40          if ( function_exists( 'mysqli_connect' ) ) {
  41              $this->use_mysqli = true;
  42  
  43              if ( defined( 'WP_USE_EXT_MYSQL' ) ) {
  44                  $this->use_mysqli = ! WP_USE_EXT_MYSQL;
  45              }
  46          }
  47  
  48          // Setup credentials
  49          $this->dbuser     = $dbuser;
  50          $this->dbpassword = $dbpassword;
  51          $this->dbname     = $dbname;
  52          $this->dbhost     = $dbhost;
  53  
  54          // Normally wpdb would try to connect here, but we don't want to do that
  55          // until we are good and ready, so instead we do nothing.
  56      }
  57  }
  58  endif;


Generated: Sat Apr 27 01:00:49 2024 Cross-referenced by PHPXref 0.7.1