2016-12-11 18:56:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$conf = $GLOBALS['CONFIG']['DOWNLOAD'];
|
|
|
|
|
|
|
|
if(isset($conf['REQUIRE_USER']))
|
|
|
|
{
|
|
|
|
if(get_current_user() != $conf['require-user'])
|
|
|
|
{
|
|
|
|
stderr(
|
|
|
|
'Not downloading files for user %s, run this script as user %s',
|
|
|
|
get_current_user(),
|
|
|
|
$conf['require-user']
|
|
|
|
);
|
|
|
|
exit(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-11 19:27:35 +00:00
|
|
|
$conferences = Conferences::getConferences();
|
|
|
|
|
|
|
|
if(isset($conf['MAX_CONFERENCE_AGE']))
|
2016-12-11 18:56:22 +00:00
|
|
|
{
|
2016-12-11 19:27:35 +00:00
|
|
|
$months = intval($conf['MAX_CONFERENCE_AGE']);
|
|
|
|
$conferencesAfter = new DateTime();
|
|
|
|
$conferencesAfter->sub(new DateInterval('P'.$months.'D'));
|
2016-12-11 18:56:22 +00:00
|
|
|
|
2016-12-11 20:17:30 +00:00
|
|
|
stdout('Skipping Conferences before %s', $conferencesAfter->format('Y-m-d'));
|
2016-12-11 19:27:35 +00:00
|
|
|
$conferences = array_filter($conferences, function($conference) use ($conferencesAfter) {
|
2016-12-11 20:17:30 +00:00
|
|
|
if($conference->isOpen())
|
|
|
|
{
|
|
|
|
stdout(
|
|
|
|
' %s: %s',
|
|
|
|
'---open---',
|
|
|
|
$conference->getSlug()
|
|
|
|
);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-12-11 19:27:35 +00:00
|
|
|
$isBefore = $conference->endsAt() < $conferencesAfter;
|
|
|
|
|
|
|
|
if($isBefore) {
|
|
|
|
stdout(
|
|
|
|
' %s: %s',
|
|
|
|
$conference->endsAt()->format('Y-m-d'),
|
|
|
|
$conference->getSlug()
|
|
|
|
);
|
|
|
|
}
|
2016-12-11 18:56:22 +00:00
|
|
|
|
2016-12-11 19:27:35 +00:00
|
|
|
return !$isBefore;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
stdout('');
|
|
|
|
foreach ($conferences as $conference)
|
|
|
|
{
|
|
|
|
stdout('== %s ==', $conference->getSlug());
|
2016-12-11 18:56:22 +00:00
|
|
|
}
|