/** * {@inheritdoc} */ protected function initialize() { parent::initialize(); foreach (glob("{$this->path}/*/theme.json") as $config) { $this->addPackage($this->loader->load($config)); } }
/** * {@inheritdoc} */ protected function initialize() { parent::initialize(); if (empty($this->packages)) { foreach (glob("{$this->path}/*/extension.json") as $config) { $this->addPackage($this->loader->load($config)); } } }
/** * {@inheritdoc} */ public function update($packageFile) { $update = $this->loader->load($packageFile); if (!($initial = $this->repository->findPackage($update->getName()))) { throw new LogicException('Package is not installed: ' . $initial); } $installPath = $this->repository->getInstallPath($initial); $this->filesystem->delete($installPath); $this->repository->removePackage($initial); $this->filesystem->copyDir(dirname($packageFile), $installPath); if (!$this->repository->hasPackage($update)) { $this->repository->addPackage(clone $update); } }