| 1 |
<?php |
| 2 |
|
| 3 |
namespace FlyWP\StaticSite\Engine\Discovery; |
| 4 |
|
| 5 |
/** |
| 6 |
* The main feed and the comments feed. The crawler finds other feeds from the page links. |
| 7 |
* |
| 8 |
* No search feed. |
| 9 |
* |
| 10 |
* @since 1.8.0 |
| 11 |
*/ |
| 12 |
class FeedSource implements UrlSource { |
| 13 |
|
| 14 |
/** |
| 15 |
* @var WordPressGateway |
| 16 |
*/ |
| 17 |
private $wp; |
| 18 |
|
| 19 |
/** |
| 20 |
* @param WordPressGateway $wp Gateway. |
| 21 |
*/ |
| 22 |
public function __construct( WordPressGateway $wp ) { |
| 23 |
$this->wp = $wp; |
| 24 |
} |
| 25 |
|
| 26 |
/** |
| 27 |
* {@inheritdoc} |
| 28 |
*/ |
| 29 |
public function urls() { |
| 30 |
yield new DiscoveredUrl( $this->wp->feed_link(), 'feed', null, null, $this->wp->newest_modified_gmt( [ 'post' ] ) ); |
| 31 |
yield new DiscoveredUrl( $this->wp->feed_link( 'comments_' ), 'feed' ); |
| 32 |
} |
| 33 |
} |
| 34 |
|