| 1: | <?php |
| 2: | |
| 3: | namespace ngatngay\http; |
| 4: | |
| 5: | use Symfony\Component\BrowserKit\HttpBrowser; |
| 6: | use Symfony\Component\BrowserKit\History; |
| 7: | use Symfony\Component\BrowserKit\CookieJar; |
| 8: | use Symfony\Contracts\HttpClient\HttpClientInterface; |
| 9: | |
| 10: | class browser extends HttpBrowser |
| 11: | { |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | public function __construct($client = null, $history = null, $cookieJar = null) |
| 18: | { |
| 19: | parent::__construct($client ?? new client(), $history, $cookieJar); |
| 20: | } |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | public function setUserAgent($userAgent) { |
| 27: | $this->setServerParameter('HTTP_USER_AGENT', $userAgent); |
| 28: | } |
| 29: | } |
| 30: | |