Documentation
¶
Index ¶
- Constants
- Variables
- func GetPhpFpmConfPath(appRoot string) (string, error)
- func LoadAvailablePHPExtensions() ([]string, error)
- func PickWebDir(buildpackYAML BuildpackYAML) string
- func SearchForWebApp(appRoot string, webdir string) (bool, error)
- func Version(buildpack buildpack.Buildpack) string
- type BuildpackYAML
- type Config
- type Contributor
- type Metadata
Constants ¶
const ( // WebDependency in the buildplan indicates that this is a web app Dependency = "php-web" // 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 ¶
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
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
LoadAvailablePHPExtensions locates available extensions and returns the list
func PickWebDir ¶ added in v0.0.33
func PickWebDir(buildpackYAML BuildpackYAML) string
PickWebDir will select the correct web directory to use
func SearchForWebApp ¶ added in v0.0.33
SearchForWebApp looks to see if this application is a PHP web app
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.