drago-ex / project-installer
Installation and cleanup tools for Drago projects.
Requires
- php: >=8.3
- composer-runtime-api: ^2.0
This package is auto-updated.
Last update: 2026-05-15 14:05:54 UTC
README
Tools for automatic installation and cleanup of project resources from Composer packages.
Features
drago-install: Automatically copies or replaces files/directories from vendor packages to your project root.drago-clean: Cleans up redundant resource folders invendor/drago-exto prevent class duplication or namespace collisions.
Installation
Add the package to your project:
composer require drago-ex/project-installer
For component development, add it to require-dev:
composer require --dev drago-ex/project-installer
Configuration
In your package's composer.json, define what should be installed:
"extra": { "drago-project": { "install": { "copy": { "resources/Permission": "app/Core/Permission", "resources/assets": "assets/naja" }, "replace": { "resources/config/overrides.neon": "app/config/overrides.neon" } } } }
Global Options
To allow installation from packages with the default type library, enable this flag in your root composer.json:
"extra": { "drago-project": { "allow-library-install": true } }
Note: For security, only packages of type drago-project-resource are allowed to install resources by default. Use this flag to enable mirroring for standard libraries.
Sections:
copy: Copies files only if they do not already exist in the destination. Safe for initial setup.replace: Always overwrites the destination files. Useful for core updates or shared assets.
Usage
Automation
Add these scripts to your composer.json to automate the process:
"scripts": { "post-install-cmd": [ "drago-install", "drago-clean" ], "post-update-cmd": [ "drago-install", "drago-clean" ] }
Manual Execution
You can also run the commands manually from your terminal:
vendor/bin/drago-install vendor/bin/drago-clean
Options
--verboseor-v: Show detailed file-by-file progress during installation.--dev: Switches the destination directory toresources/in the current working directory. Useful for testing installation logic during package development.
How it works
drago-installscans all installed packages for theextra.drago-project.installconfiguration.- It resolves relative paths against the package root and the current working directory.
- It respects the
allow-library-installflag in your rootcomposer.json(defaults tofalsefor libraries). drago-cleanspecifically targetsvendor/drago-exand removesresourcesdirectories to keep your vendor clean after files have been mirrored to your project.