2017 © Pedro Peláez
 

library apc

APC Cache

image

rcastera/apc

APC Cache

  • Saturday, September 21, 2013
  • by rcastera
  • Repository
  • 2 Watchers
  • 7 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ApcCache

The Alternative PHP Cache (APC) 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., (*1)

Setup

Add a composer.json file to your project:, (*2)

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

Then provided you have composer installed, you can run the following command:, (*3)

$ 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, (*4)

require 'vendor/autoload.php';

Then you need to use the relevant class, for example:, (*5)

use rcastera\Apc\ApcCache;

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

  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

The Versions

21/09 2013

dev-master

9999999-dev http://www.richardcastera.com

APC Cache

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-apc *

 

by Richard Castera

cache apc

21/09 2013

v1.0.0

1.0.0.0 http://www.richardcastera.com

APC Cache

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-apc *

 

by Richard Castera

cache apc