PHPackages                             kevbaldwyn/css-path-rewrite - 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. kevbaldwyn/css-path-rewrite

ActiveLibrary

kevbaldwyn/css-path-rewrite
===========================

Rewrite paths in css files, includes a filter for Assetic

0.1.3(11y ago)01.5k1PHPPHP &gt;=5.3.3

Since Dec 19Pushed 11y agoCompare

[ Source](https://github.com/kevbaldwyn/css-path-rewrite)[ Packagist](https://packagist.org/packages/kevbaldwyn/css-path-rewrite)[ RSS](/packages/kevbaldwyn-css-path-rewrite/feed)WikiDiscussions master Synced 1mo ago

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

css-path-rewrite
================

[](#css-path-rewrite)

Rewrite paths in css files to things like images from local to remote (or anything else). Currently only handles "root relative" url paths, ie urls that start with `/`.

\##Installation With Composer

```
"require": {
    ...
    "kevbaldwyn/css-path-rewrite":"0.*"
    ...
}

```

Composer Update:

```
$ composer update kevbaldwyn/css-path-rewrite

```

\##Usage To simply rewrite urls in a css file:

```
$cssFileContent = file_get_contents('/path/to/my/file.css');
$writer = new KevBaldwyn\CssPathRewrite\Rewriter($cssFileContent, 'http://www.example.com');
$output = $writer->rewrite();
file_put_contents('/path/to/my/file.css', $output);

```

Or if using assetic simply include in your filters array:

```
$css = new AssetCollection(array(
    new FileAsset('/path/to/src/styles.less', array(new LessFilter())),
    new GlobAsset('/path/to/css/*'),
), array(
    new KevBaldwyn\CssPathRewrite\Assetic\Filter('http://www.example.com'),
));

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~10 days

Total

4

Last Release

4127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/493d83b3d613f5d449f08b101e742fa85a28a272ab9cf0a73ca778464ad47a7b?d=identicon)[kevbaldwyn](/maintainers/kevbaldwyn)

---

Top Contributors

[![kevbaldwyn](https://avatars.githubusercontent.com/u/2512883?v=4)](https://github.com/kevbaldwyn "kevbaldwyn (8 commits)")[![leeparsons](https://avatars.githubusercontent.com/u/555669?v=4)](https://github.com/leeparsons "leeparsons (1 commits)")

---

Tags

csscompressionasseticassetsminificationrewrite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kevbaldwyn-css-path-rewrite/health.svg)

```
[![Health](https://phpackages.com/badges/kevbaldwyn-css-path-rewrite/health.svg)](https://phpackages.com/packages/kevbaldwyn-css-path-rewrite)
```

###  Alternatives

[kriswallsmith/assetic

Asset Management for PHP

3.7k48.9M160](/packages/kriswallsmith-assetic)[assetic/framework

Asset Management for PHP

1001.4M20](/packages/assetic-framework)[widmogrod/zf2-assetic-module

Zend Framework 2 module that provides complete integration of Assetic library

144348.5k8](/packages/widmogrod-zf2-assetic-module)[mmanos/laravel-casset

An asset management package for Laravel 4.

112.6k](/packages/mmanos-laravel-casset)[ju1ius/webpack-assets-bundle

Integrates Webpack into Symfony2

1461.8k](/packages/ju1ius-webpack-assets-bundle)[konstantin-kuklin/assetic-static-gzip-bundle

Provide static gzip compression for css,js files via AsseticBundle

149.2k1](/packages/konstantin-kuklin-assetic-static-gzip-bundle)

PHPackages © 2026

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