Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efc9ab0

Browse files
committed
Add PickPoint provider.
Fixed style.
1 parent b132d44 commit efc9ab0

19 files changed

+480
-0
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<server name="OPENCAGE_API_KEY" value="YOUR_GEOCODING_KEY" />
2828
<server name="MAPZEN_API_KEY" value="YOUR_MAPZEN_API_KEY" />
2929
<server name="IPINFODB_API_KEY" value="YOUR_API_KEY" />
30+
<server name="PICKPOINT_API_KEY" value="YOUR_API_KEY" />
3031
<!--<server name="MAXMIND_API_KEY" value="YOUR_API_KEY" />-->
3132
</php>
3233

src/Provider/PickPoint/.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gitattributes export-ignore
2+
.travis.yml export-ignore
3+
phpunit.xml.dist export-ignore
4+
Tests/ export-ignore

src/Provider/PickPoint/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml

src/Provider/PickPoint/.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: php
2+
sudo: false
3+
4+
php: 7.0
5+
6+
7+
install:
8+
- composer update --prefer-stable --prefer-dist
9+
10+
script:
11+
- composer test-ci
12+
13+
after_success:
14+
- wget https://scrutinizer-ci.com/ocular.phar
15+
- php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
16+

src/Provider/PickPoint/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
3+
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
4+
5+
## 4.0.0
6+
7+
First release of this library.

