Make WordPress Core


Ignore:
Timestamp:
02/26/2010 06:14:26 AM (17 years ago)
Author:
nacin
Message:

@since version numbers and other docs for wp-db. props hakre see #12362

File:
1 edited

Legend:

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

    r13387 r13426  
    2121
    2222/**
    23  * @since {@internal Version Unknown}}
     23 * @since 2.5.0
    2424 */
    2525define( 'OBJECT_K', 'OBJECT_K', false );
     
    120120         * Results of the last query made
    121121         *
    122          * @since {@internal Version Unknown}}
     122         * @since 1.0.0
    123123         * @access private
    124124         * @var array|null
     
    187187         * List of WordPress per-blog tables
    188188         *
    189          * @since {@internal Version Unknown}}
     189         * @since 2.5.0
    190190         * @access private
    191191         * @see wpdb::tables()
     
    267267         * WordPress Post Metadata table
    268268         *
    269          * @since {@internal Version Unknown}}
     269         * @since 1.5.0
    270270         * @access public
    271271         * @var string
     
    471471         * to the database.
    472472         *
     473         * @link http://core.trac.wordpress.org/ticket/3354
    473474         * @since 2.0.8
    474475         *
     
    534535         * PHP5 style destructor and will run when database object is destroyed.
    535536         *
     537         * @see wpdb::__construct()
    536538         * @since 2.0.8
    537539         * @return bool true
     
    635637         *
    636638         * 'all' - returns 'all' and 'global' tables. No old tables are returned.
     639         * 'blog' - returns the blog-level tables for the queried blog.
    637640         * 'global' - returns the global tables for the installation, returning multisite tables only if running multisite.
    638641         * 'ms_global' - returns the multisite global tables, regardless if current installation is multisite.
    639          * 'blog' - returns the blog-level tables for the queried blog.
    640642         * 'old' - returns tables which are deprecated.
    641643         *
     
    650652         * @param bool $prefix Optional. Whether to include table prefixes. Default true. If blog
    651653         *      prefix is requested, then the custom users and usermeta tables will be mapped.
    652          * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::blogid. Used only when prefix is requested.
     654         * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::$blogid. Used only when prefix is requested.
    653655         * @return array Table names. When a prefix is requested, the key is the unprefixed table name.
    654656         */
     
    659661                                if ( is_multisite() )
    660662                                        $tables = array_merge( $tables, $this->ms_global_tables );
     663                                break;
     664                        case 'blog' :
     665                                $tables = $this->tables;
    661666                                break;
    662667                        case 'global' :
     
    667672                        case 'ms_global' :
    668673                                $tables = $this->ms_global_tables;
    669                                 break;
    670                         case 'blog' :
    671                                 $tables = $this->tables;
    672674                                break;
    673675                        case 'old' :
     
    734736         *
    735737         * @see addslashes()
    736          * @since {@internal Version Unknown}}
    737          * @access private
    738          *
    739          * @param  string $string
     738         * @since 2.8.0
     739         * @access private
     740         *
     741         * @param string $string
    740742         * @return string
    741743         */
     
    872874                $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it
    873875                $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
    874                 $query = preg_replace('|(?<!%)%s|', "'%s'", $query); // quote the strings, avoiding escaped strings like %%s
     876                $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
    875877                array_walk( $args, array( &$this, 'escape_by_ref' ) );
    876878                return @vsprintf( $query, $args );
     
    897899
    898900                if ( $caller = $this->get_caller() )
    899                         $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller);
     901                        $error_str = sprintf( /*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller );
    900902                else
    901                         $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query);
    902 
    903                 if ( function_exists('error_log') && $log_file = @ini_get('error_log') && ( 'syslog' == $log_file || is_writable( $log_file ) ) )
    904                         @error_log( $error_str, 0 );
    905 
    906                 // Is error output turned on or not..
     903                        $error_str = sprintf( /*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query );
     904
     905                if ( function_exists( 'error_log' )
     906                        && $log_file = @ini_get( 'error_log' )
     907                        && ( 'syslog' == $log_file || @is_writable( $log_file ) )
     908                        )
     909                        @error_log( $error_str );
     910
     911                // Are we showing errors?
    907912                if ( ! $this->show_errors )
    908913                        return false;
Note: See TracChangeset for help on using the changeset viewer.