RequireThemeGenerator
extends ThemeGenerator
in package
Table of Contents
Properties
- $compiler : Compiler
- $destination : Destination
- $exclusionList : array<string|int, string>
- $httpClient : Browser
- $includeList : array<string|int, mixed>
- $logger : Logger
- $maxPublishCount : int
- $sourceTheme : string
Methods
- __construct() : mixed
- Generator constructor.
- run() : PromiseInterface<string|int, void>
- setExclusionList() : void
- setIncludeList() : void
- setSourceTheme() : void
- createPages() : array<string|int, Page>
- getName() : string
- handle() : PromiseInterface<string|int, void>
- handleError() : void
- onBeforeRequest() : void
- // Do something before sending HTTP request
- request() : PromiseInterface<string|int, void>
- shouldGenerateNextPage() : bool
- 次のページを生成するかどうか
- writeContents() : void
Properties
$compiler
protected
Compiler
$compiler
$destination
protected
Destination
$destination
$exclusionList
protected
array<string|int, string>
$exclusionList
= []
$httpClient
protected
Browser
$httpClient
$includeList
protected
array<string|int, mixed>
$includeList
= []
$logger
protected
Logger
$logger
$maxPublishCount
protected
int
$maxPublishCount
$sourceTheme
protected
string
$sourceTheme
Methods
__construct()
Generator constructor.
public
__construct(Compiler $compiler, Destination $destination, Logger $logger[, int $maxPublishCount = 5 ][, string $nameServer = '8.8.8.8' ]) : mixed
Parameters
- $compiler : Compiler
- $destination : Destination
- $logger : Logger
- $maxPublishCount : int = 5
- $nameServer : string = '8.8.8.8'
run()
public
run() : PromiseInterface<string|int, void>
Tags
Return values
PromiseInterface<string|int, void>setExclusionList()
public
setExclusionList(array<string|int, string> $list) : void
Parameters
- $list : array<string|int, string>
setIncludeList()
public
setIncludeList(array<string|int, string> $list) : void
Parameters
- $list : array<string|int, string>
setSourceTheme()
public
setSourceTheme(string $sourceTheme) : void
Parameters
- $sourceTheme : string
createPages()
protected
createPages(Finder $iterator) : array<string|int, Page>
Parameters
- $iterator : Finder
Return values
array<string|int, Page>getName()
protected
getName() : string
Return values
stringhandle()
protected
final handle(array<string|int, Page> $pages) : PromiseInterface<string|int, void>
Parameters
- $pages : array<string|int, Page>
Return values
PromiseInterface<string|int, void>handleError()
protected
handleError(Throwable $th, string $url) : void
Parameters
- $th : Throwable
- $url : string
onBeforeRequest()
// Do something before sending HTTP request
protected
onBeforeRequest(Page $page) : void
Parameters
- $page : Page
request()
protected
final request(string $url[, callable $onSuccess = null ][, callable $onFailure = null ]) : PromiseInterface<string|int, void>
Parameters
- $url : string
- $onSuccess : callable = null
- $onFailure : callable = null
Return values
PromiseInterface<string|int, void>shouldGenerateNextPage()
次のページを生成するかどうか
protected
shouldGenerateNextPage() : bool
Return values
boolwriteContents()
protected
writeContents(string $path, string $data) : void
Parameters
- $path : string
- $data : string