src/Provider/PickPoint/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 — Vladimir Kalinkin <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/Provider/PickPoint/PickPoint.php

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Geocoder package.
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*
10+
* @license MIT License
11+
*/
12+
13+
namespace Geocoder\Provider\PickPoint;
14+
15+
use Geocoder\Collection;
16+
use Geocoder\Exception\InvalidServerResponse;
17+
use Geocoder\Exception\InvalidCredentials;
18+
use Geocoder\Location;
19+
use Geocoder\Model\AddressBuilder;
20+
use Geocoder\Model\AddressCollection;
21+
use Geocoder\Query\GeocodeQuery;
22+
use Geocoder\Query\ReverseQuery;
23+
use Geocoder\Http\Provider\AbstractHttpProvider;
24+
use Geocoder\Provider\LocaleAwareGeocoder;
25+
use Geocoder\Provider\Provider;
26+
use Http\Client\HttpClient;
27+
28+
/**
29+
* @author Vladimir Kalinkin <[email protected]>
30+
*/
31+
final class PickPoint extends AbstractHttpProvider implements LocaleAwareGeocoder, Provider
32+
{
33+
/**
34+
* @var string
35+
*/
36+
const BASE_API_URL = 'https://api.pickpoint.io/v1';
37+
38+
/**
39+
* @var string
40+
*/
41+
private $apiKey;
42+
43+
/**
44+
* @param HttpClient $client an HTTP adapter
45+
* @param string $apiKey an API key
46+
*/
47+
public function __construct(HttpClient $client, string $apiKey)
48+
{
49+
if (empty($apiKey)) {
50+
throw new InvalidCredentials('No API key provided.');
51+
}
52+
53+
$this->apiKey = $apiKey;
54+
parent::__construct($client);
55+
}
56+
57+
/**
58+
* {@inheritdoc}
59+
*/
60+
public function geocodeQuery(GeocodeQuery $query): Collection
61+
{
62+
$address = $query->getText();
63+
64+
$url = sprintf($this->getGeocodeEndpointUrl(), urlencode($address), $query->getLimit());
65+
$content = $this->executeQuery($url, $query->getLocale());
66+
67+
$doc = new \DOMDocument();
68+
if (!@$doc->loadXML($content) || null === $doc->getElementsByTagName('searchresults')->item(0)) {
69+
throw InvalidServerResponse::create($url);
70+
}
71+
72+
$searchResult = $doc->getElementsByTagName('searchresults')->item(0);
73+
$places = $searchResult->getElementsByTagName('place');
74+
75+
if (null === $places || 0 === $places->length) {
76+
return new AddressCollection([]);
77+
}
78+
79+
$results = [];
80+
foreach ($places as $place) {
81+
$results[] = $this->xmlResultToArray($place, $place);
82+
}
83+
84+
return new AddressCollection($results);
85+
}
86+
87+
/**
88+
* {@inheritdoc}
89+
*/
90+
public function reverseQuery(ReverseQuery $query): Collection
91+
{
92+
$coordinates = $query->getCoordinates();
93+
$longitude = $coordinates->getLongitude();
94+
$latitude = $coordinates->getLatitude();
95+
$url = sprintf($this->getReverseEndpointUrl(), $latitude, $longitude, $query->getData('zoom', 18));
96+
$content = $this->executeQuery($url, $query->getLocale());
97+
98+
$doc = new \DOMDocument();
99+
if (!@$doc->loadXML($content) || $doc->getElementsByTagName('error')->length > 0) {
100+
return new AddressCollection([]);
101+
}
102+
103+
$searchResult = $doc->getElementsByTagName('reversegeocode')->item(0);
104+
$addressParts = $searchResult->getElementsByTagName('addressparts')->item(0);
105+
$result = $searchResult->getElementsByTagName('result')->item(0);
106+
107+
return new AddressCollection([$this->xmlResultToArray($result, $addressParts)]);
108+
}
109+
110+
/**
111+
* @param \DOMElement $resultNode
112+
* @param \DOMElement $addressNode
113+
*
114+
* @return Location
115+
*/
116+
private function xmlResultToArray(\DOMElement $resultNode, \DOMElement $addressNode): Location
117+
{
118+
$builder = new AddressBuilder($this->getName());
119+
120+
foreach (['state', 'county'] as $i => $tagName) {
121+
if (null !== ($adminLevel = $this->getNodeValue($addressNode->getElementsByTagName($tagName)))) {
122+
$builder->addAdminLevel($i + 1, $adminLevel, '');
123+
}
124+
}
125+
126+
// get the first postal-code when there are many
127+
$postalCode = $this->getNodeValue($addressNode->getElementsByTagName('postcode'));
128+
if (!empty($postalCode)) {
129+
$postalCode = current(explode(';', $postalCode));
130+
}
131+
$builder->setPostalCode($postalCode);
132+
$builder->setStreetName($this->getNodeValue($addressNode->getElementsByTagName('road')) ?: $this->getNodeValue($addressNode->getElementsByTagName('pedestrian')));
133+
$builder->setStreetNumber($this->getNodeValue($addressNode->getElementsByTagName('house_number')));
134+
$builder->setLocality($this->getNodeValue($addressNode->getElementsByTagName('city')));
135+
$builder->setSubLocality($this->getNodeValue($addressNode->getElementsByTagName('suburb')));
136+
$builder->setCountry($this->getNodeValue($addressNode->getElementsByTagName('country')));
137+
$builder->setCountryCode(strtoupper($this->getNodeValue($addressNode->getElementsByTagName('country_code'))));
138+
$builder->setCoordinates($resultNode->getAttribute('lat'), $resultNode->getAttribute('lon'));
139+
140+
$boundsAttr = $resultNode->getAttribute('boundingbox');
141+
if ($boundsAttr) {
142+
$bounds = [];
143+
list($bounds['south'], $bounds['north'], $bounds['west'], $bounds['east']) = explode(',', $boundsAttr);
144+
$builder->setBounds($bounds['south'], $bounds['north'], $bounds['west'], $bounds['east']);
145+
}
146+
147+
return $builder->build();
148+
}
149+
150+
/**
151+
* {@inheritdoc}
152+
*/
153+
public function getName(): string
154+
{
155+
return 'pickpoint';
156+
}
157+
158+
/**
159+
* @param string $url
160+
* @param string|null $locale
161+
*
162+
* @return string
163+
*/
164+
private function executeQuery(string $url, string $locale = null): string
165+
{
166+
if (null !== $locale) {
167+
$url = sprintf('%s&accept-language=%s', $url, $locale);
168+
}
169+
170+
return $this->getUrlContents($url);
171+
}
172+
173+
private function getGeocodeEndpointUrl(): string
174+
{
175+
return self::BASE_API_URL.'/forward?q=%s&format=xml&addressdetails=1&limit=%d&key='.$this->apiKey;
176+
}
177+
178+
private function getReverseEndpointUrl(): string
179+
{
180+
return self::BASE_API_URL.'/reverse?format=xml&lat=%F&lon=%F&addressdetails=1&zoom=%d&key='.$this->apiKey;
181+
}
182+
183+
private function getNodeValue(\DOMNodeList $element)
184+
{
185+
return $element->length ? $element->item(0)->nodeValue : null;
186+
}
187+
}

