Skip to content

Commit 91e9c6f

Browse files
schlesseraclaude
andcommitted
Pass the ImageMagick settings on to the WP-CLI processes
setup-php installs ImageMagick on macOS somewhere else than it was built for, and points it at its coders and configuration through MAGICK_* variables. The launched processes did not get these, so Imagick supported none of the formats ImageMagick provides as modules, and PDF previews were never made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4c17e6d commit 91e9c6f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/Context/FeatureContext.php‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,15 @@ private static function get_process_env_variables(): array {
514514
}
515515
}
516516

517+
// An ImageMagick that is not installed where it was built, like the one setup-php provides on
518+
// macOS, is pointed at its coders and configuration through these. Without them, Imagick
519+
// supports none of the formats that ImageMagick provides as modules, PDF among them.
520+
foreach ( (array) getenv() as $key => $value ) {
521+
if ( 0 === strpos( (string) $key, 'MAGICK_' ) ) {
522+
$env[ $key ] = $value;
523+
}
524+
}
525+
517526
if ( self::running_with_code_coverage() ) {
518527
$has_coverage_driver = ( new Runtime() )->hasXdebug() || ( new Runtime() )->hasPCOV();
519528

0 commit comments

Comments
 (0)