php

package
v0.0.0-...-82567e2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultComposerVersion = 2

Variables

This section is empty.

Functions

func GetBinaryNames

func GetBinaryNames() []string

func IsBinaryName

func IsBinaryName(name string) bool

IsBinaryName returns true if the command is a PHP binary name

func LookPath

func LookPath(file string) (string, error)

we look in the directory of the current PHP version first, then fall back to PATH

Types

type ComposerResult

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

func Composer

func Composer(dir string, args, env []string, stdout, stderr, logger io.Writer, debugLogger zerolog.Logger) ComposerResult

func (ComposerResult) Error

func (c ComposerResult) Error() string

func (ComposerResult) ExitCode

func (c ComposerResult) ExitCode() int

type Executor

type Executor struct {
	Dir        string
	BinName    string
	Args       []string
	SkipNbArgs int
	Stdout     io.Writer
	Stderr     io.Writer
	Stdin      io.Reader
	Paths      []string
	ExtraEnv   []string
	Logger     zerolog.Logger
	// contains filtered or unexported fields
}

func (*Executor) Config

func (e *Executor) Config(loadDotEnv bool) error

Config determines the right version of PHP depending on the configuration (+ its configuration)

func (*Executor) DetectScriptDir

func (e *Executor) DetectScriptDir() (string, error)

DetectScriptDir detects the script dir based on the current configuration

func (*Executor) Execute

func (e *Executor) Execute(loadDotEnv bool) int

Execute executes the right version of PHP depending on the configuration

func (*Executor) PathsToWatch

func (e *Executor) PathsToWatch() []string

type Server

type Server struct {
	Version *phpstore.Version
	// contains filtered or unexported fields
}

Server represents a PHP server process (can be php-fpm, php-cgi, or php-cli)

func NewServer

func NewServer(homeDir, projectDir, documentRoot, passthru, appVersion string, logger zerolog.Logger) (*Server, error)

NewServer creates a new PHP server backend

func (*Server) Serve

func (p *Server) Serve(w http.ResponseWriter, r *http.Request, env map[string]string) error

Serve serves an HTTP request

func (*Server) Start

func (p *Server) Start(ctx context.Context, pidFile *pid.PidFile) (*pid.PidFile, func() error, error)

Start starts a PHP server

Jump to

Keyboard shortcuts

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