@@ -294,15 +294,17 @@ private function displayInstallationResult()
294
294
{
295
295
if (empty ($ this ->requirementsErrors )) {
296
296
$ this ->output ->writeln (sprintf (
297
- " <info>%s</info> Symfony was <info>successfully installed</info>. Now you can: \n" ,
298
- defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'OK ' : '✔ '
297
+ " <info>%s</info> Symfony %s was <info>successfully installed</info>. Now you can: \n" ,
298
+ defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'OK ' : '✔ ' ,
299
+ $ this ->getInstalledSymfonyVersion ()
299
300
));
300
301
} else {
301
302
$ this ->output ->writeln (sprintf (
302
- " <comment>%s</comment> Symfony was <info>successfully installed</info> but your system doesn't meet its \n" .
303
+ " <comment>%s</comment> Symfony %s was <info>successfully installed</info> but your system doesn't meet its \n" .
303
304
" technical requirements! Fix the following issues before executing \n" .
304
305
" your Symfony application: \n" ,
305
- defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'FAILED ' : '✕ '
306
+ defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'FAILED ' : '✕ ' ,
307
+ $ this ->getInstalledSymfonyVersion ()
306
308
));
307
309
308
310
foreach ($ this ->requirementsErrors as $ helpText ) {
@@ -318,13 +320,13 @@ private function displayInstallationResult()
318
320
}
319
321
320
322
$ this ->output ->writeln (sprintf (
321
- " * Change your current directory to %s. \n" .
323
+ " * Change your current directory to <comment>%s</comment> \n \n" .
322
324
" * Configure your application in <comment>app/config/parameters.yml</comment> file. \n\n" .
323
325
" * Run your application: \n" .
324
326
" 1. Execute the <comment>php app/console server:run</comment> command. \n" .
325
327
" 2. Browse to the <comment>http://localhost:8000</comment> URL. \n\n" .
326
328
" * Read the documentation at <comment>http://symfony.com/doc</comment> \n" ,
327
- $ this ->projectName
329
+ $ this ->projectDir
328
330
));
329
331
330
332
return $ this ;
@@ -378,4 +380,21 @@ private function getErrorMessage(\Requirement $requirement, $lineSize = 70)
378
380
379
381
return $ errorMessage ;
380
382
}
383
+
384
+ /**
385
+ * Returns the full Symfony version number of the project by getting
386
+ * it in the composer.lock file.
387
+ *
388
+ * @return string
389
+ */
390
+ private function getInstalledSymfonyVersion ()
391
+ {
392
+ $ composer = json_decode (file_get_contents ($ this ->projectDir .'/composer.lock ' ), true );
393
+
394
+ foreach ($ composer ['packages ' ] as $ package ) {
395
+ if ('symfony/symfony ' === $ package ['name ' ]) {
396
+ return $ package ['version ' ];
397
+ }
398
+ }
399
+ }
381
400
}
0 commit comments