Cecil

IncrementalBuildResolver

Resolves impacted source pages for incremental serve builds.

Table of Contents

Properties

$builder  : Builder
$includeDrafts  : bool

Methods

__construct()  : mixed
resolve()  : array<int, string>|null
Resolves the list of content pages to rebuild from watcher changes.
buildReverseTemplateDependencyGraph()  : array<string, array<int, string>>
Builds a reverse dependency graph keyed by template reference (`scope:file`).
getPageOutputFormats()  : array<int, string>
Returns output formats for a page using render step rules.
getTemplateRoots()  : array<string, string>
Returns template roots keyed by their scope name used by Layout::finder.
normalizePath()  : string
Normalizes a filesystem path to use forward slashes without a trailing slash.
relativePathFromDirectory()  : string
Returns file path relative to a directory path.
resolveAffectedTemplates()  : array<string, bool>
Returns all templates impacted by changed templates (including reverse dependencies).
resolvePagesImpactedByTemplates()  : array<int, string>|null
Resolves source pages impacted by changed templates.
resolveTemplateRefFromPath()  : array{scope: string, file: string}|null
Resolves a filesystem path to a template reference when it belongs to a template root.

Properties

Methods

resolve()

Resolves the list of content pages to rebuild from watcher changes.

public resolve(ResourceWatcherResult $watcher) : array<int, string>|null

Returns an array of page paths (relative to the pages directory) when an incremental rebuild is possible, or null when a full rebuild is required.

Parameters
$watcher : ResourceWatcherResult
Return values
array<int, string>|null

buildReverseTemplateDependencyGraph()

Builds a reverse dependency graph keyed by template reference (`scope:file`).

private buildReverseTemplateDependencyGraph() : array<string, array<int, string>>
Return values
array<string, array<int, string>>

getPageOutputFormats()

Returns output formats for a page using render step rules.

private getPageOutputFormats(Page $page) : array<int, string>
Parameters
$page : Page
Return values
array<int, string>

getTemplateRoots()

Returns template roots keyed by their scope name used by Layout::finder.

private getTemplateRoots() : array<string, string>
Return values
array<string, string>

normalizePath()

Normalizes a filesystem path to use forward slashes without a trailing slash.

private normalizePath(string $path) : string
Parameters
$path : string
Return values
string

relativePathFromDirectory()

Returns file path relative to a directory path.

private relativePathFromDirectory(string $filePath, string $directoryPath) : string
Parameters
$filePath : string
$directoryPath : string
Return values
string

resolveAffectedTemplates()

Returns all templates impacted by changed templates (including reverse dependencies).

private resolveAffectedTemplates(array<int, array{scope: string, file: string}> $changedTemplates) : array<string, bool>
Parameters
$changedTemplates : array<int, array{scope: string, file: string}>
Return values
array<string, bool>

resolvePagesImpactedByTemplates()

Resolves source pages impacted by changed templates.

private resolvePagesImpactedByTemplates(array<int, array{scope: string, file: string}> $changedTemplates) : array<int, string>|null
Parameters
$changedTemplates : array<int, array{scope: string, file: string}>
Return values
array<int, string>|null

resolveTemplateRefFromPath()

Resolves a filesystem path to a template reference when it belongs to a template root.

private resolveTemplateRefFromPath(string $path) : array{scope: string, file: string}|null
Parameters
$path : string
Return values
array{scope: string, file: string}|null
On this page

Search results