Skip to content

Commit

Permalink
Merge remote branch 'fabriceb/initbundleformat'
Browse files Browse the repository at this point in the history
* fabriceb/initbundleformat:
  [FrameworkBundle] added --format=xml,php,yml optional parameter to the init:bundle command
  • Loading branch information
fabpot committed Feb 21, 2011
2 parents 6e12029 + 13469a2 commit b9168bb
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@ protected function configure()
new InputArgument('namespace', InputArgument::REQUIRED, 'The namespace of the bundle to create'),
new InputArgument('dir', InputArgument::REQUIRED, 'The directory where to create the bundle'),
new InputArgument('bundleName', InputArgument::OPTIONAL, 'The optional bundle name'),
new InputOption('format', '', InputOption::VALUE_REQUIRED, 'Use the format for configuration files (php, xml, or yml)', 'xml')
))
->setHelp(<<<EOT
The <info>init:bundle</info> command generates a new bundle with a basic skeleton.
Expand Down Expand Up @@ -93,7 +94,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$filesystem = $this->container->get('filesystem');
$filesystem->mirror(__DIR__.'/../Resources/skeleton/bundle', $targetDir);
$filesystem->mirror(__DIR__.'/../Resources/skeleton/bundle/generic', $targetDir);
$filesystem->mirror(__DIR__.'/../Resources/skeleton/bundle/'.$input->getOption('format'), $targetDir);

Mustache::renderDir($targetDir, array(
'namespace' => $namespace,
Expand Down
@@ -0,0 +1,12 @@
<?php

use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

$collection = new RouteCollection();
/*
$collection->add('homepage', new Route('/', array(
'_controller' => 'NewBundle:Default:index',
)));
*/
return $collection;
@@ -0,0 +1,3 @@
#homepage:
# pattern: /
# defaults: { _controller: NewBundle:Default:index }

0 comments on commit b9168bb

Please sign in to comment.