1

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

3
  • What is your actual aim here? If it's to have a local cache of the public packages you depend on, I think Satis may not be the right tool for the job.
    – IMSoP
    Aug 25, 2022 at 23:20
  • 2
    And please refrain from posting the same question over and over again, if you specialized since the four hours of your first question, edit it to extend, don't extend with a second question.
    – hakre
    Aug 26, 2022 at 4:28
  • @hakre, I managed to make it work the way I meant it, if you're interested look in my answer. Also, regarding the duplicate answer - I was sure I deleted it. I just made a badly asked question and made this instead, but forgot to delete the other. IMSoP I need to be able to use Composer from a local repository and not online due to security issues, and I can only get one version at a time
    – pileup
    Aug 26, 2022 at 8:04

1 Answer 1

0

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
    }
}
7
  • 1
    Okay, then I really didn't get your question sorry. A pointer to the docs might be the composer repository configuration: getcomposer.org/doc/05-repositories.md - no idea what your requirement for Satis actually is still thought. You're aware of the global composer configuration file, right?
    – hakre
    Aug 26, 2022 at 13:49
  • @hakre - where I work, they blocked outbound/inbound traffic and they only allow me to get individual packages downloaded from GitHub after they've been scanned. So I need to be able to use composer commands so that it configures everything properly (Manually configuring my project's composer files is a nightmare, or actually impossible). Btw, what do you mean by global composer configuration file - I know about it, but where does it go in this case and what should I be aware of?
    – pileup
    Aug 26, 2022 at 21:32
  • 1
    In the global configuration file you can configure repositories as well. It's then that you don't need to do that within the projects individually. E.g. you could configure to use the Satis by default or even packages on the hosts file-system directly which comes with some benefits when installing (e.g. symlinking is possible or local git clones). It is also that you don't need to run some extra service.
    – hakre
    Aug 27, 2022 at 9:02
  • Oh that's a good idea to define the satis repository in the global config. Good idea. I did that, or so I think. I found a composer.json in the ROAMING directory, but it was an empty json file. So where things like Packagist is defined as the default repo in the first place? Is this composer.json the global config or I'm wrong?
    – pileup
    Aug 27, 2022 at 12:04
  • composer config home shows it, look inside there you find a config.json there, keep backups (or use the CLI interface for changes) ;) - compare getcomposer.org/doc/06-config.md (see --global), getcomposer.org/doc/03-cli.md#config and getcomposer.org/doc/05-repositories.md etc.
    – hakre
    Aug 27, 2022 at 12:46

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.