spiral / snapshotter
Snapshot component with ability to view, delete and aggregate snapshots.
Installs: 2 490
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- nesbot/carbon: ^1.38
- spiral/framework: ^1.0.0
- spiral/vault: ^0.9.7
- vvval/spiral-array-paginable: ^0.1.0
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: ^6.0
- roave/security-advisories: dev-master
- spiral/ide-helper: ^0.9.2
README
Snapshots management module. Can store snapshot in database or in files, allows to view and easily manipulate them via vault panel.
Installation
composer require spiral/snapshotter
spiral register spiral/snapshotter
Include snapshots controller link into navigation menu like below (optional):
'snapshots' => [ 'title' => 'Snapshots', 'requires' => 'vault.snapshots' ],
Include SnapshotterBootloader
$this->getBootloader()->bootload([ \Spiral\Snapshotter\Bootloaders\SnapshotterBootloader::class ]);
Select one of provided handlers
Currently there are two supported handlers: FileHandler
and AggregationHandler
, choose onf of them and bind it:
$this->getBootloader()->bootload([ \Spiral\Snapshotter\Bootloaders\FileHandlerBootloader::class ]); //OR: $this->getBootloader()->bootload([ \Spiral\Snapshotter\Bootloaders\AggregationHandlerBootloader::class ]);
Then you can remove standard SnapshotInterface
binding (if included):
//$this->container->bind(SnapshotInterface::class, Snapshotter\Debug\AggregatedSnapshot::class);
File Handler
File handler stores snapshot files in runtime directory.
Aggregation Handler
Aggregation handler stores snapshots in database. Exception body is gzencoded
Suppression
Aggregation handler aggregates similar snapshot incidents groping them by snapshot teaser message, it allows you to easily manage snapshots if some of them occurred more than once. Aggregation handler supports suppression feature: it allows you to save space because new snapshot incidents will be stored with empty exception source. You will see all incidents, no reason to store all sources if you can find it in the last incident. If you want to store sources - just disable suppression.
After suppression is enabled, only new incidents will be involved, old ones will be kept untouched. Same for disabled suppression.
Define database connection.
Aggregation handler uses database, by default it is set as an alias to the default
database
#TODO-list
- Add charts/widgets
- Add listing dependency