equal
deleted
inserted
replaced
503 * @param int $atime Optional. Access time to set for file. |
503 * @param int $atime Optional. Access time to set for file. |
504 * Default 0. |
504 * Default 0. |
505 * @return bool True on success, false on failure. |
505 * @return bool True on success, false on failure. |
506 */ |
506 */ |
507 public function touch( $file, $time = 0, $atime = 0 ) { |
507 public function touch( $file, $time = 0, $atime = 0 ) { |
508 if ( 0 == $time ) { |
508 if ( 0 === $time ) { |
509 $time = time(); |
509 $time = time(); |
510 } |
510 } |
511 |
511 |
512 if ( 0 == $atime ) { |
512 if ( 0 === $atime ) { |
513 $atime = time(); |
513 $atime = time(); |
514 } |
514 } |
515 |
515 |
516 return touch( $file, $time, $atime ); |
516 return touch( $file, $time, $atime ); |
517 } |
517 } |
519 /** |
519 /** |
520 * Creates a directory. |
520 * Creates a directory. |
521 * |
521 * |
522 * @since 2.5.0 |
522 * @since 2.5.0 |
523 * |
523 * |
524 * @param string $path Path for new directory. |
524 * @param string $path Path for new directory. |
525 * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). |
525 * @param int|false $chmod Optional. The permissions as octal number (or false to skip chmod). |
526 * Default false. |
526 * Default false. |
527 * @param string|int $chown Optional. A user name or number (or false to skip chown). |
527 * @param string|int|false $chown Optional. A user name or number (or false to skip chown). |
528 * Default false. |
528 * Default false. |
529 * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp). |
529 * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp). |
530 * Default false. |
530 * Default false. |
531 * @return bool True on success, false on failure. |
531 * @return bool True on success, false on failure. |
532 */ |
532 */ |
533 public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) { |
533 public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) { |
534 // Safe mode fails with a trailing slash under certain PHP versions. |
534 // Safe mode fails with a trailing slash under certain PHP versions. |
535 $path = untrailingslashit( $path ); |
535 $path = untrailingslashit( $path ); |
628 |
628 |
629 if ( ! $include_hidden && '.' === $struc['name'][0] ) { |
629 if ( ! $include_hidden && '.' === $struc['name'][0] ) { |
630 continue; |
630 continue; |
631 } |
631 } |
632 |
632 |
633 if ( $limit_file && $struc['name'] != $limit_file ) { |
633 if ( $limit_file && $struc['name'] !== $limit_file ) { |
634 continue; |
634 continue; |
635 } |
635 } |
636 |
636 |
637 $struc['perms'] = $this->gethchmod( $path . '/' . $entry ); |
637 $struc['perms'] = $this->gethchmod( $path . '/' . $entry ); |
638 $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] ); |
638 $struc['permsn'] = $this->getnumchmodfromh( $struc['perms'] ); |