php

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package php evaluates PHP snippets using the phpscript runner. It implements the model.Evaluator interface and reads its entry point and includes from the fs.FS supplied on the request.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = runner.Options{
	SAPI:          "vuego-cli",
	WorkDir:       ".",
	WritablePaths: []string{"."},
}

DefaultOptions configures the PHP VM used to evaluate snippets.

Functions

This section is empty.

Types

type Evaluator

type Evaluator struct {
	Options runner.Options
}

Evaluator runs PHP snippets.

func New

func New() *Evaluator

New returns a PHP evaluator using DefaultOptions.

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, req model.Request) (model.Result, error)

Eval loads req.Entry from req.FS and executes it, returning the captured output as HTML. When the requested entry is missing it falls back to the first .php file found in the filesystem.

Jump to

Keyboard shortcuts

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