PHPackages                             rcastera/apc - 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. [Caching](/categories/caching)
4. /
5. rcastera/apc

ActiveLibrary[Caching](/categories/caching)

rcastera/apc
============

APC Cache

v1.0.0(12y ago)6323MITPHPPHP &gt;=5.3.0

Since Sep 21Pushed 12y ago2 watchersCompare

[ Source](https://github.com/rcastera/APC-Cache-Class)[ Packagist](https://packagist.org/packages/rcastera/apc)[ Docs](http://www.richardcastera.com)[ RSS](/packages/rcastera-apc/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

ApcCache
========

[](#apccache)

The Alternative PHP Cache ([APC](http://www.php.net/manual/en/book.apc.php)) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code. This class is in simple form, an Abstraction to the APC Library.

Setup
-----

[](#setup)

Add a `composer.json` file to your project:

```
{
  "require": {
      "rcastera/apc": "v1.0.0"
  }
}
```

Then provided you have [composer](http://getcomposer.org) installed, you can run the following command:

```
$ composer.phar install
```

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library

```
require 'vendor/autoload.php';
```

Then you need to `use` the relevant class, for example:

```
use rcastera\Apc\ApcCache;
```

Example
-------

[](#example)

```
require 'vendor/autoload.php';

use rcastera\Apc\ApcCache;

// Create a new object with properties to store in cache.
$object = new stdClass;
$object->name = 'Richard';
$object->age = 30;

// Store the object in cache.
ApcCache::store('rich', $object, 3600);

// Now check if it exists and fetch it.
if (ApcCache::exists('rich')) {
    $person = ApcCache::fetch('rich');
}

// Output the name property value.
echo $person->name;

// Delete this specific key in cache.
ApcCache::delete('rich');

// Delete all cache.
ApcCache::clear();
```

Contributing
------------

[](#contributing)

1. Fork it.
2. Create a branch (`git checkout -b my_branch`)
3. Commit your changes (`git commit -am "Added something"`)
4. Push to the branch (`git push origin my_branch`)
5. Create an \[Issue\]\[1\] with a link to your branch
6. Enjoy a refreshing Coke and wait

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4665d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/212232?v=4)[Richard Castera](/maintainers/rcastera)[@rcastera](https://github.com/rcastera)

---

Top Contributors

[![rcastera](https://avatars.githubusercontent.com/u/212232?v=4)](https://github.com/rcastera "rcastera (17 commits)")

---

Tags

cacheapc

### Embed Badge

![Health badge](/badges/rcastera-apc/health.svg)

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

###  Alternatives

[tedivm/stash

The place to keep your cache.

9614.9M126](/packages/tedivm-stash)[tedivm/stash-bundle

Incorporates the Stash caching library into Symfony.

841.4M16](/packages/tedivm-stash-bundle)[sabre/cache

Simple cache abstraction layer implementing PSR-16

551.3M5](/packages/sabre-cache)[ihor/cachalot

Cache a lot in a proper way (APC, XCache, Memcached, Redis, Couchbase)

2528.3k](/packages/ihor-cachalot)

PHPackages © 2026

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