runtime

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package runtime provides functionality for discovering and managing the PHP execution environment required to interact with a Laravel project at runtime. It encapsulates the process of locating a valid PHP binary and executing PHP code to retrieve essential project information

By abstracting the PHP process management details, the runtime package allows client code to seamlessly obtain runtime information without manually handling PHP code,execution or file discovery. This design helps in maintaining a clear separation of concerns.

Key features:

  • Locate and validate the PHP executable for the target Laravel project.
  • Execute PHP code to extract project data.
  • Provide structured access to configuration and application binding data via repository types.

The package is intended to be used as a foundation for tools that need to analyze or interact with Laravel projects by leveraging runtime information.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBinary = errors.New("failed to find php binary")

Functions

func CallScript

func CallScript[T any](call *PHPProccess, rootPath string, code []byte, out T) (T, error)

Types

type PHPProccess

type PHPProccess struct {
	Args []string
}

PHPProccess represents a PHP execution process with configurable arguments.

func FindPHPProcess

func FindPHPProcess(rootPath string) (*PHPProccess, error)

func NewPHPProcess

func NewPHPProcess(args ...string) *PHPProccess

NewPHPProcess creates a new PHPProccess instance with the given arguments.

func (PHPProccess) Exec

func (proc PHPProccess) Exec(workingDir string, code []byte) (io.Reader, error)

Exec executes the PHP code in the specified working directory. It returns an io.Reader with the output or an error if execution fails.

type PHPProcessLocator

type PHPProcessLocator func() *PHPProccess

PHPProcessLocator is a function type that returns a pointer to a PHPProccess. It's used to locate a valid PHP executable in different environments.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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