文件操作 - PathUtils.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/kidsonlychiropract/public_html/wp-content/plugins/backwpup/src/Common/PathUtils.php
编辑文件内容
<?php declare(strict_types=1); namespace WPMedia\BackWPup\Common; /** * @psalm-immutable */ final class PathUtils { /** * @return list<non-empty-string> * * @psalm-pure */ public static function split(string $path): array { $path = trim($path, '/'); return array_values(array_filter(explode('/', $path))); } /** * @psalm-pure */ public static function join(string ...$parts): string { // Strip all empty elements $parts = array_values(array_filter($parts)); if (empty($parts)) { return ''; } $isAbsolute = strpos($parts[0], '/') === 0; $path = ''; foreach ($parts as $part) { $part = trim($part, '/'); if (empty($part)) { continue; } if (!empty($path)) { $path .= '/'; } $path .= $part; } return ($isAbsolute ? '/' : '') . $path; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件