mileschou / imgecho
PHP的行内图片协议实现。
v0.1.0
2021-10-12 15:37 UTC
Requires
- php: ^7.1 | ^8.0
Requires (Dev)
- phpunit/phpunit: ^7.5 | ^8.5 | ^9.3
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2024-09-12 22:04:35 UTC
README
使用行内图片协议在iTerm App上回显图片。
安装
使用Composer进行安装。
composer require mileschou/imgecho
用法
使用流畅的API构建控制代码。以下是一个示例
$uri = 'https://chart.apis.google.com/chart?cht=lc&chs=450x200&chd=t:70,72,67,68,65,59,64,70,73,75,78,80&chxt=x,y&chxl=0:|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec&chg=10,20'; $resolver = static function () use ($uri) { return file_get_contents($uri); }; $echoer = new MilesChou\ImgEcho\ImgEcho(); $echoer->withName('basic'); $echoer->withImage($resolver); $echoer->send();