✏️ 编辑:class-file-utils.php
路径:
/home/forge/kingkrunch.com/wp/wp-content/plugins/wp-smush-pro/core/class-file-utils.php
大小:708 B · 修改:2026-09-29 06:58:27 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace Smush\Core; class File_Utils { private $file_sizes_cache = array(); /** * @var Settings|null */ private $settings; public function __construct() { $this->settings = Settings::get_instance(); } public function is_large_file( $file_path ) { $file_size = $this->get_file_size( $file_path ); $cut_off = $this->settings->get_large_file_cutoff(); return $file_size > $cut_off; } public function get_file_size( $file_path ) { if ( ! isset( $this->file_sizes_cache[ $file_path ] ) ) { $this->file_sizes_cache[ $file_path ] = file_exists( $file_path ) ? filesize( $file_path ) : 0; } return $this->file_sizes_cache[ $file_path ]; } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF