/** * Gets called when the script is exiting. * Sends out all sync records. */ public static function exiting() { // Use all of the course records foreach (self::$coursesToSync as $course) { // Sync the course $course->perform_sync(); } self::$coursesToSync = array(); }