php - Composer hook to fix package version -
i need hook in composer installation process fix versions of second level dependencies of root package. i.e. package depends on packages (with correct versions) these packages depends on other packages , versions "wrong". try use pre-package-install hook patch such versions not working me, code inside installer::prepackageinstall not executed.
root package composer.json looks this:
{ "name": "***/root-package", "repositories": [ { "type": "composer", "url": "http://***/packages.json" } ], "require": { "***/first-level-dep-1": "dev-release-xx", "***/first-level-dep-2": "dev-release-xx" }, "scripts": { "pre-package-install": [ "root-package\\installer::prepackageinstall" ] } }
first level dependency composer.json looks this:
{ "name": "***/first-level-dep-1", "repositories": [ { "type": "composer", "url": "http://***/packages.json" } ], "require": { "***/second-level-dep-1": "*", // !!! here problem "***/second-level-dep-2": "*" } }
i need replace * appropriate version during installation process.
you don't have "fix" version. should add second-level-dep own dependency in correct version, , case solved.
if first-level-dependency requires version of package, depending on correct version restrict installable versions 1 allow.
Comments
Post a Comment