Automattic\WooCommerce\Internal\Admin\Logging\FileV2
File::get_file_size()
Get the size of the file in bytes. Or false if the file isn't readable.
Метод класса: File{}
Хуков нет.
Возвращает
int|false
.
Использование
$File = new File(); $File->get_file_size();
Код File::get_file_size() File::get file size WC 9.7.1
public function get_file_size() { try { $filesystem = FilesystemUtil::get_wp_filesystem(); if ( ! $filesystem->is_readable( $this->path ) ) { return false; } $size = $filesystem->size( $this->path ); } catch ( Exception $exception ) { return false; } return $size; }