Changeset 7893
- Timestamp:
- 11/24/2018 02:06:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/i18n/class-code-import.php
r6287 r7893 23 23 */ 24 24 public function import_from_tag( $tag ) { 25 if ( ! defined( 'WPORGTRANSLATE_WPCLI' ) ) { 26 throw new Exception( 'Missing configuration for WPORGTRANSLATE_WPCLI.' ); 27 } 28 25 29 $svn_url = $this->get_plugin_svn_url( $tag ); 26 30 … … 43 47 } 44 48 45 if ( ! class_exists( '\PotExtMeta' ) ) { 46 require_once plugin_dir_path( \WordPressdotorg\Plugin_Directory\PLUGIN_FILE ) . 'libs/i18n-tools/makepot.php'; 47 } 49 $pot_file = "{$tmp_directory}/{$this->plugin}-code.pot"; 48 50 49 $pot_file = "{$tmp_directory}/{$this->plugin}-code.pot"; 50 $makepot = new \MakePOT(); 51 $cmd = sprintf( 52 '%s i18n make-pot %s %s --slug=%s --ignore-domain --skip-audit', 53 WPORGTRANSLATE_WPCLI, 54 escapeshellarg( $export_directory ), 55 escapeshellarg( $pot_file ), 56 escapeshellarg( $this->plugin ) 57 ); 51 58 52 if ( ! $makepot->wp_plugin( $export_directory, $pot_file, $this->plugin ) || ! file_exists( $pot_file ) ) { 59 exec( $cmd, $output, $return_code ); 60 61 if ( 0 !== $return_code || ! file_exists( $pot_file ) ) { 53 62 throw new Exception( "POT file couldn't be created." ); 54 63 }
Note: See TracChangeset
for help on using the changeset viewer.