2017 © Pedro Peláez
 

library php-excel

Old faster PHPExcel

image

slam/php-excel

Old faster PHPExcel

  • Monday, February 5, 2018
  • by Slam
  • Repository
  • 1 Watchers
  • 7 Stars
  • 3,877 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 20 Versions
  • 4 % Grown

The README.md

ABANDONED, use slam/openspout-helper

Slam PHPExcel old&faster

Latest Stable Version Downloads Integrate Code Coverage, (*1)

This package is NOT intended to be complete and flexible, but to be fast., (*2)

PHPOffice/PHPExcel and PHPOffice/PhpSpreadsheet are great libraries, but abstract everything in memory before writing to the disk. This is extremely inefficent and slow if you need to write a giant XLS with thousands rows and hundreds columns., (*3)

Based on Spreadsheet_Excel_Writer v0.9.3, which can be found active on Github. This is not a fork: I copied it and adapted to work with PHP 7.1 and applied some coding standard fixes and some Scrutinizer patches., (*4)

Installation

composer require slam/php-excel, (*5)

Usage

From version 4 the code is split in two parts:, (*6)

  1. Slam\Excel\Pear namespace, the original Pear code
  2. Slam\Excel\Helper namespace, an helper to apply a trivial style on a Table structure:
use Slam\Excel\Helper as ExcelHelper;

require __DIR__ . '/vendor/autoload.php';

// Being an Iterator, the data can be any dinamically generated content
// for example a PDOStatement set on unbuffered query
$users = new ArrayIterator([
    [
        'column_1' => 'John',
        'column_2' => '123.45',
        'column_3' => '2017-05-08',
    ],
    [
        'column_1' => 'Mary',
        'column_2' => '4321.09',
        'column_3' => '2018-05-08',
    ],
]);

$columnCollection = new ExcelHelper\ColumnCollection([
    new ExcelHelper\Column('column_1',  'User',     10,     new ExcelHelper\CellStyle\Text()),
    new ExcelHelper\Column('column_2',  'Amount',   15,     new ExcelHelper\CellStyle\Amount()),
    new ExcelHelper\Column('column_3',  'Date',     15,     new ExcelHelper\CellStyle\Date()),
]);

$filename = sprintf('%s/my_excel_%s.xls', __DIR__, uniqid());

$phpExcel = new ExcelHelper\TableWorkbook($filename);
$worksheet = $phpExcel->addWorksheet('My Users');

$table = new ExcelHelper\Table($worksheet, 0, 0, 'My Heading', $users);
$table->setColumnCollection($columnCollection);

$phpExcel->writeTable($table);
$phpExcel->close();

Result:, (*7)

Example, (*8)

The Versions

07/11 2017

v4.3.0

4.3.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Filippo Tessarotto

24/10 2017

v4.2.1

4.2.1.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

24/10 2017

v4.2.0

4.2.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

24/10 2017

v4.1.2

4.1.2.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

26/06 2017

v4.1.1

4.1.1.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

26/06 2017

v4.1.0

4.1.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

09/05 2017

v4.0.0

4.0.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

17/01 2017

v3.0.0

3.0.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Filippo Tessarotto

16/09 2016

v2.1.0

2.1.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream ^1.6

by Filippo Tessarotto

19/07 2016

v2.0.1

2.0.1.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream ^1.6

by Filippo Tessarotto

01/07 2016

v2.0.0

2.0.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream *

by Filippo Tessarotto

04/05 2015

v1.2.1

1.2.1.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream *

by Filippo Tessarotto

28/04 2015

v1.2.0

1.2.0.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream *

by Filippo Tessarotto

17/04 2015

v1.1.2

1.1.2.0

Old faster PHPExcel

  Sources   Download

MIT

The Development Requires

  • mikey179/vfsstream *

by Filippo Tessarotto

17/04 2015

v1.1.1

1.1.1.0

Old faster PHPExcel

  Sources   Download

MIT

by Filippo Tessarotto

16/04 2015

v1.1.0

1.1.0.0

Old faster PHPExcel

  Sources   Download

MIT

by Filippo Tessarotto

16/04 2015

v1.0.0

1.0.0.0

Old faster PHPExcel

  Sources   Download

MIT

by Filippo Tessarotto