Merge remote branch 'symfony/master' into experimental

This commit is contained in:
Bernhard Schussek 2011-03-27 21:07:13 +02:00
commit 7006202e24
5 changed files with 12 additions and 60 deletions

View File

@ -14,8 +14,6 @@ namespace Symfony\Bundle\AsseticBundle\Command;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\LazyAssetManager;
use Symfony\Bundle\FrameworkBundle\Command\Command;
use Symfony\Bundle\AsseticBundle\Event\WriteEvent;
use Symfony\Bundle\AsseticBundle\Events;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@ -46,10 +44,6 @@ class DumpCommand extends Command
$am = $this->container->get('assetic.asset_manager');
// notify an event so custom stream wrappers can be registered lazily
$writeEvent = new WriteEvent($basePath);
$this->container->get('event_dispatcher')->dispatch(Events::onAsseticWrite, $writeEvent);
if ($input->getOption('watch')) {
return $this->watch($am, $basePath, $output, $this->container->getParameter('kernel.debug'));
}

View File

@ -1,32 +0,0 @@
<?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Event;
use Symfony\Component\EventDispatcher\Event;
/**
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*/
class WriteEvent extends Event
{
private $targetPath;
public function __construct($targetPath = null)
{
$this->targetPath = $targetPath;
}
public function getTargetPath()
{
return $this->targetPath;
}
}

View File

@ -1,20 +0,0 @@
<?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle;
/**
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*/
final class Events
{
const onAsseticWrite = 'onAsseticWrite';
}

View File

@ -120,7 +120,13 @@ class HttpKernel implements HttpKernelInterface
}
if (!$response instanceof Response) {
throw new \LogicException(sprintf('The controller must return a response (%s given).', $this->varToString($response)));
$msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
// the user may have forgotten to return something
if (null === $response) {
$msg .= ' Did you forget to add a return statement somewhere in your controller?';
}
throw new \LogicException($msg);
}
}
@ -187,6 +193,10 @@ class HttpKernel implements HttpKernelInterface
return '[resource]';
}
if (null === $var) {
return 'null';
}
return str_replace("\n", '', var_export((string) $var, true));
}
}

View File

@ -55,7 +55,7 @@ class Filesystem
*/
public function mkdir($dirs, $mode = 0777)
{
$ret = false;
$ret = true;
foreach ($this->toIterator($dirs) as $dir) {
if (is_dir($dir)) {
continue;