Skip to content

Commit

Permalink
docs: adding a documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nulxrd committed Feb 23, 2024
1 parent 1612f87 commit 1db6553
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/adapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Adapters

## APCu Adapter

The APCu adapter requires a APCu extension.

```php
$pool = new \Charon\Cache\Adapter\APCu\APCuAdapter(

);
```

## Array Adapter

The Array adapter is useful for testing purposes, as its data stored in memory.

```php
$pool = new \Charon\Cache\Adapter\Array\ArrayAdapter(

);
```
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# charon-cache

## Installation

```bash
composer require charonlab/charon-cache
```

## Support

- Sources available at [github](https://github.com/charonlab/charon-cache).
- Report a bug [here](https://github.com/charonlab/charon-cache/issues)
16 changes: 16 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Usage

This following example shows basic usage of the cache:
```php

$value = $cache->get('foobar', function (\Charon\Cache\CacheItemPool $item): string {
// The callback will be called only when the cache miss.
return 'cachepool';
});

// Output: 'cachepool'
echo $value;

// Clears the cache value.
$cache->delete('foobar');
```

0 comments on commit 1db6553

Please sign in to comment.