@@ -26,10 +26,10 @@ endpoint for filesystem operations::
2626 use Symfony\Component\Filesystem\Filesystem;
2727 use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
2828
29- $fileSystem = new Filesystem();
29+ $filesystem = new Filesystem();
3030
3131 try {
32- $fileSystem ->mkdir(sys_get_temp_dir().'/'.random_int(0, 1000));
32+ $filesystem ->mkdir(sys_get_temp_dir().'/'.random_int(0, 1000));
3333 } catch (IOExceptionInterface $exception) {
3434 echo "An error occurred while creating your directory at ".$exception->getPath();
3535 }
5353On POSIX filesystems, directories are created with a default mode value
5454`0777 `. You can use the second argument to set your own mode::
5555
56- $fileSystem ->mkdir('/tmp/photos', 0700);
56+ $filesystem ->mkdir('/tmp/photos', 0700);
5757
5858.. note ::
5959
@@ -79,11 +79,11 @@ presence of one or more files or directories and returns ``false`` if any of
7979them is missing::
8080
8181 // if this absolute directory exists, returns true
82- $fileSystem ->exists('/tmp/photos');
82+ $filesystem ->exists('/tmp/photos');
8383
8484 // if rabbit.jpg exists and bottle.png does not exist, returns false
8585 // non-absolute paths are relative to the directory where the running PHP script is stored
86- $fileSystem ->exists(['rabbit.jpg', 'bottle.png']);
86+ $filesystem ->exists(['rabbit.jpg', 'bottle.png']);
8787
8888.. note ::
8989
@@ -100,10 +100,10 @@ source modification date is later than the target. This behavior can be overridd
100100by the third boolean argument::
101101
102102 // works only if image-ICC has been modified after image.jpg
103- $fileSystem ->copy('image-ICC.jpg', 'image.jpg');
103+ $filesystem ->copy('image-ICC.jpg', 'image.jpg');
104104
105105 // image.jpg will be overridden
106- $fileSystem ->copy('image-ICC.jpg', 'image.jpg', true);
106+ $filesystem ->copy('image-ICC.jpg', 'image.jpg', true);
107107
108108touch
109109~~~~~
@@ -113,11 +113,11 @@ modification time for a file. The current time is used by default. You can set
113113your own with the second argument. The third argument is the access time::
114114
115115 // sets modification time to the current timestamp
116- $fileSystem ->touch('file.txt');
116+ $filesystem ->touch('file.txt');
117117 // sets modification time 10 seconds in the future
118- $fileSystem ->touch('file.txt', time() + 10);
118+ $filesystem ->touch('file.txt', time() + 10);
119119 // sets access time 10 seconds in the past
120- $fileSystem ->touch('file.txt', time(), time() - 10);
120+ $filesystem ->touch('file.txt', time(), time() - 10);
121121
122122.. note ::
123123
@@ -131,9 +131,9 @@ chown
131131a file. The third argument is a boolean recursive option::
132132
133133 // sets the owner of the lolcat video to www-data
134- $fileSystem ->chown('lolcat.mp4', 'www-data');
134+ $filesystem ->chown('lolcat.mp4', 'www-data');
135135 // changes the owner of the video directory recursively
136- $fileSystem ->chown('/video', 'www-data', true);
136+ $filesystem ->chown('/video', 'www-data', true);
137137
138138.. note ::
139139
@@ -147,9 +147,9 @@ chgrp
147147a file. The third argument is a boolean recursive option::
148148
149149 // sets the group of the lolcat video to nginx
150- $fileSystem ->chgrp('lolcat.mp4', 'nginx');
150+ $filesystem ->chgrp('lolcat.mp4', 'nginx');
151151 // changes the group of the video directory recursively
152- $fileSystem ->chgrp('/video', 'nginx', true);
152+ $filesystem ->chgrp('/video', 'nginx', true);
153153
154154.. note ::
155155
@@ -163,9 +163,9 @@ chmod
163163permissions of a file. The fourth argument is a boolean recursive option::
164164
165165 // sets the mode of the video to 0600
166- $fileSystem ->chmod('video.ogg', 0600);
166+ $filesystem ->chmod('video.ogg', 0600);
167167 // changes the mod of the src directory recursively
168- $fileSystem ->chmod('src', 0700, 0000, true);
168+ $filesystem ->chmod('src', 0700, 0000, true);
169169
170170.. note ::
171171
@@ -178,7 +178,7 @@ remove
178178:method: `Symfony\\ Component\\ Filesystem\\ Filesystem::remove ` deletes files,
179179directories and symlinks::
180180
181- $fileSystem ->remove(['symlink', '/path/to/directory', 'activity.log']);
181+ $filesystem ->remove(['symlink', '/path/to/directory', 'activity.log']);
182182
183183.. note ::
184184
@@ -192,9 +192,9 @@ rename
192192of a single file or directory::
193193
194194 // renames a file
195- $fileSystem ->rename('/tmp/processed_video.ogg', '/path/to/store/video_647.ogg');
195+ $filesystem ->rename('/tmp/processed_video.ogg', '/path/to/store/video_647.ogg');
196196 // renames a directory
197- $fileSystem ->rename('/tmp/files', '/path/to/store/files');
197+ $filesystem ->rename('/tmp/files', '/path/to/store/files');
198198
199199symlink
200200~~~~~~~
@@ -204,10 +204,10 @@ symbolic link from the target to the destination. If the filesystem does not
204204support symbolic links, a third boolean argument is available::
205205
206206 // creates a symbolic link
207- $fileSystem ->symlink('/path/to/source', '/path/to/destination');
207+ $filesystem ->symlink('/path/to/source', '/path/to/destination');
208208 // duplicates the source directory if the filesystem
209209 // does not support symbolic links
210- $fileSystem ->symlink('/path/to/source', '/path/to/destination', true);
210+ $filesystem ->symlink('/path/to/source', '/path/to/destination', true);
211211
212212readlink
213213~~~~~~~~
@@ -223,10 +223,10 @@ The :method:`Symfony\\Component\\Filesystem\\Filesystem::readlink` method provid
223223by the Filesystem component always behaves in the same way::
224224
225225 // returns the next direct target of the link without considering the existence of the target
226- $fileSystem ->readlink('/path/to/link');
226+ $filesystem ->readlink('/path/to/link');
227227
228228 // returns its absolute fully resolved final version of the target (if there are nested links, they are resolved)
229- $fileSystem ->readlink('/path/to/link', true);
229+ $filesystem ->readlink('/path/to/link', true);
230230
231231Its behavior is the following::
232232
@@ -247,12 +247,12 @@ makePathRelative
247247absolute paths and returns the relative path from the second path to the first one::
248248
249249 // returns '../'
250- $fileSystem ->makePathRelative(
250+ $filesystem ->makePathRelative(
251251 '/var/lib/symfony/src/Symfony/',
252252 '/var/lib/symfony/src/Symfony/Component'
253253 );
254254 // returns 'videos/'
255- $fileSystem ->makePathRelative('/tmp/videos', '/tmp')
255+ $filesystem ->makePathRelative('/tmp/videos', '/tmp')
256256
257257mirror
258258~~~~~~
@@ -262,7 +262,7 @@ contents of the source directory into the target one (use the
262262:method: `Symfony\\ Component\\ Filesystem\\ Filesystem::copy ` method to copy single
263263files)::
264264
265- $fileSystem ->mirror('/path/to/source', '/path/to/target');
265+ $filesystem ->mirror('/path/to/source', '/path/to/target');
266266
267267isAbsolutePath
268268~~~~~~~~~~~~~~
@@ -271,13 +271,13 @@ isAbsolutePath
271271``true `` if the given path is absolute, ``false `` otherwise::
272272
273273 // returns true
274- $fileSystem ->isAbsolutePath('/tmp');
274+ $filesystem ->isAbsolutePath('/tmp');
275275 // returns true
276- $fileSystem ->isAbsolutePath('c:\\Windows');
276+ $filesystem ->isAbsolutePath('c:\\Windows');
277277 // returns false
278- $fileSystem ->isAbsolutePath('tmp');
278+ $filesystem ->isAbsolutePath('tmp');
279279 // returns false
280- $fileSystem ->isAbsolutePath('../dir');
280+ $filesystem ->isAbsolutePath('../dir');
281281
282282tempnam
283283~~~~~~~
@@ -296,7 +296,7 @@ file first and then moves it to the new file location when it's finished.
296296This means that the user will always see either the complete old file or
297297complete new file (but never a partially-written file)::
298298
299- $fileSystem ->dumpFile('file.txt', 'Hello World');
299+ $filesystem ->dumpFile('file.txt', 'Hello World');
300300
301301The ``file.txt `` file contains ``Hello World `` now.
302302
@@ -306,7 +306,7 @@ appendToFile
306306:method: `Symfony\\ Component\\ Filesystem\\ Filesystem::appendToFile ` adds new
307307contents at the end of some file::
308308
309- $fileSystem ->appendToFile('logs.txt', 'Email sent to user@example.com');
309+ $filesystem ->appendToFile('logs.txt', 'Email sent to user@example.com');
310310
311311If either the file or its containing directory doesn't exist, this method
312312creates them before appending the contents.
0 commit comments