Make WordPress Core

Ticket #30825: 30825.3.diff

File 30825.3.diff, 12.5 KB (added by morganestes, 11 years ago)
  • src/wp-admin/includes/upgrade.php

    From 6c66b1b24d581d1fa11fb7c65fde922b1deb404e Mon Sep 17 00:00:00 2001
    From: Morgan Estes <morgan.estes@gmail.com>
    Date: Mon, 22 Dec 2014 22:30:12 -0500
    Subject: [PATCH] Update PHP docblocks for upgrade methods.
    
    - Add short and long descriptions where missing.
    - Remove an extra "@since" in a block.
    - Punctuation added where required.
    ---
     src/wp-admin/includes/upgrade.php | 29 +++++++++++++++++------------
     1 file changed, 17 insertions(+), 12 deletions(-)
    
    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index b72303a..608cde2 100644
    a b  
    22/**
    33 * WordPress Upgrade API
    44 *
    5  * Most of the functions are pluggable and can be overwritten
     5 * Most of the functions are pluggable and can be overwritten.
    66 *
    77 * @package WordPress
    88 * @subpackage Administration
    require_once(ABSPATH . 'wp-admin/includes/schema.php'); 
    2020
    2121if ( !function_exists('wp_install') ) :
    2222/**
    23  * Installs the blog
     23 * Installs the blog.
    2424 *
    25  * {@internal Missing Long Description}}
     25 * Runs the required functions to set up and populate the database,
     26 * including primary admin user and initial options.
    2627 *
    2728 * @since 2.1.0
    2829 *
    endif; 
    108109
    109110if ( !function_exists('wp_install_defaults') ) :
    110111/**
    111  * {@internal Missing Short Description}}
     112 * Creates the initial content for a newly-installed site.
    112113 *
    113  * {@internal Missing Long Description}}
     114 * Adds the default "Uncategorized" category, the first post (with comment),
     115 * first page, and default widgets for default theme for the current version.
    114116 *
    115117 * @since 2.1.0
    116118 *
    endif; 
    262264
    263265if ( !function_exists('wp_new_blog_notification') ) :
    264266/**
    265  * {@internal Missing Short Description}}
     267 * Notify the site admin that the setup is complete.
    266268 *
    267  * {@internal Missing Long Description}}
     269 * Sends an email with {@link wp_mail} to the new administrator that the site
     270 * setup is complete, and provides them with a record of their login credentials.
    268271 *
    269272 * @since 2.1.0
    270273 *
    if ( !function_exists('wp_upgrade') ) : 
    302305/**
    303306 * Run WordPress Upgrade functions.
    304307 *
    305  * {@internal Missing Long Description}}
     308 * Upgrades the database if needed during a site update.
    306309 *
    307310 * @since 2.1.0
    308311 *
    309  * @return null
     312 * @return null If no update is necessary or site isn't completely installed.
    310313 */
    311314function wp_upgrade() {
    312315        global $wp_current_db_version, $wp_db_version, $wpdb;
    endif; 
    351354/**
    352355 * Functions to be called in install and upgrade scripts.
    353356 *
    354  * {@internal Missing Long Description}}
     357 * Contains conditional checks to determine which upgrade scripts to run, based on
     358 * database version and WP version we're updating to.
    355359 *
    356360 * @since 1.0.1
     361 *
     362 * @return null If no update is necessary.
    357363 */
    358364function upgrade_all() {
    359365        global $wp_current_db_version, $wp_db_version;
    function upgrade_370() { 
    12901296 * Execute changes made in WordPress 3.7.2.
    12911297 *
    12921298 * @since 3.7.2
    1293  * @since 3.8.0
    12941299 */
    12951300function upgrade_372() {
    12961301        global $wp_current_db_version;
    function upgrade_400() { 
    13291334}
    13301335
    13311336/**
    1332  * Execute network level changes
     1337 * Execute network level changes.
    13331338 *
    13341339 * @since 3.0.0
    13351340 */
  • src/wp-admin/includes/upgrade.php

    -- 
    2.2.1
    
    From ef1cc4e4faa26edcbc0872e279651d80e1aa1d23 Mon Sep 17 00:00:00 2001
    From: Morgan Estes <morgan.estes@gmail.com>
    Date: Mon, 22 Dec 2014 23:35:28 -0500
    Subject: [PATCH] Update docblocks with descriptions and updated parameter and
     return info.
    
    ---
     src/wp-admin/includes/upgrade.php | 66 ++++++++++++++++++++++-----------------
     1 file changed, 37 insertions(+), 29 deletions(-)
    
    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index 608cde2..a983c57 100644
    a b function upgrade_network() { 
    14361436// General
    14371437
    14381438/**
    1439  * {@internal Missing Short Description}}
     1439 * Create a table in the database if it doesn't already exist.
    14401440 *
    1441  * {@internal Missing Long Description}}
     1441 * This method checks for an existing database and creates a new one if it's not
     1442 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
     1443 * to query all tables first and then run the SQL statement creating the table.
    14421444 *
    14431445 * @since 1.0.0
    14441446 *
    function maybe_create_table($table_name, $create_ddl) { 
    14661468}
    14671469
    14681470/**
    1469  * {@internal Missing Short Description}}
     1471 * Drop a specified index from a table.
    14701472 *
    14711473 * {@internal Missing Long Description}}
    14721474 *
    function drop_index($table, $index) { 
    14891491}
    14901492
    14911493/**
    1492  * {@internal Missing Short Description}}
     1494 * Add an index to a specified table.
    14931495 *
    14941496 * {@internal Missing Long Description}}
    14951497 *
    function get_alloptions_110() { 
    15531555}
    15541556
    15551557/**
    1556  * Version of get_option that is private to install/upgrade.
     1558 * Version of {@link get_option} that is private to install/upgrade.
    15571559 *
    15581560 * @since 1.5.1
    15591561 * @access private
    function __get_option($setting) { 
    15821584}
    15831585
    15841586/**
    1585  * {@internal Missing Short Description}}
     1587 * Filter for content to remove unnecessary slashes.
    15861588 *
    15871589 * {@internal Missing Long Description}}
    15881590 *
    15891591 * @since 1.5.0
    15901592 *
    1591  * @param string $content
    1592  * @return string
     1593 * @param string $content The content to modify.
     1594 * @return string The de-slashed content.
    15931595 */
    15941596function deslash($content) {
    15951597        // Note: \\\ inside a regex denotes a single backslash.
    function deslash($content) { 
    16131615}
    16141616
    16151617/**
    1616  * {@internal Missing Short Description}}
     1618 * Modify the database based on specified SQL statements.
    16171619 *
    1618  * {@internal Missing Long Description}}
     1620 * Useful for creating new tables, and updating existing tables to a new structure.
    16191621 *
    16201622 * @since 1.5.0
    16211623 *
    1622  * @param string $queries
    1623  * @param bool   $execute
    1624  * @return array
     1624 * @param string|array $queries The query to run. Can be multiple queries in an array,
     1625 *                              or a string of queries separated by semicolons.
     1626 * @param bool         $execute Whether or not to execute the query right away.
     1627 * @return array Strings containing the results of the various update queries.
    16251628 */
    16261629function dbDelta( $queries = '', $execute = true ) {
    16271630        global $wpdb;
    function dbDelta( $queries = '', $execute = true ) { 
    18641867}
    18651868
    18661869/**
    1867  * {@internal Missing Short Description}}
     1870 * Update the database tables to a new schema.
    18681871 *
    1869  * {@internal Missing Long Description}}
     1872 * By default, updates all the tables to use the latest defined schema, but can also
     1873 * be used to update a specific set of tables in {@see wp_get_db_schema()}.
    18701874 *
    18711875 * @since 1.5.0
     1876 * @uses dbDelta
     1877 *
     1878 * @param string $tables Optional. Which set of tables to update. Default is 'all'.
    18721879 */
    18731880function make_db_current( $tables = 'all' ) {
    18741881        $alterations = dbDelta( $tables );
    function make_db_current( $tables = 'all' ) { 
    18781885}
    18791886
    18801887/**
    1881  * {@internal Missing Short Description}}
     1888 * Update the database tables to a new schema, but without displaying results.
    18821889 *
    1883  * {@internal Missing Long Description}}
     1890 * By default, updates all the tables to use the latest defined schema, but can also
     1891 * be used to update a specific set of tables in {@see wp_get_db_schema()}.
    18841892 *
    18851893 * @since 1.5.0
     1894 * @see make_db_current()
     1895 *
     1896 * @param string $tables Optional. Which set of tables to update. Default is 'all'.
    18861897 */
    18871898function make_db_current_silent( $tables = 'all' ) {
    18881899        dbDelta( $tables );
    18891900}
    18901901
    18911902/**
    1892  * {@internal Missing Short Description}}
     1903 * Create a site theme from an existing theme.
    18931904 *
    18941905 * {@internal Missing Long Description}}
    18951906 *
    18961907 * @since 1.5.0
    18971908 *
    1898  * @param string $theme_name
    1899  * @param string $template
     1909 * @param string $theme_name The name of the theme.
     1910 * @param string $template The directory name of the theme.
    19001911 * @return bool
    19011912 */
    19021913function make_site_theme_from_oldschool($theme_name, $template) {
    function make_site_theme_from_oldschool($theme_name, $template) { 
    19721983}
    19731984
    19741985/**
    1975  * {@internal Missing Short Description}}
     1986 * Create a site theme from the default theme.
    19761987 *
    19771988 * {@internal Missing Long Description}}
    19781989 *
    19791990 * @since 1.5.0
    19801991 *
    1981  * @param string $theme_name
    1982  * @param string $template
     1992 * @param string $theme_name The name of the theme.
     1993 * @param string $template The directory name of the theme.
    19831994 * @return null|false
    19841995 */
    19851996function make_site_theme_from_default($theme_name, $template) {
    function make_site_theme_from_default($theme_name, $template) { 
    20362047        @closedir($images_dir);
    20372048}
    20382049
    2039 // Create a site theme from the default theme.
    20402050/**
    2041  * {@internal Missing Short Description}}
     2051 * Create a site theme.
    20422052 *
    20432053 * {@internal Missing Long Description}}
    20442054 *
    function translate_level_to_role($level) { 
    21172127}
    21182128
    21192129/**
    2120  * {@internal Missing Short Description}}
    2121  *
    2122  * {@internal Missing Long Description}}
     2130 * Check the version of the installed MySQL binary.
    21232131 *
    21242132 * @since 2.1.0
    21252133 */
    function maybe_disable_automattic_widgets() { 
    21482156}
    21492157
    21502158/**
    2151  * Disables the Link Manager on upgrade, if at the time of upgrade, no links exist in the DB.
     2159 * Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.
    21522160 *
    21532161 * @since 3.5.0
    21542162 */
  • src/wp-admin/includes/upgrade.php

    -- 
    2.2.1
    
    From bee03fa40602c85701a0820b24030162a3c9c473 Mon Sep 17 00:00:00 2001
    From: Morgan Estes <morgan.estes@gmail.com>
    Date: Mon, 22 Dec 2014 23:36:35 -0500
    Subject: [PATCH] Added docblock for a method that existed since 1.3, but
     didn't have inline documentation consistent with current standards.
    
    ---
     src/wp-admin/includes/upgrade.php | 12 ++++++++----
     1 file changed, 8 insertions(+), 4 deletions(-)
    
    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index a983c57..595b426 100644
    a b function add_clean_index($table, $index) { 
    15091509}
    15101510
    15111511/**
    1512  ** maybe_add_column()
    1513  ** Add column to db table if it doesn't exist.
    1514  ** Returns:  true if already exists or on successful completion
    1515  **           false on error
     1512 * Add column to a database table if it doesn't already exist.
     1513 *
     1514 * @since 1.3.0
     1515 *
     1516 * @param string $table_name The table name to modify.
     1517 * @param string $column_name The column name to add to the table.
     1518 * @param string $create_ddl The SQL statement used to add the column.
     1519 * @return True if already exists or on successful completion, false on error.
    15161520 */
    15171521function maybe_add_column($table_name, $column_name, $create_ddl) {
    15181522        global $wpdb;
  • src/wp-admin/includes/upgrade.php

    -- 
    2.2.1
    
    From 9dc70fff031667e64811569f1d8dfd257b661b2c Mon Sep 17 00:00:00 2001
    From: Morgan Estes <morgan.estes@gmail.com>
    Date: Mon, 22 Dec 2014 23:38:25 -0500
    Subject: [PATCH] Removed long description stubs where no long description is
     needed for a method.
    
    ---
     src/wp-admin/includes/upgrade.php | 14 ++++----------
     1 file changed, 4 insertions(+), 10 deletions(-)
    
    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index 595b426..325c7ed 100644
    a b function maybe_create_table($table_name, $create_ddl) { 
    14701470/**
    14711471 * Drop a specified index from a table.
    14721472 *
    1473  * {@internal Missing Long Description}}
    1474  *
    14751473 * @since 1.0.1
    14761474 *
    14771475 * @param string $table Database table name.
    function drop_index($table, $index) { 
    14931491/**
    14941492 * Add an index to a specified table.
    14951493 *
    1496  * {@internal Missing Long Description}}
    1497  *
    14981494 * @since 1.0.1
    14991495 *
    15001496 * @param string $table Database table name.
    function add_clean_index($table, $index) { 
    15101506
    15111507/**
    15121508 * Add column to a database table if it doesn't already exist.
    1513  *
     1509 * 
    15141510 * @since 1.3.0
    1515  *
     1511 * 
    15161512 * @param string $table_name The table name to modify.
    15171513 * @param string $column_name The column name to add to the table.
    15181514 * @param string $create_ddl The SQL statement used to add the column.
    function __get_option($setting) { 
    15901586/**
    15911587 * Filter for content to remove unnecessary slashes.
    15921588 *
    1593  * {@internal Missing Long Description}}
    1594  *
    15951589 * @since 1.5.0
    15961590 *
    15971591 * @param string $content The content to modify.
    function dbDelta( $queries = '', $execute = true ) { 
    18781872 *
    18791873 * @since 1.5.0
    18801874 * @uses dbDelta
    1881  *
     1875 * 
    18821876 * @param string $tables Optional. Which set of tables to update. Default is 'all'.
    18831877 */
    18841878function make_db_current( $tables = 'all' ) {
    function make_db_current( $tables = 'all' ) { 
    18961890 *
    18971891 * @since 1.5.0
    18981892 * @see make_db_current()
    1899  *
     1893 * 
    19001894 * @param string $tables Optional. Which set of tables to update. Default is 'all'.
    19011895 */
    19021896function make_db_current_silent( $tables = 'all' ) {