Skip to content

Commit

Permalink
rm FilesystemCache
Browse files Browse the repository at this point in the history
  • Loading branch information
attogram committed Apr 22, 2020
1 parent 1d339cf commit 46b1d45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 67 deletions.
20 changes: 12 additions & 8 deletions src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace Attogram\Justrefs;

use Illuminate\Cache\FileStore;
use Illuminate\Cache\Repository;
use Illuminate\Filesystem\Filesystem;

use function get_class;
use function header;
use function htmlentities;
Expand All @@ -21,7 +25,10 @@

class Base
{
const VERSION = '0.7.0';
const VERSION = '0.8.0';

/** Cache Directory */
const CACHE_DIRECTORY = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'cache';

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

/**
* @var Attogram\Justrefs\FilesystemCache
* @var Illuminate\Cache\Repository
*/
protected $filesystem;

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

/**
* @var string - path to cache directory
*/
protected $cacheDirectory = '..' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;

/**
* @var array - array of start times
*/
Expand Down Expand Up @@ -231,7 +233,9 @@ protected function setTopicFromUrl()

protected function initFilesystem()
{
$this->filesystem = (new FilesystemCache())->init();
$this->filesystem = new Repository(
new FileStore(new Filesystem(), self::CACHE_DIRECTORY)
);
}

protected function initMediawiki()
Expand Down
59 changes: 0 additions & 59 deletions src/FilesystemCache.php

This file was deleted.

0 comments on commit 46b1d45

Please sign in to comment.