Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/workflow/DivinerGenerateWorkflow.php
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | private function generateBook($book, PhutilArgumentParser $args) { | ||||
// documentation generator, which can compare the graph hashes to a list | // documentation generator, which can compare the graph hashes to a list | ||||
// of already-generated graph hashes and easily assess which documents need | // of already-generated graph hashes and easily assess which documents need | ||||
// to be regenerated and which can be deleted. | // to be regenerated and which can be deleted. | ||||
$this->buildAtomCache(); | $this->buildAtomCache(); | ||||
$this->buildGraphCache(); | $this->buildGraphCache(); | ||||
$publisher_class = $args->getArg('publisher'); | $publisher_class = $args->getArg('publisher'); | ||||
$symbols = id(new PhutilSymbolLoader()) | $symbols = id(new PhutilSymbolLoader()) | ||||
->setName($publisher_class) | ->setName($publisher_class) | ||||
->setConcreteOnly(true) | ->setConcreteOnly(true) | ||||
->setAncestorClass('DivinerPublisher') | ->setAncestorClass('DivinerPublisher') | ||||
->selectAndLoadSymbols(); | ->selectAndLoadSymbols(); | ||||
epriestley: Definitely incomplete / not correct. | |||||
if (!$symbols) { | if (!$symbols) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
"Publisher class '%s' must be a concrete subclass of %s.", | "Publisher class '%s' must be a concrete subclass of %s.", | ||||
$publisher_class, | $publisher_class, | ||||
'DivinerPublisher')); | 'DivinerPublisher')); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | /* -( Atom Cache )--------------------------------------------------------- */ | ||||
* Get a global version number, which changes whenever any atom or atomizer | * Get a global version number, which changes whenever any atom or atomizer | ||||
* implementation changes in a way which is not backward-compatible. | * implementation changes in a way which is not backward-compatible. | ||||
*/ | */ | ||||
private function getDivinerAtomWorldVersion() { | private function getDivinerAtomWorldVersion() { | ||||
$version = array(); | $version = array(); | ||||
$version['atom'] = DivinerAtom::getAtomSerializationVersion(); | $version['atom'] = DivinerAtom::getAtomSerializationVersion(); | ||||
$version['rules'] = $this->getRules(); | $version['rules'] = $this->getRules(); | ||||
$atomizers = id(new PhutilSymbolLoader()) | $atomizers = id(new PhutilClassMapQuery()) | ||||
->setAncestorClass('DivinerAtomizer') | ->setAncestorClass('DivinerAtomizer') | ||||
->setConcreteOnly(true) | ->execute(); | ||||
->selectAndLoadSymbols(); | |||||
$atomizer_versions = array(); | $atomizer_versions = array(); | ||||
foreach ($atomizers as $atomizer) { | foreach ($atomizers as $atomizer) { | ||||
$atomizer_versions[$atomizer['name']] = call_user_func( | $atomizer_versions[$atomizer['name']] = call_user_func( | ||||
array( | array( | ||||
$atomizer['name'], | $atomizer['name'], | ||||
'getAtomizerVersion', | 'getAtomizerVersion', | ||||
)); | )); | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |
Definitely incomplete / not correct.