MediaWiki  master
MediaWiki\Edit\SimpleParsoidOutputStash Class Reference
Inheritance diagram for MediaWiki\Edit\SimpleParsoidOutputStash:
Collaboration diagram for MediaWiki\Edit\SimpleParsoidOutputStash:

Public Member Functions

 __construct (BagOStuff $bagOfStuff, int $duration)
 
 get (ParsoidRenderId $renderId)
 This will decode the JSON data and create a page bundle from it if we have something in the stash that matches a given rendering or will just return an empty array if no entry in the stash. More...
 
 set (ParsoidRenderId $renderId, PageBundle $bundle)
 Before we stash, we serialize & encode into JSON the relevant parts of the data we need to construct a page bundle in the future. More...
 
- Public Member Functions inherited from MediaWiki\Edit\ParsoidOutputStash
 get (ParsoidRenderID $renderId)
 Retrieve a page bundle (that was previously put in the stash using the ->set() method) from the stash using a unique render ID. More...
 
 set (ParsoidRenderID $renderId, PageBundle $bundle)
 Stash a PageBundle representing a rendering of a revision at a given point in time. More...
 

Detailed Description

Since
1.39
Stability: unstable
since 1.39, should be stable before release.

Definition at line 15 of file SimpleParsoidOutputStash.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Edit\SimpleParsoidOutputStash::__construct ( BagOStuff  $bagOfStuff,
int  $duration 
)
Parameters
BagOStuff$bagOfStuffstorage backend
int$durationcache duration in seconds

Definition at line 28 of file SimpleParsoidOutputStash.php.

Member Function Documentation

◆ get()

MediaWiki\Edit\SimpleParsoidOutputStash::get ( ParsoidRenderId  $renderId)

This will decode the JSON data and create a page bundle from it if we have something in the stash that matches a given rendering or will just return an empty array if no entry in the stash.

Parameters
ParsoidRenderId$renderId
Returns
PageBundle|null

Definition at line 57 of file SimpleParsoidOutputStash.php.

References FormatJson\decode().

◆ set()

MediaWiki\Edit\SimpleParsoidOutputStash::set ( ParsoidRenderId  $renderId,
PageBundle  $bundle 
)

Before we stash, we serialize & encode into JSON the relevant parts of the data we need to construct a page bundle in the future.

Parameters
ParsoidRenderId$renderId
PageBundle$bundle
Returns
bool

Definition at line 42 of file SimpleParsoidOutputStash.php.

References FormatJson\encode().


The documentation for this class was generated from the following file: