Created
January 9, 2020 08:22
-
-
Save pniederlag/ee0470ff06be2416e942a12bf93890cd to your computer and use it in GitHub Desktop.
TYPO3 http-trigger for scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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