MNB PHPExcelDeveloper Guide

Database + XLSX · Large files

Database + XLSX large files examples.

Package-local, copy-ready examples organized like the classes and methods reference. Open one example at a time, search by method, and jump from the right-side index.

Packagemnb/mnb-phpexcel-database-xlsx:^2.0Reference2 examples · 1 methods
Database + XLSX individual library

Large files examples with copy-ready, production-minded PHP.

Every snippet uses mnb/mnb-phpexcel-database-xlsx or its declared Core dependency. Each copied snippet includes strict typing, a concise summary, implementation guidance, readable limits, and a safe fixture check.

2
examples
1
documented methods
Example 01

Resume an interrupted XLSX database import

Open related guide
LargeExcelDatabaseImportEngine::importToSql()
resume-an-interrupted-xlsx-database-import.php
<?php

declare(strict_types=1);

/*
Summary:
    Persist a manifest and resume from the last committed source row.

Implementation note:
    Keep the source file unchanged while its manifest is active and use a database unique constraint
    to make replay safe.
*/

use Mnb\PHPExcel\Large\LargeExcelDatabaseImportEngine;

$result = (new LargeExcelDatabaseImportEngine())->importToSql(
    __DIR__ . '/orders.xlsx',
    $pdo,
    'orders',
    [
        'sheet' => 'Orders',
        'chunk_size' => 2_000,
        'batch_size' => 500,
        'manifest_path' => __DIR__ . '/storage/orders-import.json',
        'resume' => true,
        'duplicate_strategy' => 'update',
        'unique_by' => ['order_id'],
    ]
);