WC_Log_Handler_File::should_rotate() protected WC 1.0
Check if log file should be rotated.
Compares the size of the log file to determine whether it is over the size limit.
{} Это метод класса: WC_Log_Handler_File{}
Хуков нет.
Возвращает
true/false. True if if should be rotated.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->should_rotate( $handle );
- $handle(строка) (обязательный)
- Log handle.
Код WC_Log_Handler_File::should_rotate() WC Log Handler File::should rotate WC 5.0.0
protected function should_rotate( $handle ) {
$file = self::get_log_file_path( $handle );
if ( $file ) {
if ( $this->is_open( $handle ) ) {
$file_stat = fstat( $this->handles[ $handle ] );
return $file_stat['size'] > $this->log_size_limit;
} elseif ( file_exists( $file ) ) {
return filesize( $file ) > $this->log_size_limit;
} else {
return false;
}
} else {
return false;
}
}