WC_Log_Handler_File::get_log_files
Get all log files in the log directory.
Метод класса: WC_Log_Handler_File{}
Хуков нет.
Возвращает
Массив.
Использование
$result = WC_Log_Handler_File::get_log_files();
Список изменений
| С версии 3.4.0 | Введена. |
Код WC_Log_Handler_File::get_log_files() WC Log Handler File::get log files WC 10.6.2
public static function get_log_files() {
$log_directory = LoggingUtil::get_log_directory();
$files = @scandir( $log_directory ); // @codingStandardsIgnoreLine.
$result = array();
if ( ! empty( $files ) ) {
foreach ( $files as $key => $value ) {
if ( ! in_array( $value, array( '.', '..' ), true ) ) {
if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
$result[ sanitize_title( $value ) ] = $value;
}
}
}
}
return $result;
}