Download the PHP package onlyphp/codeigniter3-housekeeping without Composer
On this page you can find all versions of the php package onlyphp/codeigniter3-housekeeping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onlyphp/codeigniter3-housekeeping
More information about onlyphp/codeigniter3-housekeeping
Files in onlyphp/codeigniter3-housekeeping
Package codeigniter3-housekeeping
Short Description A powerful and flexible database archiving solution for CodeIgniter 3 applications. This package helps you manage database growth by providing tools to archive and purge data while maintaining data integrity.
License MIT
Informations about the package codeigniter3-housekeeping
🗄️ CodeIgniter 3 Database Archiver
A powerful and flexible database archiving solution for CodeIgniter 3 applications. This package helps you manage database growth by providing tools to archive and purge data while maintaining data integrity.
⚠️ Warning
DO NOT USE THIS PACKAGE IN PRODUCTION
This package is under active development and may contain critical bugs. It is primarily intended for personal use and testing. The current version has not undergone rigorous testing and may be unstable.
🚀 Features
- ✨ Backup and purge operations with transaction support
- 🔄 Parallel processing support for faster execution
- 📊 Progress tracking and integrity verification
- 📝 Detailed logging with customizable paths
- 🎯 Chunk-based processing to manage memory usage
- 🛡️ Support for unique constraints
- 🔌 Multiple database driver support (MySQL, Oracle)
- 🔍 Real-time progress monitoring
- 📈 Performance optimization options
💻 Requirements
- PHP >= 7.4
- CodeIgniter 3.x
- MySQL 5.7+ or Oracle 11g+
- PHP PCNTL extension (for parallel processing)
- Composer
📦 Installation
Via Composer
Manual Installation
- Download the package
- Extract to your application/libraries folder
- Add to your autoload.php:
🎓 Basic Concepts
Operation Modes
- Backup Only (BO): Only copies data to archive table
- Purge Only (PO): Only deletes data from source table
- Backup & Purge (BP): Copies data then deletes from source
Processing Methods
- Sequential: Single-threaded processing
- Parallel: Multi-threaded processing (Unix/Linux only)
🎯 Usage Examples
Example 1: Basic Backup Operation
Archive records older than 6 months from the 'orders' table:
Example 2: Backup and Purge with Unique Constraints
Archive and delete completed orders while ensuring no duplicate order numbers:
Example 3: Parallel Processing with Custom Archive Table
Archive large datasets using parallel processing:
Example 4: Oracle Database with Debug Mode
Archive data from an Oracle database with debug logging:
Example 5: Purge-Only Operation with Memory Management
Delete old log entries without backing them up:
Example 6: Interactive Archiving Process with Progress Monitoring
This example shows a complete archiving process with real-time progress monitoring and verification:
⚙️ Configuration Options
| Method | Description |
|---|---|
driver(string) |
Set database driver ('mysql' or 'oci') |
backupFrom(string) |
Set source table name |
backupTo(string) |
Set custom archive table name |
primaryKey(string) |
Set primary key column |
condition(string) |
Set WHERE clause for record selection |
mode(string) |
Set operation mode ('BO', 'PO', or 'BP') |
chunk(int) |
Set chunk size (100-50000) |
parallel(int) |
Set number of parallel threads (1-16) |
uniqueColumns(array) |
Set columns that should be unique in archive |
sqlHint(string) |
Set SQL optimization hint |
logPath(string) |
Set custom log file path |
onDebug() |
Enable debug mode |
🔍 Monitoring and Verification
The package provides methods to monitor and verify the archiving process:
⚠️ Important Notes
- Always backup your database before running archiving operations
- Test the archiving process on a subset of data first
- Monitor system resources during parallel processing
- Consider database load and peak hours when scheduling archiving tasks
- Verify archive integrity after completion
📄 License
The MIT License (MIT). Please see License File for more information.