Documentation ¶
Overview ¶
Package php is the planner for PHP projects.
Index ¶
- Constants
- func DetermineApplication(source afero.Fs) (types.PHPApplication, types.PHPProperty)
- func DetermineAptDependencies(source afero.Fs, server string) []string
- func DetermineBuildCommand(config plan.ImmutableProjectConfiguration, buildCommand *string) string
- func DeterminePHPExtensions(source afero.Fs) []string
- func DetermineProjectFramework(source afero.Fs) types.PHPFramework
- func DetermineStartCommand(config plan.ImmutableProjectConfiguration, startCommand *string) string
- func GenerateDockerfile(meta types.PlanMeta) (string, error)
- func GetPHPVersion(config plan.ImmutableProjectConfiguration, source afero.Fs) string
- func NewIdentifier() plan.Identifier
- func NewPacker() packer.Packer
- func PropertyFromString(s string) types.PHPProperty
- func PropertyToString(p types.PHPProperty) string
- func RetrieveNginxConf(app string) (string, error)
Constants ¶
const ( // OctaneServerRoadrunner indicates this Laravel Octane server uses RoadRunner. OctaneServerRoadrunner = "roadrunner" // OctaneServerSwoole indicates this Laravel Octane server uses Swoole. OctaneServerSwoole = "swoole" )
const ConfigLaravelOctaneServer = "laravel.octane.server"
ConfigLaravelOctaneServer defines what server we should use to run Laravel Octane.
When this config is set, we will use the corresponding server to run the project instead of the original Nginx + PHP-FPM stack.
const ConfigPHPVersion = "php.version"
ConfigPHPVersion defines the PHP version to use.
const DefaultPHPVersion = "8"
DefaultPHPVersion is the default PHP version.
Variables ¶
This section is empty.
Functions ¶
func DetermineApplication ¶
func DetermineApplication(source afero.Fs) (types.PHPApplication, types.PHPProperty)
DetermineApplication determines what application the project is using. Therefore, we can apply some custom fixes such as the nginx configuration.
func DetermineAptDependencies ¶
DetermineAptDependencies determines the required apt dependencies of the project.
We install Nginx server unless server is "swoole".
func DetermineBuildCommand ¶
func DetermineBuildCommand(config plan.ImmutableProjectConfiguration, buildCommand *string) string
DetermineBuildCommand determines the build command of the project.
func DeterminePHPExtensions ¶
DeterminePHPExtensions determines the required PHP extensions from composer.json of the project.
func DetermineProjectFramework ¶
func DetermineProjectFramework(source afero.Fs) types.PHPFramework
DetermineProjectFramework determines the framework of the project.
func DetermineStartCommand ¶
func DetermineStartCommand(config plan.ImmutableProjectConfiguration, startCommand *string) string
DetermineStartCommand determines the start command of the project.
func GenerateDockerfile ¶
GenerateDockerfile generates the Dockerfile for PHP projects.
func GetPHPVersion ¶
func GetPHPVersion(config plan.ImmutableProjectConfiguration, source afero.Fs) string
GetPHPVersion gets the php version of the project.
func NewIdentifier ¶
func NewIdentifier() plan.Identifier
NewIdentifier returns a new PHP identifier.
func PropertyFromString ¶
func PropertyFromString(s string) types.PHPProperty
PropertyFromString deserializes a property. It must be the serialized result from PropertyToString.
func PropertyToString ¶
func PropertyToString(p types.PHPProperty) string
PropertyToString serializes a PHPProperty.
func RetrieveNginxConf ¶
RetrieveNginxConf retrieves the nginx conf for the given app.
The app should be an instance of types.PHPApplication; otherwise, an error will be returned.
Types ¶
This section is empty.