@@ -51,8 +51,9 @@ endpoint for filesystem operations::
51
51
Mkdir
52
52
~~~~~
53
53
54
- Mkdir creates directory. On posix filesystems, directories are created with a
55
- default mode value `0777 `. You can use the second argument to set your own mode::
54
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::mkdir ` creates directory.
55
+ On posix filesystems, directories are created with a default mode value
56
+ `0777 `. You can use the second argument to set your own mode::
56
57
57
58
$fs->mkdir('/tmp/photos', 0700);
58
59
@@ -64,8 +65,8 @@ default mode value `0777`. You can use the second argument to set your own mode:
64
65
Exists
65
66
~~~~~~
66
67
67
- Exists checks for the presence of all files or directories and returns false if a
68
- file is missing::
68
+ :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem::exists ` checks for the
69
+ presence of all files or directories and returns false if a file is missing::
69
70
70
71
// this directory exists, return true
71
72
$fs->exists('/tmp/photos');
@@ -81,9 +82,10 @@ file is missing::
81
82
Copy
82
83
~~~~
83
84
84
- This method is used to copy files. If the target already exists, the file is
85
- copied only if the source modification date is later than the target. This
86
- behavior can be overridden by the third boolean argument::
85
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::copy ` is used to copy
86
+ files. If the target already exists, the file is copied only if the source
87
+ modification date is later than the target. This behavior can be overridden by
88
+ the third boolean argument::
87
89
88
90
// works only if image-ICC has been modified after image.jpg
89
91
$fs->copy('image-ICC.jpg', 'image.jpg');
@@ -94,9 +96,9 @@ behavior can be overridden by the third boolean argument::
94
96
Touch
95
97
~~~~~
96
98
97
- Touch sets access and modification time for a file. The current time is used by
98
- default. You can set your own with the second argument. The third argument is
99
- the access time::
99
+ :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem::touch ` sets access and
100
+ modification time for a file. The current time is used by default. You can set
101
+ your own with the second argument. The third argument is the access time::
100
102
101
103
// set modification time to the current timestamp
102
104
$fs->touch('file.txt');
@@ -113,8 +115,8 @@ the access time::
113
115
Chown
114
116
~~~~~
115
117
116
- Chown is used to change the owner of a file. The third argument is a boolean
117
- recursive option::
118
+ :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem::chown ` is used to change
119
+ the owner of a file. The third argument is a boolean recursive option::
118
120
119
121
// set the owner of the lolcat video to www-data
120
122
$fs->chown('lolcat.mp4', 'www-data');
@@ -129,8 +131,8 @@ recursive option::
129
131
Chgrp
130
132
~~~~~
131
133
132
- Chgrp is used to change the group of a file. The third argument is a boolean
133
- recursive option::
134
+ :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem::chgrp ` is used to change
135
+ the group of a file. The third argument is a boolean recursive option::
134
136
135
137
// set the group of the lolcat video to nginx
136
138
$fs->chgrp('lolcat.mp4', 'nginx');
@@ -146,8 +148,8 @@ recursive option::
146
148
Chmod
147
149
~~~~~
148
150
149
- Chmod is used to change the mode of a file. The fourth argument is a boolean
150
- recursive option::
151
+ :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem::chmod ` is used to change
152
+ the mode of a file. The fourth argument is a boolean recursive option::
151
153
152
154
// set the mode of the video to 0600
153
155
$fs->chmod('video.ogg', 0600);
@@ -162,7 +164,8 @@ recursive option::
162
164
Remove
163
165
~~~~~~
164
166
165
- Remove let's you remove files, symlink, directories easily::
167
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::remove ` let's you remove
168
+ files, symlink, directories easily::
166
169
167
170
$fs->remove(array('symlink', '/path/to/directory', 'activity.log'));
168
171
@@ -174,7 +177,8 @@ Remove let's you remove files, symlink, directories easily::
174
177
Rename
175
178
~~~~~~
176
179
177
- Rename is used to rename files and directories::
180
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::rename ` is used to rename
181
+ files and directories::
178
182
179
183
//rename a file
180
184
$fs->rename('/tmp/processed_video.ogg', '/path/to/store/video_647.ogg');
@@ -184,8 +188,9 @@ Rename is used to rename files and directories::
184
188
symlink
185
189
~~~~~~~
186
190
187
- Creates a symbolic link from the target to the destination. If the filesystem
188
- does not support symbolic links, a third boolean argument is available::
191
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::symlink ` creates a
192
+ symbolic link from the target to the destination. If the filesystem does not
193
+ support symbolic links, a third boolean argument is available::
189
194
190
195
// create a symbolic link
191
196
$fs->symlink('/path/to/source', '/path/to/destination');
@@ -196,7 +201,8 @@ does not support symbolic links, a third boolean argument is available::
196
201
makePathRelative
197
202
~~~~~~~~~~~~~~~~
198
203
199
- Return the relative path of a directory given another one::
204
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::makePathRelative ` returns
205
+ the relative path of a directory given another one::
200
206
201
207
// returns '../'
202
208
$fs->makePathRelative(
@@ -209,14 +215,16 @@ Return the relative path of a directory given another one::
209
215
mirror
210
216
~~~~~~
211
217
212
- Mirrors a directory::
218
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::mirror ` mirrors a
219
+ directory::
213
220
214
221
$fs->mirror('/path/to/source', '/path/to/target');
215
222
216
223
isAbsolutePath
217
224
~~~~~~~~~~~~~~
218
225
219
- isAbsolutePath returns true if the given path is absolute, false otherwise::
226
+ :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::isAbsolutePath ` returns
227
+ ``true `` if the given path is absolute, false otherwise::
220
228
221
229
// return true
222
230
$fs->isAbsolutePath('/tmp');
@@ -236,9 +244,9 @@ thrown.
236
244
237
245
.. note ::
238
246
239
- Prior to version 2.1, :method: ` Symfony \\ Component \\ Filesystem \\ Filesystem:: mkdir `
240
- returned a boolean and did not throw exceptions. As of 2.1, a
241
- :class: `Symfony\\ Component\\ Filesystem\\ Exception\\ IOException ` is
242
- thrown if a directory creation fails.
247
+ Prior to version 2.1, `` mkdir `` returned a boolean and did not throw
248
+ exceptions. As of 2.1, a
249
+ :class: `Symfony\\ Component\\ Filesystem\\ Exception\\ IOException ` is thrown
250
+ if a directory creation fails.
243
251
244
252
.. _`Packagist` : https://packagist.org/packages/symfony/filesystem
0 commit comments