Enterprise-grade batch processing for PHP 8.4+.
Lemric BatchProcessing is a framework-agnostic library for building robust, restartable, observable batch jobs in PHP. Compliance with PSR standards and the idiomatic PHP style.
- Production-ready β atomic per-chunk transactions, full restart semantics, durable metadata.
- Framework-agnostic β works standalone, with optional bridges for Symfony 6.4/7+ and Laravel 11+/12+.
- Standards-first β PSR-3 logger, PSR-6/16 cache, PSR-11 container, PSR-14 events.
- Modern PHP β readonly classes, enums, attributes, typed properties, strict types.
composer require lemric/batch-processingRequires PHP 8.4 or higher.
use Lemric\BatchProcessing\BatchProcessing;
use Lemric\BatchProcessing\Domain\JobParameters;
use Lemric\BatchProcessing\Item\Reader\IteratorItemReader;
use Lemric\BatchProcessing\Testing\InMemoryItemWriter;
$env = BatchProcessing::inMemoryEnvironment();
$reader = new IteratorItemReader(range(1, 1000));
$writer = new InMemoryItemWriter();
$step = $env->stepBuilderFactory->get('demoStep')
->chunk(100, $reader, null, $writer)
->build();
$job = $env->jobBuilderFactory->get('demoJob')->start($step)->build();
$execution = $env->launcher->run($job, JobParameters::of(['run.id' => 1]));
echo $execution->getStatus()->value; // COMPLETEDFull documentation lives in the docs/ directory:
- Getting Started β installation, quick start, architecture.
- Core Concepts β domain model, jobs, steps, chunks.
- Reading & Writing β readers, processors, writers.
- Error Handling β retry, skip, exceptions.
- Infrastructure β repository, transactions, events.
- Advanced β partitioning, flow jobs, scopes, restart.
- Framework Integration β Symfony & Laravel.
- Reference β configuration, PSR, testing, performance.
Clone the repository and install dependencies:
git clone https://github.com/Lemric/BatchProcessing.git
cd BatchProcessing
composer installRun the test suite:
composer testRun static analysis and code style fixes:
composer stan- Issues: GitHub Issues
- Security: Security Policy
- Discussions: GitHub Discussions
This project is developed by Lemric and is available under a dual licensing model:
| Use case | Allowed | Cost |
|---|---|---|
| Open Source project | β | Free |
| Personal non-commercial use | β | Free |
| Commercial / SaaS / enterprise | β | Paid license required |
| Closed-source project | β | Paid license required |
For commercial licensing inquiries, contact: dominik@labudzinski.com
See the LICENSE file for full terms.
- Dominik Labudzinski β dominik@labudzinski.com β labudzinski.com
- Lemric β lemric.com