Documentation
¶
Index ¶
- Constants
- Variables
- func HasExt(name string) bool
- func NewBufContext(ctx phpv.Context, b io.Writer) phpv.Context
- func ParseQueryToArray(ctx phpv.Context, q string, a *phpv.ZArray) error
- func RegisterExt(e *Ext)
- func WithConfig(parent phpv.Context, name phpv.ZString, v *phpv.ZVal) phpv.Context
- type BufContext
- type Buffer
- type Ext
- type ExtFunction
- type ExtFunctionArg
- type Flusher
- type FuncContext
- func (c *FuncContext) AsVal(ctx phpv.Context, t phpv.ZType) (phpv.Val, error)
- func (c *FuncContext) Class() phpv.ZClass
- func (c *FuncContext) Count(ctx phpv.Context) phpv.ZInt
- func (ctx *FuncContext) Deprecated(format string, a ...any) error
- func (ctx *FuncContext) Error(err error, t ...phpv.PhpErrorType) error
- func (ctx *FuncContext) Errorf(format string, a ...any) error
- func (c *FuncContext) Func() phpv.FuncContext
- func (ctx *FuncContext) FuncError(err error, t ...phpv.PhpErrorType) error
- func (ctx *FuncContext) FuncErrorf(format string, a ...any) error
- func (ctx *FuncContext) GetFuncName() string
- func (c *FuncContext) GetType() phpv.ZType
- func (c *FuncContext) NewIterator() phpv.ZIterator
- func (ctx *FuncContext) Notice(format string, a ...any) error
- func (c *FuncContext) OffsetCheck(ctx phpv.Context, name phpv.Val) (*phpv.ZVal, bool, error)
- func (c *FuncContext) OffsetExists(ctx phpv.Context, name phpv.Val) (bool, error)
- func (c *FuncContext) OffsetGet(ctx phpv.Context, name phpv.Val) (*phpv.ZVal, error)
- func (c *FuncContext) OffsetSet(ctx phpv.Context, name phpv.Val, v *phpv.ZVal) error
- func (c *FuncContext) OffsetUnset(ctx phpv.Context, name phpv.Val) error
- func (ctx *FuncContext) Parent(n int) phpv.Context
- func (c *FuncContext) This() phpv.ZObject
- func (ctx *FuncContext) Warn(format string, a ...any) error
- func (ctx *FuncContext) WarnDeprecated() error
- func (c *FuncContext) ZVal() *phpv.ZVal
- type Global
- func (g *Global) AppendBuffer() *Buffer
- func (g *Global) Argv() []string
- func (g *Global) Buffer() *Buffer
- func (c *Global) Call(ctx phpv.Context, f phpv.Callable, args []phpv.Runnable, ...) (*phpv.ZVal, error)
- func (c *Global) CallZVal(ctx phpv.Context, f phpv.Callable, args []*phpv.ZVal, ...) (*phpv.ZVal, error)
- func (g *Global) Chdir(d phpv.ZString) error
- func (g *Global) Class() phpv.ZClass
- func (g *Global) Close() error
- func (g *Global) ConstantGet(name phpv.ZString) (phpv.Val, bool)
- func (g *Global) ConstantSet(k phpv.ZString, v phpv.Val) bool
- func (c *Global) Count(ctx phpv.Context) phpv.ZInt
- func (g *Global) Deadline() (time.Time, bool)
- func (g *Global) Deprecated(format string, a ...any) error
- func (c *Global) DoString(ctx phpv.Context, strCode phpv.ZString) (*phpv.ZVal, error)
- func (g *Global) Error(err error, t ...phpv.PhpErrorType) error
- func (g *Global) Errorf(format string, a ...any) error
- func (g *Global) Exists(fn phpv.ZString) (bool, error)
- func (g *Global) Flush()
- func (g *Global) Func() phpv.FuncContext
- func (g *Global) FuncError(err error, t ...phpv.PhpErrorType) error
- func (g *Global) FuncErrorf(format string, a ...any) error
- func (g *Global) GetClass(ctx phpv.Context, name phpv.ZString, autoload bool) (phpv.ZClass, error)
- func (g *Global) GetConfig(name phpv.ZString, def *phpv.ZVal) *phpv.ZVal
- func (g *Global) GetDefinedFunctions(ctx phpv.Context, excludeDisabled bool) (*phpv.ZArray, error)
- func (g *Global) GetFuncName() string
- func (g *Global) GetFunction(ctx phpv.Context, name phpv.ZString) (phpv.Callable, error)
- func (g *Global) GetGlobalConfig(name phpv.ZString, def *phpv.ZVal) *phpv.ZVal
- func (g *Global) GetLoadedExtensions() []string
- func (g *Global) GetScriptFile() phpv.ZString
- func (g *Global) GetStackTrace(ctx phpv.Context) []*phpv.StackTraceEntry
- func (g *Global) GetUserErrorHandler() (phpv.Callable, phpv.PhpErrorType)
- func (g *Global) Getenv(key string) (string, bool)
- func (g *Global) Getwd() phpv.ZString
- func (g *Global) Global() phpv.GlobalContext
- func (g *Global) HeaderContext() *phpv.HeaderContext
- func (c *Global) Include(ctx phpv.Context, fn phpv.ZString) (*phpv.ZVal, error)
- func (c *Global) IncludeOnce(ctx phpv.Context, fn phpv.ZString) (*phpv.ZVal, error)
- func (g *Global) IterateConfig() iter.Seq2[string, phpv.IniValue]
- func (g *Global) Loc() *phpv.Loc
- func (g *Global) LogError(err *phpv.PhpError, optionArg ...logopt.Data)
- func (g *Global) MemAlloc(ctx phpv.Context, s uint64) error
- func (c *Global) NewIterator() phpv.ZIterator
- func (g *Global) NextResourceID() int
- func (g *Global) Notice(format string, a ...any) error
- func (c *Global) OffsetCheck(ctx phpv.Context, name phpv.Val) (*phpv.ZVal, bool, error)
- func (c *Global) OffsetExists(ctx phpv.Context, name phpv.Val) (bool, error)
- func (c *Global) OffsetGet(ctx phpv.Context, name phpv.Val) (*phpv.ZVal, error)
- func (c *Global) OffsetSet(ctx phpv.Context, name phpv.Val, v *phpv.ZVal) error
- func (c *Global) OffsetUnset(ctx phpv.Context, name phpv.Val) error
- func (g *Global) Open(ctx phpv.Context, fn phpv.ZString, mode phpv.ZString, useIncludePath bool, ...) (phpv.Stream, error)
- func (c *Global) Parent(n int) phpv.Context
- func (g *Global) Random() *random.State
- func (g *Global) RegisterClass(name phpv.ZString, c phpv.ZClass) error
- func (g *Global) RegisterFunction(name phpv.ZString, f phpv.Callable) error
- func (g *Global) RegisterLazyClass(name phpv.ZString, r phpv.Runnables, p int)
- func (g *Global) RegisterLazyFunc(name phpv.ZString, r phpv.Runnables, p int)
- func (g *Global) RegisterShutdownFunction(f phpv.Callable)
- func (c *Global) Require(ctx phpv.Context, fn phpv.ZString) (*phpv.ZVal, error)
- func (c *Global) RequireOnce(ctx phpv.Context, fn phpv.ZString) (*phpv.ZVal, error)
- func (g *Global) ResetDeadline()
- func (g *Global) RestoreConfig(name phpv.ZString)
- func (g *Global) RunFile(fn string) error
- func (g *Global) SetDeadline(t time.Time)
- func (g *Global) SetLocalConfig(name phpv.ZString, value *phpv.ZVal) (*phpv.ZVal, bool)
- func (g *Global) SetOutput(w io.Writer)
- func (g *Global) SetUserErrorHandler(handler phpv.Callable, filter phpv.PhpErrorType)
- func (g *Global) Setenv(key, value string) error
- func (g *Global) ShownDeprecated(key string) bool
- func (g *Global) This() phpv.ZObject
- func (g *Global) Tick(ctx phpv.Context, l *phpv.Loc) error
- func (g *Global) Unsetenv(key string) error
- func (g *Global) Warn(format string, a ...any) error
- func (g *Global) WarnDeprecated() error
- func (g *Global) Write(v []byte) (int, error)
- func (g *Global) WriteErr(v []byte) (int, error)
- type MemMgr
- type OpenContext
- type Process
- type ProcessOptions
Constants ¶
View Source
const ( BufferWrite = 0 BufferStart = 1 << iota BufferClean BufferFlush BufferFinal BufferCleanable BufferFlushable BufferRemovable )
View Source
const ( PHP_OUTPUT_HANDLER_START = phpv.ZInt(BufferStart) PHP_OUTPUT_HANDLER_WRITE = phpv.ZInt(BufferWrite) PHP_OUTPUT_HANDLER_FLUSH = phpv.ZInt(BufferFlush) PHP_OUTPUT_HANDLER_CLEAN = phpv.ZInt(BufferClean) PHP_OUTPUT_HANDLER_FINAL = phpv.ZInt(BufferFinal) PHP_OUTPUT_HANDLER_CONT = phpv.ZInt(BufferWrite) PHP_OUTPUT_HANDLER_END = phpv.ZInt(BufferFinal) PHP_OUTPUT_HANDLER_CLEANABLE = phpv.ZInt(BufferCleanable) PHP_OUTPUT_HANDLER_FLUSHABLE = phpv.ZInt(BufferFlushable) PHP_OUTPUT_HANDLER_REMOVABLE = phpv.ZInt(BufferRemovable) )
> const
Variables ¶
View Source
var PHP_OUTPUT_HANDLER_STDFLAGS = phpv.ZInt(BufferCleanable | BufferFlushable | BufferRemovable)
> const
Functions ¶
func ParseQueryToArray ¶
ParseQueryToArray will parse a given query string into a ZArray with PHP parsing rules
func RegisterExt ¶
func RegisterExt(e *Ext)
Types ¶
type BufContext ¶
type Buffer ¶
type Ext ¶
type ExtFunction ¶
type ExtFunction struct { phpv.CallableVal Func func(ctx phpv.Context, args []*phpv.ZVal) (*phpv.ZVal, error) Args []*ExtFunctionArg // contains filtered or unexported fields }
func (*ExtFunction) Name ¶
func (e *ExtFunction) Name() string
type ExtFunctionArg ¶
type FuncContext ¶
type FuncContext struct { phpv.Context Args []*phpv.ZVal // contains filtered or unexported fields }
func (*FuncContext) Class ¶
func (c *FuncContext) Class() phpv.ZClass
func (*FuncContext) Deprecated ¶
func (ctx *FuncContext) Deprecated(format string, a ...any) error
func (*FuncContext) Error ¶
func (ctx *FuncContext) Error(err error, t ...phpv.PhpErrorType) error
func (*FuncContext) Func ¶
func (c *FuncContext) Func() phpv.FuncContext
func (*FuncContext) FuncError ¶
func (ctx *FuncContext) FuncError(err error, t ...phpv.PhpErrorType) error
func (*FuncContext) FuncErrorf ¶
func (ctx *FuncContext) FuncErrorf(format string, a ...any) error
func (*FuncContext) GetFuncName ¶
func (ctx *FuncContext) GetFuncName() string
func (*FuncContext) GetType ¶
func (c *FuncContext) GetType() phpv.ZType
func (*FuncContext) NewIterator ¶
func (c *FuncContext) NewIterator() phpv.ZIterator
func (*FuncContext) OffsetCheck ¶
func (*FuncContext) OffsetExists ¶
func (*FuncContext) OffsetUnset ¶
func (*FuncContext) This ¶
func (c *FuncContext) This() phpv.ZObject
func (*FuncContext) WarnDeprecated ¶
func (ctx *FuncContext) WarnDeprecated() error
func (*FuncContext) ZVal ¶
func (c *FuncContext) ZVal() *phpv.ZVal
type Global ¶
type Global struct { context.Context IniConfig phpv.IniConfig DefaultStreamContext *stream.Context // contains filtered or unexported fields }
func (*Global) AppendBuffer ¶
func (*Global) Call ¶
func (c *Global) Call(ctx phpv.Context, f phpv.Callable, args []phpv.Runnable, optionalThis ...phpv.ZObject) (*phpv.ZVal, error)
perform call in new context
func (*Global) Func ¶
func (g *Global) Func() phpv.FuncContext
func (*Global) GetDefinedFunctions ¶
func (*Global) GetFuncName ¶
func (*Global) GetFunction ¶
func (*Global) GetGlobalConfig ¶
func (*Global) GetLoadedExtensions ¶
func (*Global) GetScriptFile ¶
func (*Global) GetStackTrace ¶
func (g *Global) GetStackTrace(ctx phpv.Context) []*phpv.StackTraceEntry
func (*Global) GetUserErrorHandler ¶
func (g *Global) GetUserErrorHandler() (phpv.Callable, phpv.PhpErrorType)
func (*Global) Global ¶
func (g *Global) Global() phpv.GlobalContext
func (*Global) HeaderContext ¶
func (g *Global) HeaderContext() *phpv.HeaderContext
func (*Global) IncludeOnce ¶
func (*Global) NewIterator ¶
func (*Global) NextResourceID ¶
func (*Global) OffsetCheck ¶
func (*Global) OffsetExists ¶
func (*Global) Open ¶
func (g *Global) Open(ctx phpv.Context, fn phpv.ZString, mode phpv.ZString, useIncludePath bool, streamContext ...phpv.Resource) (phpv.Stream, error)
Open opens a file using PHP stream wrappers and returns a handler to said file.
func (*Global) RegisterClass ¶
func (*Global) RegisterFunction ¶
func (*Global) RegisterLazyClass ¶
func (*Global) RegisterLazyFunc ¶
func (*Global) RegisterShutdownFunction ¶
func (*Global) RequireOnce ¶
func (*Global) ResetDeadline ¶
func (g *Global) ResetDeadline()
func (*Global) RestoreConfig ¶
func (*Global) SetDeadline ¶
func (*Global) SetLocalConfig ¶
func (*Global) SetUserErrorHandler ¶
func (g *Global) SetUserErrorHandler(handler phpv.Callable, filter phpv.PhpErrorType)
func (*Global) ShownDeprecated ¶
func (*Global) WarnDeprecated ¶
type OpenContext ¶
type OpenContext int
type Process ¶
type Process struct { ScriptFilename string Argv []string Options *ProcessOptions // contains filtered or unexported fields }
func NewProcess ¶
NewProcess instanciates a new instance of Process, which represents a running PHP process.
func (*Process) CommandLine ¶
CommandLine will parse arguments from the command line and configure the process accordingly. If nil is passed, then the actual command line will be parsed. In case of error, messages will be sent to stderr by default.
func (*Process) Handler ¶
Hander returns a http.Handler object suitable for use with golang standard http servers and similar.
func (*Process) SetConstant ¶
SetConstant sets a global constant, typically used to set PHP_SAPI.
Click to show internal directories.
Click to hide internal directories.