gasparonik/composer-symlinks

Create relative symlinks based on getcwd() and relative data

Installs: 1 217

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 9

Type:composer-plugin

1.4.1 2021-02-22 17:11 UTC

This package is auto-updated.

Last update: 2024-04-23 00:12:45 UTC


README

Its provide a simple Composer script to symlink paths.

Installation

To install the latest stable version of this component, open a console and execute the following command:

$ composer require gasparonik/composer-symlinks

Usage

1. Define symlinks

Create the symlinks definition adding a somework/composer-symlinks section inside the extra section of the composer.json file.

Set skip-missing-target to true if we should not throw exception if target path doesn't exists
Set absolute-path to true if you want to create realpath symlinks
Set throw-exception to false if you dont want to break creating on some error while check symlinks
Set force-create to force unlink link if something already exists on link path

You can set personal configs for any symlink.
For personal configs link must be defined

{
    "extra": {
        "somework/composer-symlinks": {
            "symlinks": {
                "common/upload": "web/upload",
                "common/static/dest": {
                    "link": "web/dest",
                    "skip-missing-target": false,
                    "absolute-path": true,
                    "throw-exception": false
                },
                "common/web": [
                    "web1",
                    "web2",
                    "web3"
                ],
                "common/local": {
                    "link": [
                        "web1/local",
                        "web2/local",
                        "web3/local"
                    ]
                }
            },
            "force-create": false,
            "skip-missing-target": false,
            "absolute-path": false,
            "throw-exception": true
        }
    }
}

3. Execute composer

DO NOT use --no-plugins for composer install or update

License

This component is under the MIT license. See the complete license in the [LICENSE] file.

Reporting an issue or a feature request

Issues and feature requests are tracked in the [Github issue tracker].