pecl

package
v0.0.0-...-f459114 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...BackendOpt) backend

New creates a new pecl backend with d default (and fully working) peclapi client, a default vfs.FS instance, a default command runner (used to compile the extensions) and a non interactive UI. All these default values can be changed through With*() functions.

Types

type Backend

type Backend interface {
	ResolveConstraint(name, constraint string, minimumStability peclapi.Stability) (string, error)
	Install(opts InstallOpts) error
	Download(opts DownloadOpts) (string, error)
	Build(opts BuildOpts) error
}

type BackendOpt

type BackendOpt func(b *backend)

func WithClient

func WithClient(client peclapi.Client) BackendOpt

WithClient returns a new BackendOpt that could be used with New() to change the default peclapi.Client used.

func WithCmdExec

func WithCmdExec(cmdexec cmdexec.CmdExecutor) BackendOpt

WithCmdExec returns a BackendOpt that could be used with New() to change the default instance of CmdExec used by the backend.

func WithFS

func WithFS(fs vfs.FS) BackendOpt

WithFS returns a BackendOpt that could be used with New() to change the default instance of vfs.FS to a custom instance.

func WithPhpConfigPath

func WithPhpConfigPath(phpConfigPath string) BackendOpt

func WithUI

func WithUI(ui ui.UI) BackendOpt

WithUI returns a new BackendOpt that could be used with New() to change the default ui.UI used.

type BuildOpts

type BuildOpts struct {
	// SourceDir is the folder containing the source code of the extension to
	// build.
	SourceDir string
	// InstallDir is the folder where the compiled extension should be installed.
	InstallDir string
	// PackageXmlPath is the full path to the package.xml for the extension to
	// build.
	PackageXmlPath string
	// ConfigureArgs is a list of flags to pass to ./configure when building.
	ConfigureArgs []string
	// Parallel is the maximum number of parallel jobs executed by make at once.
	Parallel int
	// Cleanup indicates whether make clean should be run.
	Cleanup bool
}

type DownloadOpts

type DownloadOpts struct {
	// Extension is the name of the extension to download.
	Extension string
	// Version is the exact version number of the extension to download.
	Version string
	// DownloadDir is the directory where notpecl decompress downloaded
	// extension archives.
	DownloadDir string
}

type InstallOpts

type InstallOpts struct {
	DownloadOpts

	// InstallDir is the directory where the compiled extension is copied to.
	InstallDir string
	// ConfigureArgs is a list of flags to pass to ./configure when building
	// the extension.
	ConfigureArgs []string
	// Parallel is the maximum number of parallel jobs executed by make at once.
	Parallel int
	// Clenaup indicates whether source code and build files should be removed
	// after sucessful builds.
	Cleanup bool
}

Jump to

Keyboard shortcuts

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