Changeset 3373 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/bin/import-plugin.php
- Timestamp:
- 06/15/2016 04:47:04 AM (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
r3164 r3373 9 9 ob_start(); 10 10 11 $opts = getopt( '', array( 'url:', 'abspath:', 'plugin:' ) );11 $opts = getopt( '', array( 'url:', 'abspath:', 'plugin:', 'changed-tags:' ) ); 12 12 13 13 // Guess the default parameters: … … 21 21 if ( empty( $opts['abspath'] ) && false !== strpos( __DIR__, 'wp-content' ) ) { 22 22 $opts['abspath'] = substr( __DIR__, 0, strpos( __DIR__, 'wp-content' ) ); 23 } 24 25 if ( empty( $opts['changed-tags'] ) ) { 26 $opts['changed-tags'] = array( 'trunk' ); 27 } else { 28 $opts['changed-tags'] = explode( ',', $opts['changed-tags'] ); 23 29 } 24 30 … … 47 53 } 48 54 49 $plugin_slug = $opts['plugin']; 55 $plugin_slug = $opts['plugin']; 56 $changed_tags = $opts['changed-tags']; 57 $start_time = microtime(1); 50 58 51 59 echo "Processing Import for $plugin_slug... "; 52 60 try { 53 61 $importer = new CLI\Import; 54 $importer->import_from_svn( $plugin_slug );55 echo "OK \n";62 $importer->import_from_svn( $plugin_slug, $changed_tags ); 63 echo "OK. Took " . round( microtime(1) - $start_time, 2 ) . "s\n"; 56 64 } catch( \Exception $e ) { 57 echo "Failed.\n"; 65 echo "Failed. Took " . round( microtime(1) - $start_time, 2 ) . "s\n"; 66 58 67 fwrite( STDERR, "[{$plugin_slug}] Plugin Import Failed: " . $e->getMessage() . "\n" ); 59 68 exit(1);
Note: See TracChangeset
for help on using the changeset viewer.