Skip to content

Commit

Permalink
Modify readme again
Browse files Browse the repository at this point in the history
  • Loading branch information
rcastera committed Feb 21, 2012
1 parent ab330b7 commit e7ed450
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions README.md
Expand Up @@ -8,34 +8,33 @@ Abstraction to the APC Library.

Examples
-----------
`// Include the class.
require('Class.ApcCache.php');`
//Include the class.
require('Class.ApcCache.php');

`// Create a new object with properties.
$object = new stdClass;
$object->name = 'Richard';
$object->age = 30;`
// Create a new object with properties.
$object = new stdClass;
$object->name = 'Richard';
$object->age = 30;

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

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

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

// Output information currently in cache.
print_r(Apc::cacheInfo());
// Output information currently in cache.
print_r(Apc::cacheInfo());

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

// Delete all cache.
Apc::cacheClear();
`
// Delete all cache.
Apc::cacheClear();


Contributing
Expand Down

0 comments on commit e7ed450

Please sign in to comment.