PHPackages                             slabphp/bundle-stack - 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. slabphp/bundle-stack

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

slabphp/bundle-stack
====================

SlabPHP Bundle Stack Management Library

v0.1.8(8y ago)0621Apache-2.0PHP

Since Feb 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SlabPHP/bundle-stack)[ Packagist](https://packagist.org/packages/slabphp/bundle-stack)[ Docs](https://www.salernolabs.com/slab)[ RSS](/packages/slabphp-bundle-stack/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (10)Used By (1)

SlabPHP Bundle Stack Library
============================

[](#slabphp-bundle-stack-library)

This library maintains a stack of SlabPHP bundles and allows a form of polymorphism within the framework while also managing what SlabPHP calls cascading file resource directories.

Please see the main SlabPHP documentation for more information about SlabPHP and the reason why these libraries exist.

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

[](#installation)

Use composer to include the package

```
composer require slabphp/bundle-stack

```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

Make sure your SlabPHP bundle configuration object exists. SlabPHP has one built-in for it's default Bundle. That's the one you should use as the first one but of course it's not required if you're for some reason using this library not within a SlabPHP context.

```
$stack = new \Slab\Bundle\Stack();

```

Then you can push bundle configuration objects for any other bundle you've created.

```
$stack
    ->pushBundle(new \SlabPHP\Configuration())
    ->pushBundle(new \My\Shared\Namespace\Configuration())
    ->pushBundle(new \My\Site\Configuration());

```

SlabPHP offers the ability to push your final bundle configuration by using dynamic means, such as a server\_name. This logic is not handled in this library.

### Finding a Class

[](#finding-a-class)

You can now use your bundle stack to locate appropriate classes. For example, if you have a second-tier shared bundle, you could make it query the bundle stack using the findClass or findClassName methods.

For example, lets assume your bundle stack looks like the following:

- Slab - default bottom bundle
- Shared - your shared bundle
- Example - your example.com site bundle

You have already created Bundle configuration objects for them and build a $this-&gt;stack object.

To continue with this example, assume you have a \\Shared\\Controllers\\Article class. Inside of this class you do the following:

```
$object = $this->stack->findClass('Utilities\Calendar');

```

The stack object will look for \\Example\\Utilities\\Calendar first, if it exists, it will use it, otherwise it will check for \\Shared\\Utilities\\Calendar, and finally it will check for \\Slab\\Utilities\\Calendar before either returning a found class instance or null. Alternatively you can just use findClassName if you just want a string representation of the name. This functionality relies on the presence of a previously configured autoloader (hopefully psr4) to be present.

### Cache

[](#cache)

Everything gets stored in a local thread-only memory cache. This will optimize repeated look-ups within the same request but has to be rebuilt every request. If you find this is an issue, consider forking.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

9

Last Release

3000d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/155974?v=4)[Eric Salerno](/maintainers/ericsalerno)[@ericsalerno](https://github.com/ericsalerno)

---

Top Contributors

[![ericsalerno](https://avatars.githubusercontent.com/u/155974?v=4)](https://github.com/ericsalerno "ericsalerno (5 commits)")

---

Tags

phpslabslabphpbundle stack

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slabphp-bundle-stack/health.svg)

```
[![Health](https://phpackages.com/badges/slabphp-bundle-stack/health.svg)](https://phpackages.com/packages/slabphp-bundle-stack)
```

###  Alternatives

[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)

PHPackages © 2026

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