resourceManager = new ResourceManager(); $this->pluginManager = new PluginManager(); $this->environment = Environment::createFromDirectory(null, true); if ($this->environment) { $this->environment->loadEnvironment(); $this->add(new Commands\DevCommand()); $this->add(new Commands\RunCommand()); $this->add(new Commands\ResourcesCommand()); $this->add(new Commands\ReplCommand()); $this->add(new Commands\PipeCommand()); $this->get("list")->setHidden(true); $this->get("completion")->setHidden(true); $this->get("help")->setHidden(true); if (getenv("SPARK_PLUGINS")) { $this->add(new Commands\PluginsCommand()); } } if (!is_dir(getcwd()."/.spark")) { $this->add(new Commands\InitCommand()); } } public function getPluginManager(): PluginManager { return $this->pluginManager; } public function getEnvironment(): Environment { // if (empty($this->environment)) { // $this->environment = Environment::createFromDirectory(); // $this->environment->setLogger($this->logger); // } return $this->environment; } public function getResourceManager(): ResourceManager { return $this->resourceManager; } public function getLogger(): LoggerInterface { return $this->logger; } public function doRun(InputInterface $input, OutputInterface $output) { $this->logger = new ConsoleLogger($output); parent::doRun($input, $output); } }