8000 Minor tweaks · symfony/symfony-docs@6276aca · GitHub
[go: up one dir, main page]

Skip to content

Commit 6276aca

Browse filesBrowse files
committed
Minor tweaks
1 parent cb2294e commit 6276aca

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

components/filesystem.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ Dealing with file paths usually involves some difficulties:
321321
- Platform differences: file paths look different on different platforms. UNIX
322322
file paths start with a slash ("/"), while Windows file paths start with a
323323
system drive ("C:"). UNIX uses forward slashes, while Windows uses backslashes
324-
by default.
324+
by default. However, Windows also accepts forward slashes, so both types of
325+
separators generally work.
325326
- Absolute/relative paths: web applications frequently need to deal with absolute
326327
and relative paths. Converting one to the other properly is tricky and repetitive.
327328

@@ -371,28 +372,29 @@ string concatenation for building file paths::
371372

372373
echo Path::join('C:\\Program Files', 'PHP', 'php.ini');
373374
// => C:/Program Files/PHP/php.ini
375+
// (both forward slashes and backslashes work on Windows)
374376

375-
The method handles multiple scenarios correctly:
377+
The ``join()`` method handles multiple scenarios correctly:
376378

377-
- Empty parts are ignored::
379+
Empty parts are ignored::
378380

379381
echo Path::join('/var/www', '', 'config.ini');
380382
// => /var/www/config.ini
381383

382-
- Leading slashes in subsequent arguments are removed::
384+
Leading slashes in subsequent arguments are removed::
383385

384386
echo Path::join('/var/www', '/etc', 'config.ini');
385387
// => /var/www/etc/config.ini
386388

387-
- Trailing slashes are preserved only for root paths::
389+
Trailing slashes are preserved only for root paths::
388390

389391
echo Path::join('/var/www', 'vhost/');
390392
// => /var/www/vhost
391393

392394
echo Path::join('/', '');
393395
// => /
394396

395-
- Works with any number of arguments::
397+
Works with any number of arguments::
396398

397399
echo Path::join('/var', 'www', 'vhost', 'symfony', 'config', 'config.ini');
398400
// => /var/www/vhost/symfony/config/config.ini

0 commit comments

Comments
 (0)
0