Download the PHP package daika7ana/smallest-box without Composer

On this page you can find all versions of the php package daika7ana/smallest-box. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smallest-box

smallest-box

[![CI](https://github.com/daika7ana/smallest-box/actions/workflows/ci.yml/badge.svg)](https://github.com/daika7ana/smallest-box/actions/workflows/ci.yml) [![PHP 7.4+](https://img.shields.io/badge/PHP-7.4%2B-777BB4?style=flat-square&logo=php)](https://www.php.net/) [![PHPUnit](https://img.shields.io/badge/PHPUnit-9.x-0A7BBB?style=flat-square)](docs/testing.md) [![PHPStan](https://img.shields.io/badge/PHPStan-Level%208-blue?style=flat-square)](phpstan.neon) [![License](https://img.shields.io/badge/license-GPL--3.0--or--later-green?style=flat-square)](LICENSE) Calculate the smallest rectangular box that fits a set of rectangular items, using axis-aligned 3D bin packing with rotation support.

Zero dependencies, fully typed, three packing algorithms, and rotation-aware candidate generation.

Table of Contents

Features

Core Strengths

Perfect For

Requirements

Installation

Via Composer

Quick Start

Pass items directly

Build item list incrementally

Choose a packing algorithm

That's it! You've got the smallest box that fits all your items.

Packing Algorithms

Algorithm Efficiency Speed Best For
ALGO_GUILLOTINE (default) ~65% Fast Uniform items, speed-critical
ALGO_EXTREMEPOINT ~75% Medium Balanced efficiency and speed
ALGO_MAXRECTS ~100% Slower Diverse items, best fit

How It Works

  1. Sort items by multiple heuristics (volume, dimensions, footprint).
  2. Generate candidate box dimensions from item dimension permutations and sums.
  3. Test each candidate with the selected packing algorithm and all six rotations.
  4. Return the smallest box that successfully fits all items.

Custom Sort & Pack Orders

Fine-tune packing behaviour for your specific use case:

Custom orders are tried after the built-in ones. Both methods support fluent chaining.

Testing

Run Static Analysis

PHPStan is configured via phpstan.neon and analyses the src/ directory.

Run Code Style Checks

Run Full Test Suite

Run The Same Checks As CI

Available Composer scripts:

Documentation

Guide Purpose
📖 Usage & Examples Working examples and patterns
🔧 Installation Detailed setup instructions
📋 API Reference Complete class and method reference
⚙️ Algorithm Details How the packing algorithms work

Made with ❤️ **Questions?** [Check the docs](docs/usage.md) or [open an issue](../../issues)

All versions of smallest-box with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daika7ana/smallest-box contains the following files

Loading the files please wait ...