metabolism/package-actions

Allow file and folder actions upon package installation or update

Installs: 4 127

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 4

Type:composer-plugin

1.2.5 2023-01-16 17:26 UTC

This package is auto-updated.

Last update: 2024-10-16 21:07:27 UTC


README

add copy/create/remove/rename/symlink per package actions

available for both post-package-install and post-package-update

Installation

composer require metabolism/package-actions

Example

"extra": {
    "post-package-install": {
        "create": {
            "vendor/package-name": {
                "public/uploads": 777,
                "public/download": 655
        },
        "copy": {
            "vendor/package-name": {
                "folder/file.php": "public/myfile.php",
            }
        },
        "symlink": {
            "vendor/package-name": {
                "folder/file.php": "public/myfile.php",
            }
        }
        "rename": {
            "vendor/package-name": {
                "public/myfile.php": "public/file.php",
            }
        }
        "remove": {
            "vendor/package-name": ["public/myfile.php"]
            }
        }
    }
}

Create

 destination : permissions

destination is relative to the composer.json file

permissions use umask, only 3 last digits

Copy / Symlink

 source : destination

source is relative to the package folder

destination is relative to the composer.json file

Rename

 source : destination

source and destination are relative to the composer.json file

Remove

 [destination]

destination is relative to the composer.json file