7use MediaWiki\Parser\Parsoid\PageBundleJsonTrait;
9use Wikimedia\Parsoid\Core\PageBundle;
16 use PageBundleJsonTrait;
29 $this->bagOfStuff = $bagOfStuff;
30 $this->duration = $duration;
42 public function set( ParsoidRenderId $renderId, PageBundle $bundle ): bool {
43 $pageBundleJson =
FormatJson::encode( $this->jsonSerializePageBundle( $bundle ) );
45 return $this->bagOfStuff->set( $renderId->getKey(), $pageBundleJson, $this->duration );
57 public function get( ParsoidRenderId $renderId ): ?PageBundle {
59 $this->bagOfStuff->get( $renderId->getKey() ),
62 $pageBundle = $this->newPageBundleFromJson( $pageBundleArray );
64 return $pageBundle ?:
null;
Class representing a cache/ephemeral data store.