PHPackages                             waughj/directory - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. waughj/directory

ActiveLibraryt[File &amp; Storage](/categories/file-storage)

waughj/directory
================

Simple class for encapsulating file directory object.

0.3.1(7y ago)01.4k5GPL-2.0-or-laterPHPPHP &gt;=7.0

Since Nov 26Pushed 7y agoCompare

[ Source](https://github.com/waughjai/directory)[ Packagist](https://packagist.org/packages/waughj/directory)[ RSS](/packages/waughj-directory/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (5)

Directory
=========

[](#directory)

Simple class for encapsulating file directory object.

Pass its constructor an array representing a chain o' folders or a string &amp; it will form a consistent directory object that can be used by other code without having to manually mess round with directory inconsistencies.

It also has methods for adding directories, getting the parent directory, or getting the local directory.

Is immutable. Methods that "change" instance, like "addDirectory", return new directory.

When getting or printing a string version o' a directory, you can pass a hash map o' options to the functions:

- "divider": Determines the divider 'tween subdirectories. Defaults to "/".
- "starting-slash": Boolean that determines whether there should be a leading divider or not. Defaults to true.
- "ending-slash": Boolean that determines whether there should be an ending divider or not. Defaults to true.

Example
-------

[](#example)

```
use WaughJ\Directory\Directory;

$directory = new Directory([ 'C:', 'Program Files', 'Directory Test' ]);
$directory->print([ 'divider' => '\\', 'starting-slash' => false, 'ending-slash' => false ]);

```

This will print "C:\\Program Files\\Directory Test".

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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 ~54 days

Total

4

Last Release

2564d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11161078?v=4)[waughj](/maintainers/waughj)[@waughj](https://github.com/waughj)

---

Tags

filedirectory

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waughj-directory/health.svg)

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

###  Alternatives

[adlawson/vfs

Virtual file system

300433.0k21](/packages/adlawson-vfs)[crysalead/dir

Recursive directory scanner to locate directories and/or files in a file system

13214.5k4](/packages/crysalead-dir)[icecave/temptation

Painless temporary files and directories that clean up after themselves.

129.3k2](/packages/icecave-temptation)

PHPackages © 2026

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