PHP code example of okcoder / think-filesystem

1. Go to this page and download the library: Download okcoder/think-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/ */

    

okcoder / think-filesystem example snippets

 think filesystem:table

return [
    'listen'    =>  [
        'AppInit'   =>  [
            \okcoder\think\filesystem\AppInitEvent::class
        ]
    ]
];

return [
    'disks' =>  [
        'qiniu'  => [
            'type'          => 'qiniu',
            'accessKey'     => env('FILESYSTEM.QINIU.ACCESS_KEY', ''),
            'secretKey'     => env('FILESYSTEM.QINIU.SECRET_KEY', ''),
            'bucket'        => env("FILESYSTEM.QINIU.BUCKET", ''),
            'url'           => env('FILESYSTEM.QINIU.URL', ''),//不要斜杠结尾,此处为URL地址域名。
            'videoWater'    => \Qiniu\base64_urlSafeEncode("kodo://" . env("FILESYSTEM.QINIU.BUCKET", '') . '/system/water.png') . '/wmGravity/SouthEast/wmScale/0.2/wmOffsetX/-20/wmOffsetY/-20',  // 视频水印
            'imageZip'      => 'imageView2/2/w/1440/format/jpg/interlace/1/q/40/ignore-error/1|imageslim', // 图片瘦身
            'pipelines'     => [    //  转码队列
                'videoWater'        =>  null,   // 生成视频预览加水印
                'videoPreviewWater' =>  null,   // 生成视频预览压缩加水印
                'h265ToH264'        =>  null,   // 265视频转码264
                'imageZip'          =>  null,   // 图片瘦身
            ]
        ],
    ],
     // 路由前缀
    'route_prefix' => 'okcoder/filesystem',
    // 是否开启265视频转码成264视频
    '265To264'     => true
];

    php think listen:queue --queue FileTranscodingJob