Changeset 13376
- Timestamp:
- 02/24/2010 06:58:52 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/wp-db.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r13357 r13376 569 569 $this->prefix = $this->get_blog_prefix( $this->blogid ); 570 570 571 foreach ( (array)$this->tables( 'blog' ) as $table => $prefixed_table )571 foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) 572 572 $this->$table = $prefixed_table; 573 573 574 foreach ( (array)$this->tables( 'old' ) as $table => $prefixed_table )574 foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) 575 575 $this->$table = $prefixed_table; 576 576 … … 631 631 * be determined by the prefix. 632 632 * 633 * The scope argument can take one of the following: 634 * 635 * 'all' - returns 'all' and 'global' tables. No old tables are returned. 636 * 'global' - returns the global tables for the installation, returning multisite tables only if running multisite. 637 * 'ms_global' - returns the multisite global tables, regardless if current installation is multisite. 638 * 'blog' - returns the blog-level tables for the queried blog. 639 * 'old' - returns tables which are deprecated. 640 * 633 641 * @since 3.0.0 634 642 * @uses wpdb::$tables … … 638 646 * @uses is_multisite() 639 647 * 640 * @param string $scope Can be all, global, ms_global, blog, or old tables. Defaults to all. 641 * 'all' returns 'all' and 'global' tables. No old tables are returned. 642 * 'global' returns the global tables for the installation, returning multisite tables only if running multisite. 643 * 'ms_global' returns the multisite global tables, regardless if current installation is multisite. 644 * 'blog' returns the blog-level tables for the queried blog. 645 * 'old' returns tables which are deprecated. 646 * @param bool $prefix Whether to include table prefixes. Default true. If blog 648 * @param string $scope Optional. Can be all, global, ms_global, blog, or old tables. Defaults to all. 649 * @param bool $prefix Optional. Whether to include table prefixes. Default true. If blog 647 650 * prefix is requested, then the custom users and usermeta tables will be mapped. 648 * @param int $blog_id The blog_id to prefix. Defaults to wpdb::blogid. Used only when prefix is requested.651 * @param int $blog_id Optional. The blog_id to prefix. Defaults to wpdb::blogid. Used only when prefix is requested. 649 652 * @return array Table names. When a prefix is requested, the key is the unprefixed table name. 650 653 */ 651 654 function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) { 652 655 switch ( $scope ) { 653 case 'old' : 654 $tables = $this->old_tables; 655 break; 656 case 'blog' : 657 $tables = $this->tables; 658 break; 659 case 'ms_global' : 660 $tables = $this->ms_global_tables; 656 case 'all' : 657 $tables = array_merge( $this->global_tables, $this->tables ); 658 if ( is_multisite() ) 659 $tables = array_merge( $tables, $this->ms_global_tables ); 661 660 break; 662 661 case 'global' : … … 665 664 $tables = array_merge( $tables, $this->ms_global_tables ); 666 665 break; 667 case 'all' : 668 $tables = array_merge( $this->global_tables, $this->tables ); 669 if ( is_multisite() ) 670 $tables = array_merge( $tables, $this->ms_global_tables ); 666 case 'ms_global' : 667 $tables = $this->ms_global_tables; 668 break; 669 case 'blog' : 670 $tables = $this->tables; 671 break; 672 case 'old' : 673 $tables = $this->old_tables; 674 break; 675 default : 676 return array(); 671 677 break; 672 678 } … … 724 730 725 731 /** 726 * Weak escape 727 * 728 * @ usesaddslashes()732 * Weak escape, using addslashes() 733 * 734 * @see addslashes() 729 735 * @since {@internal Version Unknown}} 730 736 * @access private … … 738 744 739 745 /** 740 * Real escape 741 * 742 * @ usesmysql_real_escape_string()743 * @ usesaddslashes()746 * Real escape, using mysql_real_escape_string() or addslashes() 747 * 748 * @see mysql_real_escape_string() 749 * @see addslashes() 744 750 * @since 2.8 745 751 * @access private … … 787 793 * 788 794 * @since 0.71 789 * @param string|array $data to escape795 * @param string|array $data to escape 790 796 * @return string|array escaped as query safe string 791 797 */ … … 810 816 * @uses wpdb::_real_escape() 811 817 * @since 2.3.0 812 * @param string $string to escape818 * @param string $string to escape 813 819 * @return void 814 820 */ … … 1457 1463 * 1458 1464 * @param string $db_cap the feature 1459 * @param false|string|resource $dbh_or_table. Not implemented.1460 1465 * @return bool 1461 1466 */ … … 1490 1495 if ( isset( $call['class'] ) && __CLASS__ == $call['class'] ) 1491 1496 continue; // Filter out wpdb calls. 1492 }1493 $caller = join( ', ', $caller );1494 1495 return $caller;1497 $caller[] = isset( $call['class'] ) ? "{$call['class']}->{$call['function']}" : $call['function']; 1498 } 1499 1500 return join( ', ', $caller ); 1496 1501 } 1497 1502 … … 1499 1504 * The database version number. 1500 1505 * 1501 * @param false|string|resource $dbh_or_table. Not implemented.1502 1506 * @return false|string false on failure, version number on success 1503 1507 */
Note: See TracChangeset
for help on using the changeset viewer.