aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Category.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Category.php')
-rw-r--r--app/Models/Category.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 6674b4e72..13bb184d5 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -94,6 +94,11 @@ class FreshRSS_Category extends Minz_Model {
return $this->nbNotRead;
}
+ /** @return array<int,mixed> */
+ public function curlOptions(): array {
+ return []; // TODO (e.g., credentials for Dynamic OPML)
+ }
+
/**
* @return array<int,FreshRSS_Feed>
* @throws Minz_ConfigurationNamespaceException
@@ -158,11 +163,10 @@ class FreshRSS_Category extends Minz_Model {
}
/**
- * @param array<string> $attributes
* @throws FreshRSS_Context_Exception
*/
- public static function cacheFilename(string $url, array $attributes): string {
- $simplePie = customSimplePie($attributes);
+ public function cacheFilename(string $url): string {
+ $simplePie = customSimplePie($this->attributes(), $this->curlOptions());
$filename = $simplePie->get_cache_filename($url);
return CACHE_PATH . '/' . $filename . '.opml.xml';
}
@@ -173,9 +177,8 @@ class FreshRSS_Category extends Minz_Model {
return false;
}
$ok = true;
- $attributes = []; //TODO
- $cachePath = self::cacheFilename($url, $attributes);
- $opml = httpGet($url, $cachePath, 'opml', $attributes);
+ $cachePath = $this->cacheFilename($url);
+ $opml = httpGet($url, $cachePath, 'opml', $this->attributes(), $this->curlOptions());
if ($opml == '') {
Minz_Log::warning('Error getting dynamic OPML for category ' . $this->id() . '! ' .
SimplePie_Misc::url_remove_credentials($url));