Changeset 9053 for trunk/wp-admin/includes/upgrade.php
- Timestamp:
- 10/02/2008 01:03:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/upgrade.php
r8989 r9053 1 1 <?php 2 2 /** 3 * WordPress Upgrade API 4 * 5 * Most of the functions are pluggable and can be overwritten 6 * 7 * @package WordPress 8 * @subpackage Administration 9 */ 10 11 /** Include user install customize script. */ 3 12 if ( file_exists(WP_CONTENT_DIR . '/install.php') ) 4 13 require (WP_CONTENT_DIR . '/install.php'); 14 15 /** WordPress Administration API */ 5 16 require_once(ABSPATH . 'wp-admin/includes/admin.php'); 17 18 /** WordPress Schema API */ 6 19 require_once(ABSPATH . 'wp-admin/includes/schema.php'); 7 20 8 21 if ( !function_exists('wp_install') ) : 22 /** 23 * {@internal Missing Short Description}} 24 * 25 * {@internal Missing Long Description}} 26 * 27 * @since unknown 28 * 29 * @param string $blog_title Blog title. 30 * @param string $user_name User's username. 31 * @param string $user_email User's email. 32 * @param bool $public Whether blog is public. 33 * @param null $deprecated Optional. Not used. 34 * @return array Array keys 'url', 'user_id', 'password'. 35 */ 9 36 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { 10 37 global $wp_rewrite; … … 54 81 55 82 if ( !function_exists('wp_install_defaults') ) : 83 /** 84 * {@internal Missing Short Description}} 85 * 86 * {@internal Missing Long Description}} 87 * 88 * @since unknown 89 * 90 * @param int $user_id User ID. 91 */ 56 92 function wp_install_defaults($user_id) { 57 93 global $wpdb; … … 108 144 109 145 if ( !function_exists('wp_new_blog_notification') ) : 146 /** 147 * {@internal Missing Short Description}} 148 * 149 * {@internal Missing Long Description}} 150 * 151 * @since unknown 152 * 153 * @param string $blog_title Blog title. 154 * @param string $blog_url Blog url. 155 * @param int $user_id User ID. 156 * @param string $password User's Password. 157 */ 110 158 function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { 111 159 $user = new WP_User($user_id); … … 133 181 134 182 if ( !function_exists('wp_upgrade') ) : 183 /** 184 * Run WordPress Upgrade functions. 185 * 186 * {@internal Missing Long Description}} 187 * 188 * @since unknown 189 * 190 * @return null 191 */ 135 192 function wp_upgrade() { 136 193 global $wp_current_db_version, $wp_db_version; … … 142 199 return; 143 200 144 if( !is_blog_installed())201 if( ! is_blog_installed() ) 145 202 return; 146 203 … … 153 210 endif; 154 211 155 // Functions to be called in install and upgrade scripts 212 /** 213 * Functions to be called in install and upgrade scripts. 214 * 215 * {@internal Missing Long Description}} 216 * 217 * @since unknown 218 */ 156 219 function upgrade_all() { 157 220 global $wp_current_db_version, $wp_db_version, $wp_rewrite; … … 221 284 } 222 285 286 /** 287 * Execute changes made in WordPress 1.0. 288 * 289 * @since 1.0.0 290 */ 223 291 function upgrade_100() { 224 292 global $wpdb; … … 242 310 } 243 311 } 244 245 312 246 313 $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') … … 273 340 } 274 341 342 /** 343 * Execute changes made in WordPress 1.0.1. 344 * 345 * @since 1.0.1 346 */ 275 347 function upgrade_101() { 276 348 global $wpdb; … … 286 358 } 287 359 288 360 /** 361 * Execute changes made in WordPress 1.2. 362 * 363 * @since 1.2.0 364 */ 289 365 function upgrade_110() { 290 366 global $wpdb; … … 305 381 } 306 382 } 307 308 383 309 384 // Get the GMT offset, we'll use that later on … … 343 418 } 344 419 420 /** 421 * Execute changes made in WordPress 1.5. 422 * 423 * @since 1.5.0 424 */ 345 425 function upgrade_130() { 346 426 global $wpdb; … … 420 500 } 421 501 502 /** 503 * Execute changes made in WordPress 2.0. 504 * 505 * @since 2.0.0 506 */ 422 507 function upgrade_160() { 423 508 global $wpdb, $wp_current_db_version; … … 498 583 } 499 584 585 /** 586 * Execute changes made in WordPress 2.1. 587 * 588 * @since 2.1.0 589 */ 500 590 function upgrade_210() { 501 591 global $wpdb, $wp_current_db_version; … … 537 627 } 538 628 629 /** 630 * Execute changes made in WordPress 2.3. 631 * 632 * @since 2.3.0 633 */ 539 634 function upgrade_230() { 540 635 global $wp_current_db_version, $wpdb; … … 707 802 } 708 803 804 /** 805 * Remove old options from the database. 806 * 807 * @since 2.3.0 808 */ 709 809 function upgrade_230_options_table() { 710 810 global $wpdb; … … 716 816 } 717 817 818 /** 819 * Remove old categories, link2cat, and post2cat database tables. 820 * 821 * @since 2.3.0 822 */ 718 823 function upgrade_230_old_tables() { 719 824 global $wpdb; … … 723 828 } 724 829 830 /** 831 * Upgrade old slugs made in version 2.2. 832 * 833 * @since 2.2.0 834 */ 725 835 function upgrade_old_slugs() { 726 836 // upgrade people who were using the Redirect Old Slugs plugin … … 729 839 } 730 840 731 841 /** 842 * Execute changes made in WordPress 2.5.0. 843 * 844 * @since 2.5.0 845 */ 732 846 function upgrade_250() { 733 847 global $wp_current_db_version; … … 739 853 } 740 854 855 /** 856 * Execute changes made in WordPress 2.5.1. 857 * 858 * @since 2.5.1 859 */ 741 860 function upgrade_251() { 742 861 global $wp_current_db_version; … … 746 865 } 747 866 867 /** 868 * Execute changes made in WordPress 2.5.2. 869 * 870 * @since 2.5.2 871 */ 748 872 function upgrade_252() { 749 873 global $wpdb; … … 752 876 } 753 877 878 /** 879 * Execute changes made in WordPress 2.6. 880 * 881 * @since 2.6.0 882 */ 754 883 function upgrade_260() { 755 884 global $wp_current_db_version; … … 764 893 } 765 894 895 /** 896 * Execute changes made in WordPress 2.7. 897 * 898 * @since 2.7.0 899 */ 766 900 function upgrade_270() { 767 901 global $wpdb, $wp_current_db_version; … … 779 913 780 914 // General 915 916 /** 917 * {@internal Missing Short Description}} 918 * 919 * {@internal Missing Long Description}} 920 * 921 * @since unknown 922 * 923 * @param string $table_name Database table name to create. 924 * @param string $create_ddl SQL statement to create table. 925 * @return bool If table already exists or was created by function. 926 */ 781 927 function maybe_create_table($table_name, $create_ddl) { 782 928 global $wpdb; … … 797 943 } 798 944 945 /** 946 * {@internal Missing Short Description}} 947 * 948 * {@internal Missing Long Description}} 949 * 950 * @since unknown 951 * 952 * @param string $table Database table name. 953 * @param string $index Index name to drop. 954 * @return bool True, when finished. 955 */ 799 956 function drop_index($table, $index) { 800 957 global $wpdb; … … 809 966 } 810 967 968 /** 969 * {@internal Missing Short Description}} 970 * 971 * {@internal Missing Long Description}} 972 * 973 * @since unknown 974 * 975 * @param string $table Database table name. 976 * @param string $index Database table index column. 977 * @return bool True, when done with execution. 978 */ 811 979 function add_clean_index($table, $index) { 812 980 global $wpdb; … … 841 1009 } 842 1010 843 844 // get_alloptions as it was for 1.2. 1011 /** 1012 * Retrieve all options as it was for 1.2. 1013 * 1014 * @since 1.2.0 1015 * 1016 * @return array List of options. 1017 */ 845 1018 function get_alloptions_110() { 846 1019 global $wpdb; … … 858 1031 } 859 1032 860 // Version of get_option that is private to install/upgrade. 1033 /** 1034 * Version of get_option that is private to install/upgrade. 1035 * 1036 * @since unknown 1037 * @access private 1038 * 1039 * @param string $setting Option name. 1040 * @return mixed 1041 */ 861 1042 function __get_option($setting) { 862 1043 global $wpdb; … … 885 1066 } 886 1067 1068 /** 1069 * {@internal Missing Short Description}} 1070 * 1071 * {@internal Missing Long Description}} 1072 * 1073 * @since unknown 1074 * 1075 * @param string $content 1076 * @return string 1077 */ 887 1078 function deslash($content) { 888 1079 // Note: \\\ inside a regex denotes a single backslash. … … 902 1093 } 903 1094 1095 /** 1096 * {@internal Missing Short Description}} 1097 * 1098 * {@internal Missing Long Description}} 1099 * 1100 * @since unknown 1101 * 1102 * @param unknown_type $queries 1103 * @param unknown_type $execute 1104 * @return unknown 1105 */ 904 1106 function dbDelta($queries, $execute = true) { 905 1107 global $wpdb; … … 1103 1305 } 1104 1306 1307 /** 1308 * {@internal Missing Short Description}} 1309 * 1310 * {@internal Missing Long Description}} 1311 * 1312 * @since unknown 1313 */ 1105 1314 function make_db_current() { 1106 1315 global $wp_queries; … … 1112 1321 } 1113 1322 1323 /** 1324 * {@internal Missing Short Description}} 1325 * 1326 * {@internal Missing Long Description}} 1327 * 1328 * @since unknown 1329 */ 1114 1330 function make_db_current_silent() { 1115 1331 global $wp_queries; … … 1118 1334 } 1119 1335 1336 /** 1337 * {@internal Missing Short Description}} 1338 * 1339 * {@internal Missing Long Description}} 1340 * 1341 * @since unknown 1342 * 1343 * @param unknown_type $theme_name 1344 * @param unknown_type $template 1345 * @return unknown 1346 */ 1120 1347 function make_site_theme_from_oldschool($theme_name, $template) { 1121 1348 $home_path = get_home_path(); … … 1186 1413 } 1187 1414 1415 /** 1416 * {@internal Missing Short Description}} 1417 * 1418 * {@internal Missing Long Description}} 1419 * 1420 * @since unknown 1421 * 1422 * @param unknown_type $theme_name 1423 * @param unknown_type $template 1424 * @return unknown 1425 */ 1188 1426 function make_site_theme_from_default($theme_name, $template) { 1189 1427 $site_dir = WP_CONTENT_DIR . "/themes/$template"; … … 1241 1479 1242 1480 // Create a site theme from the default theme. 1481 /** 1482 * {@internal Missing Short Description}} 1483 * 1484 * {@internal Missing Long Description}} 1485 * 1486 * @since unknown 1487 * 1488 * @return unknown 1489 */ 1243 1490 function make_site_theme() { 1244 1491 // Name the theme after the blog. … … 1282 1529 } 1283 1530 1531 /** 1532 * Translate user level to user role name. 1533 * 1534 * @since unknown 1535 * 1536 * @param int $level User level. 1537 * @return string User role name. 1538 */ 1284 1539 function translate_level_to_role($level) { 1285 1540 switch ($level) { … … 1303 1558 } 1304 1559 1560 /** 1561 * {@internal Missing Short Description}} 1562 * 1563 * {@internal Missing Long Description}} 1564 * 1565 * @since unknown 1566 */ 1305 1567 function wp_check_mysql_version() { 1306 1568 global $wpdb; … … 1310 1572 } 1311 1573 1574 /** 1575 * {@internal Missing Short Description}} 1576 * 1577 * {@internal Missing Long Description}} 1578 * 1579 * @since unknown 1580 */ 1312 1581 function maybe_disable_automattic_widgets() { 1313 1582 $plugins = __get_option( 'active_plugins' );
Note: See TracChangeset
for help on using the changeset viewer.