Changeset View
Changeset View
Standalone View
Standalone View
src/applications/console/core/DarkConsoleCore.php
<?php | <?php | ||||
final class DarkConsoleCore extends Phobject { | final class DarkConsoleCore extends Phobject { | ||||
private $plugins = array(); | private $plugins = array(); | ||||
const STORAGE_VERSION = 1; | const STORAGE_VERSION = 1; | ||||
public function __construct() { | public function __construct() { | ||||
$symbols = id(new PhutilSymbolLoader()) | $this->plugins = id(new PhutilClassMapQuery()) | ||||
->setType('class') | |||||
->setAncestorClass('DarkConsolePlugin') | ->setAncestorClass('DarkConsolePlugin') | ||||
->selectAndLoadSymbols(); | ->execute(); | ||||
foreach ($symbols as $symbol) { | foreach ($this->plugins as $plugin) { | ||||
epriestley: It looks like no plugins actually use this, so we could potentially just remove it and avoid… | |||||
$plugin = newv($symbol['name'], array()); | |||||
if (!$plugin->shouldStartup()) { | |||||
continue; | |||||
} | |||||
$plugin->setConsoleCore($this); | $plugin->setConsoleCore($this); | ||||
$plugin->didStartup(); | $plugin->didStartup(); | ||||
$this->plugins[$symbol['name']] = $plugin; | |||||
} | } | ||||
} | } | ||||
public function getPlugins() { | public function getPlugins() { | ||||
return $this->plugins; | return $this->plugins; | ||||
} | } | ||||
public function getKey(AphrontRequest $request) { | public function getKey(AphrontRequest $request) { | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |
It looks like no plugins actually use this, so we could potentially just remove it and avoid the question of whether this is cacheable between requests or not.