Publisher
in package
The publisher provides the application with the ability to register files that should get merged into the main repository of the application so that resources can be :
A) Overwritten in a package that extends the application. Something like "pete's forum" could require "vendor/forumsoftware" using composer, and then use the publish method to import the forum's templates into the main repository, allowing them to modify the templates to their liking, commit, and push it to a server.
B) Overwritten by a package that extends the software. A theme (for example) that is installed as a dependency of the software, can overwrite the templates of the software.
There may be a mix of both, where the user installs a package that overwrites the resource of the application, and then goes ahead and overrides them again.
Tags
Table of Contents
- $publishes : array<string|int, array<string|int, array<string|int, string>>>
- This array contains a list of files that the application should publish when the publish director is invoked. Publishing means that spitfire copies the sources from a package that has been imported to the top-level repository, allowing packages to potentially extend / override functionality provided by the base application.
- get() : array<string|int, array<string|int, string>>
- Returns the publications made under a certain tag. Also, note that sources and targets may be directories, even mismatched ones.
- publish() : mixed
- The publish method allows the application to register a file that should be written to a different location whenever the developer invokes the spitfire.publish director.
- tags() : array<string|int, string>
- Returns a list of tags available to publish. This allows the application to assemble a list of tags available to publish, or to iterate over them and build them all.
Properties
$publishes
This array contains a list of files that the application should publish when the publish director is invoked. Publishing means that spitfire copies the sources from a package that has been imported to the top-level repository, allowing packages to potentially extend / override functionality provided by the base application.
private
array<string|int, array<string|int, array<string|int, string>>>
$publishes
= []
Methods
get()
Returns the publications made under a certain tag. Also, note that sources and targets may be directories, even mismatched ones.
public
get(string $tag) : array<string|int, array<string|int, string>>
The return format is an array that looks like this: [ [from, to], [from, to], [from, to] ]
Parameters
- $tag : string
Return values
array<string|int, array<string|int, string>> —publish()
The publish method allows the application to register a file that should be written to a different location whenever the developer invokes the spitfire.publish director.
public
publish(string $tag, string $from, string $to) : mixed
Parameters
- $tag : string
- $from : string
- $to : string
Return values
mixed —tags()
Returns a list of tags available to publish. This allows the application to assemble a list of tags available to publish, or to iterate over them and build them all.
public
tags() : array<string|int, string>