Use different declaration of logger for ORCID API
For some reason LoggerAwareInterface doesn't work
This commit is contained in:
parent
348dcbe8a9
commit
2561ee3da5
|
@ -12,23 +12,29 @@
|
|||
|
||||
namespace Kitodo\Dlf\Api\Orcid;
|
||||
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerAwareTrait;
|
||||
use TYPO3\CMS\Core\Http\RequestFactory;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* ORCID API Client class
|
||||
**/
|
||||
class Client implements LoggerAwareInterface
|
||||
class Client
|
||||
{
|
||||
use LoggerAwareTrait;
|
||||
|
||||
/**
|
||||
* constants for API endpoint
|
||||
**/
|
||||
const HOSTNAME = 'orcid.org';
|
||||
const VERSION = '3.0';
|
||||
|
||||
/**
|
||||
* This holds the logger
|
||||
*
|
||||
* @var LogManager
|
||||
* @access protected
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* The ORCID API endpoint
|
||||
*
|
||||
|
@ -66,6 +72,7 @@ class Client implements LoggerAwareInterface
|
|||
**/
|
||||
public function __construct($orcid, RequestFactory $requestFactory)
|
||||
{
|
||||
$this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
|
||||
$this->orcid = $orcid;
|
||||
$this->requestFactory = $requestFactory;
|
||||
}
|
||||
|
|
|
@ -13,17 +13,22 @@
|
|||
namespace Kitodo\Dlf\Api\Orcid;
|
||||
|
||||
use Kitodo\Dlf\Common\Helper;
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerAwareTrait;
|
||||
use TYPO3\CMS\Core\Http\RequestFactory;
|
||||
use TYPO3\CMS\Core\Log\LogManager;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* ORCID profile API class
|
||||
**/
|
||||
class Profile implements LoggerAwareInterface
|
||||
class Profile
|
||||
{
|
||||
use LoggerAwareTrait;
|
||||
/**
|
||||
* This holds the logger
|
||||
*
|
||||
* @var LogManager
|
||||
* @access protected
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* The raw ORCID profile
|
||||
|
@ -41,6 +46,7 @@ class Profile implements LoggerAwareInterface
|
|||
**/
|
||||
public function __construct($orcid)
|
||||
{
|
||||
$this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
|
||||
$this->client = new Client($orcid, GeneralUtility::makeInstance(RequestFactory::class));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue