@@ -426,7 +426,7 @@ Especially when storing many paths, the amount of duplicated information is
426
426
noticeable. You can use :method: `Symfony\\ Component\\ Filesystem\\ Path::getLongestCommonBasePath `
427
427
to check a list of paths for a common base path::
428
428
429
- Path::getLongestCommonBasePath(
429
+ $basePath = Path::getLongestCommonBasePath(
430
430
'/var/www/vhosts/project/httpdocs/config/config.yaml',
431
431
'/var/www/vhosts/project/httpdocs/config/routing.yaml',
432
432
'/var/www/vhosts/project/httpdocs/config/services.yaml',
@@ -435,17 +435,14 @@ to check a list of paths for a common base path::
435
435
);
436
436
// => /var/www/vhosts/project/httpdocs
437
437
438
- Use this path together with :method: `Symfony\\ Component\\ Filesystem\\ Path::makeRelative `
439
- to shorten the stored paths::
440
-
441
- $bp = '/var/www/vhosts/project/httpdocs';
438
+ Use this common base path to shorten the stored paths::
442
439
443
440
return [
444
- $bp .'/config/config.yaml',
445
- $bp .'/config/routing.yaml',
446
- $bp .'/config/services.yaml',
447
- $bp .'/images/banana.gif',
448
- $bp .'/uploads/images/nicer-banana.gif',
441
+ $basePath .'/config/config.yaml',
442
+ $basePath .'/config/routing.yaml',
443
+ $basePath .'/config/services.yaml',
444
+ $basePath .'/images/banana.gif',
445
+ $basePath .'/uploads/images/nicer-banana.gif',
449
446
];
450
447
451
448
:method: `Symfony\\ Component\\ Filesystem\\ Path::getLongestCommonBasePath ` always
0 commit comments