PHPackages                             maxserv/composer-application-context - 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. maxserv/composer-application-context

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

maxserv/composer-application-context
====================================

1.0.2(6y ago)0264PHPCI failing

Since Feb 29Pushed 6y ago3 watchersCompare

[ Source](https://github.com/MaxServ/composer-application-context)[ Packagist](https://packagist.org/packages/maxserv/composer-application-context)[ RSS](/packages/maxserv-composer-application-context/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Application Context Composer plugin
===================================

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

This plugin sets some additional environment variables by patching entry files like *index.php*. In environments where FCGI variables can not be set this plugin patches a list of defined PHP files to bootstrap with the proper `putenv` calls to lete the application "think" it's running in a certain environment.

```
"extra": {
  "application-context": {
    "paths": [
      "index.php"
    ],
    "variables": {
      "APPLICATION_CONTEXT": "%env(APPLICATION_CONTEXT)%"
    }
  }
}

```

Variables that should be set and thus included in the generated snippet can be configured in *composer.json* under *extra*. Files that should be patched can also be configured here.

A snippet like the one below is added to the top each file.

```
// Prefixed by MaxServ\ComposerApplicationContext\Plugin
call_user_func(function(){
if (function_exists('getenv') !== false && function_exists('putenv') !== false){
if ('%env(APPLICATION_CONTEXT)%' !== '' && stripos('%env(APPLICATION_CONTEXT)%', '%env(') === false) {
  if (getenv('APPLICATION_CONTEXT') === false){putenv('APPLICATION_CONTEXT=%env(APPLICATION_CONTEXT)%');}
  if ($_SERVER['APPLICATION_CONTEXT'] === null){$_SERVER['APPLICATION_CONTEXT'] = '%env(APPLICATION_CONTEXT)%';}
}
}
});

```

At runtime the variable (that is possibly replaced by another script) is evaluated before invoking `getenv` and `putenv`.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

2264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3856e66c656dd19ba00019fc7ac9013466d569cda8ad35ad79ec6176de3efd6?d=identicon)[arnoschoon](/maintainers/arnoschoon)

---

Top Contributors

[![arnoschoon](https://avatars.githubusercontent.com/u/4816186?v=4)](https://github.com/arnoschoon "arnoschoon (3 commits)")

### Embed Badge

![Health badge](/badges/maxserv-composer-application-context/health.svg)

```
[![Health](https://phpackages.com/badges/maxserv-composer-application-context/health.svg)](https://phpackages.com/packages/maxserv-composer-application-context)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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