1
0
Fork 0

Merge branch 'roa'

* roa:
  roagen.php: add additional commentary info to metadata section
This commit is contained in:
netravnen 2020-01-10 13:56:07 +00:00
commit 7c617dc326
1 changed files with 11 additions and 7 deletions

View File

@ -221,18 +221,22 @@ foreach ($raw_array as $sub_array)
* *
* Add info * Add info
* 1. generation time (now), * 1. generation time (now),
* 2. expire time (now+7d), * 2. expire time (now + 3 days),
* 3. number of routes * 3. number of routes
*
* Numbers must be unquoted integers, and timeformat must
* be epoch format. TImezone is set to Etc/UTC.
*/ */
$roaFileCreated = (int)( date_format( new \DateTime( "now", new \DateTimeZone( "UTC" ) ), "U" ) ); $roaRegistryCount = (int)count($roas["roas"]);
$roaFileExpire = (int)( date_format( date_modify( new \DateTime( "now", new \DateTimeZone( "UTC" ) ), "+3 day" ), "U" ) ); $roaFileDateTimeCreated = (int)( date_format( new \DateTime( "now", new \DateTimeZone( "UTC" ) ), "U" ) );
$roaFileDateTimeExpire = (int)( date_format( date_modify( new \DateTime( "now", new \DateTimeZone( "UTC" ) ), "+3 day" ), "U" ) );
$roas["metadata"]["counts"] = (int)count($roas["roas"]); $roas["metadata"]["counts"] = $roaRegistryCount;
$roas["metadata"]["generated"] = $roaFileCreated; $roas["metadata"]["generated"] = $roaFileDateTimeCreated;
$roas["metadata"]["valid"] = $roaFileExpire; $roas["metadata"]["valid"] = $roaFileDateTimeExpire;
/* /*
$roas["metadata"]["signature"] = ""; $roas["metadata"]["signature"] = "";
$roas["metadata"]["signatureData"] = ""; $roas["metadata"]["signatureData"] = "";
*/ */