PHP code example of thib92 / flysystem-public-url-plugin
1. Go to this page and download the library: Download thib92/flysystem-public-url-plugin 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/ */
thib92 / flysystem-public-url-plugin example snippets
$adapter = new \League\Flysystem\Adapter\Local(__DIR__.'/path/to/root/');
$filesystem = new \League\Flysystem\Filesystem($adapter);
$filesystem->addPlugin(new \Thib\FlysystemPublicUrlPlugin\PublicUrlPlugin);
$filesystem->getPublicUrl("/path/to/my/file");
$plugin = new \Thib\FlysystemPublicUrlPlugin\PublicUrlPlugin();
$plugin->setParam(\Thib\FlysystemPublicUrlPlugin\Adapter\LocalUrlAdapter::class, [
"/path/to/webserver/root"
]);