mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-02 09:04:44 +02:00
refactor (#4244)
This commit is contained in:
parent
bb2f471a03
commit
6a24e53d6c
7 changed files with 69 additions and 66 deletions
|
@ -14,8 +14,13 @@ function getContents(
|
|||
array $curlOptions = [],
|
||||
bool $returnFull = false
|
||||
) {
|
||||
$httpClient = RssBridge::getHttpClient();
|
||||
$cache = RssBridge::getCache();
|
||||
global $container;
|
||||
|
||||
/** @var HttpClient $httpClient */
|
||||
$httpClient = $container['http_client'];
|
||||
|
||||
/** @var CacheInterface $cache */
|
||||
$cache = $container['cache'];
|
||||
|
||||
// TODO: consider url validation at this point
|
||||
|
||||
|
@ -212,7 +217,11 @@ function getSimpleHTMLDOMCached(
|
|||
$defaultBRText = DEFAULT_BR_TEXT,
|
||||
$defaultSpanText = DEFAULT_SPAN_TEXT
|
||||
) {
|
||||
$cache = RssBridge::getCache();
|
||||
global $container;
|
||||
|
||||
/** @var CacheInterface $cache */
|
||||
$cache = $container['cache'];
|
||||
|
||||
$cacheKey = 'pages_' . $url;
|
||||
$content = $cache->get($cacheKey);
|
||||
if (!$content) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue