Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
HTTP
PhpEnvironment
ServerAddress.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\HTTP\PhpEnvironment
;
7
8
use
Magento\Framework\App\RequestInterface
;
9
13
class
ServerAddress
14
{
20
protected
$request
;
21
25
public
function
__construct
(
RequestInterface
$httpRequest)
26
{
27
$this->request = $httpRequest;
28
}
29
36
public
function
getServerAddress
($ipToLong =
false
)
37
{
38
$address
= $this->request->getServer(
'SERVER_ADDR'
);
39
if
(!
$address
) {
40
return
false
;
41
}
42
return
$ipToLong ? ip2long(
$address
) :
$address
;
43
}
44
}
Magento\Framework\HTTP\PhpEnvironment
Definition:
RemoteAddress.php:6
$address
$address
Definition:
customer.php:38
Magento\Framework\HTTP\PhpEnvironment\ServerAddress\$request
$request
Definition:
ServerAddress.php:20
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
Magento\Framework\HTTP\PhpEnvironment\ServerAddress
Definition:
ServerAddress.php:13
Magento\Framework\HTTP\PhpEnvironment\ServerAddress\getServerAddress
getServerAddress($ipToLong=false)
Definition:
ServerAddress.php:36
Magento\Framework\HTTP\PhpEnvironment\ServerAddress\__construct
__construct(RequestInterface $httpRequest)
Definition:
ServerAddress.php:25