PHPackages                             asper/replacer - 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. asper/replacer

ActiveCakephp-plugin

asper/replacer
==============

CakePHP output string replacement

19PHP

Since Dec 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/asper/Replacer)[ Packagist](https://packagist.org/packages/asper/replacer)[ RSS](/packages/asper-replacer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Replacer
========

[](#replacer)

Provides a simple graphical interface to replace strings in CakePHP's output using regular expressions.

Possible usages :

- Format text (ex : m2 =&gt; m², mysql =&gt; MySQL, cAkePHp =&gt; CakePHP...)
- Add code to every page (&lt;/body&gt; =&gt; &lt;script&gt;analytics();&lt;/script&gt;&lt;/body&gt;)
- Add a CDN to remote assets (src="js/script.js" =&gt; src="")...
- ...

Setup
-----

[](#setup)

1. Clone repository :

    $ cd /my/app/root &amp;&amp; git clone git://github.com/asper/Replacer.git Plugin/Replacer
2. Load plugin in `app/Config/bootstrap.php` :

    CakePlugin::load(array( 'Replacer' =&gt; array( 'routes' =&gt; true ) ));
3. Create schema :

    $ cd /my/app/root &amp;&amp; cake schema create Replacer.replacer
4. Open `app/webroot/index.php` and search for (l. 96 for CakePHP 2.1) :

    $Dispatcher-&gt;dispatch(new CakeRequest(), new CakeResponse(array('charset' =&gt; Configure::read('App.encoding'))));
5. Replace this line with :

    App::import('Lib', 'Replacer.ReplacerResponse'); $Dispatcher-&gt;dispatch(new CakeRequest(), new ReplacerResponse(array('charset' =&gt; Configure::read('App.encoding'))));
6. Enable `admin` routing prefix by uncommenting `Configure::write('Routing.prefixes', array('admin'));` in `app/Config/core.php`
7. Navigate to `http://my-app/admin/replacer` and start configuring the plugin

Usage
-----

[](#usage)

Replacer Plugin is composed of 2 main sections `Replacements` and `Scopes`

`Replacements` let you substitute strings in output using regular expressions

`Scopes` let you choose where these substitutions should occur

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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.

### Community

Maintainers

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

---

Top Contributors

[![13i](https://avatars.githubusercontent.com/u/1174353?v=4)](https://github.com/13i "13i (8 commits)")[![asper](https://avatars.githubusercontent.com/u/251397?v=4)](https://github.com/asper "asper (6 commits)")

### Embed Badge

![Health badge](/badges/asper-replacer/health.svg)

```
[![Health](https://phpackages.com/badges/asper-replacer/health.svg)](https://phpackages.com/packages/asper-replacer)
```

PHPackages © 2026

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