PHPackages                             bnf/static-docroot - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. bnf/static-docroot

ActiveComposer-plugin[DevOps &amp; Deployment](/categories/devops)

bnf/static-docroot
==================

Composer plugin that ensures DOCUMENT\_ROOT is static and stable during one request, intended for symlink based deployments.

1.1.3(9y ago)12.6kMITPHPPHP &gt;=5.5.0

Since Mar 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/bnf/static-docroot)[ Packagist](https://packagist.org/packages/bnf/static-docroot)[ Docs](https://github.com/bnf/static-docroot)[ RSS](/packages/bnf-static-docroot/feed)WikiDiscussions master Synced 3d ago

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

Static DOCUMENT\_ROOT for symlink based deployments
===================================================

[](#static-document_root-for-symlink-based-deployments)

This package acts as composer plugin in order to automatically patch `$_SERVER['DOCUMENT_ROOT']` and `$_SERVER['SCRIPT_FILENAME']`to their realpath so that they do not contain symlinks. That is to ensure that they are static and stable. That means we want their destination to not change during one request. That would happen when they contain symlinks which may change during one request due to a deployment.

```
  composer require bnf/static-docroot

```

The behavior of this plugin can be influenced by configuration in the `extra`section of the root `composer.json`

```
  "extra": {
      "bnf/static-docroot": {
          "web-dir": "public"
      }
  }

```

#### `web-dir`

[](#web-dir)

You can specify a relative path from the base directory, where the public document root should be located.

*The default value* is derived from `extra|typo3/cms|web-dir` or if that is unset, `"web"` as last resort. That means if you have already configured the `typo3/cms` `web-dir`, you do not need to add the `bnf/static-docroot` section.

```
  "extra": {
      "typo3/cms": {
          "web-dir": "web"
      }
  }

```

Note for TYPO3 8.7: This package is not needed as of TYPO3 8.7 LTS.  fixed TYPO3 to base path calculations on `__DIR__` and thus does effectively the same as this package. You might still need this package if you have a (bad) extension that uses `$_SERVER['DOCUMENT_ROOT']` instead of `GeneralUtility::getIndpEnv()`.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3376d ago

### Community

Maintainers

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

---

Top Contributors

[![bnf](https://avatars.githubusercontent.com/u/473155?v=4)](https://github.com/bnf "bnf (9 commits)")

---

Tags

plugincomposersymlinkdocroot

### Embed Badge

![Health badge](/badges/bnf-static-docroot/health.svg)

```
[![Health](https://phpackages.com/badges/bnf-static-docroot/health.svg)](https://phpackages.com/packages/bnf-static-docroot)
```

###  Alternatives

[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

601175.5M2.3k](/packages/dealerdirect-phpcodesniffer-composer-installer)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k40.0M2.8k](/packages/ergebnis-composer-normalize)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

576.1M119](/packages/automattic-jetpack-autoloader)[laminas/laminas-component-installer

Composer plugin for injecting modules and configuration providers into application configuration

304.4M107](/packages/laminas-laminas-component-installer)[pyrech/composer-notifier

Display desktop notifications when composer finishes to install / update

411.7k](/packages/pyrech-composer-notifier)[enygma/composerclean

An additional command for Composer that removes configured files/directory

171.8k](/packages/enygma-composerclean)

PHPackages © 2026

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