Skip to content

Commit 5975d9b

Browse files
authored
Merge pull request #422 from wp-cli/fix/forward-imagemagick-env
Pass the ImageMagick settings on to the WP-CLI processes
2 parents 4c17e6d + 91e9c6f commit 5975d9b

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)