| Next revision | Previous revision |
| scriptlog:lib:core:remoteaddress [2026/09/26 09:09] – admin admin | scriptlog:lib:core:remoteaddress [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Core Class | | | ''@category'' | Core Class | |
| | ''@license'' | https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License | | | ''@license'' | https://github.com/zendframework/zend-http/blob/master/LICENSE.md New BSD License | |
| | ''@see'' | https://github.com/zendframework/zend-http for the canonical source repository | | | ''@see'' | https://github.com/zendframework/zend-http for the canonical source repository | |
| | ''@see'' | https://framework.zend.com/apidoc/2.1/classes/Zend.Http.PhpEnvironment.RemoteAddress.html | | | ''@see'' | https://framework.zend.com/apidoc/2.1/classes/Zend.Http.PhpEnvironment.RemoteAddress.html | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| ======= Properties (3) ======= | ======= Properties (3) ======= |
| |
| ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | ''protected'' | ''(untyped)'' | ''$useProxy'' | ''false;'' | 30 | | | ''protected'' | ''(untyped)'' | ''$useProxy'' | ''false'' | 30 | |
| | ''protected'' | ''(untyped)'' | ''$trustedProxies'' | ''[];'' | 37 | | | ''protected'' | ''(untyped)'' | ''$trustedProxies'' | ''[]'' | 37 | |
| | ''protected'' | ''(untyped)'' | ''$proxyHeader'' | '''HTTP_X_FORWARDED_FOR';'' | 44 | | | ''protected'' | ''(untyped)'' | ''$proxyHeader'' | '''HTTP_X_FORWARDED_FOR''' | 44 | |
| |
| ======= Methods (7) ======= | ======= Methods (7) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''setUseProxy()'' | Changes proxy handling setting. | 55 | | | public | ''setUseProxy()'' | Changes proxy handling setting. | 55 | |
| | public | ''isUseProxy()'' | Checks proxy handling setting. | 66 | | | public | ''isUseProxy()'' | Checks proxy handling setting. | 66 | |
| | public | ''setTrustedProxies()'' | Set list of trusted proxy addresses | 77 | | | public | ''setTrustedProxies()'' | Set list of trusted proxy addresses | 77 | |
| | public | ''setProxyHeader()'' | Set the header to introspect for proxy IPs | 89 | | | public | ''setProxyHeader()'' | Set the header to introspect for proxy IPs | 89 | |
| | public | ''getIpAddress()'' | Returns client IP address. | 100 | | | public | ''getIpAddress()'' | Returns client IP address. | 100 | |
| | protected | ''getIpAddressFromProxy()'' | Attempt to get the IP address for a proxied client | 121 | | | protected | ''getIpAddressFromProxy()'' | Attempt to get the IP address for a proxied client | 121 | |
| | protected | ''normalizeProxyHeader()'' | Normalize a header string | 164 | | | protected | ''normalizeProxyHeader()'' | Normalize a header string | 164 | |
| |
| |
| at session read, so this is the only way to switch setting. | at session read, so this is the only way to switch setting. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$useProxy'' | ''(untyped)'' | ''true'' | Whether to check also proxied IP addresses. | | | ''$useProxy'' | ''(untyped)'' | ''true'' | Whether to check also proxied IP addresses. | |
| |
| **Returns:** ''(none declared)'' — $this | **Returns:** ''(none declared)'' — $this |
| Set list of trusted proxy addresses | Set list of trusted proxy addresses |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$trustedProxies'' | ''array'' | //required// | //none// | | | ''$trustedProxies'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — $this | **Returns:** ''(none declared)'' — $this |
| Set the header to introspect for proxy IPs | Set the header to introspect for proxy IPs |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$header'' | ''(untyped)'' | '''X-Forwarded-For''' | //none// | | | ''$header'' | ''(untyped)'' | '''X-Forwarded-For''' | //none// | |
| |
| **Returns:** ''(none declared)'' — $this | **Returns:** ''(none declared)'' — $this |
| $_SERVER | $_SERVER |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$header'' | ''(untyped)'' | //required// | //none// | | | ''$header'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |