Make WordPress Core

Changeset 11865


Ignore:
Timestamp:
08/21/2009 05:00:53 PM (15 years ago)
Author:
ryan
Message:

Machine parseable db error codes. Props dd32. fixes #10293

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r11013 r11865  
    297297
    298298    /**
     299     * Database Username
     300     *
     301     * @since 2.9.0
     302     * @access private
     303     * @var string
     304     */
     305    var $dbuser;
     306
     307    /**
    299308     * Connects to the database server and selects a database
    300309     *
     
    338347        if ( defined('DB_COLLATE') )
    339348            $this->collate = DB_COLLATE;
     349
     350        $this->dbuser = $dbuser;
    340351
    341352        $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
     
    350361</ul>
    351362<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
    352 "/*/WP_I18N_DB_CONN_ERROR*/, $dbhost));
     363"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost), 'db_connect_fail');
    353364            return;
    354365        }
     
    437448<li>On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?</li>
    438449</ul>
    439 <p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER));
     450<p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, $this->dbuser), 'db_select_fail');
    440451            return;
    441452        }
     
    9971008     * @since 1.5.0
    9981009     *
    999      * @param string $message
     1010     * @param string $message The Error message
     1011     * @param string $error_code (optional) A Computer readable string to identify the error.
    10001012     * @return false|void
    10011013     */
    1002     function bail($message) {
     1014    function bail($message, $error_code = '500') {
    10031015        if ( !$this->show_errors ) {
    10041016            if ( class_exists('WP_Error') )
    1005                 $this->error = new WP_Error('500', $message);
     1017                $this->error = new WP_Error($error_code, $message);
    10061018            else
    10071019                $this->error = $message;
     
    10361048     * @return bool True if collation is supported, false if version does not
    10371049     */
    1038     function supports_collation()
    1039     {
     1050    function supports_collation() {
    10401051        return $this->has_cap( 'collation' );
    10411052    }
Note: See TracChangeset for help on using the changeset viewer.