mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 00:02:41 +01:00
b0a5f42244
Summary: Ref T988. This adds basics for the non-static publishing target: - Storage (called "Live", e.g. `DivinerLiveAtom` to distinguish it from shared classes like `DivinerAtom`). - Mostly populate the storage. - Some minor fixes and improvements. Test Plan: Generated docs, looked at DB, saw mostly-sensible output. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T988 Differential Revision: https://secure.phabricator.com/D5973
40 lines
920 B
PHP
40 lines
920 B
PHP
<?php
|
|
|
|
abstract class DivinerRenderer {
|
|
|
|
private $publisher;
|
|
private $atomStack = array();
|
|
|
|
public function setPublisher($publisher) {
|
|
$this->publisher = $publisher;
|
|
return $this;
|
|
}
|
|
|
|
public function getPublisher() {
|
|
return $this->publisher;
|
|
}
|
|
|
|
public function getConfig($key, $default = null) {
|
|
return $this->getPublisher()->getConfig($key, $default);
|
|
}
|
|
|
|
protected function pushAtomStack(DivinerAtom $atom) {
|
|
$this->atomStack[] = $atom;
|
|
return $this;
|
|
}
|
|
|
|
protected function peekAtomStack() {
|
|
return end($this->atomStack);
|
|
}
|
|
|
|
protected function popAtomStack() {
|
|
array_pop($this->atomStack);
|
|
return $this;
|
|
}
|
|
|
|
abstract public function renderAtom(DivinerAtom $atom);
|
|
abstract public function renderAtomSummary(DivinerAtom $atom);
|
|
abstract public function renderAtomIndex(array $refs);
|
|
abstract public function getHrefForAtomRef(DivinerAtomRef $ref);
|
|
|
|
}
|