Making WordPress.org


Ignore:
Timestamp:
07/07/2022 03:23:38 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Developer, CLI: Move the path validation checks closer together for consistency.

Follow-up to [7717], [10692], [10693].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli-commands.php

    r10812 r11949  
    99     *
    1010     * The source code for the version of WordPress to be parsed needs to be
    11      * obtained and unpackaged locally. You should not be code used in an
     11     * obtained and unpackaged locally. It should not be code used in an
    1212     * active install.
    1313     *
     
    8080        }
    8181
    82         // Determine importing user's ID.
    83         $user = get_user_by( 'id', $user_id );
    84         if ( ! $user ) {
    85             WP_CLI::error( 'Invalid user_id provided.' );
    86         }
    87         WP_CLI::log( "Importing as user ID $user_id ({$user->user_nicename})." );
    88 
    89         $plugins = [
    90             'phpdoc-parser'  => 'phpdoc-parser/plugin.php',
    91             'posts-to-posts' => 'posts-to-posts/posts-to-posts.php',
    92         ];
    93 
    9482        // Verify path is not a file.
    9583        if ( is_file( $path ) ) {
     
    113101            WP_CLI::confirm( "Looks like WP $version was already parsed on " . date_i18n( 'Y-m-d H:i', $last_parsed_date ) . ". Proceed anyway?" );
    114102        }
     103
     104        // Determine importing user's ID.
     105        $user = get_user_by( 'id', $user_id );
     106        if ( ! $user ) {
     107            WP_CLI::error( 'Invalid user_id provided.' );
     108        }
     109        WP_CLI::log( "Importing as user ID $user_id ({$user->user_nicename})." );
     110
     111        $plugins = [
     112            'phpdoc-parser'  => 'phpdoc-parser/plugin.php',
     113            'posts-to-posts' => 'posts-to-posts/posts-to-posts.php',
     114        ];
    115115
    116116        // Get the phpdoc-parser plugin if not installed.
Note: See TracChangeset for help on using the changeset viewer.