File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,16 @@ public function onPostInstallOrUpdate(ScriptEvent $event)
380
380
$ installer ->setUpdateAllowList ($ requirements );
381
381
}
382
382
383
+ // Respect --ignore-platform-reqs option from input or
384
+ // COMPOSER_IGNORE_PLATFORM_REQS environment variable.
385
+ if ($ this ->state ->isComposer1 ()) {
386
+ $ ignore_platform_reqs = in_array ('--ignore-platform-reqs ' , $ _SERVER ['argv ' ]);
387
+ $ installer ->setIgnorePlatformRequirements ($ ignore_platform_reqs );
388
+ } else {
389
+ $ ignore_platform_reqs = getenv ('COMPOSER_IGNORE_PLATFORM_REQS ' ) == 1 ? true : in_array ('--ignore-platform-reqs ' , $ _SERVER ['argv ' ]);
390
+ $ installer ->setPlatformRequirementFilter (\Composer \Filter \PlatformRequirementFilter \PlatformRequirementFilterFactory::fromBoolOrList ($ ignore_platform_reqs ));
391
+ }
392
+
383
393
$ status = $ installer ->run ();
384
394
if (( $ status !== 0 ) && $ lockBackup && $ lock && !$ this ->state ->isComposer1 ()) {
385
395
$ this ->logger ->log (
You can’t perform that action at this time.
0 commit comments