mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -04:00
Clean up some class inheritance issues in feeds
This commit is contained in:
parent
2ef5ce6551
commit
18f761929a
3 changed files with 18 additions and 9 deletions
|
@ -23,6 +23,14 @@ class RssFeed extends Feed{
|
|||
return $this->XmlString;
|
||||
}
|
||||
|
||||
public function SaveIfChanged(): void{
|
||||
// Did we actually update the feed? If so, write to file and update the index
|
||||
if($this->HasChanged($this->Path)){
|
||||
// Files don't match, save the file
|
||||
$this->Save();
|
||||
}
|
||||
}
|
||||
|
||||
protected function HasChanged(string $path): bool{
|
||||
// RSS doesn't have information about when an item was updated,
|
||||
// only when it was first published. So, we approximate on whether the feed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue