External Sort: Sort large files similar to the UNIX sort command

Recommend this page to a friend!
  Info   Screenshots   View files (5)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 387 All time: 6,557 This week: 310
Version License PHP version Categories
external-sort 1.0.0Freely Distributable5Algorithms, PHP 5, Text processing, C...
Description Author

This class can sort large files similar to the UNIX sort command.

It can read the file to be sorted in small buckets associated to temporary files to not exceed the configured PHP memory limits.

The buckets are sorted individually and then merged to produce the final sorted output.

The class provides command line interface options so it can be executed as a command from a shell.

Innovation Award
PHP Programming Innovation award nominee
November 2011
Number 7
Sorting data is a relatively easy operation to implement in PHP using the many variants of PHP array sorting functions.

However, if you need to sort large amounts of data, that is not very easy, as it may exceed PHP configured memory limits.

This class implements an approach to sort large files similar to the Unix sort command.

It splits a file to be sorted in multiple chunks of limited size and then merges the sorted results into a final output file.

Manuel Lemos
Picture of Philipp Strazny
  Performance   Level  
Name: Philipp Strazny is available for providing paid consulting. Contact Philipp Strazny .
Classes: 5 packages by
Country: United States United States
Age: 53
All time rank: 1413195 in United States United States
Week rank: 246 20 in United States United States
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

Screenshots  
  • efficiency_comparison.png
  Files  
File Role Description
ExternalSort.php Class the external sorting application
ExternalSort_about.htm Doc. explanations, examples, performance
BucketCollectionTest.php Test unit tests for BucketCollection utility class
ExternalSortTest.php Test unit tests for ExternalSort
License Lic. Academic Free License

 Version Control Unique User Downloads Download Rankings  
 0%
Total:387
This week:0
All time:6,557
This week:310

For more information send a message to info at phpclasses dot org.