Skip to content

Commit

Permalink
docs: optimize cached feed reader documentation
Browse files Browse the repository at this point in the history
- replaced dead links from example with github release notes
- imported laminas-feed `Reader` class

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
  • Loading branch information
boesing committed Jul 11, 2021
1 parent 1208e17 commit 1a9caf6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/book/pattern/class-cache.md
Expand Up @@ -41,22 +41,22 @@ Option | Data Type | Default Value | Description
```php
use Laminas\Cache\Pattern\ClassCache;
use Laminas\Cache\Pattern\PatternOptions;
use \Laminas\Feed\Reader\Reader;

$cachedFeedReader = new ClassCache(
$storage,
new PatternOptions([
'class' => \Laminas\Feed\Reader\Reader::class,
'class' => Reader::class,

// The feed reader doesn't output anything,
// so the output doesn't need to be caught and cached:
'cache_output' => false,
])
);

$feed = $cachedFeedReader->call("import", array('http://www.planet-php.net/rdf/'));

// OR
$feed = $cachedFeedReader->import('http://www.planet-php.net/rdf/');
$feed = $cachedFeedReader->call("import", ['https://github.com/laminas/laminas-cache/releases.atom']);
// or
$feed = $cachedFeedReader->import('https://github.com/laminas/laminas-cache/releases.atom');
```

## Available Methods
Expand Down

0 comments on commit 1a9caf6

Please sign in to comment.