PHP code example of timeshow / laravel-filesystem
1. Go to this page and download the library: Download timeshow/laravel-filesystem 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/ */
timeshow / laravel-filesystem example snippets bash
PHP >=8.0
Laravel >=9.0
php
TimeShow\Filesystem\FilesystemServiceProvider::class,
angular2html
use Illuminate\Support\Facades\Storage;
array $disk->$adapter()->getMetadata('file.md');
array $disk->$adapter()->listContents();
string $disk->$adapter()->getUrl('file.md');
string $disk->getAdapter()->signatureConfig('path/to/file.png');
// url 访问有效期 & 图片处理「$timeout 为多少秒过期」
string $adapter->getTemporaryUrl('file.md', $timeout, ['x-oss-process' => 'image/circle,r_100']); // get
string $adapter->getTemporaryUrl('file.md', $timeout, ['x-oss-process' => 'image/circle,r_100'],'PUT'); // put
// 多个bucket切换
$adapter->bucket('test')->has('file.md');
angular2html
list($verify, $data) = $adapter->verify();
// [$verify, $data] = $flysystem->verify(); // php 7.1 +
if (!$verify) {
// 验证失败处理,此时 $data 为验签失败提示信息
}
// 注意一定要返回 json 格式的字符串,因为 oss 服务器只接收 json 格式,否则给前端报 CallbackFailed
header("Content-Type: application/json");
echo json_encode($data);