PHP Class Imdb\Pages

Exibir arquivo Open project: tboothman/imdbphp Class Usage Examples

Protected Properties

Property Type Description
$cache CacheInterface
$config Config
$logger Psr\Log\LoggerInterface
$name
$pages

Public Methods

Method Description
__construct ( Config $config, CacheInterface $cache, Psr\Log\LoggerInterface $logger )
get ( $url ) : string Retrieve the content of the specified $url Caching will be used where possible

Protected Methods

Method Description
buildRequest ( $url )
getCacheKey ( $url )
getFromCache ( $url )
requestPage ( $url ) : string Request the page from IMDb
saveToCache ( $url, $page )

Method Details

__construct() public method

public __construct ( Config $config, CacheInterface $cache, Psr\Log\LoggerInterface $logger )
$config Config
$cache CacheInterface
$logger Psr\Log\LoggerInterface

buildRequest() protected method

protected buildRequest ( $url )

get() public method

Retrieve the content of the specified $url Caching will be used where possible
public get ( $url ) : string
return string

getCacheKey() protected method

protected getCacheKey ( $url )

getFromCache() protected method

protected getFromCache ( $url )

requestPage() protected method

Request the page from IMDb
protected requestPage ( $url ) : string
$url
return string Page html. Empty string on failure

saveToCache() protected method

protected saveToCache ( $url, $page )

Property Details

$cache protected_oe property

protected CacheInterface $cache
return CacheInterface

$config protected_oe property

protected Config,imdb $config
return Config

$logger protected_oe property

protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface

$name protected_oe property

protected $name

$pages protected_oe property

protected $pages