PHP 클래스 HM\BackUpWordPress\Site_Size

Use to calculate the total or partial size of the sites database and files.
파일 보기 프로젝트 열기: humanmade/backupwordpress

공개 메소드들

메소드 설명
__construct ( string $type = 'complete', Excludes $excludes = null ) Constructor
directory_filesize ( SplFileInfo $file )
filesize ( SplFileInfo $file ) : integer Get the total filesize for a given file or directory. Aware of exclusions.
get_cached_filesizes ( $max_age = WEEK_IN_SECONDS )
get_formatted_site_size ( ) : string Get the site size formatted
get_site_size ( ) : string Calculate the size total size of the database + files.
is_site_size_being_calculated ( ) : boolean Whether the total filesize is being calculated
is_site_size_cached ( ) : boolean Whether the total filesize is cached
rebuild_directory_filesizes ( )
recursive_filesize_scanner ( ) : array Recursively scans a directory to calculate the total filesize

메소드 상세

__construct() 공개 메소드

Set up some initial conditions including whether we want to calculate the size of the database, files or both and whether to exclude any files from the file size calculation.
public __construct ( string $type = 'complete', Excludes $excludes = null )
$type string Whether to calculate the size of the database, files or both. Should be one of 'file', 'database' or 'complete'
$excludes Excludes An array of exclude rules

directory_filesize() 공개 메소드

public directory_filesize ( SplFileInfo $file )
$file SplFileInfo

filesize() 공개 메소드

If $file is a file then return the result of filesize() or 0 if it's excluded. If $file is a directory then recursively calculate the size without the size of excluded files/directories.
public filesize ( SplFileInfo $file ) : integer
$file SplFileInfo The file or directory you want to know the size of.
리턴 integer The total filesize of the file or directory without the size of excluded files/directories.

get_cached_filesizes() 공개 메소드

public get_cached_filesizes ( $max_age = WEEK_IN_SECONDS )

get_formatted_site_size() 공개 메소드

Get the site size formatted
또한 보기: size_format
public get_formatted_site_size ( ) : string
리턴 string

get_site_size() 공개 메소드

Doesn't account for any compression that would be gained by zipping.
public get_site_size ( ) : string
리턴 string

is_site_size_being_calculated() 공개 정적인 메소드

Whether the total filesize is being calculated
public static is_site_size_being_calculated ( ) : boolean
리턴 boolean

is_site_size_cached() 공개 메소드

Whether the total filesize is cached
public is_site_size_cached ( ) : boolean
리턴 boolean

rebuild_directory_filesizes() 공개 메소드

recursive_filesize_scanner() 공개 메소드

Locks should be set by the caller with set_transient( 'hmbkp_directory_filesizes_running', true, HOUR_IN_SECONDS );
public recursive_filesize_scanner ( ) : array
리턴 array $directory_sizes An array of directory paths => filesize sum of all files in directory