Skip to content

Move etc/ to config/ and web/ to public/ #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Configurator/BundlesConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ private function dump(string $file, iterable $bundles): void

private function getConfFile(): string
{
return getcwd().'/etc/bundles.php';
return getcwd().'/config/bundles.php';
}
}
4 changes: 2 additions & 2 deletions src/Configurator/ContainerConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function configure(Recipe $recipe, $parameters): void
public function unconfigure(Recipe $recipe, $parameters): void
{
$this->write('Unsetting parameters');
$target = getcwd().'/etc/container.yaml';
$target = getcwd().'/config/container.yaml';
$lines = [];
foreach (file($target) as $line) {
foreach (array_keys($parameters) as $key) {
Expand All @@ -42,7 +42,7 @@ public function unconfigure(Recipe $recipe, $parameters): void

private function addParameters(iterable $parameters): void
{
$target = getcwd().'/etc/container.yaml';
$target = getcwd().'/config/container.yaml';
$lines = [];
foreach (file($target) as $line) {
$lines[] = $line;
Expand Down
4 changes: 2 additions & 2 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ private function initOptions(): Options
$options = array_merge([
'bin-dir' => 'bin',
'conf-dir' => 'conf',
'etc-dir' => 'etc',
'config-dir' => 'config',
'src-dir' => 'src',
'var-dir' => 'var',
'web-dir' => 'web',
'public-dir' => 'public',
], $this->composer->getPackage()->getExtra());

return new Options($options);
Expand Down
2 changes: 1 addition & 1 deletion tests/Configurator/BundlesConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testConfigure()

$recipe = $this->getMockBuilder('Symfony\Flex\Recipe')->disableOriginalConstructor()->getMock();

$config = sys_get_temp_dir().'/etc/bundles.php';
$config = sys_get_temp_dir().'/config/bundles.php';
@unlink($config);
$configurator->configure($recipe, [
'FooBundle' => ['dev', 'test'],
Expand Down
2 changes: 1 addition & 1 deletion tests/Configurator/ContainerConfiguratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ContainerConfiguratorTest extends TestCase
public function testConfigure()
{
$recipe = $this->getMockBuilder('Symfony\Flex\Recipe')->disableOriginalConstructor()->getMock();
$config = sys_get_temp_dir().'/etc/container.yaml';
$config = sys_get_temp_dir().'/config/container.yaml';
file_put_contents($config, <<<EOF
# comment
parameters:
Expand Down
6 changes: 3 additions & 3 deletions tests/FlexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testPostInstall()
'manifests' => [
'dummy/dummy' => [
'manifest' => [
'post-install-output' => ['line 1 %ETC_DIR%', 'line 2 %VAR_DIR%'],
'post-install-output' => ['line 1 %CONFIG_DIR%', 'line 2 %VAR_DIR%'],
'bundles' => [
'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle' => ['all'],
],
Expand Down Expand Up @@ -69,15 +69,15 @@ public function testPostInstall()
$flex->configurator = $configurator;
$flex->downloader = $downloader;
$flex->runningCommand = function() {};
$flex->options = new Options(['etc-dir' => 'etc', 'var-dir' => 'var']);
$flex->options = new Options(['config-dir' => 'config', 'var-dir' => 'var']);

return $flex;
}, null, Flex::class)->__invoke();
$flex->record($event);
$flex->install($this->getMockBuilder(Event::class)->disableOriginalConstructor()->getMock());

$postInstallOutput = \Closure::bind(function () { return $this->postInstallOutput; }, $flex, Flex::class)->__invoke();
$this->assertSame(['', 'line 1 etc', 'line 2 var', ''], $postInstallOutput);
$this->assertSame(['', 'line 1 config', 'line 2 var', ''], $postInstallOutput);

$this->assertSame(<<<EOF
Symfony operations: 1 recipe
Expand Down