Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit a2e5ec0

Browse files
committed
feature #187 Allow to install Symfony in the current directory (javiereguiluz)
This PR was squashed before being merged into the 1.0-dev branch (closes #187). Discussion ---------- Allow to install Symfony in the current directory This fixes #162 Commits ------- 8e8bbd8 Allow to install Symfony in the current directory
2 parents b0ce47c + 8e8bbd8 commit a2e5ec0

File tree

3 files changed

+50
-32
lines changed

3 files changed

+50
-32
lines changed

composer.lock

Lines changed: 30 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Symfony/Installer/NewCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,18 @@ protected function displayInstallationResult()
254254
));
255255
}
256256

257+
if ('.' !== $this->projectDir) {
258+
$this->output->writeln(sprintf(
259+
" * Change your current directory to <comment>%s</comment>\n\n", $this->projectDir
260+
));
261+
}
262+
257263
$this->output->writeln(sprintf(
258-
" * Change your current directory to <comment>%s</comment>\n\n".
259264
" * Configure your application in <comment>app/config/parameters.yml</comment> file.\n\n".
260265
" * Run your application:\n".
261266
" 1. Execute the <comment>php app/console server:run</comment> command.\n".
262267
" 2. Browse to the <comment>http://localhost:8000</comment> URL.\n\n".
263-
" * Read the documentation at <comment>http://symfony.com/doc</comment>\n",
264-
$this->projectDir
268+
" * Read the documentation at <comment>http://symfony.com/doc</comment>\n"
265269
));
266270

267271
return $this;

tests/Symfony/Installer/Tests/IntegrationTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ public function testSymfonyInstallation($commandArguments, $messageRegexp, $vers
6161
$this->assertRegExp($versionRegexp, $output);
6262
}
6363

64+
public function testSymfonyInstallationInCurrentDirectory()
65+
{
66+
$projectDir = sprintf('%s/my_test_project', sys_get_temp_dir());
67+
$this->fs->remove($projectDir);
68+
$this->fs->mkdir($projectDir);
69+
70+
$output = $this->runCommand(sprintf('php %s/symfony.phar new . 2.7.5', $this->rootDir), $projectDir);
71+
$this->assertContains('Downloading Symfony...', $output);
72+
73+
$output = $this->runCommand('php app/console --version', $projectDir);
74+
$this->assertContains('Symfony version 2.7.5 - app/dev/debug', $output);
75+
}
76+
6477
/**
6578
* Runs the given string as a command and returns the resulting output.
6679
* The CWD is set to the root project directory to simplify command paths.

0 commit comments

Comments
 (0)