BuildTaskService
in package
This service manages the build tasks that are called before and after the site is compiled using the build command.
The class is registered as a singleton in the Laravel service container and is run by the build command. Build Tasks can be registered programmatically, through the config, and through autodiscovery. The service determines when to run a task depending on which class it extends.
Table of Contents
Properties
- $buildTasks : array<string, BuildTask>
- $output : OutputStyle|null
Methods
- __construct() : mixed
- getRegisteredTasks() : array<string|int, PreBuildTask>|PostBuildTask>>
- registerTask() : void
- runPostBuildTasks() : void
- runPreBuildTasks() : void
- setOutput() : void
- findTasksInAppDirectory() : array<string|int, PreBuildTask>|PostBuildTask>>
- findTasksInConfig() : array<string|int, PreBuildTask>|PostBuildTask>>
- makeTaskIdentifier() : string
- pathToClassName() : string
- registerIf() : void
- registerTaskInService() : void
- registerTasks() : void
- canCleanSiteDirectory() : bool
- canGenerateFeed() : bool
- canGenerateManifest() : bool
- canGenerateSearch() : bool
- canGenerateSitemap() : bool
- registerFrameworkTasks() : void
Properties
$buildTasks
protected
array<string, BuildTask>
$buildTasks
= []
$output
protected
OutputStyle|null
$output
= null
Methods
__construct()
public
__construct() : mixed
getRegisteredTasks()
public
getRegisteredTasks() : array<string|int, PreBuildTask>|PostBuildTask>>
Return values
array<string|int, PreBuildTask>|PostBuildTask>>registerTask()
public
registerTask(PreBuildTask|PostBuildTask|string $task) : void
Parameters
- $task : PreBuildTask|PostBuildTask|string
runPostBuildTasks()
public
runPostBuildTasks() : void
runPreBuildTasks()
public
runPreBuildTasks() : void
setOutput()
public
setOutput(OutputStyle|null $output) : void
Parameters
- $output : OutputStyle|null
findTasksInAppDirectory()
protected
findTasksInAppDirectory() : array<string|int, PreBuildTask>|PostBuildTask>>
Return values
array<string|int, PreBuildTask>|PostBuildTask>>findTasksInConfig()
protected
findTasksInConfig() : array<string|int, PreBuildTask>|PostBuildTask>>
Return values
array<string|int, PreBuildTask>|PostBuildTask>>makeTaskIdentifier()
protected
makeTaskIdentifier(BuildTask $class) : string
Parameters
- $class : BuildTask
Return values
stringpathToClassName()
protected
static pathToClassName(string $file) : string
Parameters
- $file : string
Return values
stringregisterIf()
protected
registerIf(string $task, bool $condition) : void
Parameters
- $task : string
- $condition : bool
registerTaskInService()
protected
registerTaskInService(PreBuildTask|PostBuildTask $task) : void
Parameters
- $task : PreBuildTask|PostBuildTask
registerTasks()
protected
registerTasks(array<string|int, mixed> $tasks) : void
Parameters
- $tasks : array<string|int, mixed>
canCleanSiteDirectory()
private
canCleanSiteDirectory() : bool
Return values
boolcanGenerateFeed()
private
canGenerateFeed() : bool
Return values
boolcanGenerateManifest()
private
canGenerateManifest() : bool
Return values
boolcanGenerateSearch()
private
canGenerateSearch() : bool
Return values
boolcanGenerateSitemap()
private
canGenerateSitemap() : bool
Return values
boolregisterFrameworkTasks()
private
registerFrameworkTasks() : void