Skip to content

Commit 46b1d45

Browse files
committed
rm FilesystemCache
1 parent 1d339cf commit 46b1d45

File tree

2 files changed

+12
-67
lines changed

2 files changed

+12
-67
lines changed

src/Base.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
namespace Attogram\Justrefs;
99

10+
use Illuminate\Cache\FileStore;
11+
use Illuminate\Cache\Repository;
12+
use Illuminate\Filesystem\Filesystem;
13+
1014
use function get_class;
1115
use function header;
1216
use function htmlentities;
@@ -21,7 +25,10 @@
2125

2226
class Base
2327
{
24-
const VERSION = '0.7.0';
28+
const VERSION = '0.8.0';
29+
30+
/** Cache Directory */
31+
const CACHE_DIRECTORY = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'cache';
2532

2633
/** Cache Time, in seconds. 4 days = 345600, 14 days = 1209600 */
2734
const CACHE_TIME = 1209600;
@@ -81,7 +88,7 @@ class Base
8188
public $template;
8289

8390
/**
84-
* @var Attogram\Justrefs\FilesystemCache
91+
* @var Illuminate\Cache\Repository
8592
*/
8693
protected $filesystem;
8794

@@ -100,11 +107,6 @@ class Base
100107
*/
101108
protected $source = 'https://en.wikipedia.org/wiki/';
102109

103-
/**
104-
* @var string - path to cache directory
105-
*/
106-
protected $cacheDirectory = '..' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
107-
108110
/**
109111
* @var array - array of start times
110112
*/
@@ -231,7 +233,9 @@ protected function setTopicFromUrl()
231233

232234
protected function initFilesystem()
233235
{
234-
$this->filesystem = (new FilesystemCache())->init();
236+
$this->filesystem = new Repository(
237+
new FileStore(new Filesystem(), self::CACHE_DIRECTORY)
238+
);
235239
}
236240

237241
protected function initMediawiki()

src/FilesystemCache.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)