PHPackages                             bmack/composer-projectcontext - 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. bmack/composer-projectcontext

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

bmack/composer-projectcontext
=============================

Versatile lightweight package to detect a composers' root path.

0.1.1(10y ago)024MITPHPPHP &gt;=5.5.0

Since Jan 31Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bmack/composer-project-context-plugin)[ Packagist](https://packagist.org/packages/bmack/composer-projectcontext)[ Docs](http://www.b13.de/)[ RSS](/packages/bmack-composer-projectcontext/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

composer-project-context-plugin
===============================

[](#composer-project-context-plugin)

A composer plugin to provide an API to access the Composer's root path and thus, access to composer.json

What does it do?
----------------

[](#what-does-it-do)

The plugin adds a constant BMACK\_PROJECTROOT which contains the path to the root path of the project installed via composer.

An API class is used for accessing the constant, and is actually there so it can be enriched in your own application.

Why?
----

[](#why)

In the TYPO3 project, we want to work with the composer.json file to detect certain special parameters. However, this is not possible to detect from the vendor directory during runtime of your PHP application where your project root directory is.

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

[](#installation)

Just require the package to your composer project:

```
composer require bmack/composer-projectcontext

```

Usage
-----

[](#usage)

You have then the constant BMACK\_PROJECTROOT in your project when including the autoload file

License
-------

[](#license)

MIT. Free for everyone, you can even make money off of it.

Author
------

[](#author)

Benni Mack  starting in 2016.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

2

Last Release

3848d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/165630?v=4)[Benni Mack](/maintainers/bmack)[@bmack](https://github.com/bmack)

---

Top Contributors

[![bmack](https://avatars.githubusercontent.com/u/165630?v=4)](https://github.com/bmack "bmack (7 commits)")

---

Tags

composerproject root

### Embed Badge

![Health badge](/badges/bmack-composer-projectcontext/health.svg)

```
[![Health](https://phpackages.com/badges/bmack-composer-projectcontext/health.svg)](https://phpackages.com/packages/bmack-composer-projectcontext)
```

###  Alternatives

[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5346.5M599](/packages/drupal-core-composer-scaffold)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k43.3M3.3k](/packages/ergebnis-composer-normalize)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

566.3M164](/packages/automattic-jetpack-autoloader)[drupal/core-project-message

Adds a message after Composer installation.

2125.4M213](/packages/drupal-core-project-message)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1435.5M65](/packages/mnsami-composer-custom-directory-installer)[typo3/class-alias-loader

Amends the composer class loader to support class aliases to provide backwards compatibility for packages

4415.0M30](/packages/typo3-class-alias-loader)

PHPackages © 2026

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