PHPackages                             inkime/phpspreadsheetcache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. inkime/phpspreadsheetcache

ActiveLibrary[File &amp; Storage](/categories/file-storage)

inkime/phpspreadsheetcache
==========================

a cache component of PhpSpreadsheet

1.5(5y ago)117MITPHPPHP &gt;=5.5

Since Apr 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/inkime/PhpSpreadsheetCache)[ Packagist](https://packagist.org/packages/inkime/phpspreadsheetcache)[ RSS](/packages/inkime-phpspreadsheetcache/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)DependenciesVersions (7)Used By (0)

PhpSpreadsheetCache
===================

[](#phpspreadsheetcache)

a cache component of PhpSpreadsheet

PhpSpreadsheet 在工作表中平均每个单元格使用约 1k，因此大型工作簿可以迅速用尽可用内存。

单元缓存提供了一种机制，该机制允许 PhpSpreadsheet 在较小的内存或非内存（例如，在磁盘上，APCu，内存缓存或 Redis、Memcache 中）中维护单元对象。

这使您可以减少大型工作簿的内存使用量，尽管以访问单元数据的速度为代价。

自定义缓存必须先引入 psr/simple-cache:^1.0 包并实现 Psr\\SimpleCache\\CacheInterface 接口

获取更多信息，请参考[PhpSpreadsheet官方文档](https://phpspreadsheet.readthedocs.io/en/stable/)

#### PhpSpreadsheetCache 提供了自定义缓存组件的实现

[](#phpspreadsheetcache-提供了自定义缓存组件的实现)

Composer安装：

> composer require inkime/phpspreadsheetcache

使用示例：

```
$reader = IOFactory::createReader('Csv');
$reader->setReadDataOnly(true);
$config = [
    'type' => 'Redis', // 或者File
    'host' => '127.0.0.1',
    'port' => 6379,
    'password' => '123456',
    'select' => '1',
    'path' => Yii::getAlias('@runtime/spreadsheet'), // 文件缓存路径
];
Settings::setCache(Cache::init($config));
foreach ($arr as $val) {
    $spreadSheet = $reader->load(Yii::getAlias('@runtime/a.csv'));
    $workSheet = $spreadSheet->getActiveSheet();
    // 释放内存
    $workSheet->disconnectCells();
    // 清理缓存
    // Cache::clear();
    // your code
}

```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

1896d ago

PHP version history (2 changes)1.0PHP ^5.5

1.1PHP &gt;=5.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82217056?v=4)[卡卡](/maintainers/inkime)[@inkime](https://github.com/inkime)

---

Top Contributors

[![inkime](https://avatars.githubusercontent.com/u/82217056?v=4)](https://github.com/inkime "inkime (1 commits)")[![jyncode](https://avatars.githubusercontent.com/u/21254283?v=4)](https://github.com/jyncode "jyncode (1 commits)")

---

Tags

phpspreadsheet

### Embed Badge

![Health badge](/badges/inkime-phpspreadsheetcache/health.svg)

```
[![Health](https://phpackages.com/badges/inkime-phpspreadsheetcache/health.svg)](https://phpackages.com/packages/inkime-phpspreadsheetcache)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
