technicalkumargaurav/file-reader
Composer 安装命令:
composer require technicalkumargaurav/file-reader
包简介
A PHP application to read and process Excel, CSV, PDF files.
README 文档
README
A lightweight PHP library for reading PDF, Excel, and CSV files through a single unified API.
Features
- Read CSV files
- Read Excel files (
.xls,.xlsx) - Read PDF files
- Unified response format
- Framework independent
- PSR-4 autoloading
- Compatible with Core PHP, Laravel, and CodeIgniter
Requirements
- PHP 8.1+
- Composer
Installation
composer require technicalkumargaurav/file-reader
Usage
require 'vendor/autoload.php'; use Kumar\FileReader\Reader; $reader = new Reader(); $result = $reader->read('sample.csv'); print_r($result);
CSV Example
$result = $reader->read('sample.csv');
Response:
[
'success' => true,
'type' => 'csv',
'filename' => 'sample.csv',
'meta' => [
'rows' => 3,
'columns' => 3
],
'data' => [...]
]
Excel Example
$result = $reader->read('sample.xlsx');
Response:
[
'success' => true,
'type' => 'excel',
'filename' => 'sample.xlsx',
'meta' => [
'rows' => 100,
'columns' => 8,
'sheet' => 'Sheet1'
],
'data' => [...]
]
PDF Example
$result = $reader->read('sample.pdf');
Response:
[
'success' => true,
'type' => 'pdf',
'filename' => 'sample.pdf',
'meta' => [
'characters' => 6225
],
'data' => [
'content' => 'PDF content...'
]
]
Supported File Types
| Extension | Supported |
|---|---|
| csv | Yes |
| xls | Yes |
| xlsx | Yes |
| Yes |
Project Structure
src/
├── Drivers/
│ ├── CsvReader.php
│ ├── ExcelReader.php
│ └── PdfReader.php
│
├── Exceptions/
│ └── UnsupportedFileException.php
│
├── Helpers/
│ └── ResponseFormatter.php
│
└── Reader.php
Roadmap
v1.0.0
- CSV Reader
- Excel Reader
- PDF Reader
- Unified Response Format
v1.1.0
- File Metadata
- JSON Export
- File Validation
v2.0.0
- Laravel Integration
- CodeIgniter Integration
- DOCX Support
- Streaming Support
License
MIT License
Author
Kumar Gaurav
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2026-06-16