PHPackages                             fishingboy/external\_sort - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fishingboy/external\_sort

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fishingboy/external\_sort
=========================

external sort PHP library

1.0.1(1mo ago)027MITPHPPHP &gt;=7.4.0CI passing

Since May 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/fishingboy/ExternalSort)[ Packagist](https://packagist.org/packages/fishingboy/external_sort)[ RSS](/packages/fishingboy-external-sort/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

ExternalSort - PHP External Sort
================================

[](#externalsort---php-external-sort)

[![Tests](https://github.com/fishingboy/ExternalSort/actions/workflows/ci.yml/badge.svg)](https://github.com/fishingboy/ExternalSort/actions)[![Packagist Version](https://camo.githubusercontent.com/853919ae8533ac3e981bc7b27d70bb168588f005edac287ff8ea9d1b75af8729/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66697368696e67626f792f65787465726e616c5f736f72742e737667)](https://packagist.org/packages/fishingboy/external_sort)[![Downloads](https://camo.githubusercontent.com/63e18d0991b35b09682d307321b85f8ed587cdc5748db8fe5fef9378247edb01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66697368696e67626f792f65787465726e616c5f736f72742e7376673f6c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/fishingboy/external_sort)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

[繁體中文](README-zh.md) | **English**

A PHP library for external merge sort — designed for datasets too large to sort in memory. You can set a `block_size` limit: data within the limit is sorted in memory, while larger datasets are split into sorted temporary files and merged via a k-way merge.

Available on Packagist for installation via Composer.

Installation
------------

[](#installation)

```
composer require fishingboy/external_sort
```

Or add it manually to `composer.json`:

```
{
    "require": {
        "fishingboy/external_sort": "dev-master"
    }
}
```

Usage
-----

[](#usage)

```
use fishingboy\external_sort\External_sort;

$sorter = new External_sort([
    'block_size'  => 1000,       // max rows buffered in memory before flushing to a temp file
    'result_file' => 'out.txt',  // output path for the final sorted result
    'data_type'   => 'number',   // 'number' (int cast) or 'text' (string trim)
]);

$sorter->add_data($value);  // accepts a single value or an array; call repeatedly
$sorter->create_result();   // performs k-way merge and writes to result_file
```

License
-------

[](#license)

This project is licensed under the [MIT License](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance92

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45bf9bc379ef669c12d4f474f48d65b40cc371652e668ec213954817a048309d?d=identicon)[fishingboy](/maintainers/fishingboy)

---

Top Contributors

[![fishingboy](https://avatars.githubusercontent.com/u/4921524?v=4)](https://github.com/fishingboy "fishingboy (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fishingboy-external-sort/health.svg)

```
[![Health](https://phpackages.com/badges/fishingboy-external-sort/health.svg)](https://phpackages.com/packages/fishingboy-external-sort)
```

###  Alternatives

[robinvdvleuten/ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

4604.0M31](/packages/robinvdvleuten-ulid)[mpratt/embera

Oembed consumer library. Converts urls into their html embed code. Supports 150+ sites, such as Youtube, Twitter, vimeo, Instagram etc.

3636.0M27](/packages/mpratt-embera)[platformsh/config-reader

Small helper to access Platform.sh environment variables

235.4M28](/packages/platformsh-config-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