src/Provider/PickPoint/Readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PickPoint Geocoder provider
2+
[![Build Status](https://travis-ci.org/geocoder-php/pickpoint-provider.svg?branch=master)](http://travis-ci.org/geocoder-php/pickpoint-provider)
3+
[![Latest Stable Version](https://poser.pugx.org/geocoder-php/pickpoint-provider/v/stable)](https://packagist.org/packages/geocoder-php/pickpoint-provider)
4+
[![Total Downloads](https://poser.pugx.org/geocoder-php/pickpoint-provider/downloads)](https://packagist.org/packages/geocoder-php/pickpoint-provider)
5+
[![Monthly Downloads](https://poser.pugx.org/geocoder-php/pickpoint-provider/d/monthly.png)](https://packagist.org/packages/geocoder-php/pickpoint-provider)
6+
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/geocoder-php/pickpoint-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/pickpoint-provider)
7+
[![Quality Score](https://img.shields.io/scrutinizer/g/geocoder-php/pickpoint-provider.svg?style=flat-square)](https://scrutinizer-ci.com/g/geocoder-php/pickpoint-provider)
8+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
9+
10+
This is the PickPoint provider from the PHP Geocoder. This is a **READ ONLY** repository. See the
11+
[main repo](https://github.com/geocoder-php/Geocoder) for information and documentation.
12+
13+
### Install
14+
15+
```bash
16+
composer require geocoder-php/pickpoint-provider
17+
```
18+
19+
### Contribute
20+
21+
Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or
22+
report any issues you find on the [issue tracker](https://github.com/geocoder-php/Geocoder/issues).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s:1025:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<reversegeocode timestamp='Tue, 27 Jun 17 20:19:20 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='format=xml&amp;lat=48.860000&amp;lon=2.350000&amp;addressdetails=1&amp;zoom=18&amp;key=pqxQyozFtbW9wx2xr93h'>
3+
<result place_id="7270079" osm_type="node" osm_id="700309516" ref="Bistrot Beaubourg" lat="48.8600408" lon="2.3499857" boundingbox="48.8599408,48.8601408,2.3498857,2.3500857">Bistrot Beaubourg, 25, Rue Quincampoix, Beaubourg, St-Merri, 3e, Paris, Île-de-France, France métropolitaine, 75004, France</result><addressparts><cafe>Bistrot Beaubourg</cafe><house_number>25</house_number><pedestrian>Rue Quincampoix</pedestrian><neighbourhood>Beaubourg</neighbourhood><suburb>St-Merri</suburb><city_district>3e</city_district><city>Paris</city><county>Paris</county><state>Île-de-France</state><country>France</country><postcode>75004</postcode><country_code>fr</country_code></addressparts></reversegeocode>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s:414:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<searchresults timestamp='Tue, 27 Jun 17 20:19:19 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='2001:0db8:0000:0042:0000:8a2e:0370:7334' polygon='false' more_url='http://127.0.0.1/search.php?q=2001%3A0db8%3A0000%3A0042%3A0000%3A8a2e%3A0370%3A7334&amp;addressdetails=1&amp;format=xml'>
3+
</searchresults>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s:1054:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<reversegeocode timestamp='Tue, 27 Jun 17 20:19:14 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='format=xml&amp;lat=38.900206&amp;lon=-77.036991&amp;addressdetails=1&amp;zoom=18&amp;key=pqxQyozFtbW9wx2xr93h&amp;accept-language=en'>
3+
<result place_id="82486650" osm_type="way" osm_id="55326891" ref="Hay-Adams Hotel" lat="38.90050395" lon="-77.0368998247139" boundingbox="38.9003173,38.9006934,-77.0371737,-77.036723">Hay-Adams Hotel, 800, 16th Street Northwest, Golden Triangle, Logan Circle, Washington, District of Columbia, 20006, United States of America</result><addressparts><hotel>Hay-Adams Hotel</hotel><house_number>800</house_number><road>16th Street Northwest</road><neighbourhood>Golden Triangle</neighbourhood><suburb>Logan Circle</suburb><city>Washington</city><state>District of Columbia</state><postcode>20006</postcode><country>United States of America</country><country_code>us</country_code></addressparts></reversegeocode>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
s:1275:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<searchresults timestamp='Tue, 27 Jun 17 20:19:12 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='10 Downing St, London, UK' polygon='false' exclude_place_ids='174040554' more_url='http://127.0.0.1/search.php?q=10+Downing+St%2C+London%2C+UK&amp;exclude_place_ids=174040554&amp;addressdetails=1&amp;format=xml'>
3+
<place place_id='174040554' osm_type='relation' osm_id='1879842' place_rank='30' boundingbox="51.5032573,51.5036483,-0.1278356,-0.1273038" lat='51.50344025' lon='-0.127708209585621' display_name='10 Downing Street, 10, Downing Street, St. James&#039;s, Covent Garden, Westminster, London, Greater London, England, SW1A 2AA, United Kingdom' class='tourism' type='attraction' importance='0.89147137691773' icon='http://127.0.0.1/images/mapicons/poi_point_of_interest.p.20.png'>
4+
<attraction>10 Downing Street</attraction><house_number>10</house_number><road>Downing Street</road><neighbourhood>St. James's</neighbourhood><suburb>Covent Garden</suburb><city>London</city><state_district>Greater London</state_district><state>England</state><postcode>SW1A 2AA</postcode><country>United Kingdom</country><country_code>gb</country_code></place></searchresults>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
s:3727:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<searchresults timestamp='Tue, 27 Jun 17 20:19:18 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='83.227.123.8' polygon='false' exclude_place_ids='172076749,164105368,109007929,164035111,163808290,109007808,86924766' more_url='http://nominatim-1/search.php?format=xml&amp;exclude_place_ids=172076749,164105368,109007929,164035111,163808290,109007808,86924766&amp;addressdetails=1&amp;q=83.227.123.8'>
3+
<place place_id='172076749' osm_type='relation' osm_id='4443470' place_rank='20' boundingbox="14.6547531,14.6595016,120.9616812,120.9696958" lat='14.6570929' lon='120.965690321509' display_name='8, Caloocan, Metro Manila, Philippines' class='boundary' type='administrative' importance='0.25' icon='http://nominatim-1/images/mapicons/poi_boundary_administrative.p.20.png'>
4+
<suburb>8</suburb><city>Caloocan</city><county>Caloocan</county><region>Metro Manila</region><country>Philippines</country><country_code>ph</country_code></place><place place_id='164105368' osm_type='way' osm_id='442213181' place_rank='26' boundingbox="54.2570501,54.2572274,18.6509649,18.6512954" lat='54.2571653' lon='18.6511709' display_name='227, Osiedle Komarowo, Osiedle Lotników, Pruszcz Gdański, powiat gdański, Pomeranian Voivodeship, 83-000, Poland' class='highway' type='secondary' importance='0.1'>
5+
<road>227</road><neighbourhood>Osiedle Komarowo</neighbourhood><suburb>Osiedle Lotników</suburb><town>Pruszcz Gdański</town><county>Pruszcz Gdański</county><state>Pomeranian Voivodeship</state><postcode>83-000</postcode><country>Poland</country><country_code>pl</country_code></place><place place_id='109007929' osm_type='way' osm_id='173224503' place_rank='26' boundingbox="54.2581747,54.258389,18.6497217,18.6498591" lat='54.2582805' lon='18.6497664' display_name='Powstańców Warszawy, Osiedle Komarowo, Osiedle Lotników, Pruszcz Gdański, powiat gdański, Pomeranian Voivodeship, 83-000, Poland' class='highway' type='secondary' importance='0.1'>
6+
<road>Powstańców Warszawy</road><neighbourhood>Osiedle Komarowo</neighbourhood><suburb>Osiedle Lotników</suburb><town>Pruszcz Gdański</town><county>Pruszcz Gdański</county><state>Pomeranian Voivodeship</state><postcode>83-000</postcode><country>Poland</country><country_code>pl</country_code></place><place place_id='109007808' osm_type='way' osm_id='173224265' place_rank='26' boundingbox="54.258389,54.2599568,18.6497217,18.6505493" lat='54.2592181' lon='18.650227' display_name='Fryderyka Chopina, Osiedle Komarowo, Osiedle Lotników, Pruszcz Gdański, powiat gdański, Pomeranian Voivodeship, 83-000, Poland' class='highway' type='secondary' importance='0.1'>
7+
<road>Fryderyka Chopina</road><neighbourhood>Osiedle Komarowo</neighbourhood><suburb>Osiedle Lotników</suburb><town>Pruszcz Gdański</town><county>Pruszcz Gdański</county><state>Pomeranian Voivodeship</state><postcode>83-000</postcode><country>Poland</country><country_code>pl</country_code></place><place place_id='86924766' osm_type='way' osm_id='89470423' place_rank='26' boundingbox="54.2599568,54.2604446,18.6505493,18.6506786" lat='54.2603127' lon='18.6506786' display_name='Fryderyka Chopina, Osiedle Mikołaja Kopernika, Osiedle Lotników, Pruszcz Gdański, powiat gdański, Pomeranian Voivodeship, 83-000, Poland' class='highway' type='secondary' importance='0.1'>
8+
<road>Fryderyka Chopina</road><neighbourhood>Osiedle Mikołaja Kopernika</neighbourhood><suburb>Osiedle Lotników</suburb><town>Pruszcz Gdański</town><county>Pruszcz Gdański</county><state>Pomeranian Voivodeship</state><postcode>83-000</postcode><country>Poland</country><country_code>pl</country_code></place></searchresults>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s:368:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<reversegeocode timestamp='Tue, 27 Jun 17 20:19:14 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='format=xml&amp;lat=0.000000&amp;lon=0.000000&amp;addressdetails=1&amp;zoom=18&amp;key=pqxQyozFtbW9wx2xr93h'>
3+
<error>Unable to geocode</error></reversegeocode>";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s:413:"<?xml version="1.0" encoding="UTF-8" ?>
2+
<searchresults timestamp='Tue, 27 Jun 17 20:19:13 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='jsajhgsdkfjhsfkjhaldkadjaslgldasd' polygon='false' more_url='http://nominatim-1/search.php?format=xml&amp;exclude_place_ids=&amp;addressdetails=1&amp;q=jsajhgsdkfjhsfkjhaldkadjaslgldasd'>
3+
</searchresults>";
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Geocoder package.
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @license MIT License
9+
*/
10+
11+
namespace Geocoder\Provider\PickPoint\Tests;
12+
13+
use Geocoder\IntegrationTest\ProviderIntegrationTest;
14+
use Geocoder\Provider\PickPoint\PickPoint;
15+
use Http\Client\HttpClient;
16+
17+
/**
18+
* @author Vladimir Kalinkin <[email protected]>
19+
*/
20+
class IntegrationTest extends ProviderIntegrationTest
21+
{
22+
protected $testAddress = true;
23+
protected $testReverse = true;
24+
25+
protected function createProvider(HttpClient $httpClient)
26+
{
27+
return new PickPoint($httpClient, $this->getApiKey());
28+
}
29+
30+
protected function getCacheDir()
31+
{
32+
return __DIR__.'/.cached_responses';
33+
}
34+
35+
protected function getApiKey()
36+
{
37+
return $_SERVER['PICKPOINT_API_KEY'];
38+
}
39+
}

0 commit comments

Comments
 (0)