GenerateBuildManifest
extends PostBuildTask
in package
The build manifest contains a list of all pages and their source and output paths.
While not used by the framework, it's useful for addon services to know which page were built, and when. The hashes are so that the addon services can determine if a page has changed since the last build.
The manifest is stored in the app/storage/framework/cache
directory by default, as some users
may not want to commit the manifest file to their repository or their deployed site.
However, a great alternate location is in _site/build-manifest.json
,
if you don't mind it the file being publicly accessible.
Table of Contents
Properties
- $message : string
- $exitCode : int
- $output : OutputStyle|null
- $timeStart : float
Methods
- createdSiteFile() : static
- Write a fluent message to the output that the task created the specified file.
- getMessage() : string
- handle() : void
- printFinishMessage() : void
- printStartMessage() : void
- run() : int
- This method is called by the BuildTaskService. It will run the task using the handle method, as well as write output to the console, and handle any exceptions that may occur.
- setOutput() : void
- skip() : void
- Write a fluent message to the output that the task is skipping and halt the execution.
- withExecutionTime() : static
- Write a fluent message to the output with the execution time of the task.
- write() : void
- writeln() : void
- getExecutionTimeInMs() : int|float
- getExecutionTimeString() : string
- getManifestPath() : string
- hashOutputPath() : string|null
- hashSourcePath() : string
- jsonEncodeOutput() : string
- startClock() : void
- stopClock() : float
Properties
$message
public
static string
$message
= 'Generating build manifest'
$exitCode
protected
int
$exitCode
= \Symfony\Component\Console\Command\Command::SUCCESS
$output
protected
OutputStyle|null
$output
$timeStart
protected
float
$timeStart
Methods
createdSiteFile()
Write a fluent message to the output that the task created the specified file.
public
createdSiteFile(string $path) : static
Parameters
- $path : string
Return values
staticgetMessage()
public
getMessage() : string
Return values
stringhandle()
public
handle() : void
printFinishMessage()
public
printFinishMessage() : void
printStartMessage()
public
printStartMessage() : void
run()
This method is called by the BuildTaskService. It will run the task using the handle method, as well as write output to the console, and handle any exceptions that may occur.
public
run([OutputStyle|null $output = null ]) : int
Parameters
- $output : OutputStyle|null = null
Return values
int —The exit code of the task. This can be used when calling a task directly from a command.
setOutput()
public
setOutput(OutputStyle $output) : void
Parameters
- $output : OutputStyle
skip()
Write a fluent message to the output that the task is skipping and halt the execution.
public
skip([string $reason = 'Task was skipped' ]) : void
Parameters
- $reason : string = 'Task was skipped'
Tags
withExecutionTime()
Write a fluent message to the output with the execution time of the task.
public
withExecutionTime() : static
Return values
staticwrite()
public
write(string $message) : void
Parameters
- $message : string
writeln()
public
writeln(string $message) : void
Parameters
- $message : string
getExecutionTimeInMs()
protected
getExecutionTimeInMs() : int|float
Return values
int|floatgetExecutionTimeString()
protected
getExecutionTimeString() : string
Return values
stringgetManifestPath()
protected
getManifestPath() : string
Return values
stringhashOutputPath()
protected
hashOutputPath(HydePage $page) : string|null
Parameters
- $page : HydePage
Return values
string|nullhashSourcePath()
protected
hashSourcePath(HydePage $page) : string
Parameters
- $page : HydePage
Return values
stringjsonEncodeOutput()
protected
jsonEncodeOutput(Collection $pages) : string
Parameters
- $pages : Collection
Return values
stringstartClock()
protected
startClock() : void
stopClock()
protected
stopClock() : float