Download the PHP package onlyphp/codeigniter3-csvimporter without Composer
On this page you can find all versions of the php package onlyphp/codeigniter3-csvimporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onlyphp/codeigniter3-csvimporter
More information about onlyphp/codeigniter3-csvimporter
Files in onlyphp/codeigniter3-csvimporter
Package codeigniter3-csvimporter
Short Description A robust CSV importer library for CodeIgniter 3 with background processing support, progress tracking, and detailed statistics. Perfect for handling large CSV files without timeouts or memory issues.
License MIT
Informations about the package codeigniter3-csvimporter
CodeIgniter 3 CSV Importer 📊
A robust CSV importer library for CodeIgniter 3 with background processing support, progress tracking, and detailed statistics. Perfect for handling large CSV files without timeouts or memory issues.
⚠️ 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
- 🚀 Background processing support with OS-specific optimizations
- 📊 Real-time progress tracking
- 📈 Detailed statistics (inserts/updates/errors)
- ⚠️ Comprehensive error handling
- 💻 Shared hosting compatible & Cross-platform compatible (Windows & Linux)
- ⏰ No cron job required
- 🛠️ Customizable processing logic
- 🔄 Memory-efficient chunk processing
- ⚡ Configurable processing parameters
- 📝 Skip empty rows automatically
- 🔍 Detailed error tracking
- 🖥️ Smart CPU load management
- 🔄 Automatic process recovery
- 🛡️ Process locking mechanism
🔧 System Requirements
- PHP 8.0 or higher
- CodeIgniter 3.x
proc_open
andproc_close
PHP functions enabledMySQL
database- Write permissions for temporary directory
- For Linux:
mpstat
command available for CPU monitoring - For Windows:
wmic
command available for CPU monitoring
📦 Installation
Install via Composer:
📝 Usage
Basic Usage
Advanced Configuration
Configuration Options
Method | Description | Default |
---|---|---|
setMemoryLimit() |
Set PHP memory limit for processing | '1G' |
setDelimiter() |
Set CSV delimiter character | ',' |
setEnclosure() |
Set CSV enclosure character | '"' |
setEscape() |
Set CSV escape character | '\' |
setChunkSize() |
Set number of rows to process in each chunk | 1000 |
setRecordUpdateInterval() |
Set database update interval (min 100) | 200 |
setSkipHeader() |
Set whether to skip the header row | true |
Process Control
Status Response Format
Frontend Integration Example
📊 Status Codes Reference
Code | Status | Description |
---|---|---|
1 | Pending | Job created, waiting to start |
2 | Processing | Currently processing the file |
3 | Completed | Processing finished successfully |
4 | Failed | Processing encountered an error |
⚙️ Callback Response Format
The callback function should return an array with the following structure:
🔒 Process Management Features
CPU Load Management
The system automatically monitors server CPU load and manages processes accordingly:
- Delays process start if CPU load is above 90%
- Continuously monitors load during processing
- Platform-specific CPU monitoring (Linux uses
mpstat
, Windows useswmic
)
Process Recovery
- Automatic cleanup of orphaned processes
- Lock file management to prevent duplicate processing
- Graceful handling of interrupted processes
Memory Management
- Chunk-based processing to control memory usage
- Configurable memory limits
- Automatic garbage collection
- Database connection management to prevent leaks
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📄 License
The MIT License (MIT). Please see License File for more information.
💖 Support
If you find this library helpful, please consider giving it a star on GitHub!