class php.WebAvailable in phpThis class is used for accessing the local Web server and the current client request and informations. static var isModNeko(default,null) : Bool static inline function flush() : VoidFlush the data sent to the client. By default on Apache, outgoing data is buffered so this can be useful for displaying some long operation progress. static function getAuthorization() : { user : String, pass : String }Returns an object with the authorization sent by the client (Basic scheme only). static function getClientHeader( k : String ) : StringRetrieve a client header value sent with the request. static function getClientHeaders() : List<{ value : String, header : String }>Retrieve all the client headers. static inline function getClientIP() : StringSurprisingly returns the client IP address. static function getCookies() : StringMap<String>Returns an hashtable of all Cookies sent by the client. Modifying the hashtable will not modify the cookie, use setCookie instead. static inline function getCwd() : StringGet the current script directory in the local filesystem. static inline function getHostName() : StringReturns the local server host name static function getMethod() : StringGet the HTTP method used by the client. static function getMultipart( maxSize : Int ) : StringMap<String>Get the multipart parameters as an hashtable. The data cannot exceed the maximum size specified. static function getParamValues( param : String ) : Array<String>Returns an Array of Strings built using GET / POST values. If you have in your URL the parameters a=foo;a=hello;a5=bar;a3=baz then php.Web.getParamValues("a") will return "foo","hello",null,"baz",null,"bar" static function getParams() : StringMap<String>Returns the GET and POST parameters. static function getParamsString() : StringReturns all the GET parameters String static function getPostData() : StringReturns all the POST data. POST Data is always parsed as being application/x-www-form-urlencoded and is stored into the getParams hashtable. POST Data is maximimized to 256K unless the content type is multipart/form-data. In that case, you will have to use getMultipart or parseMultipart methods. static function getURI() : StringReturns the original request URL (before any server internal redirections) static function parseMultipart( onPart : String -> String -> Void, onData : Bytes -> Int -> Int -> Void ) : VoidParse the multipart data. Call onPart when a new part is found with the part name and the filename if present and onData when some part data is readed. You can this way directly save the data on hard drive in the case of a file upload. static function redirect( url : String ) : VoidTell the client to redirect to the given url ("Location" header) static function setCookie( key : String, value : String, ?expire : Date, ?domain : String, ?path : String, ?secure : Bool, ?httpOnly : Bool ) : VoidSet a Cookie value in the HTTP headers. Same remark as setHeader. static inline function setHeader( h : String, v : String ) : VoidSet an output header value. If some data have been printed, the headers have already been sent so this will raise an exception. static function setReturnCode( r : Int ) : VoidSet the HTTP return code. Same remark as setHeader. See status code explanation here
version #19270, modified 2013-05-08 11:11:18 by api
0 comment