| 1 | <?php |
||
| 5 | class Response |
||
| 6 | { |
||
| 7 | public $origHtml; |
||
| 8 | public $html; |
||
| 9 | public $proxyPath; |
||
| 10 | |||
| 11 | public function __construct($html) |
||
| 12 | { |
||
| 13 | $this->html = $this->origHtml = $html; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function setProxyPath($path) |
||
| 17 | { |
||
| 18 | $this->proxyPath = $path; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function replaceDomainLinks($domain) |
||
| 22 | { |
||
| 23 | $this->html = str_replace($domain, $this->proxyPath, $this->html); |
||
| 24 | } |
||
| 25 | |||
| 26 | // handle url encoding |
||
| 27 | public function hadleProxyURL($url) |
||
| 31 | |||
| 32 | public function replaceInternalHtmlLinks($usingUrlParam=false) |
||
| 33 | { |
||
| 34 | // replace href & src links where they DO NOT start with https?:... or //... |
||
| 42 | |||
| 43 | public function replaceInternalCssLinks($usingUrlParam=false) |
||
| 50 | |||
| 51 | public function getHtml() |
||
| 55 | |||
| 56 | public function getOrigHtml() |
||
| 60 | } |
||
| 61 |