Files
pathfinder/app/Lib/Api/CcpClient.php
Mark Friedrich 647bd7db58 - BC Break: _PHP_ namespaces changed (PSR-4 standard). The _root_ namespace for all _PF_ related scripts is Exodus4D\Pathfinder
- BC Break: Project folder structure changed. Removed `app/main` dir.
- BC Break: Core _PHP_ framework + dependencies moved into `composer.json` and are no longer part of this repo
2019-12-15 22:27:17 +01:00

45 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Exodus 4D
* Date: 26.12.2018
* Time: 17:43
*/
namespace Exodus4D\Pathfinder\Lib\Api;
use Exodus4D\Pathfinder\Lib\Config;
use Exodus4D\ESI\Client\ApiInterface;
use Exodus4D\ESI\Client\Ccp\Esi\Esi as Client;
use Exodus4D\ESI\Client\Ccp\Esi\EsiInterface as ClientInterface;
/**
* Class CcpClient
* @package lib\api
*
* @method ClientInterface getServerStatus()
* @method ClientInterface getStatusForRoutes(string $version)
*/
class CcpClient extends AbstractClient {
/**
* @var string
*/
const CLIENT_NAME = 'ccpClient';
/**
* @param \Base $f3
* @return ApiInterface|null
*/
protected function getClient(\Base $f3) : ?ApiInterface {
$client = null;
if(class_exists(Client::class)){
$client = new Client(Config::getEnvironmentData('CCP_ESI_URL'));
$client->setDataSource(Config::getEnvironmentData('CCP_ESI_DATASOURCE'));
}else{
$this->getLogger()->write($this->getMissingClassError(Client::class));
}
return $client;
}
}