Download the PHP package geonative/garbage-collector without Composer
On this page you can find all versions of the php package geonative/garbage-collector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download geonative/garbage-collector
More information about geonative/garbage-collector
Files in geonative/garbage-collector
Package garbage-collector
Short Description Doctrine Entities garbage collector
License MIT
Informations about the package garbage-collector
Doctrine Garbage Collector
This package is a Symfony Bundle providing a "garbage collector" command to prune Doctrine entities that you consider stale.
Installation
PHP 8.1 or above is required.
Configuration
-
Add the bundle into your
config/bundles.php
(likely to be done automatically with Symfony Flex). -
Update your configuration:
-
Update your database schema:
- Implement
GeoNative\GarbageCollector\PrunableRepositoryInterface
on your repositories:getGarbageCollectorCheckInterval()
should return the minimum interval between checks, to avoid ruining your DB performancespruneStaleEntities()
should actually perform removals and return the number of entities which have been removed.
If your entities should be pruned against a DateTime column, you can use GeoNative\GarbageCollector\PruneStaleEntitiesTrait
to get started faster.
Usage
Oneshot
You can store this in a crontab to periodically cleanup your entities.
Daemonize
This command can also run in a loop and be daemonized with supervisord or systemctl.
The react/event-loop
package is required.
The Garbage Collector will pass every 5 seconds.
Lock
If your application runs on multiple hosts, you may want to prevent several instances
of the Garbage Collector from running simultaneously. To do so, just add a --lock
option:
Tests
License
MIT.
All versions of garbage-collector with dependencies
symfony/http-kernel Version ^6.4|^7.0
symfony/console Version ^6.4|^7.0
doctrine/doctrine-bundle Version ^2.5
doctrine/orm Version ^2.10
symfony/uid Version ^6.4|^7.0