Skip to content

Commit

Permalink
Fix various PHP compatibility issues and update dependencies to suppo…
Browse files Browse the repository at this point in the history
…rted versions
  • Loading branch information
DivineOmega committed Dec 15, 2018
1 parent becae54 commit f44ed1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
composer.lock
cache/*.cache
cache/*.cache
.idea
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
],
"require": {
"php": ">=5.3",
"rapidwebltd/rw-file-cache-psr-6": "^1.0"
"divineomega/do-file-cache-psr-6": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"satooshi/php-coveralls": "^2.0"
"php-coveralls/php-coveralls": "^2.1"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

namespace RapidWeb\UkBankHolidays\Objects\CacheDrivers;

use rapidweb\RWFileCachePSR6\CacheItemPool;
use DivineOmega\DOFileCachePSR6\CacheItemPool;
use RapidWeb\UkBankHolidays\Interfaces\CacheDriverInterface;

class RWFileCacheDriver implements CacheDriverInterface
class DOFileCacheDriver implements CacheDriverInterface
{
const CACHE_EXPIRY_IN_SECONDS = 60 * 60 * 24 * 30; // 30 days
const CACHE_EXPIRY_IN_SECONDS = 2592000; // 30 days

private $cache = null;

public function __construct()
{
$this->cache = new CacheItemPool();
$this->cache->changeConfig(
[
array(
'cacheDirectory' => '/tmp/php-uk-bank-holidays-cache/',
'gzipCompression' => true,
]
)
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Objects/DataRetrievers/GovUkDataRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use RapidWeb\UkBankHolidays\Interfaces\CacheDriverInterface;
use RapidWeb\UkBankHolidays\Interfaces\DataRetrieverInterface;
use RapidWeb\UkBankHolidays\Objects\CacheDrivers\LaravelCacheDriver;
use RapidWeb\UkBankHolidays\Objects\CacheDrivers\RWFileCacheDriver;
use RapidWeb\UkBankHolidays\Objects\CacheDrivers\DOFileCacheDriver;
use RapidWeb\UkBankHolidays\Objects\UkBankHoliday;

class GovUkDataRetriever implements DataRetrieverInterface
Expand All @@ -26,7 +26,7 @@ private function setupCache()
if (class_exists('Illuminate\Support\Facades\Cache')) {
$this->setCacheDriver(new LaravelCacheDriver());
} else {
$this->setCacheDriver(new RWFileCacheDriver());
$this->setCacheDriver(new DOFileCacheDriver());
}
}

Expand Down

0 comments on commit f44ed1f

Please sign in to comment.