PHPackages                             saminyaser/boxpackerlite - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. saminyaser/boxpackerlite

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

saminyaser/boxpackerlite
========================

An implementation of the 3D (actually 4D) bin packing/knapsack problem (aka creating parcels by putting items into boxes)

v1.0.3(2mo ago)07↓50%MITPHPPHP ^7.4

Since Feb 1Pushed 2mo agoCompare

[ Source](https://github.com/SaminYaser-work/BoxPackerLite)[ Packagist](https://packagist.org/packages/saminyaser/boxpackerlite)[ Docs](https://yaser.com.bd/)[ RSS](/packages/saminyaser-boxpackerlite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

BoxPackerLite
=============

[](#boxpackerlite)

BoxPackerLite is a compact PHP library for solving the "4D" bin packing/knapsack problem (3D dimensions plus weight). Given a list of items and available box sizes, it determines how many boxes are required and how items should be packed while respecting physical dimensions and weight limits.

This is especially useful for e-commerce and logistics workflows, such as selecting the right parcel sizes for shipping rates or estimating the number of labels to print.

Requirements
------------

[](#requirements)

- **PHP 7.4 or higher**
- ext-json

The library is designed to work seamlessly in **WordPress environments** (5.6+) and includes built-in WordPress detection and logging integration through `error_log()`.

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

[](#installation)

```
composer require saminyaser/boxpackerlite
```

Features
--------

[](#features)

- 3D bin packing algorithm with weight constraints
- Automatic box rotation and item orientation optimization
- Support for items that must be kept flat
- Weight redistribution across multiple boxes
- Layer stability calculation
- Custom sorting strategies for boxes and items
- WordPress-compatible logging
- Zero external dependencies (except ext-json)
- PHP 7.4+ typed properties and modern syntax

Credit
------

[](#credit)

This project is based on the original BoxPacker library by Doug Wright (dvdoug/boxpacker). This lite version removes tests, docs, and logging dependencies to keep the package minimal while preserving core packing behavior.

License
-------

[](#license)

BoxPackerLite is MIT-licensed.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance86

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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

Every ~10 days

Total

4

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e60e5e4ccd83e5026085f9c1e85b4bcf19e75320b7686d84c88eac51f54bcc9c?d=identicon)[SaminYaser-work](/maintainers/SaminYaser-work)

---

Top Contributors

[![SaminYaser-work](https://avatars.githubusercontent.com/u/40205522?v=4)](https://github.com/SaminYaser-work "SaminYaser-work (6 commits)")

---

Tags

containerboxshippingpackagingknapsackboxespackingbinpackingbin packingboxpackingparcelparcelpacking

### Embed Badge

![Health badge](/badges/saminyaser-boxpackerlite/health.svg)

```
[![Health](https://phpackages.com/badges/saminyaser-boxpackerlite/health.svg)](https://phpackages.com/packages/saminyaser-boxpackerlite)
```

###  Alternatives

[dvdoug/boxpacker

An implementation of the 3D (actually 4D) bin packing/knapsack problem (aka creating parcels by putting items into boxes)

6522.7M18](/packages/dvdoug-boxpacker)[psr/container

Common Container Interface (PHP FIG PSR-11)

10.0k1.0B3.7k](/packages/psr-container)[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[league/container

A fast and intuitive dependency injection container.

86787.8M343](/packages/league-container)[league/tactician-container

Tactician integration for any container implementing PSR-11

7710.1M23](/packages/league-tactician-container)

PHPackages © 2026

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