Свойство | Type | Description | |
---|---|---|---|
$cookieJar | string | Path to cookies file | |
$cookies | Cookies container | ||
$cookiesPath | string | Path to directory to store cookie file | |
$curl | resource | Contains the curl instance. | |
$currentUrl | string | ||
$headers | array | ||
$options | array | Custom CURL options for requests. |
Méthode | Description | |
---|---|---|
__construct ( |
||
cookie ( $name ) : mixed | Get a cookie value by name | |
cookies ( ) : array | Get all cookies | |
execute ( string $url, string $postString = '', array $headers = [] ) : string | Executes curl request. | |
getCookiesPath ( ) : string | ||
getCurrentUrl ( ) : string | ||
loadCookies ( string $username = '' ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | Load cookies for specified username | |
removeCookies ( ) | ||
setCookiesPath ( string $path ) | Set directory to store all cookie files. | |
setOptions ( array $options ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | Set custom Curl options to override default | |
useProxy ( string $host, string $port, string $auth = null, string $type = null ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
useSocksProxy ( string $host, string $port, null $auth = null ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient |
Méthode | Description | |
---|---|---|
callCurl ( ) : mixed | ||
fillCookies ( ) | ||
getDefaultHttpOptions ( ) : array | ||
init ( string $url, string $postString, array $headers ) | Initializes curl resource with options. | |
initCookieFile ( string $username ) : string | Returns cookie file name by username. If username is empty we use a random cookie name, to be sure we have different cookies in parallel sessions. | |
initCookieJar ( $username = '' ) | Init cookie file for a specified username. If username is empty we use common cookie file for all sessions. If file does not exist it will be created in system temp directory. | |
makeHttpOptions ( string $postString = '' ) : array | Adds necessary curl options for query. |
public __construct ( |
||
$cookies |
protected getDefaultHttpOptions ( ) : array | ||
Résultat | array |
protected initCookieFile ( string $username ) : string | ||
$username | string | |
Résultat | string |
protected initCookieJar ( $username = '' ) | ||
$username |
public loadCookies ( string $username = '' ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
$username | string | |
Résultat | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected makeHttpOptions ( string $postString = '' ) : array | ||
$postString | string | POST query string |
Résultat | array |
public setCookiesPath ( string $path ) | ||
$path | string |
public setOptions ( array $options ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
$options | array | |
Résultat | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
public useProxy ( string $host, string $port, string $auth = null, string $type = null ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
$host | string | '192.168.1.1' |
$port | string | '12345' |
$auth | string | Authentication string: 'username:password' |
$type | string | HTTP|SOCKS |
Résultat | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected Cookies,seregazhuk\PinterestBot\Helpers $cookies | ||
Résultat |
protected string $cookiesPath | ||
Résultat | string |
protected array $options | ||
Résultat | array |