mediact/composer-file-installer

该软件包已被废弃,不再维护。作者建议使用 youwe/composer-file-installer 软件包。

使用 Composer 安装文件。

1.1.0 2020-12-24 03:34 UTC

This package is auto-updated.

Last update: 2022-08-10 18:13:57 UTC


README

Scrutinizer Code Quality

[废弃] composer-file-installer

将文件作为项目的一部分安装,作为 composer installcomposer update 的一部分。使用 mediact/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);