1. Go to this page and download the library: Download tuum/filemap 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/ */
tuum / filemap example snippets
$map = Tuum\Locator\FileMap::forge(
__DIR__.'/map', // root dir where mapped files exist.
__DIR__.'/cache' // give cache dir to convert md files.
);
// render the file based on path.
$found = $map->render('images/sample.jpg');
if (!$found->found()) {
echo 'not found';
}
header('Content-Type: '.$found->getMimeType());
if ($fp = $found->getResource()) {
fpassthru($fp);
} else {
echo $found->getContents();
}