/** * Class constructor */ function __construct($dbuser, $dbpassword, $dbname, $dbhost) { foreach ($this->qm_php_vars as $setting => &$val) { $val = ini_get($setting); } parent::__construct($dbuser, $dbpassword, $dbname, $dbhost); }
/** * Create an instance of WPDKDB class * * @brief Construct * * @return WPDKDB */ public function __construct() { // Extends WordPress Database class parent::__construct(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); /* * Remake check for MySQLi extension because WordPress keep this flag as private. * * Use ext/mysqli if it exists and: * * - WP_USE_EXT_MYSQL is defined as false, or * - We are a development version of WordPress, or * - We are running PHP 5.5 or greater, or * - ext/mysql is not loaded. */ if (function_exists('mysqli_connect')) { if (defined('WP_USE_EXT_MYSQL')) { $this->mysqli = !WP_USE_EXT_MYSQL; } elseif (version_compare(phpversion(), '5.5', '>=') || !function_exists('mysql_connect')) { $this->mysqli = true; } elseif (false !== strpos($GLOBALS['wp_version'], '-')) { $this->mysqli = true; } } // Raise the memory limit and max_execution time @ini_set('memory_limit', apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT)); @set_time_limit(0); }
/** * PHP5 constructor * * @param string $dbuser * @param string $dbpassword * @param string $dbname * @param string $dbhost */ function __construct($dbuser, $dbpassword, $dbname, $dbhost) { require_once W3TC_LIB_W3_DIR . '/Config.php'; $this->_config =& W3_Config::instance(); $this->_lifetime = $this->_config->get_integer('dbcache.lifetime'); if ($this->_config->get_boolean('dbcache.enabled') && $this->_config->get_boolean('dbcache.debug')) { ob_start(array(&$this, 'ob_callback')); } parent::__construct($dbuser, $dbpassword, $dbname, $dbhost); }
/** * Connects to the database server and selects a database * * PHP5 style constructor for compatibility with PHP5. Does * the actual setting up of the class properties and connection * to the database. * * @link http://core.trac.wordpress.org/ticket/3354 * @since 2.0.8 * * @param string $dbuser MySQL database user * @param string $dbpassword MySQL database password * @param string $dbname MySQL database name * @param string $dbhost MySQL database host */ function __construct($dbuser, $dbpassword, $dbname, $dbhost) { if (!extension_loaded('mysqli')) { $this->bail(' <h1>Extension Not Loaded</h1> <p>The mysqli PHP extension is not loaded properly or available for PHP to use.</p> <ul> <li>Check your phpinfo</li> <li>Make sure it is loaded in your php ini file</li> <li>Turn on display_errors and display_startup_errors so you can detect issues with loading the module.</li> </ul>'); return; } parent::__construct($dbuser, $dbpassword, $dbname, $dbhost); }
/** * @see wpdb::__construct() * @param string $dbuser * @param string $dbpassword * @param string $dbname * @param string $dbhost */ function __construct($dbuser, $dbpassword, $dbname, $dbhost) { parent::__construct($dbuser, $dbpassword, $dbname, $dbhost); // these will be whitelisted for both read and write operations $ignore_both = array('_comment', '_cron', '_cache', '_count', "'cron'", '_edit_lock', '_nonce', '_logins', '_random_seed', '_stats'); self::$CACHE_READ_WHITELIST = $ignore_both; self::$CACHE_WRITE_WHITELIST = $ignore_both; // read-only ignore list for things like random numbers and such that have no directly related insert/update statement array_push(self::$CACHE_READ_WHITELIST, 'FOUND_ROWS', 'RAND()'); // merge in any user-defined keywords if (defined('CACHE_READ_WHITELIST') && CACHE_READ_WHITELIST) { self::$CACHE_READ_WHITELIST = array_merge(self::$CACHE_READ_WHITELIST, explode('|', CACHE_READ_WHITELIST)); } // merge in any user-defined keywords if (defined('CACHE_WRITE_WHITELIST') && CACHE_WRITE_WHITELIST) { self::$CACHE_WRITE_WHITELIST = array_merge(self::$CACHE_WRITE_WHITELIST, explode('|', CACHE_WRITE_WHITELIST)); } }
function __construct() { parent::__construct('root', '', 'opusx', 'localhost'); }
public function __construct($host, $user, $pass, $db) { parent::__construct($host, $user, $pass, $db); }