CategoryArchivesGenerator
extends PageGenerator
in package
Table of Contents
Properties
- $categoryId : int|null
- $compiler : Compiler
- $destination : Destination
- $logger : Logger
- $maxPage : int|null
- $maxPublishCount : int
- $pageGenerationService : PageGenerationService
- $range : string
- $targetBlogId : int
- $targetBlogName : string
Methods
- __construct() : mixed
- Generator constructor.
- addEntryPage() : void
- エントリーページを追加する
- addPage() : void
- ページを追加する
- onPageGenerationError() : void
- ページ生成エラー時の処理
- onPageGenerationStart() : bool
- 開始時の処理
- onPageGenerationSuccess() : void
- ページ生成成功時の処理
- requestStop() : void
- 停止を要求する
- run() : void
- ページ生成を開始する
- setCategoryId() : void
- setMaxPage() : void
- setRange() : void
- getArchiveContext() : array{bid: int, date: string, cid?: int}
- getFileName() : string
- getName() : string
- handle() : void
- 書き出しのために、ページ取得を開始する
- handleError() : void
- onBeforeRequest() : void
- リクエスト前の処理
- onSuccess() : void
- リクエスト成功時の処理
- writeContents() : void
Properties
$categoryId
protected
int|null
$categoryId
$compiler
protected
Compiler
$compiler
$destination
protected
Destination
$destination
$logger
protected
Logger
$logger
$maxPage
protected
int|null
$maxPage
= 1
$maxPublishCount
protected
int
$maxPublishCount
$pageGenerationService
protected
PageGenerationService
$pageGenerationService
$range
protected
string
$range
$targetBlogId
protected
int
$targetBlogId
$targetBlogName
protected
string
$targetBlogName
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
setCategoryId()
public
setCategoryId(int $categoryId) : void
Parameters
- $categoryId : int
setMaxPage()
public
setMaxPage(int $maxPage) : void
Parameters
- $maxPage : int
setRange()
public
setRange(string $range) : void
Parameters
- $range : string
getArchiveContext()
protected
getArchiveContext(string $date) : array{bid: int, date: string, cid?: int}
Parameters
- $date : string
Return values
array{bid: int, date: string, cid?: int}getFileName()
protected
getFileName(int $page) : string
Parameters
- $page : int
Return values
stringgetName()
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
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