Download the PHP package glueful/archive without Composer
On this page you can find all versions of the php package glueful/archive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download glueful/archive
More information about glueful/archive
Files in glueful/archive
Package archive
Short Description Data-lifecycle archiving for Glueful (table archiving, retention, compression, restore).
License MIT
Homepage https://github.com/glueful/archive
Informations about the package archive
Archive Extension for Glueful
Overview
Archive adds data-lifecycle archiving to your Glueful application: move aged rows out of operational tables into compressed (optionally encrypted) archive files, keep a searchable index of what was archived, and restore archived rows back into a table when you need them again.
It is a self-contained product — there is no core seam to bind. Installing the
extension ships its own schema (registry, search index, table-stats), a
ArchiveService for programmatic use, and an archive:manage CLI for
operational tasks. The schema is config-gated: migrations only register when
you explicitly opt in via ARCHIVE_DATABASE_SCHEMA (→ archive.enabled).
Features
- Table archiving: export rows older than a cutoff date, compress (gzip/bzip2) and optionally encrypt (AES-256-GCM), checksum, register, then delete the originals — all guarded by verification before the source rows are removed
- Restore: replay archived rows back into a target table inside a single
transaction, with
skip/overwriteconflict resolution and offset/limit slicing - Search: query across compressed archives by user, endpoint, action, IP, and date range, backed by a per-archive search index built at archive time
- Verification & integrity: SHA-256 checksums with on-demand
verifyArchive()and mandatory restore-time checksum verification - Table growth tracking: record row counts / sizes per table and surface which tables exceed configured row/age thresholds and need archiving
archive:manageCLI:archive,status,search,verify,health,cleanup,auto, andtrackactions for day-to-day operations- Config-gated schema: ships its own migrations, registered only when
ARCHIVE_DATABASE_SCHEMAis enabled — zero footprint until you opt in - Dedicated storage disk: archives are written to a private local disk rooted at the configured storage path
Installation
Installation (Recommended)
Install via Composer
Composer discovers packages of type glueful-extension, but installing does not auto-enable them — the provider must be added to config/extensions.php's enabled allow-list. The CLI does that for you:
In production, manage the enabled list in config and run php glueful extensions:cache in your deploy step.
This extension ships migrations, but the schema is config-gated. Set the opt-in flag, then run the migrations:
The migrations only register when archive.enabled (ARCHIVE_DATABASE_SCHEMA) is
true, so nothing is created until you opt in.
Local Development Installation
To develop the extension locally, register it as a Composer path repository in your app's composer.json, then require and enable it:
Entries in config/extensions.php are plain string FQCNs (no ::class) — prefer extensions:enable over editing by hand.
Verify Installation
Post-install checklist:
- Opt into the schema: set
ARCHIVE_DATABASE_SCHEMA=true, thenphp glueful migrate:run - Rebuild cache after Composer operations:
php glueful extensions:cache - Confirm the CLI is registered:
php glueful archive:manage status
Configuration
Configuration is loaded from the extension's config/archive.php and merged under
the archive key by the service provider. It reads ARCHIVE_* environment
variables. Key settings:
config/archive.php also defines retention_policies (per-table archive age /
row thresholds for audit_logs, api_metrics, api_metrics_daily,
api_rate_limits, and notifications), allowed_tables, denied_tables,
monitoring (health-check and alerting thresholds), schedule, and backup
sections — see the file for the full set of ARCHIVE_* overrides. Identity and
system tables such as users, auth_sessions, api_keys, and archive metadata
tables are denied by default.
Usage
CLI
The archive:manage command is the operational entry point. Its first argument
is the action (default status):
Useful options: --uuid, --user, --endpoint, --start-date, --end-date,
--limit, --format (table|json|csv), --dry-run, --force, and
--show-sensitive. Search output redacts sensitive fields by default; use
--show-sensitive only in a trusted operator session.
Archive files are compressed plaintext unless ARCHIVE_ENCRYPTION_KEY is set.
Keep the archive storage path outside the web root, restrict filesystem access,
and set a 32-byte key for tables that may contain PII or regulated data.
Programmatic (ArchiveService)
Resolve the service from the container via its interface:
Schema
When enabled, the extension creates three tables:
archive_registry— one row per archive (table, period, record count, file path, size, checksum, status, metadata)archive_search_index— per-archive index of searchable entity values (FK toarchive_registry, cascade on delete)archive_table_stats— per-table growth tracking and archive thresholds
Requirements
- PHP 8.3 or higher
- Glueful 1.52.0 or higher
- MySQL, PostgreSQL, or SQLite database
ext-opensslfor archive encryption (optional, whenARCHIVE_ENCRYPTION_KEYis set)
License
MIT — licensed consistently with the Glueful framework.
Support
For issues, feature requests, or questions, please create an issue in the repository.