phpweb

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebDependency in the buildplan indiates that this is a web app
	WebDependency = "php-web"

	// ScriptDependency in the buildplan indicates that this is a script app
	ScriptDependency = "php-script"

	// Nginx is text user can specify to request Nginx Web Server
	Nginx = "nginx"

	// ApacheHttpd is text user can specify to request Apache Web Server
	ApacheHttpd = "httpd"

	// PhpWebServer is text user can specify to use PHP's built-in Web Server
	PhpWebServer = "php-server"
)

Variables

This section is empty.

Functions

func API

func API(version string) string

API returns the API string for the given PHP version

func Version

func Version(buildpackYAML BuildpackYAML, buildpack buildpack.Buildpack, dependency buildplan.Dependency) string

Version returns the selected version of PHP using the following precedence:

1. `php.version` from `buildpack.yml` 2. Build Plan Version, if set by composer 3. Buildpack Metadata "default_version" 4. `*` which should pick latest version

Types

type BuildpackYAML

type BuildpackYAML struct {
	Config Config `yaml:"php"`
}

BuildpackYAML represents user specified config options through `buildpack.yml`

func LoadBuildpackYAML

func LoadBuildpackYAML(appRoot string) (BuildpackYAML, error)

LoadBuildpackYAML reads `buildpack.yml` and PHP specific config options in it

type Config

type Config struct {
	Version      string `yaml:"version"`
	WebServer    string `yaml:"webserver"`
	WebDirectory string `yaml:"webdirectory"`
	Script       string `yaml:"script"`
}

Config represents PHP specific configuration options for BuildpackYAML

type Contributor

type Contributor struct {
	// contains filtered or unexported fields
}

Contributor represents a PHP contribution by the buildpack

func NewContributor

func NewContributor(context build.Build) (c Contributor, willContribute bool, err error)

NewContributor creates a new Contributor instance. willContribute is true if build plan contains "php-script" or "php-web" dependency, otherwise false.

func (Contributor) Contribute

func (c Contributor) Contribute() error

Contribute contributes an expanded PHP to a cache layer.

func (Contributor) Identity

func (c Contributor) Identity() (string, string)

Identity make Contributor satisfy the Identifiable interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL