From 284e4761bfc94dc69f216a5e27a75898cc676ede Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Mon, 14 Sep 2015 09:48:15 +0100 Subject: [PATCH] Add documentation about the `path` repository --- doc/05-repositories.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/05-repositories.md b/doc/05-repositories.md index 1df20828a..5dae47295 100644 --- a/doc/05-repositories.md +++ b/doc/05-repositories.md @@ -606,6 +606,39 @@ imported. When an archive with a newer version is added in the artifact folder and you run `update`, that version will be imported as well and Composer will update to the latest version. +### Path + +In addition to the artifact repository, you can use the path one, which allow +you to depends on a relative directory. This can be especially useful when dealing +with monolith repositories. + +For instance, if you have the following directory structure in your repository: +``` +- apps +\_ my-app + \_ composer.json +- packages +\_ my-package + \_ composer.json +``` + +Then, to add the package `my/package` as a dependency, in your `apps/my-app/composer.json` +file, you can use the following configuration: + +```json +{ + "repositories": [ + { + "type": "path", + "url": "../../packages/my-package" + } + ], + "require": { + "my/package": "*@dev" + } +} +``` + ## Disabling Packagist You can disable the default Packagist repository by adding this to your