$ipAddress
$ipAddress : string
IP address of the current user.
Class CLIRequest
Represents a request from the command-line. Provides additional tools to interact with that request since CLI requests are not static like HTTP requests might be.
Portions of this code were initially from the FuelPHP Framework, version 1.7.x, and used here under the MIT license they were originally made available under.
__construct(\Config\App $config)
Constructor
\Config\App | $config |
setMethod(string $method) : \CodeIgniter\HTTP\Request
Sets the request method. Used when spoofing the request.
string | $method |
getServer(string|array|null $index = null, integer|null $filter = null, null $flags = null) : mixed
Fetch an item from the $_SERVER array.
string|array|null | $index | Index for item to be fetched from $_SERVER |
integer|null | $filter | A filter name to be applied |
null | $flags |
fetchGlobal(string $method, string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetches one or more items from a global, like cookies, get, post, etc.
Can optionally filter the input when you retrieve it by passing in a filter.
If $type is an array, it must conform to the input allowed by the filter_input_array method.
http://php.net/manual/en/filter.filters.sanitize.php
string | $method | Input filter constant |
string|array|null | $index | |
integer|null | $filter | Filter constant |
mixed | $flags |
setBody( $data) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Sets the body of the current message.
$data |
appendBody( $data) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Appends data to the body of the current message.
$data |
getHeader(string $name) : array|\CodeIgniter\HTTP\Header
Returns a single header object. If multiple headers with the same name exist, then will return an array of header objects.
string | $name |
getHeaderLine(string $name) : string
Retrieves a comma-separated string of the values for a single header.
This method returns all of the header values of the given case-insensitive header name as a string concatenated together using a comma.
NOTE: Not all header values may be appropriately represented using comma concatenation. For such headers, use getHeader() instead and supply your own delimiter when concatenating.
string | $name |
setHeader(string $name, array|null|string $value) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Sets a header and it's value.
string | $name | |
array|null|string | $value |
removeHeader(string $name) : \CodeIgniter\HTTP\Message
Removes a header from the list of headers we track.
string | $name |
appendHeader(string $name, string $value) : \CodeIgniter\HTTP\Message
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
string | $name | |
string | $value |
prependHeader(string $name, string $value) : \CodeIgniter\HTTP\Message
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
string | $name | |
string | $value |
setProtocolVersion(string $version) : \CodeIgniter\HTTP\Message
Sets the HTTP protocol version.
string | $version |
getPath() : string
Returns the "path" of the request script so that it can be used in routing to the appropriate controller/method.
The path is determined by treating the command line arguments as if it were a URL - up until we hit our first option.
Example: php index.php users 21 profile -foo bar
// Routes to /users/21/profile (index is removed for routing sake)
// with the option foo = bar.