示例#1
0
 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);
 }
示例#2
0
文件: Service.php 项目: JamieS/phrozn
 /**
  * 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());
 }