1
0
mirror of https://github.com/deuill/go-php.git synced 2024-09-21 08:50:45 +00:00
go-php/php.go
Alex Palaistras 8a2ce468e2 Add documentation blocks.
Added documentation blocks and licence headers to all files.
2015-10-04 19:28:44 +01:00

29 lines
946 B
Go

// Copyright 2015 Alexander Palaistras. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
// Package php implements bindings from Go to PHP, and allows for executing
// scripts, binding variables and defining functions and classes which can then
// be called from within PHP scripts.
package php
import (
"io"
"github.com/deuill/go-php/context"
"github.com/deuill/go-php/engine"
)
// New initializes a PHP engine instance on which contexts can be executed. It
// corresponds to PHP's MINIT (module init) phase.
func New() (*engine.Engine, error) {
return engine.New()
}
// NewContext creates a new execution context on which scripts can be executed
// and variables can be binded. It corresponds to PHP's RINIT (request init
// phase and *must* be preceeded by a call to `php.New()`.
func NewContext(w io.Writer) (*context.Context, error) {
return context.New(w)
}