Download the PHP package cromero/composer-mr-patches-commit-lock without Composer

On this page you can find all versions of the php package cromero/composer-mr-patches-commit-lock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-mr-patches-commit-lock

Composer Patches Commit Lock

A Composer plugin that extends cweagans/composer-patches to lock Git patch commits from various providers (Drupal.org, GitHub, GitLab, etc.) in composer.lock.

Problem

When using patches from Git hosting providers (Drupal.org MRs, GitHub PRs, GitLab MRs), the patch URL often returns the latest version of the patch. If a new commit is pushed to the branch, the patch content changes.

This causes issues during deployment:

Solution

This plugin:

  1. Detects Git patch URLs from supported providers
  2. Fetches the commit hash from the provider's API
  3. Downloads the patch for that specific commit
  4. Stores the commit hash and provider in composer.lock under patch-commit-lock section
  5. On subsequent installs, uses the locked commit hash to download the exact same patch

Installation

Make sure you also have cweagans/composer-patches installed:

Usage

Define your patches as usual in composer.json:

How it works

Automatic lock on install/update

The plugin automatically checks if all git.drupalcode.org patches are locked in composer.lock when you run:

If any patches are missing from the lock, it will:

  1. Fetch the commit hash from GitLab API
  2. Save it to composer.lock under patch-commit-lock
  3. Continue with the normal install/update process

Example output:

Manual lock commands

Lock all patches

Scans all git.drupalcode.org patches in composer.json and locks their commit hashes to composer.lock.

Lock a single patch

Set a specific commit hash

Example:

This is useful when you need to lock to a specific commit that is not the latest one. The command:

Get commit hash for a patch (testing)

Supported Providers

Provider URL Pattern Identifier
Drupal.org (GitLab) https://git.drupalcode.org/project/{project}/-/merge_requests/{mr}.patch drupal-gitlab
Drupal.org (issues) https://www.drupal.org/files/issues/{date}/{issue}.patch drupal-gitlab
GitHub PR https://github.com/owner/repo/pull/123.patch github
GitHub (patch-diff) https://patch-diff.githubusercontent.com/raw/owner/repo/pull/123.patch github
GitHub Commit https://github.com/owner/repo/commit/abc123.patch github

Example composer.lock output

Commands Reference

Command Description
composer patches:lock-commits Lock all git.drupalcode.org patches to composer.lock
composer patches:lock-commit <url> Lock a single patch to composer.lock
composer patches:set-commit <url> <hash> Set a specific commit hash for a patch
composer patches:mr-commit <url> Fetch and display commit hash (testing)

Extending with Custom Providers

Create a custom provider by implementing GitProviderInterface or extending AbstractGitProvider:

Requirements

License

BSD-3-Clause


All versions of composer-mr-patches-commit-lock with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
composer-plugin-api Version ^2.0
cweagans/composer-patches Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cromero/composer-mr-patches-commit-lock contains the following files

Loading the files please wait ...