Detailed Description
The on-premise IP intelligence engine uses a local data file (.ipi) to generate a set of properties about an IP address supplied as evidence.
It wraps the native IpIntelligenceEngineModule produced by SWIG from 51degrees-cxx.
Mirrors DeviceDetectionOnPremise in device-detection/onpremise and IpIntelligenceOnPremise in 51degrees-python.
Inheritance diagram for fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise:
Collaboration diagram for fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise:
Public Member Functions | |
| __construct (array $settings=[]) | |
| Uses the engine the extension builds once, when PHP starts, from the FiftyOneDegreesIpIntelligenceEngine. | |
| getEvidenceKeyFilter () | |
| The accepted evidence keys (query.client-ip, server.client-ip, query.client-ip-51d, ...). | |
| processInternal (FlowData $flowData) | |
| Process FlowData - this is process function is usually overridden by specific FlowElements to do their core work. | |
| close () | |
| Release the native engine this element built from its dataFile setting. | |
| setCache (?DataKeyedCache $cache) | |
| The on-premise engine manages its own internal cache and does not support an external cache. | |
| refreshData (?string $fileName=null) | |
| Ask the engine to start using the specified data file for lookups. | |
| getProduct () | |
| The product (data tier) of the loaded data file. | |
| & | __get (string $name) |
| Builds the table of every available property when it is first read. | |
| findProperty (string $name) | |
| The metadata a read needs of a property, holding at least its name and type, or null when the engine has no available property of that name. | |
Public Member Functions inherited from fiftyone\pipeline\engines\Engine | |
| getDataSourceTier () | |
| Get the tier to which the current data source belongs. | |
| setCache (DataKeyedCache $cache) | |
| Add a cache to an engine. | |
| setRestrictedProperties (array $propertiesList) | |
| Add a subset of properties. | |
| inCache (FlowData $flowData) | |
| A method to check if a flowData's evidence is in the cache. | |
| process (FlowData $flowData) | |
| Engine's core process function. | |
Public Member Functions inherited from fiftyone\pipeline\core\FlowElement | |
| __construct () | |
| A default dummy constructor is needed for there are classes inheriting this class deeper than 1-level of inheritance and calling parent::__construct() in their explicit constructors. | |
| filterEvidence (FlowData $flowData) | |
| Filter FlowData evidence using the FlowElement's EvidenceKeyFilter. | |
| filterEvidenceKey (string $key) | |
| Filter FlowData evidence using the FlowElement's EvidenceKeyFilter. | |
| onRegistration (Pipeline $pipeline) | |
| Callback called when an engine is added to a pipeline. | |
| getProperties () | |
| Get properties Usually overridden by specific FlowElements. | |
| updatePropertyList () | |
| Update a FlowElement's property list This is used by elements that are only aware of their properties at a later stage, such as cloud request based FlowElements or FlowElements that change their properties later based on new datafiles. | |
Data Fields | |
| string | $dataKey = Constants::ELEMENT_DATA_KEY |
| $engine | |
Data Fields inherited from fiftyone\pipeline\engines\Engine | |
| array | $restrictedProperties |
Data Fields inherited from fiftyone\pipeline\core\FlowElement | |
| string | $dataKey |
| array | $properties = [] |
| array | $pipelines = [] |
Additional Inherited Members | |
Protected Member Functions inherited from fiftyone\pipeline\engines\Engine | |
| holdsValueForOneRequest (ElementData $data) | |
| Whether a result holds a value created for the one request that asked for it, such as a 51Did. | |
Constructor & Destructor Documentation
◆ __construct()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::__construct | ( | array | $settings = [] | ) |
Uses the engine the extension builds once, when PHP starts, from the FiftyOneDegreesIpIntelligenceEngine.
- php.ini settings. Set FiftyOneDegreesIpIntelligenceEngine.data_file to the .ipi data file and pass no settings. That engine always holds the whole data file in memory, so a performance_profile ini setting other than Constants::STARTUP_PERFORMANCE_PROFILE is rejected, as are ENGINE_SETTINGS.
- Parameters
-
array<string,mixed> $settings dataFile - (optional, command-line tools only) path to an .ipi data file to build a new engine from, in place of the one built when PHP starts. Each construction opens the data file again and reads as much of it into memory as the performance profile asks for, the whole file with MaxPerformance. A web server constructs this class in every request, so under any SAPI other than 'cli' the setting is refused with an exception. performanceProfile - (optional, with dataFile) one of Constants::PERFORMANCE_PROFILES, defaulting to Constants::DEFAULT_PERFORMANCE_PROFILE. restrictedProperties- (optional, with dataFile) list of properties to populate. concurrency - (optional, with dataFile) expected concurrent accesses.
- Exceptions
-
Exception
Member Function Documentation
◆ __get()
| & fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::__get | ( | string | $name | ) |
Builds the table of every available property when it is first read.
- Returns
- mixed
- Exceptions
-
Exception
◆ close()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::close | ( | ) |
Release the native engine this element built from its dataFile setting.
Its data is freed once no results read from it are still held, so close every FlowData it processed as well. The shared global engine belongs to the extension and stays loaded. Closing the Pipeline closes the element.
◆ findProperty()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::findProperty | ( | string | $name | ) |
The metadata a read needs of a property, holding at least its name and type, or null when the engine has no available property of that name.
Until the table of every property is built, a property the engine was built with is looked up on its own in native code, so a request pays only for the properties it reads.
- Returns
- null|array<string, mixed>
- Exceptions
-
Exception
◆ getEvidenceKeyFilter()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::getEvidenceKeyFilter | ( | ) |
The accepted evidence keys (query.client-ip, server.client-ip, query.client-ip-51d, ...).
Note that this engine performs a single-IP lookup: only the first parseable IPv4/IPv6 value from the evidence (in the priority order used by getClientIps) actually drives the lookup. This is not multi-evidence detection.
Reimplemented from fiftyone\pipeline\core\FlowElement.
◆ getProduct()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::getProduct | ( | ) |
The product (data tier) of the loaded data file.
Used by the missing property service.
◆ processInternal()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::processInternal | ( | FlowData | $flowData | ) |
Process FlowData - this is process function is usually overridden by specific FlowElements to do their core work.
Reimplemented from fiftyone\pipeline\core\FlowElement.
◆ refreshData()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::refreshData | ( | ?string | $fileName = null | ) |
Ask the engine to start using the specified data file for lookups.
- Parameters
-
null | string $fileName Path to a new data file, or null to reload the existing one from disk.
◆ setCache()
| fiftyone\pipeline\ipintelligence\IpIntelligenceOnPremise::setCache | ( | ?DataKeyedCache | $cache | ) |
The on-premise engine manages its own internal cache and does not support an external cache.
- Exceptions
-
Exception
