Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a6f556

Browse files
avalanche123fabpot
authored andcommitted
[FrameworkBundle] registered FileSystem as a service, switched commands to use it
1 parent 39e33df commit 3a6f556

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Symfony\Component\Console\Input\InputInterface;
88
use Symfony\Component\Console\Output\OutputInterface;
99
use Symfony\Component\Console\Output\Output;
10-
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
1110

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

53-
$filesystem = new Filesystem();
52+
$filesystem = $this->container->get('filesystem');
5453

5554
// Create the bundles directory otherwise symlink will fail.
5655
$filesystem->mkdirs($input->getArgument('target').'/bundles/', 0777);

src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Symfony\Component\Console\Input\InputInterface;
88
use Symfony\Component\Console\Output\OutputInterface;
99
use Symfony\Component\Console\Output\Output;
10-
use Symfony\Bundle\FrameworkBundle\Util\Filesystem;
1110
use Symfony\Bundle\FrameworkBundle\Util\Mustache;
1211

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

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

7776
Mustache::renderDir($targetDir, array(

src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<parameter key="response.class">Symfony\Component\HttpFoundation\Response</parameter>
1111
<parameter key="error_handler.class">Symfony\Component\HttpKernel\Debug\ErrorHandler</parameter>
1212
<parameter key="error_handler.level">null</parameter>
13+
<parameter key="filesystem.class">Symfony\Bundle\FrameworkBundle\Util\FileSystem</parameter>
1314
</parameters>
1415

1516
<services>
@@ -37,5 +38,7 @@
3738
<argument>%kernel.charset%</argument>
3839
</call>
3940
</service>
41+
42+
<service id="filesystem" class="%filesystem.class%"></service>
4043
</services>
4144
</container>

0 commit comments

Comments
 (0)