BuildService
in package
uses
InteractsWithIO, InteractsWithDirectories
Moves logic from the build command to a service.
Handles the build loop which generates the static site.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- compileStaticPages() : void
- transferMediaAssets() : void
- compilePagesForClass() : void
- getClassPluralName() : string
- getPageTypes() : array<string|int, HydePage>>
- needsDirectories() : void
- Ensure the supplied directories exist by creating them if they don't.
- needsDirectory() : void
- Ensure the supplied directory exist by creating it if it does not.
- needsParentDirectory() : void
- Ensure the supplied file's parent directory exists by creating it if it does not.
Properties
$router
protected
RouteCollection
$router
Methods
__construct()
public
__construct(OutputStyle $output) : mixed
Parameters
- $output : OutputStyle
compileStaticPages()
public
compileStaticPages() : void
transferMediaAssets()
public
transferMediaAssets() : void
This method will be replaced by a build task in v2.0
compilePagesForClass()
protected
compilePagesForClass(HydePage> $pageClass) : void
Parameters
- $pageClass : HydePage>
getClassPluralName()
protected
getClassPluralName(string $pageClass) : string
Parameters
- $pageClass : string
Return values
stringgetPageTypes()
protected
getPageTypes() : array<string|int, HydePage>>
Return values
array<string|int, HydePage>>needsDirectories()
Ensure the supplied directories exist by creating them if they don't.
protected
static needsDirectories(array<string|int, string> $directories) : void
Parameters
- $directories : array<string|int, string>
-
array with relative file paths to the directories
needsDirectory()
Ensure the supplied directory exist by creating it if it does not.
protected
static needsDirectory(string $directory) : void
Parameters
- $directory : string
-
relative file path to the directory
needsParentDirectory()
Ensure the supplied file's parent directory exists by creating it if it does not.
protected
static needsParentDirectory(string $file[, int $levels = 1 ]) : void
Parameters
- $file : string
- $levels : int = 1