wueason / icapture
一个用于与 PhantomJs 交互并捕获网页截图的 PHP 类
v1.0.0
2017-04-08 14:18 UTC
Requires
- chrisboulton/php-resque: 1.2.x
- microweber/screen: 1.0.x
This package is not auto-updated.
Last update: 2024-09-20 19:40:20 UTC
README
PhantomJS 作为服务与 Swoole 模块。Icapture 可作为您的屏幕捕获服务。
要求
- PHP 5.3+
- Redis 2.2+ 并确保 Redis 已启动
- Swoole 扩展 1.8.13+
- 可选但推荐:Composer
入门指南
如果您不熟悉 Composer,请参阅 https://getcomposer.org.cn/。
- 将 icapture 添加到您的应用程序的 composer.json。
{ "require": { "wueason/icapture": "1.0.x" } }
-
运行
composer install
。 -
如果您尚未这样做,请将 Composer 自动加载添加到您的项目初始化文件中。(示例)
require 'vendor/autoload.php';
- 服务管理。
make start
make stop
make restart
- 使用
\Icapture\CaptureClient
发送请求,并获取捕获。
$client = new \Icapture\CaptureClient(); $client->request(); echo $clien->getCaptureFile();
提示
Screen 中的 PhantomJS 二进制文件可能已损坏,您可以使用 phantomjsBinPath
设置使用自己的版本。