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 3w 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 26% 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

3803d 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

[symfony/runtime

Enables decoupling PHP applications from global state

74794.9M939](/packages/symfony-runtime)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k40.0M2.6k](/packages/ergebnis-composer-normalize)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52923.6M1.0k](/packages/bamarni-composer-bin-plugin)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M526](/packages/drupal-core-composer-scaffold)[mnsami/composer-custom-directory-installer

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

1415.3M59](/packages/mnsami-composer-custom-directory-installer)[dg/composer-cleaner

Victor The Cleaner: removes unnecessary files from vendor directory.

1361.6M30](/packages/dg-composer-cleaner)

PHPackages © 2026

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