Skip to content

Commit 7092778

Browse files
committed
Preload polyfills in the PHAR
1 parent da259bd commit 7092778

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/src/Console/PrepareCommand.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ private function buildPreloadScript(): void
203203
$output .= 'require_once __DIR__ . ' . var_export($path, true) . ';' . "\n";
204204
}
205205

206+
$polyfillBootstraps = [
207+
'/vendor/symfony/polyfill-php80/bootstrap.php',
208+
'/vendor/symfony/polyfill-php81/bootstrap.php',
209+
'/vendor/symfony/polyfill-php83/bootstrap.php',
210+
'/vendor/symfony/polyfill-php84/bootstrap.php',
211+
'/vendor/symfony/polyfill-php85/bootstrap.php',
212+
'/vendor/symfony/polyfill-mbstring/bootstrap.php',
213+
'/vendor/symfony/polyfill-intl-normalizer/bootstrap.php',
214+
'/vendor/symfony/polyfill-intl-grapheme/bootstrap.php',
215+
'/vendor/symfony/polyfill-ctype/bootstrap.php',
216+
];
217+
foreach ($polyfillBootstraps as $bootstrapPath) {
218+
$output .= 'require_once __DIR__ . ' . var_export($bootstrapPath, true) . ';' . "\n";
219+
}
220+
206221
file_put_contents($preloadScript, sprintf($template, $output));
207222
}
208223

0 commit comments

Comments
 (0)