tethys/app/Models/Oai/Configuration.php
Arno Kaimbacher 79b51e93e7 - add ResumptionToken for OAI-ListIdentifiers
- max identifiers and reciords via config
- add constants.php
- add clear-expired command for deleting obsolete cache
2020-06-10 21:09:37 +02:00

69 lines
1.4 KiB
PHP

<?php
namespace App\Models\Oai;
class Configuration
{
/**
* Hold path where to store temporary resumption token files.
*
* @var string
*/
private $pathTokens = '';
/**
* Holds maximum number of identifiers to list per request.
*
* @var int
*/
private $maxListIds = 15;
/**
* Holds maximum number of records to list per request.
*
* @var int
*/
private $maxListRecs = 15;
public function __construct()
{
$this->maxListIds = config('oai.max.listidentifiers');
$this->maxListRecs = config('oai.max.listrecords');
$this->pathTokens = config('app.workspacePath')
. DIRECTORY_SEPARATOR .'tmp'
. DIRECTORY_SEPARATOR . 'resumption';
}
/**
* Return temporary path for resumption tokens.
*
* @return string Path.
*/
public function getResumptionTokenPath()
{
return $this->pathTokens;
}
/**
* Return maximum number of listable identifiers per request.
*
* @return int Maximum number of listable identifiers per request.
*/
public function getMaxListIdentifiers()
{
return $this->maxListIds;
}
/**
* Return maximum number of listable records per request.
*
* @return int Maximum number of listable records per request.
*/
public function getMaxListRecords()
{
return $this->maxListRecs;
}
}