php

package
v0.0.0-...-f288f0e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: AGPL-3.0 Imports: 40 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 SymfonyConsoleExecutor

func SymfonyConsoleExecutor(logger zerolog.Logger, args []string) (*Executor, error)

SymfonyConsoleExecutor returns an Executor prepared to run Symfony Console. It returns an error if no console binary is found.

func (*Executor) CleanupTemporaryDirectories

func (e *Executor) CleanupTemporaryDirectories()

func (Executor) CommandLine

func (e Executor) CommandLine() string

func (*Executor) Config

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

Config determines the right version of PHP depending on the configuration (+ its configuration). It also creates some symlinks to ease the integration with underlying tools that could try to run PHP. This is the responsibility of the caller to clean those temporary files. One can call CleanupTemporaryDirectories to do so.

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 PieResult

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

func Pie

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

func (PieResult) Error

func (p PieResult) Error() string

func (PieResult) ExitCode

func (p PieResult) ExitCode() int

type Server

type Server struct {
	Version *phpstore.Version

	StoppedChan chan bool
	// 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