comparison vendor/symfony/filesystem/Filesystem.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
135 135
136 /** 136 /**
137 * Sets access and modification time of file. 137 * Sets access and modification time of file.
138 * 138 *
139 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to create 139 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to create
140 * @param int $time The touch time as a Unix timestamp 140 * @param int|null $time The touch time as a Unix timestamp, if not supplied the current system time is used
141 * @param int $atime The access time as a Unix timestamp 141 * @param int|null $atime The access time as a Unix timestamp, if not supplied the current system time is used
142 * 142 *
143 * @throws IOException When touch fails 143 * @throws IOException When touch fails
144 */ 144 */
145 public function touch($files, $time = null, $atime = null) 145 public function touch($files, $time = null, $atime = null)
146 { 146 {
191 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode 191 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode
192 * @param int $mode The new mode (octal) 192 * @param int $mode The new mode (octal)
193 * @param int $umask The mode mask (octal) 193 * @param int $umask The mode mask (octal)
194 * @param bool $recursive Whether change the mod recursively or not 194 * @param bool $recursive Whether change the mod recursively or not
195 * 195 *
196 * @throws IOException When the change fail 196 * @throws IOException When the change fails
197 */ 197 */
198 public function chmod($files, $mode, $umask = 0000, $recursive = false) 198 public function chmod($files, $mode, $umask = 0000, $recursive = false)
199 { 199 {
200 foreach ($this->toIterable($files) as $file) { 200 foreach ($this->toIterable($files) as $file) {
201 if (true !== @chmod($file, $mode & ~$umask)) { 201 if (true !== @chmod($file, $mode & ~$umask)) {
212 * 212 *
213 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner 213 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
214 * @param string $user The new owner user name 214 * @param string $user The new owner user name
215 * @param bool $recursive Whether change the owner recursively or not 215 * @param bool $recursive Whether change the owner recursively or not
216 * 216 *
217 * @throws IOException When the change fail 217 * @throws IOException When the change fails
218 */ 218 */
219 public function chown($files, $user, $recursive = false) 219 public function chown($files, $user, $recursive = false)
220 { 220 {
221 foreach ($this->toIterable($files) as $file) { 221 foreach ($this->toIterable($files) as $file) {
222 if ($recursive && is_dir($file) && !is_link($file)) { 222 if ($recursive && is_dir($file) && !is_link($file)) {
239 * 239 *
240 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group 240 * @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
241 * @param string $group The group name 241 * @param string $group The group name
242 * @param bool $recursive Whether change the group recursively or not 242 * @param bool $recursive Whether change the group recursively or not
243 * 243 *
244 * @throws IOException When the change fail 244 * @throws IOException When the change fails
245 */ 245 */
246 public function chgrp($files, $group, $recursive = false) 246 public function chgrp($files, $group, $recursive = false)
247 { 247 {
248 foreach ($this->toIterable($files) as $file) { 248 foreach ($this->toIterable($files) as $file) {
249 if ($recursive && is_dir($file) && !is_link($file)) { 249 if ($recursive && is_dir($file) && !is_link($file)) {
517 * Copies files and directories from the origin directory into the target directory. By default: 517 * Copies files and directories from the origin directory into the target directory. By default:
518 * 518 *
519 * - existing files in the target directory will be overwritten, except if they are newer (see the `override` option) 519 * - existing files in the target directory will be overwritten, except if they are newer (see the `override` option)
520 * - files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option) 520 * - files in the target directory that do not exist in the source directory will not be deleted (see the `delete` option)
521 * 521 *
522 * @param string $originDir The origin directory 522 * @param string $originDir The origin directory
523 * @param string $targetDir The target directory 523 * @param string $targetDir The target directory
524 * @param \Traversable $iterator Iterator that filters which files and directories to copy 524 * @param \Traversable|null $iterator Iterator that filters which files and directories to copy, if null a recursive iterator is created
525 * @param array $options An array of boolean options 525 * @param array $options An array of boolean options
526 * Valid options are: 526 * Valid options are:
527 * - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false) 527 * - $options['override'] If true, target files newer than origin files are overwritten (see copy(), defaults to false)
528 * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false) 528 * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink(), defaults to false)
529 * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) 529 * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
530 * 530 *
531 * @throws IOException When file type is unknown 531 * @throws IOException When file type is unknown
532 */ 532 */
533 public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = []) 533 public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = [])
534 { 534 {