77
88namespace Attogram \Justrefs ;
99
10+ use Illuminate \Cache \FileStore ;
11+ use Illuminate \Cache \Repository ;
12+ use Illuminate \Filesystem \Filesystem ;
13+
1014use function get_class ;
1115use function header ;
1216use function htmlentities ;
2125
2226class 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 ()
0 commit comments