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

Allow to install Symfony in the current directory #187

Closed
wants to merge 5 commits into from
Closed
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
59 changes: 30 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/Symfony/Installer/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,18 @@ protected function displayInstallationResult()
));
}

if ('.' !== $this->projectDir) {
$this->output->writeln(sprintf(
" * Change your current directory to <comment>%s</comment>\n\n", $this->projectDir
));
}

$this->output->writeln(sprintf(
" * Change your current directory to <comment>%s</comment>\n\n".
" * Configure your application in <comment>app/config/parameters.yml</comment> file.\n\n".
" * Run your application:\n".
" 1. Execute the <comment>php app/console server:run</comment> command.\n".
" 2. Browse to the <comment>http://localhost:8000</comment> URL.\n\n".
" * Read the documentation at <comment>http://symfony.com/doc</comment>\n",
$this->projectDir
" * Read the documentation at <comment>http://symfony.com/doc</comment>\n"
));

return $this;
Expand Down
13 changes: 13 additions & 0 deletions tests/Symfony/Installer/Tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ public function testSymfonyInstallation($commandArguments, $messageRegexp, $vers
$this->assertRegExp($versionRegexp, $output);
}

public function testSymfonyInstallationInCurrentDirectory()
{
$projectDir = sprintf('%s/my_test_project', sys_get_temp_dir());
$this->fs->remove($projectDir);
$this->fs->mkdir($projectDir);

$output = $this->runCommand(sprintf('php %s/symfony.phar new . 2.7.5', $this->rootDir), $projectDir);
$this->assertContains('Downloading Symfony...', $output);

$output = $this->runCommand('php app/console --version', $projectDir);
$this->assertContains('Symfony version 2.7.5 - app/dev/debug', $output);
}

/**
* Runs the given string as a command and returns the resulting output.
* The CWD is set to the root project directory to simplify command paths.
Expand Down