Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (7 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/import-plugin.php

    r4563 r6287  
    1414if ( empty( $opts ) && $argc == 2 ) {
    1515    $opts['plugin'] = $argv[1];
    16     $argv[1] = '--plugin ' . $argv[1];
     16    $argv[1]        = '--plugin ' . $argv[1];
    1717}
    1818if ( empty( $opts['url'] ) ) {
     
    4444$_SERVER['REQUEST_URI'] = parse_url( $opts['url'], PHP_URL_PATH );
    4545
    46 include rtrim( $opts['abspath'], '/' ) . '/wp-load.php';
     46require rtrim( $opts['abspath'], '/' ) . '/wp-load.php';
    4747
    4848if ( ! class_exists( '\WordPressdotorg\Plugin_Directory\Plugin_Directory' ) ) {
     
    5050    if ( defined( 'WPORG_PLUGIN_DIRECTORY_BLOGID' ) ) {
    5151        fwrite( STDERR, "Run the following command instead:\n" );
    52         fwrite( STDERR, "\tphp " . implode( ' ', $argv ) . " --url " . get_site_url( WPORG_PLUGIN_DIRECTORY_BLOGID, '/' ) . "\n" );
     52        fwrite( STDERR, "\tphp " . implode( ' ', $argv ) . ' --url ' . get_site_url( WPORG_PLUGIN_DIRECTORY_BLOGID, '/' ) . "\n" );
    5353    }
    5454    die();
     
    5757$plugin_slug  = $opts['plugin'];
    5858$changed_tags = $opts['changed-tags'];
    59 $start_time   = microtime(1);
     59$start_time   = microtime( 1 );
    6060
    6161// If async, queue it to be parsed instead.
     
    6868echo "Processing Import for $plugin_slug... ";
    6969try {
    70     $importer = new CLI\Import;
     70    $importer = new CLI\Import();
    7171    $importer->import_from_svn( $plugin_slug, $changed_tags );
    72     echo "OK. Took " . round( microtime(1) - $start_time, 2 ) . "s\n";
    73 } catch( \Exception $e ) {
    74     echo "Failed. Took " . round( microtime(1) - $start_time, 2 ) . "s\n";
     72    echo 'OK. Took ' . round( microtime( 1 ) - $start_time, 2 ) . "s\n";
     73} catch ( \Exception $e ) {
     74    echo 'Failed. Took ' . round( microtime( 1 ) - $start_time, 2 ) . "s\n";
    7575
    7676    fwrite( STDERR, "[{$plugin_slug}] Plugin Import Failed: " . $e->getMessage() . "\n" );
    77     exit(1);
     77    exit( 1 );
    7878}
Note: See TracChangeset for help on using the changeset viewer.