phpweb

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 19 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 GetPhpFpmConfPath added in v0.0.2

func GetPhpFpmConfPath(appRoot string) (string, error)

GetPhpFpmConfPath will look to see if a user has specified custom PHP-FPM config & if so return the path. Returns an empty string if not specified.

func LoadAvailablePHPExtensions added in v0.0.2

func LoadAvailablePHPExtensions() ([]string, error)

LoadAvailablePHPExtensions locates available extensions and returns the list

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"`
	LibDirectory string `yaml:"libdirectory"`
	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.

type Metadata added in v0.0.2

type Metadata struct {
	Name string
	Hash string
}

Metadata that used to determine if the buildpack will contribute updated configs

We want to generate new configuration if the following happens:

  • The buildpack version changes, cause our base config files might change
  • The user's buildpack.yml file changes, cause values from this file are passed into the config
  • If the user has custom PHP FPM. When there is/isn't custom PHP-FPM config, this changes the config files that are generated (because PHP-FPM freaks out if you Include config, but the included path doesn't exist or have any actual config files)

If more conditions arise which affect how this buildpack generates config then we need to update this Metadata to track those as well.

func (Metadata) Identity added in v0.0.2

func (m Metadata) Identity() (name string, version string)

Identity provides libcfbuildpack with information to decide if it should contribute

Jump to

Keyboard shortcuts

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