I have a similar problem.
This is how I solved it.
Two things.
A. Your command should use a double backslash like
hello/console init:bundle "Application\\FooBundle"
B. There is a bug in the core Symfony 2 Mustache Class "renderDir"
method for Linux users
src/vendor/symfony/src/Symfony/Framework/WebBundle/Util/
Mustache.php
Change to
class Mustache
{
static public function renderFile($file, $parameters)
{
$replacer = function ($match) use($parameters)
{
return isset($parameters[$match[1]]) ? $parameters[$match[1]] :
"{{ $match[0] }}";
};
file_put_contents($file, preg_replace_callback('/{{\s*(.+?)
\s*}}/', $replacer, file_get_contents($file)));
}
static public function renderDir($dir, $parameters)
{
foreach (new \RecursiveIteratorIterator(new
\RecursiveDirectoryIterator($dir),
\RecursiveIteratorIterator::LEAVES_ONLY) as $file)
{
if (!$file->isFile()) {
continue;
}
static::renderFile((string) $file, $parameters);
}
}
}
cheers,
Matt F
On Feb 26, 2:15 pm, "Matthias N." <[email protected]>
wrote:
> Hi,
>
> when I try to generate a new bundle using the sandbox:
>
> hello/consoleinit:bundle"Application/FooBundle"
>
> I get the following exception:
>
> [ErrorException]
> Warning: file_put_contents(.../sandbox/hello/../src/Application/
> BarBundle/Resources/views/.): failed to open stream: Is a directory
> in .../sandbox/src/vendor/symfony/src/Symfony/Framework/WebBundle/Util/
> Mustache.php line 23
>
> The bundle seems to be mirrored but the vars are not replaced. There
> are {{ ... }} strings in the files.
>
> regards,
> Matthias
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en