Skip to content

Instantly share code, notes, and snippets.

@pniederlag
Created January 9, 2020 08:22
Show Gist options
  • Save pniederlag/ee0470ff06be2416e942a12bf93890cd to your computer and use it in GitHub Desktop.
Save pniederlag/ee0470ff06be2416e942a12bf93890cd to your computer and use it in GitHub Desktop.
TYPO3 http-trigger for scheduler
<?php
/*
*
* http trigger script for TYPO3 Scheduler
*
*
**/
// first check proper token
if ( !is_array($_POST) || !isset($_POST['token']) || $_POST['token'] !== 'XXXMAGICSECRETXXXX' ) {
header("HTTP/1.0 403 Forbidden");
exit(99);
}
set_time_limit(100000); //Just to make sure
$output=[];
$status=0;
chdir(__DIR__ . '/..'); // @todo: adapt to where your root directory is
exec('./vendor/bin/typo3cms scheduler:run', $output, $status);
if ($status === 0) {
echo "Successful";
} else {
header("HTTP/1.0 503 Service Unavailable");
echo "Failure running scheduler";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment