Changeset 7808 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-make-core-pot.php
- Timestamp:
- 10/31/2018 04:54:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-make-core-pot.php
r7807 r7808 53 53 } 54 54 55 $extract_js = version_compare( $wp_version, '5.0-beta', '>=' ); 56 55 57 $dry_run = Utils\get_flag_value( $assoc_args, 'dry-run', false ); 56 58 57 59 $headers = wp_json_encode( [ 58 60 'Report-Msgid-Bugs-To' => 'https://core.trac.wordpress.org/', 59 'PO-Revision-Date' => 'YEAR-MO-DA HO:MI+ZONE',60 61 ], JSON_UNESCAPED_SLASHES ); 61 62 62 63 $file_comment = sprintf( 63 "Copyright (C) %s by the contributors\nThis file is distributed under the same license as the WordPress package.",64 'Copyright (C) %s by the contributors\nThis file is distributed under the same license as the WordPress package.', 64 65 date( 'Y' ) 65 66 ); … … 77 78 78 79 WP_CLI::line( $command ); 79 ! $dry_run && WP_CLI::runcommand( $command /*, [ 'launch' => false ]*/);80 ! $dry_run && WP_CLI::runcommand( $command ); 80 81 81 82 // Front end. 83 $front_end_exclude = [ 84 'wp-admin/*', 85 'wp-content/themes/*', 86 'wp-includes/class-pop3.php', 87 'wp-content/plugins/akismet/*', 88 // External JavaScript libaries. 89 'wp-includes/js/tinymce/*', 90 'wp-includes/js/codemirror/*', 91 'wp-includes/js/crop/*', 92 'wp-includes/js/imgareaselect/*', 93 'wp-includes/js/jcrop/*', 94 'wp-includes/js/jquery/*', 95 'wp-includes/js/mediaelement/*', 96 'wp-includes/js/plupload/*', 97 'wp-includes/js/swfupload/*', 98 'wp-includes/js/thickbox/*', 99 'wp-includes/js/tinymce/*', 100 'wp-includes/js/tw-sack.js', 101 '*.js.map', // TODO: Currently not parsable, https://wordpress.slack.com/archives/C02RP4T41/p1541003227208000. 102 ]; 103 82 104 $command = 'i18n make-pot ' . escapeshellarg( $this->source ); 83 105 $command .= ' ' . escapeshellarg( $this->destination . '/wordpress.pot' ); 84 $command .= ' --exclude= "wp-admin/*,wp-content/themes/*,wp-includes/class-pop3.php,wp-content/plugins/akismet/"';106 $command .= ' --exclude=' . escapeshellarg( implode( ',', $front_end_exclude ) ); 85 107 $command .= ' --package-name=' . escapeshellarg( self::PACKAGE_NAME ); 86 108 $command .= ' --headers=' . escapeshellarg( $headers ); 87 109 $command .= ' --file-comment=' . escapeshellarg( $file_comment ); 88 $command .= ' --skip-js';89 110 $command .= ' --skip-audit'; 90 111 $command .= ' --ignore-domain'; 91 112 113 if ( ! $extract_js ) { 114 $command .= ' --skip-js'; 115 } 116 92 117 WP_CLI::line( $command ); 93 ! $dry_run && WP_CLI::runcommand( $command /*, [ 'launch' => false ]*/);118 ! $dry_run && WP_CLI::runcommand( $command ); 94 119 95 120 // Hello Dolly, included in admin. … … 108 133 109 134 WP_CLI::line( $command ); 110 ! $dry_run && WP_CLI::runcommand( $command /*, [ 'launch' => false ]*/);135 ! $dry_run && WP_CLI::runcommand( $command ); 111 136 112 137 // Admin. … … 133 158 $command .= ' --headers=' . escapeshellarg( $headers ); 134 159 $command .= ' --file-comment=' . escapeshellarg( $file_comment ); 135 $command .= ' --skip-js'; 160 $command .= ' --skip-js'; // TODO: No use of wp.i18n, yet. 136 161 $command .= ' --skip-audit'; 137 162 $command .= ' --ignore-domain'; 138 163 139 164 WP_CLI::line( $command ); 140 ! $dry_run && WP_CLI::runcommand( $command /*, [ 'launch' => false ]*/);165 ! $dry_run && WP_CLI::runcommand( $command ); 141 166 142 167 unlink( $hello_dolly_pot ); … … 150 175 $command .= ' --headers=' . escapeshellarg( $headers ); 151 176 $command .= ' --file-comment=' . escapeshellarg( $file_comment ); 152 $command .= ' --skip-js'; 177 $command .= ' --skip-js'; // TODO: No use of wp.i18n, yet. 153 178 $command .= ' --skip-audit'; 154 179 $command .= ' --ignore-domain'; 155 180 156 181 WP_CLI::line( $command ); 157 ! $dry_run && WP_CLI::runcommand( $command /*, [ 'launch' => false ]*/);182 ! $dry_run && WP_CLI::runcommand( $command ); 158 183 } 159 184
Note: See TracChangeset
for help on using the changeset viewer.