Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3942409
WithRemoteAddress.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
768 B
Referenced Files
None
Subscribers
None
WithRemoteAddress.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\HTTP\Requests
;
trait
WithRemoteAddress
{
/**
* Gets remote IP address.
*
* This is intended as a drop-in replacement for $_SERVER['REMOTE_ADDR'],
* which takes in consideration proxy values, blindly trusted.
*
* This method should is only for environment where headers are controlled,
* like nginx + php_fpm, where HTTP_ headers are reserved for the server
* information, and where the headers sent by the web server to nginx are
* checked or populated by nginx itself.
*
* @return string the remote address
*/
public
static
function
getRemoteAddress
()
:
string
{
return
RemoteAddress
::
fromServer
()->
getClientAddress
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 26, 16:13 (7 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2315167
Default Alt Text
WithRemoteAddress.php (768 B)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment