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

Commit 23afbd1

Browse files
committed
feature #64 Added more information about project installed (saro0h)
This PR was merged into the 1.0-dev branch. Discussion ---------- Added more information about project installed Before enhancement: ![capture d ecran 2014-11-30 a 21 05 49](https://cloud.githubusercontent.com/assets/667519/5239116/bf08c954-78d4-11e4-9d46-01767681be37.png) After enhancement: ![capture d ecran 2014-12-03 a 22 16 26](https://cloud.githubusercontent.com/assets/667519/5288968/1b20e6a6-7b3a-11e4-99da-98fdca151ba7.png) Commits ------- 83c8b2d Added more information about project installed
2 parents b6c8d65 + 83c8b2d commit 23afbd1

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/Symfony/Installer/NewCommand.php

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,17 @@ private function displayInstallationResult()
315315
{
316316
if (empty($this->requirementsErrors)) {
317317
$this->output->writeln(sprintf(
318-
" <info>%s</info> Symfony was <info>successfully installed</info>. Now you can:\n",
319-
defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : ''
318+
" <info>%s</info> Symfony %s was <info>successfully installed</info>. Now you can:\n",
319+
defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : '',
320+
$this->getInstalledSymfonyVersion()
320321
));
321322
} else {
322323
$this->output->writeln(sprintf(
323-
" <comment>%s</comment> Symfony was <info>successfully installed</info> but your system doesn't meet its\n".
324+
" <comment>%s</comment> Symfony %s was <info>successfully installed</info> but your system doesn't meet its\n".
324325
" technical requirements! Fix the following issues before executing\n".
325326
" your Symfony application:\n",
326-
defined('PHP_WINDOWS_VERSION_BUILD') ? 'FAILED' : ''
327+
defined('PHP_WINDOWS_VERSION_BUILD') ? 'FAILED' : '',
328+
$this->getInstalledSymfonyVersion()
327329
));
328330

329331
foreach ($this->requirementsErrors as $helpText) {
@@ -339,13 +341,13 @@ private function displayInstallationResult()
339341
}
340342

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

351353
return $this;
@@ -399,4 +401,21 @@ private function getErrorMessage(\Requirement $requirement, $lineSize = 70)
399401

400402
return $errorMessage;
401403
}
404+
405+
/**
406+
* Returns the full Symfony version number of the project by getting
407+
* it in the composer.lock file.
408+
*
409+
* @return string
410+
*/
411+
private function getInstalledSymfonyVersion()
412+
{
413+
$composer = json_decode(file_get_contents($this->projectDir.'/composer.lock'), true);
414+
415+
foreach ($composer['packages'] as $package) {
416+
if ('symfony/symfony' === $package['name']) {
417+
return $package['version'];
418+
}
419+
}
420+
}
402421
}

0 commit comments

Comments
 (0)