phpweb

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WebDependency in the buildplan indicates 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

View Source
var (
	// DefaultCliScript is the script used when one is not provided in buildpack.yml
	DefaultCliScripts = []string{"app.php", "main.php", "run.php", "start.php"}
)

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(buildpack buildpack.Buildpack) 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"`
	ServerAdmin  string `yaml:"serveradmin"`
}

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
}

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