Skip to content

Commit

Permalink
[FrameworkBundle] registered FileSystem as a service, switched comman…
Browse files Browse the repository at this point in the history
…ds to use it
  • Loading branch information
avalanche123 authored and fabpot committed Jan 14, 2011
1 parent 39e33df commit 3a6f556
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Expand Up @@ -7,7 +7,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;

/*
* This file is part of the Symfony framework.
Expand Down Expand Up @@ -50,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
}

$filesystem = new Filesystem();
$filesystem = $this->container->get('filesystem');

// Create the bundles directory otherwise symlink will fail.
$filesystem->mkdirs($input->getArgument('target').'/bundles/', 0777);
Expand Down
Expand Up @@ -7,7 +7,6 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
use Symfony\Bundle\FrameworkBundle\Util\Mustache;

/*
Expand Down Expand Up @@ -71,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
throw new \RuntimeException(sprintf('Bundle "%s" already exists.', $bundle));
}

$filesystem = new Filesystem();
$filesystem = $this->container->get('filesystem');
$filesystem->mirror(__DIR__.'/../Resources/skeleton/bundle', $targetDir);

Mustache::renderDir($targetDir, array(
Expand Down
Expand Up @@ -10,6 +10,7 @@
<parameter key="response.class">Symfony\Component\HttpFoundation\Response</parameter>
<parameter key="error_handler.class">Symfony\Component\HttpKernel\Debug\ErrorHandler</parameter>
<parameter key="error_handler.level">null</parameter>
<parameter key="filesystem.class">Symfony\Bundle\FrameworkBundle\Util\FileSystem</parameter>
</parameters>

<services>
Expand Down Expand Up @@ -37,5 +38,7 @@
<argument>%kernel.charset%</argument>
</call>
</service>

<service id="filesystem" class="%filesystem.class%"></service>
</services>
</container>

0 comments on commit 3a6f556

Please sign in to comment.