0

Updating to Symfony 2.3 is easy if all the dependencies support it. One of the dependency I am using from Packagist says its requirement is Symfony <2.3. Therefore, I cannot install that library.

The library is a little old, and I know there is one or two problems, however, I wish I could still install it with composer.

How can I force composer to install the library dev-master even though packagist says <2.3 ?

jsgoupil
  • 3,788
  • 3
  • 38
  • 53
  • Do you have a link to the package? – cheesemacfly Jul 22 '13 at 14:50
  • @cheesemacfly https://packagist.org/packages/nicodmf/highlight-bundle I guess I could install the git repository instead of the packagist one. – jsgoupil Jul 22 '13 at 14:58
  • 1
    I see 2 ways to solve it: Try the bundle using the git repository directly and see if it works with Symfony 2.3. If yes, package it yourself. Or ask the owner if it is planned to be updated. I sadly don't know any easy other solution :/ – cheesemacfly Jul 22 '13 at 15:07

1 Answers1

1

You could fork it on github, change the composer.json to your setup of the bundle:

"symfony/symfony":   "2.3.*",

and add the fork as repository in your projects composer.json:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "youralias/highlight-bundle",
            "version": "dev-master",
            "source": {
                "url": "https://github.com/youralias/HighlightBundle",
                "type": "git",
                "reference": "origin/master"
            },
            "target-dir": "Highlight"
        }
    }

This will then take your fork instead of the original when you require: nicodmf/highlight-bundle

As for the PSR-0

"autoload": {
    "psr-0": {
        "": "src/",
        "Highlight\\": "vendor/youralias/highlight-bundle"
    }
},

And require:

"require": [
    ...,
    "youralias/highlight-bundle": "dev-master"
]

As cheesemacfly said "if it works with Symfony 2.3"

jsgoupil
  • 3,788
  • 3
  • 38
  • 53
ivoba
  • 5,780
  • 5
  • 48
  • 55
  • This is what I'm trying to do right now, thanks for the answer... I am having some trouble with the autoloader for some reason. I will reply here soon – jsgoupil Jul 22 '13 at 16:49
  • I finally got it, the autoload was not kicking in. Once I got it, then I needed to add a target-dir. I used the type: "package" – jsgoupil Jul 22 '13 at 21:12