Giter Club home page Giter Club logo

composer-override's Introduction

Composer Override

Allows to use a composer.override.json next to your composer.json file for external package management. This is useful, in example, when you need to have packages symlinked for local development, but not for production.

This tool will not use an existing composer.lock-file, so pulling may be slower. It will also not modify the existing lock file, if you need this, you can pass --copy-lock as parameter, and will copy the created lock file to the directory where the tool is run from.

Install

Please note that php-cli 5.6+ should be installed on your system, as well as Composer.

Run the following script on any Linux based machine: If you wish a different path than /usr/local/bin you can modify the last two lines.

wget https://raw.githubusercontent.com/FaimMedia/composer-override/master/composer-override -nv -O composer-override

php -r "if(hash_file('md5', 'composer-override') !== '2d2d98355db4bf9893e2689c4f2cf490') { print \"Invalid checksum\r\n\"; exit(1); }" \
	&& sudo mv composer-override /usr/local/bin/composer-override \
	&& sudo chmod +x /usr/local/bin/composer-override

Usage

composer.json

{
	"name": "faimmedia/my-app",

	"require": {
		"faimmedia/my-library": "^1.0"
	}
}

Next create a composer.override.json file next to the composer.json file:

composer.override.json

{
	"repositories": {
		"faimmedia/my-library": {
			"type": "path",
			"url": "../faimmedia-my-library",
			"symlink": true
		}
	}
}

When running composer-override it will merge the two files together, giving precedence for the override file, and will now create a symlink to a local directory, instead of pulling the package from Packagist.

You may override or add any value, in example:

composer.override.json

{
	"require": {
		"faimmedia/my-library": "dev-master"
	},

	"config": {
		"platform-check": false
	}
}

composer-override's People

Contributors

faimmedia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.