Skip to content

Instantly share code, notes, and snippets.

@isalmanhaider
Last active June 26, 2024 10:36
Show Gist options
  • Save isalmanhaider/70ae4652626b8ef7310fbada8571054a to your computer and use it in GitHub Desktop.
Save isalmanhaider/70ae4652626b8ef7310fbada8571054a to your computer and use it in GitHub Desktop.
batch process using cron - elysia cron in Drupal
<?php
// Example of setting up a batch process in Drupal that runs programmatically without user intervention
// Define batch operations and other batch settings as required: $batch
batch_set($batch); // Initialize and register the batch with Drupal's batch processing system.
drupal_alter('batch', $batch); // Allow other modules to alter the batch settings before it runs.
$batch = &batch_get(); // Retrieve a reference to the current batch array for direct manipulation.
$batch['progressive'] = FALSE; // Set the batch to run non-progressively, suitable for automated processes.
batch_process(); // Start processing the batch without expecting a user-driven progression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment