gaojie1592/download_network_data_to_local
Composer 安装命令:
composer create-project gaojie1592/download_network_data_to_local
包简介
下载网络数据识别文件后缀后保存到本地并返回本地地址.Download the network data identification file suffix, save it to the local and return to the local address.
README 文档
README
功能说明:
将网络数据下载并自动识别文件后缀,保存到本地并返回本地地址.
Download network data and automatically recognize the file suffix, save it locally and return to the local address.
安装方法:
composer require gaojie1592/download_network_data_to_local
使用方法:
- 例子一:
require_once __DIR__ . '/vendor/autoload.php'; use gaojie1592\Download_Network_Data_To_Local; $img = new Download_Network_Data_To_Local( // 必要参数:需要下载的网络地址,必须是完整的 // Necessary parameters: the network address to be downloaded must be complete 'http://www.github.com/gif_download', // 必要参数:保存到本地的地址,不包含文件名称,以'/'或'\'结尾 // Necessary parameters: save to the local address, do not include the file name, end with'/' or'\' '/home/www.github.com/img/', // 可选参数:可以指定保存的文件名称,如果不指定则用随机字符 // Optional parameter: you can specify the saved file name, if not specified, use random characters 'filename' ); $local = $img->start(); var_dump($local); // 返回结果 string() "/home/www.github.com/img/filename.gif"
- 例子二:
require_once __DIR__ . '/vendor/autoload.php'; use gaojie1592\Download_Network_Data_To_Local; $img = new Download_Network_Data_To_Local(); // 必要参数:需要下载的网络地址,必须是完整的 // Necessary parameters: the network address to be downloaded must be complete $local = $img->set_http_url('http://www.github.com/jpg_download') // 必要参数:保存到本地的地址,不包含文件名称,以'/'或'\'结尾 // Necessary parameters: save to the local address, do not include the file name, end with'/' or'\' ->set_local_path('/home/www.github.com/img/') // 可选参数:可以指定保存的文件名称,如果不指定则用随机字符 // Optional parameter: you can specify the saved file name, if not specified, use random characters ->set_filename('filename') ->start(); var_dump($local); // 返回结果 string() "/home/www.github.com/img/filename.jpg"
- 例子三:
require_once __DIR__ . '/vendor/autoload.php'; use gaojie1592\Download_Network_Data_To_Local; $img = new Download_Network_Data_To_Local(); // 必要参数:需要下载的网络地址,必须是完整的 // Necessary parameters: the network address to be downloaded must be complete $local = $img->set_http_url('http://www.github.com/jpg_download') // 必要参数:保存到本地的地址,不包含文件名称,以'/'或'\'结尾 // Necessary parameters: save to the local address, do not include the file name, end with'/' or'\' ->set_local_path('/home/www.github.com/img/') // 可选参数:可以指定保存的文件名称,如果不指定则用随机字符 // Optional parameter: you can specify the saved file name, if not specified, use random characters ->set_filename('filename') // 可选参数:下载持续的最大时间,需要下载的文件体积越大,则设置越大 // Optional parameter: the maximum time for downloading, the larger the file size to be downloaded, the larger the setting ->set_http_timeout(50) // 可选参数:连接服务器的最大等待时间,如果网络不好,则设置大点 // Optional parameter: the maximum waiting time to connect to the server, if the network is not good, set a larger one ->set_http_sertimeout(50) // 可选参数:使用代理下载 // Optional parameter: download using proxy ->set_http_proxy('192.168.0.1:1080') // 可选参数:使用代理的账号与密码 // Optional parameters: use proxy account and password ->set_http_proxyusrpwd('usrname:password') ->start(); var_dump($local); // 返回结果 string() "/home/www.github.com/img/filename.jpg"
支持文件后缀:
- js
- psd
- htm_or_html
- xml
- bmp
- gif
- exe
- midi
- zip
- rar
- bt
- png
- bat
- xls_or_doc_or_ppt
- txt_or_aspx_or_asp_or_sql
- jpg
- rdp
许可证:
当前软件使用的许可证是 MIT,请查看完整的许可证.
This bundle is under the MIT license. See the complete license in the bundle.
gaojie1592/download_network_data_to_local 适用场景与选型建议
gaojie1592/download_network_data_to_local 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 03 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gaojie1592/download_network_data_to_local 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gaojie1592/download_network_data_to_local 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-03