youwe / composer-file-installer
使用Composer安装文件。
1.2.2
2023-06-15 10:18 UTC
Requires
- php: ^7.2 || ^8.0
- youwe/file-mapping: ~1.1.0
Requires (Dev)
- composer/composer: @stable
- kint-php/kint: @stable
- mikey179/vfsstream: @stable
- phpunit/phpunit: @stable
This package is auto-updated.
Last update: 2024-09-15 12:57:13 UTC
README
将文件作为项目的一部分安装,作为 composer install
或 composer update
的部分。使用 youwe/file-mapping 包根据源 -> 目标映射移动文件。Composer 的 IOInterface
为文件安装器提供写入文件和向最终用户提供输出消息的能力。
使用示例
<?php // Create a file mapping. $mappingFilePaths = new UnixFileMapping( __DIR__ . '/../folder/files', getcwd(), ['./dir/one','./dir/two'] ); // Get a file mapping reader. $reader = new UnixFileMappingReader($sourceDirectory, $targetDirectory, $mappingFilePaths); // Get an installer, supply with the file mapping reader. $installer = new FileInstaller($reader); // Install according to mapping, supply with Composer IOInterface. $installer->install($io);