PHP 클래스 seregazhuk\PinterestBot\Api\CurlHttpClient

상속: implements seregazhuk\PinterestBot\Api\Contracts\HttpClient
파일 보기 프로젝트 열기: seregazhuk/php-pinterest-bot

보호된 프로퍼티들

프로퍼티 타입 설명
$cookieJar string Path to cookies file
$cookies seregazhuk\PinterestBot\Helpers\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.

공개 메소드들

메소드 설명
__construct ( Cookies $cookies )
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

보호된 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

public __construct ( Cookies $cookies )
$cookies seregazhuk\PinterestBot\Helpers\Cookies

callCurl() 보호된 메소드

protected callCurl ( ) : mixed
리턴 mixed

cookies() 공개 메소드

Get all cookies
public cookies ( ) : array
리턴 array

execute() 공개 메소드

Executes curl request.
public execute ( string $url, string $postString = '', array $headers = [] ) : string
$url string
$postString string
$headers array
리턴 string

fillCookies() 보호된 메소드

protected fillCookies ( )

getCookiesPath() 공개 메소드

public getCookiesPath ( ) : string
리턴 string

getCurrentUrl() 공개 메소드

public getCurrentUrl ( ) : string
리턴 string

getDefaultHttpOptions() 보호된 메소드

protected getDefaultHttpOptions ( ) : array
리턴 array

init() 보호된 메소드

Initializes curl resource with options.
protected init ( string $url, string $postString, array $headers )
$url string
$postString string
$headers array

initCookieFile() 보호된 메소드

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.
protected initCookieFile ( string $username ) : string
$username string
리턴 string

initCookieJar() 보호된 메소드

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.
protected initCookieJar ( $username = '' )
$username

loadCookies() 공개 메소드

Load cookies for specified username
public loadCookies ( string $username = '' ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
$username string
리턴 seregazhuk\PinterestBot\Api\Contracts\HttpClient

makeHttpOptions() 보호된 메소드

Adds necessary curl options for query.
protected makeHttpOptions ( string $postString = '' ) : array
$postString string POST query string
리턴 array

removeCookies() 공개 메소드

public removeCookies ( )

setCookiesPath() 공개 메소드

Set directory to store all cookie files.
public setCookiesPath ( string $path )
$path string

setOptions() 공개 메소드

Set custom Curl options to override default
public setOptions ( array $options ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
$options array
리턴 seregazhuk\PinterestBot\Api\Contracts\HttpClient

useProxy() 공개 메소드

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
리턴 seregazhuk\PinterestBot\Api\Contracts\HttpClient

useSocksProxy() 공개 메소드

public useSocksProxy ( string $host, string $port, null $auth = null ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
$host string
$port string
$auth null
리턴 seregazhuk\PinterestBot\Api\Contracts\HttpClient

프로퍼티 상세

$cookieJar 보호되어 있는 프로퍼티

Path to cookies file
protected string $cookieJar
리턴 string

$cookies 보호되어 있는 프로퍼티

Cookies container
protected Cookies,seregazhuk\PinterestBot\Helpers $cookies
리턴 seregazhuk\PinterestBot\Helpers\Cookies

$cookiesPath 보호되어 있는 프로퍼티

Path to directory to store cookie file
protected string $cookiesPath
리턴 string

$curl 보호되어 있는 프로퍼티

Contains the curl instance.
protected resource $curl
리턴 resource

$currentUrl 보호되어 있는 프로퍼티

protected string $currentUrl
리턴 string

$headers 보호되어 있는 프로퍼티

protected array $headers
리턴 array

$options 보호되어 있는 프로퍼티

Custom CURL options for requests.
protected array $options
리턴 array