@@ -315,15 +315,17 @@ private function displayInstallationResult()
315
315
{
316
316
if (empty ($ this ->requirementsErrors )) {
317
317
$ 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 ()
320
321
));
321
322
} else {
322
323
$ 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" .
324
325
" technical requirements! Fix the following issues before executing \n" .
325
326
" your Symfony application: \n" ,
326
- defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'FAILED ' : '✕ '
327
+ defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'FAILED ' : '✕ ' ,
328
+ $ this ->getInstalledSymfonyVersion ()
327
329
));
328
330
329
331
foreach ($ this ->requirementsErrors as $ helpText ) {
@@ -339,13 +341,13 @@ private function displayInstallationResult()
339
341
}
340
342
341
343
$ this ->output ->writeln (sprintf (
342
- " * Change your current directory to %s. \n" .
344
+ " * Change your current directory to <comment>%s</comment> \n \n" .
343
345
" * Configure your application in <comment>app/config/parameters.yml</comment> file. \n\n" .
344
346
" * Run your application: \n" .
345
347
" 1. Execute the <comment>php app/console server:run</comment> command. \n" .
346
348
" 2. Browse to the <comment>http://localhost:8000</comment> URL. \n\n" .
347
349
" * Read the documentation at <comment>http://symfony.com/doc</comment> \n" ,
348
- $ this ->projectName
350
+ $ this ->projectDir
349
351
));
350
352
351
353
return $ this ;
@@ -399,4 +401,21 @@ private function getErrorMessage(\Requirement $requirement, $lineSize = 70)
399
401
400
402
return $ errorMessage ;
401
403
}
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
+ }
402
421
}
0 commit comments