PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 10, 2022

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

 November 10, 2022     composer-php, php, satis     No comments   

Issue

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
    }
}


Answered By - James Werben
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing