phpstore

package module
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: AGPL-3.0 Imports: 15 Imported by: 3

README

PHP Store

PHP Store allows to find and manage local PHP installations.

Documentation

Index

Constants

View Source
const (
	FlavorCLI        string = "cli"
	FlavorCGI        string = "cgi"
	FlavorFPM        string = "fpm"
	FlavorFrankenPHP string = "frankenphp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PHPStore

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

PHPStore stores information about all locally installed PHP versions

func New

func New(configDir string, reload bool, logger func(msg string, a ...interface{})) *PHPStore

New creates a new PHP store

func (*PHPStore) BestVersionForDir

func (s *PHPStore) BestVersionForDir(dir string) (*Version, string, string, error)

BestVersionForDir returns the configured PHP version for the given PHP script

func (*PHPStore) IsVersionAvailable

func (s *PHPStore) IsVersionAvailable(version string) bool

func (*PHPStore) Versions

func (s *PHPStore) Versions() []*Version

Versions returns all available PHP versions

type Version

type Version struct {
	FullVersion   *version.Version `json:"-"`
	Version       string           `json:"version"`
	Path          string           `json:"path"`
	PHPPath       string           `json:"php_path"`
	FPMPath       string           `json:"fpm_path"`
	CGIPath       string           `json:"cgi_path"`
	PHPConfigPath string           `json:"php_config_path"`
	PHPizePath    string           `json:"phpize_path"`
	PHPdbgPath    string           `json:"phpdbg_path"`
	IsSystem      bool             `json:"is_system"`
	FrankenPHP    bool             `json:"frankenphp"`
	// contains filtered or unexported fields
}

Version stores information about an installed PHP version

func NewVersion added in v1.0.14

func NewVersion(v string) *Version

func (*Version) ForceFlavor added in v1.0.14

func (v *Version) ForceFlavor(flavor string)

func (*Version) IsCGIServer

func (v *Version) IsCGIServer() bool

func (*Version) IsCLIServer

func (v *Version) IsCLIServer() bool

func (*Version) IsFPMServer

func (v *Version) IsFPMServer() bool

func (*Version) IsFrankenPHPServer added in v1.0.6

func (v *Version) IsFrankenPHPServer() bool

func (*Version) ServerPath

func (v *Version) ServerPath() string

func (*Version) ServerTypeName

func (v *Version) ServerTypeName() string

func (*Version) SupportsFlavor added in v1.0.14

func (v *Version) SupportsFlavor(flavor string) bool

Jump to

Keyboard shortcuts

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