PHP code example of yiche / zip-client

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

    

yiche / zip-client example snippets



        
        $path = '/age';
        
        $urls = [
            'https://yiche-static.oss-cn-hangzhou.aliyuncs.com/yiche/uploads/image/20190814/bba450c87f32fbb711be606090df97bd.jpg',
        ];
        
        $jobs  = [
            'task' => [
                [
                    'path'  => $path,
                    'files' => $urls,
                ],
            ],
        ];
        $token = self::TOKEN;
        
        $task_id = ZipClient::download($token, $jobs);  //返回 下载任务id
        
        $this->assertTrue(is_int($task_id));
        

        
         
         $token = self::TOKEN;
        
         $url = ZipClient::get_generated_url($token, $task_id); // 返回 下载完成后生成的地址 或者 空字符串
        
         $this->assertTrue(is_string($url));