SingleInstance
extends Webservice
in package
PHP library to access FDSN Webservices and request Event (earthquake) information in text format
Tags
Table of Contents
Constants
- basePath = 'https://%s/fdsnws/event/1'
- defaultFdsnServer = 'webservices.ms.ingv.it'
- fdsnSupportedVersion = '^1.6'
Properties
- $arrayOfResults : array<string|int, mixed>
- $fdsn_server : string
- $version : string
- $webserviceFullPath : string
- $counter : int
- $event : Quake
- $eventId : Id
- $eventList : string
- $format : string
- $url : string
- $user : string
Methods
- __construct() : mixed
- addFilterByEventId() : void
- Add filter based on ID Event (see https://terremoti.ingv.it/ to get event ids)
- details() : Quake
- Get event details , if only one event was found (filtering by eventId or when only one event is found by fetch() )
- fetch() : int
- Apply all filter and DO the request to the Official ONT Webservice
- getIterator() : array<string|int, mixed>
- Iterate over catalogis found
- numRows() : int
- Return the number of elems found
- version() : string
- Get FDSN running version
- getFetch() : string
- Fetch data from selected FDSN server
- composeURL() : string
- Compose URL before do the request
- fdsnSupportedVersion() : bool
- Check if FDSN server version is supported
- formatIsValid() : bool
- Check if format set is valid
- parse() : int
- Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
Constants
basePath
public
Base
basePath
= 'https://%s/fdsnws/event/1'
URL to compile with FDSN server url
defaultFdsnServer
public
Default
defaultFdsnServer
= 'webservices.ms.ingv.it'
server url
fdsnSupportedVersion
public
Max
fdsnSupportedVersion
= '^1.6'
supported version
Properties
$arrayOfResults
protected
array<string|int, mixed>
$arrayOfResults
= array()
$fdsn_server
protected
string
$fdsn_server
$version
protected
string
$version
= ''
$webserviceFullPath
protected
string
$webserviceFullPath
$counter
private
int
$counter
= 0
$event
private
Quake
$event
$eventId
private
Id
$eventId
$eventList
private
string
$eventList
$format
private
string
$format
= 'text'
$url
private
string
$url
$user
private
string
$user
Methods
__construct()
public
__construct(string $format, string $user[, string $fdns_server = Fdsnws_Webservice::defaultFdsnServer ]) : mixed
Parameters
- $format : string
- $user : string
- $fdns_server : string = Fdsnws_Webservice::defaultFdsnServer
addFilterByEventId()
Add filter based on ID Event (see https://terremoti.ingv.it/ to get event ids)
public
addFilterByEventId(Id $eventId) : void
Parameters
- $eventId : Id
-
Unique event ID
details()
Get event details , if only one event was found (filtering by eventId or when only one event is found by fetch() )
public
details() : Quake
Return values
Quake —Quake obj
fetch()
Apply all filter and DO the request to the Official ONT Webservice
public
fetch() : int
Return values
int —Return the number of elems found
getIterator()
Iterate over catalogis found
public
getIterator() : array<string|int, mixed>
Return values
array<string|int, mixed> —array of \Fdsn\DataStructure\Catalog obj
numRows()
Return the number of elems found
public
numRows() : int
Return values
int —The number of elems found
version()
Get FDSN running version
public
version() : string
Return values
string —FDSN running version (trimmed by newline)
getFetch()
Fetch data from selected FDSN server
protected
getFetch(string $url) : string
Parameters
- $url : string
Return values
string —downloaded string
composeURL()
Compose URL before do the request
private
composeURL() : string
Return values
string —composed URL
fdsnSupportedVersion()
Check if FDSN server version is supported
private
fdsnSupportedVersion() : bool
Return values
boolformatIsValid()
Check if format set is valid
private
formatIsValid(string $format) : bool
Parameters
- $format : string
Return values
bool —format is valid?
parse()
Loop over found elems found (in text format) and convert the to \Fdsn\DataStructure\Quake obj
private
parse(string $response) : int
Parameters
- $response : string