-1

this is my composer.json:

{
    "require": {
        "spipu/html2pdf": "dev-master"
    }
}

now, spipu/html2pdf depends on tecnickcom/TCPDF, but i would like to use the patch-1 branch of divinity76/TCPDF as a substitute for tecnickcom/TCPDF, how can i do that?

(here's the problem: there's a unicode bug? limitation? in tecnickcom/TCPDF , making it impossible to generate PDF files with unicode filenames, like aæøå.pdf. i have sent a fix pull request , but it's been over 2 months with no response from the upstream maintainer :( i tried emailing tecnickcom too, but no response )

hanshenrik
  • 19,904
  • 4
  • 43
  • 89
  • 1
    https://stackoverflow.com/a/13500676/4621324 – Axalix Aug 13 '17 at 02:58
  • @Axalix seems relevant yes, but changing my composer.json to [this](https://pastebin.com/raw/TRBimyRg) , gives [this](https://pastebin.com/raw/pLxuArPf) error when running `composer update` ... any ideas? – hanshenrik Aug 13 '17 at 10:19

1 Answers1

0

with the link posted by Axalix in a comment, i found out i could substitute 1 repository with another, with the repositories property in composer.json , however, this substitute repository will not load tags that don't already exist in the original repository, just branches. however, spipu/html2pdf specifically requires version ~6.2, which makes composer refuse to install any dev-branch... but with the as keyword, i can substitute any branch with any version too, with that in mind, this seems to work:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/divinity76/TCPDF.git"
        }
    ],
    "require": {
        "spipu/html2pdf": "dev-master",
        "tecnickcom/tcpdf": "dev-patch-1 as 6.2.13"
    }
}

i found the branch-version substitution solution (the as keyword) here http://mnapoli.fr/overriding-dependencies-with-composer/

and the repository substitution solution in this answer: https://stackoverflow.com/a/13500676/1067003 (linked to by Axalix )

hanshenrik
  • 19,904
  • 4
  • 43
  • 89