Files
boost-tasks/cron-super-project
Daniel James bc29af3f9e Only use the log file for the cron jobs.
Really need to work on the logging, but it works well enough for now.
2015-10-10 12:31:53 +01:00

30 lines
883 B
PHP
Executable File

#!/usr/bin/php
<?php
require_once(__DIR__.'/vendor/autoload.php');
CommandLineOptions::cron_job();
// Quick and dirty check if the configuration has changed since last run.
$settings = \Nette\Neon\Neon::encode(EvilGlobals::safe_settings(), \Nette\Neon\Neon::BLOCK);
$record = R::findOne('variable', 'name = "settings"');
if (!$record || $settings !== $record->value) {
echo "Configuration updated:\n\n{$settings}";
if (!$record) {
$record = R::dispense('variable');
$record->name = 'settings';
}
$record->value = $settings;
$record->updated_on = R::isoDateTime();
R::store($record);
$history = R::dispense('history');
$history->name = $record->name;
$history->value = $record->value;
$history->updated_on = $record->updated_on;
R::store($history);
}
GitHubEventQueue::downloadEvents();
SuperProject::updateBranches();