Documentation
¶
Index ¶
- Constants
- func ExecPhpScript(client *cl.Client, requestId uint16, parameters []*nvpair.NameValuePair, ...) (stdOut []byte, stdErr []byte, err error)
- func ParseStatus(statusValue string) (statusCode uint, statusText string, err error)
- func RunOncePhpScript(serverNetwork string, serverAddress string, requestId uint16, ...) (stdOut []byte, stdErr []byte, err error)
- func RunOnceSimplePhpScript(serverNetwork string, serverAddress string, scriptFilePath string) (stdOut []byte, stdErr []byte, err error)
- type Data
- func ExecPhpScriptAndGetHttpData(client *cl.Client, requestId uint16, parameters []*nvpair.NameValuePair, ...) (data *Data, err error)
- func RunOncePhpScriptAndGetHttpData(serverNetwork string, serverAddress string, requestId uint16, ...) (data *Data, err error)
- func RunOnceSimplePhpScriptAndGetHttpData(serverNetwork string, serverAddress string, scriptFilePath string) (data *Data, err error)
- func SplitHeadersFromStdout(stdout []byte) (data *Data, err error)
- type Header
Constants ¶
const ( HeaderNameValueDelimiter = ":" // Status is a virtual HTTP header. It looks like PHP returns HTTP status // information inside a virtual HTTP header named 'Status'. Status = "status" )
const ( ErrNoHeaderOnLine = "no header on line: %v" ErrHeaderNameIsEmpty = "header name is empty: %v" ErrHeaderValueIsEmpty = "header value is empty: %v" )
Variables ¶
This section is empty.
Functions ¶
func ExecPhpScript ¶
func ExecPhpScript(client *cl.Client, requestId uint16, parameters []*nvpair.NameValuePair, stdin []byte) (stdOut []byte, stdErr []byte, err error)
ExecPhpScript executes a PHP script using the specified client. Path to the script file must be set as a 'SCRIPT_FILENAME' parameter inside the 'parameters' argument.
func ParseStatus ¶
ParseStatus parses information about HTTP status returned by PHP.
func RunOncePhpScript ¶
func RunOncePhpScript(serverNetwork string, serverAddress string, requestId uint16, parameters []*nvpair.NameValuePair, stdin []byte) (stdOut []byte, stdErr []byte, err error)
RunOncePhpScript runs a PHP script once. Path to the script file must be set as a 'SCRIPT_FILENAME' parameter inside the 'parameters' argument.
func RunOnceSimplePhpScript ¶
func RunOnceSimplePhpScript(serverNetwork string, serverAddress string, scriptFilePath string) (stdOut []byte, stdErr []byte, err error)
RunOnceSimplePhpScript runs a simple PHP script once and gets its output. Only the `SCRIPT_FILENAME` parameter is provided to the PHP script, that is why it is simple. The PHP-CGI server must be started manually before running this function.
Types ¶
type Data ¶
Data is data returned by a PHP script.
func ExecPhpScriptAndGetHttpData ¶
func ExecPhpScriptAndGetHttpData(client *cl.Client, requestId uint16, parameters []*nvpair.NameValuePair, stdin []byte) (data *Data, err error)
ExecPhpScriptAndGetHttpData executes a PHP script using the specified client, gets its output, splits the output into HTTP headers and HTTP body. Path to the script file must be set as a 'SCRIPT_FILENAME' parameter inside the 'parameters' argument. The PHP-CGI server must be started manually before running this function.
func RunOncePhpScriptAndGetHttpData ¶
func RunOncePhpScriptAndGetHttpData(serverNetwork string, serverAddress string, requestId uint16, parameters []*nvpair.NameValuePair, stdin []byte) (data *Data, err error)
RunOncePhpScriptAndGetHttpData runs a PHP script once, gets its output, splits the output into HTTP headers and HTTP body. Path to the script file must be set as a 'SCRIPT_FILENAME' parameter inside the 'parameters' argument. The PHP-CGI server must be started manually before running this function.
func RunOnceSimplePhpScriptAndGetHttpData ¶
func RunOnceSimplePhpScriptAndGetHttpData(serverNetwork string, serverAddress string, scriptFilePath string) (data *Data, err error)
RunOnceSimplePhpScriptAndGetHttpData runs a simple PHP script once, gets its output, splits the output into HTTP headers and HTTP body. Only the `SCRIPT_FILENAME` parameter is provided to the PHP script, that is why it is simple. The PHP-CGI server must be started manually before running this function.
func SplitHeadersFromStdout ¶
SplitHeadersFromStdout splits PHP stdout stream into HTTP headers and HTTP body.