PHPackages                             brettt89/silverstripe-garbage-collector - 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. [Database &amp; ORM](/categories/database)
4. /
5. brettt89/silverstripe-garbage-collector

ActiveLibrary[Database &amp; ORM](/categories/database)

brettt89/silverstripe-garbage-collector
=======================================

SilverStripe Garbage Collector module

2.0.1(1y ago)109.6k↓47.5%10[2 issues](https://github.com/brettt89/silverstripe-garbage-collector/issues)[1 PRs](https://github.com/brettt89/silverstripe-garbage-collector/pulls)MITPHPPHP ~8.0CI passing

Since Jul 27Pushed 6mo ago5 watchersCompare

[ Source](https://github.com/brettt89/silverstripe-garbage-collector)[ Packagist](https://packagist.org/packages/brettt89/silverstripe-garbage-collector)[ RSS](/packages/brettt89-silverstripe-garbage-collector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Silverstripe Garbage Collection Module
======================================

[](#silverstripe-garbage-collection-module)

[![PHPUnit](https://github.com/brettt89/silverstripe-garbage-collector/actions/workflows/php.yml/badge.svg)](https://github.com/brettt89/silverstripe-garbage-collector/actions/workflows/php.yml) [![codecov](https://camo.githubusercontent.com/ca5d050a0dab28ef32f9ec4d64a3e852c7730b971077d20a20f5add34a66df5f/68747470733a2f2f636f6465636f762e696f2f67682f62726574747438392f73696c7665727374726970652d676172626167652d636f6c6c6563746f722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d464545454a5038333737)](https://codecov.io/gh/brettt89/silverstripe-garbage-collector)

Overview
--------

[](#overview)

Silverstripe module for defining and processing garbage collection on Silverstripe applications.

Installation
------------

[](#installation)

```
composer require brettt89/silverstripe-garbage-collector

```

Basic Usage
-----------

[](#basic-usage)

The example below shows how you can enable and configure the VersionedCollector and ChangeSetCollector for your application.

```
---
Name: GarbageCollectors
---
SilverStripe\GarbageCollector\Collectors\VersionedCollector:
  # Increase Versioned keep limit to 10 records
  keep_limit: 10
  # Define base classes to collect versions for
  base_classes:
    - SilverStripe\CMS\Model\SiteTree

SilverStripe\GarbageCollector\Collectors\ChangeSetCollector:
  # Reduce ChangeSet lifetime to 10 days
  deletion_lifetime: 10

# Register collectors with service
SilverStripe\GarbageCollector\GarbageCollectorService:
  collectors:
    - 'SilverStripe\GarbageCollector\Collectors\VersionedCollector'
    - 'SilverStripe\GarbageCollector\Collectors\ChangeSetCollector'

# Queue a RecurringAllGarbageCollectorJob if there isn't one already. It will then re-queue itself to run once a day.
Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor:
  extensions:
    - 'SilverStripe\GarbageCollector\Extensions\QueuedJobDescriptorExtension'
```

The example setup will create a job that runs all garbage collectors every day after running dev build. It does this by calling `GarbageCollectorService::inst()->process();`.

You may also decide to do this with some other process (BuildTask with Crontab that calls `GarbageCollectorService::inst()->process();`)

Documentation
-------------

[](#documentation)

Garbage Collection is based on the idea of removal/processing of records and items that may not have native garbage collection. This should be extendable to work with any type of data set as long as there are corresponding processors.

### Components

[](#components)

- [Collectors](./docs/en/Collectors.md)
- [Processors](./docs/en/Processors.md)
- [Garbage Collector Service](./docs/en/Garbage-Collector-Service.md)

### Guides

[](#guides)

- [Advanced Usage](./docs/en/Advanced-Usage.md)

Reporting Issues
----------------

[](#reporting-issues)

Please [create an issue](https://github.com/brettt89/silverstripe-garbage-collector/issues) for any bugs you've found, or features you're missing.

License
-------

[](#license)

This module is released under the [MIT License](LICENSE)

Credits
-------

[](#credits)

This project is made possible by the community surrounding it and especially the wonderful people and projects listed in this document.

### Contributors

[](#contributors)

- Brett Tasker ()
- Mojmir Fendek ()

### Libraries

[](#libraries)

- [silverstripe/framework](https://github.com/silverstripe/silverstripe-framework)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance49

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~282 days

Total

6

Last Release

613d ago

Major Versions

1.3.0 → 2.0.02024-07-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d7967367c3797eb0077efe95964c746af01a64a5a7f34c9551a0bc57e5092f8?d=identicon)[brettt89](/maintainers/brettt89)

---

Top Contributors

[![brettt89](https://avatars.githubusercontent.com/u/4122344?v=4)](https://github.com/brettt89 "brettt89 (34 commits)")[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (13 commits)")[![michalkleiner](https://avatars.githubusercontent.com/u/233342?v=4)](https://github.com/michalkleiner "michalkleiner (10 commits)")[![edwilde](https://avatars.githubusercontent.com/u/415374?v=4)](https://github.com/edwilde "edwilde (8 commits)")[![jamesLiAKQA](https://avatars.githubusercontent.com/u/87284202?v=4)](https://github.com/jamesLiAKQA "jamesLiAKQA (5 commits)")[![mfendeksilverstripe](https://avatars.githubusercontent.com/u/26395487?v=4)](https://github.com/mfendeksilverstripe "mfendeksilverstripe (1 commits)")[![3Dgoo](https://avatars.githubusercontent.com/u/2616373?v=4)](https://github.com/3Dgoo "3Dgoo (1 commits)")[![elliot-sawyer](https://avatars.githubusercontent.com/u/354793?v=4)](https://github.com/elliot-sawyer "elliot-sawyer (1 commits)")

---

Tags

databaseversionssilverstripeversioningcollectorgarbageobsoletepruningstalepruner

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/brettt89-silverstripe-garbage-collector/health.svg)

```
[![Health](https://phpackages.com/badges/brettt89-silverstripe-garbage-collector/health.svg)](https://phpackages.com/packages/brettt89-silverstripe-garbage-collector)
```

###  Alternatives

[silverstripe/postgresql

SilverStripe now has tentative support for PostgreSQL ('Postgres')

16258.1k2](/packages/silverstripe-postgresql)[silverstripe/mssql

Adds MSSQL support to SilverStripe

157.8k1](/packages/silverstripe-mssql)

PHPackages © 2026

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