-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServiceHub.php
80 lines (73 loc) · 1.98 KB
/
ServiceHub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* Service Hub
*
* @category Core
* @package KoolReport
* @author KoolPHP Inc <support@koolphp.net>
* @copyright 2017-2028 KoolPHP Inc
* @license MIT License https://www.koolreport.com/license#mit-license
* @link https://www.koolphp.net
*/
namespace koolreport\cloudexport;
/**
* Service Hub
*
* @category Core
* @package KoolReport
* @author KoolPHP Inc <support@koolphp.net>
* @copyright 2017-2028 KoolPHP Inc
* @license MIT License https://www.koolreport.com/license#mit-license
* @link https://www.koolphp.net
*/
class ServiceHub
{
/**
* The html content of report
*
* @param string $html The html content of report
*/
protected $html;
/**
* Construction
*
* @param string $html The html content of report
*/
public function __construct($html)
{
$this->html = $html;
}
/**
* Use ChromeHeadless.io service
*
* @param array $settings The array contain settings for Chromeheadles.io service
*
* @return ChromeHeadlessIoService The ChromeHeadlessIo service object
*/
public function chromeHeadlessio($authentication = "", $serviceHost = null)
{
$service = new ChromeHeadlessIoService($this->html, $authentication);
$service->settings([
'serviceHost' => $serviceHost
]);
return $service;
}
public function khtml($authentication = "", $serviceHost = null)
{
$service = new ChromeHeadlessIoService($this->html, $authentication);
$service->settings([
'engine' => 'wkhtmltopdf',
'serviceHost' => $serviceHost
]);
return $service;
}
public function phantomjs($authentication = "", $serviceHost = null)
{
$service = new ChromeHeadlessIoService($this->html, $authentication);
$service->settings([
'engine' => 'phantomjs',
'serviceHost' => $serviceHost
]);
return $service;
}
}