Changeset 9119
- Timestamp:
- 08/28/2019 09:12:29 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r9052 r9119 443 443 // Find blocks 444 444 $blocks = array(); 445 $files_with_blocks = array(); 445 446 foreach ( Filesystem::list_files( "$tmp_dir/export/", true /* recursive */, '!\.(?:php|js|jsx|json)$!i' ) as $filename ) { 446 447 $file_blocks = $this->find_blocks_in_file( $filename ); 447 448 if ( $file_blocks ) { 449 $files_with_blocks[] = str_replace( "$tmp_dir/export/", '', $filename ); 448 450 foreach ( $file_blocks as $block ) { 449 451 // If the info came from a block.json file with more metadata (like description) then we want it to override less detailed info scraped from php/js. … … 461 463 462 464 foreach ( $dist_files as $file ) { 463 #$block_files[] = 'https://plugins.svn.wordpress.org' . "/{$plugin_slug}/trunk/dist/" . $file;464 465 $block_files[] = '/trunk/dist/' . $file; 465 466 } 466 467 467 468 foreach ( $build_files as $file ) { 468 #$block_files[] = 'https://plugins.svn.wordpress.org' . "/{$plugin_slug}/trunk/build/" . $file;469 469 $block_files[] = '/trunk/build/' . $file; 470 470 } 471 472 if ( empty( $block_files ) ) { 473 foreach ( $files_with_blocks as $file ) { 474 $block_files[] = '/trunk/' . $file; 475 } 476 } 477 478 // Only allow js or css files 479 $block_files = array_unique( array_filter( $block_files, function( $filename ) { 480 return preg_match( '!\.(?:js|jsx|css)$!i', $filename ); 481 } ) ); 471 482 472 483 return compact( 'readme', 'stable_tag', 'tmp_dir', 'plugin_headers', 'assets', 'tagged_versions', 'blocks', 'block_files' );
Note: See TracChangeset
for help on using the changeset viewer.