Composer\Satis\Builder\WebBuilder::dump PHP Метод

dump() публичный Метод

public dump ( array $packages )
$packages array
    public function dump(array $packages)
    {
        $mappedPackages = $this->getMappedPackageList($packages);
        $name = $this->rootPackage->getPrettyName();
        if ($name === '__root__') {
            $name = 'A';
            $this->output->writeln('Define a "name" property in your json config to name the repository');
        }
        if (!$this->rootPackage->getHomepage()) {
            $this->output->writeln('Define a "homepage" property in your json config to configure the repository URL');
        }
        $this->setDependencies($packages);
        $this->output->writeln('<info>Writing web view</info>');
        $content = $this->getTwigEnvironment()->render($this->getTwigTemplate(), ['name' => $name, 'url' => $this->rootPackage->getHomepage(), 'description' => $this->rootPackage->getDescription(), 'packages' => $mappedPackages, 'dependencies' => $this->dependencies]);
        file_put_contents($this->outputDir . '/index.html', $content);
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider dataAbandoned
  */
 public function testAbandoned($abandoned, $expected)
 {
     $webBuilder = new WebBuilder(new NullOutput(), vfsStream::url('build'), array(), false);
     $webBuilder->setRootPackage($this->rootPackage);
     $this->package->setAbandoned($abandoned);
     $webBuilder->dump(array($this->package));
     $html = $this->root->getChild('build/index.html')->getContent();
     $this->assertRegExp('/Package vendor\\/name is abandoned, you should avoid using it/', $html);
     $this->assertRegExp($expected, $html);
 }
All Usage Examples Of Composer\Satis\Builder\WebBuilder::dump