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 ¶
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.
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.