PHPackages                             youwe/file-mapping - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. youwe/file-mapping

ActiveLibrary[File &amp; Storage](/categories/file-storage)

youwe/file-mapping
==================

File mapping library

2.0.0(9mo ago)0174.3k↓15.5%11MITPHPPHP ^8.1

Since May 10Pushed 9mo agoCompare

[ Source](https://github.com/YouweGit/file-mapping)[ Packagist](https://packagist.org/packages/youwe/file-mapping)[ RSS](/packages/youwe-file-mapping/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (10)Used By (1)

File mapping
============

[](#file-mapping)

A PHP package for mapping files from one location to another. It is used by the [youwe/composer-file-installer](https://github.com/YouweGit/composer-file-installer) package to move installed files according to the location mapping.

Mapping notation
----------------

[](#mapping-notation)

The mapping can contain `{source,destination}` placeholders, which will be replaced with the source or destination part relatively. A mapping string can contain multiple `{source,destination}` placeholders.

Examples mappings:

Mapping stringTranslates to source pathTranslates to destination path`file.php``file.php``file.php``{dot,.}gitignore``dotgitignore``.gitignore``{default/,}config.yaml{.dist,}``default/config.yaml.dist``config.yaml`Mapping file
------------

[](#mapping-file)

All mappings can be stored in and read from a file in your project/library. In that case, adding options to the mapping should be done with a colon-separated string. The actual meaning of the options depends on the implementation actually using the mappings, but an example of an option could be to indicate that contents should be force overwritten.

Example mapping file:

```
file1.php
file2.php:option1:option2
{dot,.}gitignore:merge:force

```

Usage examples
--------------

[](#usage-examples)

```
