EntryGenerator
extends Generator
in package
Table of Contents
Properties
- $compiler : Compiler
- $copyArchiveEngine : CopyEntryArchive
- $destination : Destination
- $entryIds : array<string|int, mixed>
- $logger : Logger
- $maxPublishCount : int
- $pageGenerationService : PageGenerationService
- $targetBlogId : int
- $targetBlogName : string
- $withArchive : bool
Methods
- __construct() : mixed
- Generator constructor.
- addEntryPage() : void
- エントリーページを追加する
- addPage() : void
- ページを追加する
- onPageGenerationError() : void
- ページ生成エラー時の処理
- onPageGenerationStart() : bool
- 開始時の処理
- onPageGenerationSuccess() : void
- ページ生成成功時の処理
- requestStop() : void
- 停止を要求する
- run() : void
- ページ生成を開始する
- setEntryIds() : mixed
- setWithArchive() : void
- getName() : string
- handle() : void
- 書き出しのために、ページ取得を開始する
- handleError() : void
- onBeforeRequest() : void
- リクエスト前の処理
- onSuccess() : void
- リクエスト成功時の処理
- writeContents() : void
Properties
$compiler
protected
Compiler
$compiler
$copyArchiveEngine
protected
CopyEntryArchive
$copyArchiveEngine
$destination
protected
Destination
$destination
$entryIds
protected
array<string|int, mixed>
$entryIds
= []
$logger
protected
Logger
$logger
$maxPublishCount
protected
int
$maxPublishCount
$pageGenerationService
protected
PageGenerationService
$pageGenerationService
$targetBlogId
protected
int
$targetBlogId
$targetBlogName
protected
string
$targetBlogName
$withArchive
protected
bool
$withArchive
= false
Methods
__construct()
Generator constructor.
public
__construct(int $targetBlogId, Compiler $compiler, Destination $destination, Logger $logger[, int $maxPublishCount = 5 ]) : mixed
Parameters
- $targetBlogId : int
- $compiler : Compiler
- $destination : Destination
- $logger : Logger
- $maxPublishCount : int = 5
addEntryPage()
エントリーページを追加する
public
addEntryPage(string $url, string $destinationPathname, int $entryId) : void
Parameters
- $url : string
- $destinationPathname : string
- $entryId : int
addPage()
ページを追加する
public
addPage(string $url, string $destinationPathname) : void
Parameters
- $url : string
- $destinationPathname : string
onPageGenerationError()
ページ生成エラー時の処理
public
onPageGenerationError(Page $page, int $statusCode, ProcessResult $result) : void
Parameters
- $page : Page
- $statusCode : int
- $result : ProcessResult
onPageGenerationStart()
開始時の処理
public
onPageGenerationStart(Page $page) : bool
Parameters
- $page : Page
Return values
boolonPageGenerationSuccess()
ページ生成成功時の処理
public
onPageGenerationSuccess(Page $page, string $stdout, int $statusCode, ProcessResult $result) : void
Parameters
- $page : Page
- $stdout : string
- $statusCode : int
- $result : ProcessResult
requestStop()
停止を要求する
public
requestStop() : void
run()
ページ生成を開始する
public
run() : void
Tags
setEntryIds()
public
setEntryIds(array<string|int, int> $entryIds) : mixed
Parameters
- $entryIds : array<string|int, int>
setWithArchive()
public
setWithArchive(bool $withArchive) : void
Parameters
- $withArchive : bool
getName()
protected
getName() : string
Return values
stringhandle()
書き出しのために、ページ取得を開始する
protected
final handle() : void
handleError()
protected
handleError(Throwable $th, string $url, int $statusCode) : void
Parameters
- $th : Throwable
- $url : string
- $statusCode : int
onBeforeRequest()
リクエスト前の処理
protected
onBeforeRequest(Page $page) : void
Parameters
- $page : Page
Tags
onSuccess()
リクエスト成功時の処理
protected
onSuccess(Page $page, string $data, int $statusCode) : void
Parameters
- $page : Page
- $data : string
- $statusCode : int
writeContents()
protected
writeContents(string $path, string $data) : void
Parameters
- $path : string
- $data : string