phpcomposer-phpsatis

What could be the correct syntax to make Satis work with single version and not the whole repository?


The config file syntax of Satis is almost like Composer's.

This example Satis config works for comparison:

{
    "name": "local/repository",
    "homepage": "http://localhost/",
    "repositories": [
        {
            "name": "doctrine/inflector",
            "type": "git",
            "url": "https://github.com/doctrine/inflector.git"
        },
        {
            "name": "laravel/laravel",            
            "type": "git",
            "url": "https://github.com/laravel/laravel.git"
        }
        
    ],
    "require-all": true,
    "archive": {
        "directory": "dist"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "secure-http": false
    }
}

However what happens is that Satis downloads all the available versions from the specified GitHub repos. In this case all of Laravel's versions and all of Inflector's versions.

But I only want a single package - the latest version, from a downloaded zip file (The zip I downloaded from the remote package repository (GitHub)).

What could possibly be the correct configuration for a downloaded zip file instead of the current name/type/url combination inside the Satis repositories block?

Or, in order to use the downloaded zip file, I need to do something completely different?

I tried a few but all ended up with all sorts of errors


Solution

  • Ok, I found the correct syntax to make Satis configure single zip files. In the following example I used both full git repository that I fetched online and one single zip file from my local machine:

    {
        "name": "local/repository",
        "homepage": "http://localhost/",
        "repositories": [            
            {
                "type": "package",
                "package": {
                    "name": "doctrine/inflector",
                    "version": "2.0.4",
                    "dist": {
                        "url": "C:/path/to/zip_files/inflector.zip",
                        "type": "zip"
                    }
                }
            },
            {
                "name": "laravel/laravel",            
                "type": "git",
                "url": "https://github.com/laravel/laravel.git"
            }
            
        ],
        "require-all": true,
        "archive": {
            "directory": "dist"
        },
        "config": {
            "optimize-autoloader": true,
            "preferred-install": "dist",
            "sort-packages": true,
            "secure-http": false
        }
    }