Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/import-plugin.php
- Timestamp:
- 12/19/2017 04:22:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/import-plugin.php
r4563 r6287 14 14 if ( empty( $opts ) && $argc == 2 ) { 15 15 $opts['plugin'] = $argv[1]; 16 $argv[1] = '--plugin ' . $argv[1];16 $argv[1] = '--plugin ' . $argv[1]; 17 17 } 18 18 if ( empty( $opts['url'] ) ) { … … 44 44 $_SERVER['REQUEST_URI'] = parse_url( $opts['url'], PHP_URL_PATH ); 45 45 46 include rtrim( $opts['abspath'], '/' ) . '/wp-load.php';46 require rtrim( $opts['abspath'], '/' ) . '/wp-load.php'; 47 47 48 48 if ( ! class_exists( '\WordPressdotorg\Plugin_Directory\Plugin_Directory' ) ) { … … 50 50 if ( defined( 'WPORG_PLUGIN_DIRECTORY_BLOGID' ) ) { 51 51 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" ); 53 53 } 54 54 die(); … … 57 57 $plugin_slug = $opts['plugin']; 58 58 $changed_tags = $opts['changed-tags']; 59 $start_time = microtime( 1);59 $start_time = microtime( 1 ); 60 60 61 61 // If async, queue it to be parsed instead. … … 68 68 echo "Processing Import for $plugin_slug... "; 69 69 try { 70 $importer = new CLI\Import ;70 $importer = new CLI\Import(); 71 71 $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"; 75 75 76 76 fwrite( STDERR, "[{$plugin_slug}] Plugin Import Failed: " . $e->getMessage() . "\n" ); 77 exit( 1);77 exit( 1 ); 78 78 }
Note: See TracChangeset
for help on using the changeset viewer.