Question

Here are the docs:

Here is my config.json file

{
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "name": "Local Packagist",
    "homepage": "http://blah/packagist",
    "repositories": [
        { "type": "vcs", "url": "http://blahsvn/myProject/my-bundle" }
    ],
    "require-all": true
}

After running the satis build command I get this in my composer.json file ( SEE HERE ):

{
    "require": {
        "myProject/my-bundle": "2.1.*"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "myProject/my-bundle", <-- HERE
                "version": "2.1.1",
                ...
            }
        }
    ]
}

When I generate the packages.json file I see this ( SEE HERE ):

{
    "packages": {
        "myProject/not-my-bundle-name": {
            "2.1.1": {
                "name": "myProject/not-my-bundle-name", <-- HERE
                "version": "2.1.1",
                ...

How do I get the two to match so I can pull with composer?

Was it helpful?

Solution

When you run satis build, you get a packages.json which contains all the info it found in the repositories you configured. So if http://blahsvn/myProject/my-bundle has a composer.json file in trunk/, it will define the name of the bundle. If the name does not match what you want, make sure you change it in trunk.

Then what you add in your project's composer.json is a repository of type "composer", and with the url pointing to your satis repo. Do not redefine the packages, otherwise you lose the whole point of satis. It should look like this:

{
    "require": {
        "myProject/my-bundle": "2.1.*"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "http://blah/packagist"
        }
    ]
}

That is assuming http://blah/packagist/packages.json is the stuff dumped by satis.

Note: You don't have to define any autoloading in the satis config.json.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top