PHP code example of youwe / composer-file-installer

1. Go to this page and download the library: Download youwe/composer-file-installer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

youwe / composer-file-installer example snippets



// 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);