pekkis/directory-calculator

Directory calculation library

v2.0.0 2018-08-17 11:30 UTC

README

A library for calculating directories for objects (files)

Use case

One shall not put too many files (or sub directories) in one directory. Classic problem.

This library calculates more or less safe directories for objects identifiable by something (id, uuid, etc).

Quickstart

<?php

use Pekkis\DirectoryCalculator\DirectoryCalculator;
use Pekkis\DirectoryCalculator\Strategy\UniversalLeveledStrategy;

$calculator = new DirectoryCalculator(new UniversalLeveledStrategy());

$directory = $calculator->calculateDirectory($someObjectImplementingRequiredInterface);