Download the PHP package consatan/weibo_image_uploader without Composer
On this page you can find all versions of the php package consatan/weibo_image_uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package weibo_image_uploader
PHP 实现的微博图床上传轮子
安装
要求
- PHP 7.0 以上版本
- json 扩展
- openssl 扩展
PHP 5.5, 5.6 版本请使用 0.5 版本
使用 composer (推荐)
从 Github 上下载
使用示例
使用说明
构造函数可传递 \Psr\Cache\CacheItemPoolInterface
和 \GuzzleHttp\ClientInterface
,默认情况下使用文件缓存 cookie 信息,存储在项目根目录的 cache/weibo 文件夹下,缓存的 key
使用 md5
后的微博用户名,可根据需求将缓存保存到其他适配器中,具体参见 \Symfony\Cache\Adapter
。
关于验证码问题(issue #3),可查看 example/cli.php 示例代码
Client::upload
方法的第四个参数允许传递 Guzzle request
的参数数组,具体见 Request Options,通过该参数可实现切换代理等操作,如下例:
水印选项
获取其他尺寸的图片链接
upload 方法中,$config 和 $option 参数位置可调换
抛出的所有异常都可通过 \Consatan\Weibo\ImageUploader\Exception\ImageUploaderException
接口捕获, 实现该接口的异常都在 src/Exception 目录下。
Todo
- [ ] 单元测试
- [x] 获取其他规格的图片 URL(如,small, thumbnail...)
- [x] 添加水印选项
- [x] 实现验证码输入(用户输入)
参考
All versions of weibo_image_uploader with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^6.2
symfony/cache Version ^3.2
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^6.2
symfony/cache Version ^3.2
The package consatan/weibo_image_uploader contains the following files
Loading the files please wait ....