23 lines
665 B
PHP
23 lines
665 B
PHP
<?php
|
|
declare(strict_types = 1);
|
|
|
|
// Some dependencies haven't been updated for PHP 8
|
|
// This can probably be removed for PHP 7.3
|
|
error_reporting(E_ALL & ~E_DEPRECATED);
|
|
|
|
require_once('vendor/autoload.php');
|
|
|
|
include_once('config/default.php');
|
|
|
|
include_once('lib/log.php');
|
|
include_once('lib/read-feed.php');
|
|
include_once('lib/fetch-site-content.php');
|
|
include_once('lib/generate-feed.php');
|
|
|
|
$existingFeed = readFeed(Config::feedPath);
|
|
$content = fetchSiteContent($existingFeed);
|
|
$feedXml = generateFeed(array_reverse($content));
|
|
|
|
Log::info("writing " . strlen($feedXml) . " bytes to " . Config::feedPath);
|
|
file_put_contents(Config::feedPath, $feedXml, LOCK_EX);
|