pclib
3.0.0
Lightweight PHP framework
|
Provides unified access to HTTP request. More...
Public Member Functions | |
getMethod () | |
Return request method. More... | |
isAjax () | |
Is current request AJAX request? | |
isSSL () | |
We have HTTPS? | |
getHost () | |
Return http host. | |
getPort () | |
Return request port. | |
getUrl () | |
Return current url. | |
getRootUrl () | |
Return root Url. | |
getClientIp () | |
Return client IP address. More... | |
getServerIp () | |
Return server IP address (safe). | |
getBaseUrl () | |
Return base Url. | |
getWebRoot () | |
Return document root. | |
getHeaders () | |
Return request headers array. More... | |
getRawBody () | |
Return request body. | |
urlMatch ($pattern) | |
Match current url against pattern. More... | |
getUserAgent () | |
It will try detect user agent, version and OS. More... | |
Public Member Functions inherited from BaseObject | |
loadDefaults ($className=null) | |
Load default parameters of class $className into object instance. | |
setProperties (array $defaults) | |
Set public properties of object from the array. More... | |
toArray () | |
Convert object to array. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseObject | |
static | defaults () |
Set or retireve default parameters of the object. More... | |
Data Fields inherited from BaseObject | |
$serviceLocator | |
var function() Return service object when requested with service(). | |
Protected Member Functions inherited from BaseObject | |
service ($service, $default=null) | |
Try acquire $service and load it into property $this->$service. More... | |
Provides unified access to HTTP request.
Can detect request method, url, user agent, request headers and such. For any getXxx() method, you can use shortcut ->xxx - e.g. print $app->request->url;
getClientIp | ( | ) |
Return client IP address.
Warning: Can be faked!
getHeaders | ( | ) |
Return request headers array.
getMethod | ( | ) |
Return request method.
'POST','GET' etc.
getUserAgent | ( | ) |
It will try detect user agent, version and OS.
urlMatch | ( | $pattern | ) |
Match current url against pattern.
string | $pattern | fnmatch pattern Example: 'http://localhost/*' |