public function testListBundleFilesByName() { $bundlesConfig = dirname(__FILE__) . '/../../configs/bundles.yml'; $bundle = new Bundle('test', new Config($bundlesConfig)); $files = $bundle->getFiles(); $this->assertFileInBundle('./plugins/Site/View/Test.php', $files); $this->assertFileInBundle('./plugins/Processor/Test.php', $files); }
/** * Apply given bundle * * @param string $bundle Bundle name, URI or filename * * @return \Phrozn\Bundle */ public function applyBundle($bundle) { $bundle = new Bundle($bundle, $this->getConfig()); $bundleId = $bundle->getInfo('id'); $registry = $this->getRegistryContainer(); if ($registry->isInstalled($bundleId)) { throw new \Exception(sprintf('Bundle "%s" is already installed.', $bundleId)); } // install $bundle->extractTo($this->getProjectPath()); // persist list of installed bundles $registry->markAsInstalled($bundleId, $bundle->getFiles()); }