Composer require local PHAR file

时间:2019-03-17 22:25:53

标签: dependencies composer-php phar

I build a small PHP library as a PHAR file. It is not published anywhere, I just have it like PHAR file locally. Lets say its name is 'myLib.phar'

I want to test and use this library in another project, 'myProject'

How can I require 'myLib.phar' in 'composer.json', in order to get the phar copied in the project's vendor directory?

Here is myProject's composer.json:

{
    "name": "myProject",
    "description": "myProject Description.",
    "require": {
        "php": ">=7.1",
        "myLib": "@dev"
    },
    "repositories": [
        {
            "type": "path",
            "url": "../../../path/to/myLib.phar"
        }
    ]
}

How can I add a dependency to 'myLib.phar' with composer?

0 个答案:

没有答案