API Documentation

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

$exitCode

protected int $exitCode = \Symfony\Component\Console\Command\Command::SUCCESS

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
static

getMessage()

public getMessage() : string
Return values
string

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.

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
throws
BuildTaskSkippedException

withExecutionTime()

Write a fluent message to the output with the execution time of the task.

public withExecutionTime() : static
Return values
static

write()

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|float

getExecutionTimeString()

protected getExecutionTimeString() : string
Return values
string

jsonEncodeOutput()

protected jsonEncodeOutput(Collection $pages) : string
Parameters
$pages : Collection
Return values
string

        
On this page

Search results