SILENT KILLERPanel

Current Path: > home > codekrsu > > cuddlebuds.lk > wp-content > plugins > woocommerce > src > Utilities


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//cuddlebuds.lk/wp-content/plugins/woocommerce/src/Utilities

NameTypeSizeLast ModifiedActions
ArrayUtil.php File 13299 bytes May 12 2025 21:07:28.
DiscountsUtil.php File 1130 bytes May 30 2024 18:23:46.
FeaturesUtil.php File 4598 bytes January 25 2023 03:19:12.
I18nUtil.php File 1727 bytes February 22 2023 07:17:34.
LoggingUtil.php File 3259 bytes August 27 2024 23:04:44.
NumberUtil.php File 6029 bytes March 03 2025 22:28:12.
OrderUtil.php File 8370 bytes May 12 2025 21:07:28.
PluginUtil.php File 13199 bytes March 03 2025 22:28:12.
RestApiUtil.php File 781 bytes May 28 2024 14:28:20.
ShippingUtil.php File 1020 bytes May 12 2025 21:07:28.
StringUtil.php File 5212 bytes June 04 2024 15:20:30.
TimeUtil.php File 1186 bytes January 30 2024 23:24:56.

Reading File: /home/codekrsu//cuddlebuds.lk/wp-content/plugins/woocommerce/src/Utilities/LoggingUtil.php

<?php
declare( strict_types=1 );

namespace Automattic\WooCommerce\Utilities;

use Automattic\WooCommerce\Internal\Admin\Logging\{ PageController, Settings };
use Automattic\WooCommerce\Internal\Admin\Logging\FileV2\{ File, FileController };

/**
 * A class of utilities for dealing with logging.
 */
final class LoggingUtil {
	/**
	 * Get the canonical URL for the Logs tab of the Status admin page.
	 *
	 * @return string
	 */
	public static function get_logs_tab_url(): string {
		return wc_get_container()->get( PageController::class )->get_logs_tab_url();
	}

	/**
	 * Determine the current value of the logging_enabled setting.
	 *
	 * @return bool
	 */
	public static function logging_is_enabled(): bool {
		return wc_get_container()->get( Settings::class )->logging_is_enabled();
	}

	/**
	 * Determine the current value of the default_handler setting.
	 *
	 * @return string
	 */
	public static function get_default_handler(): string {
		return wc_get_container()->get( Settings::class )->get_default_handler();
	}

	/**
	 * Determine the current value of the retention_period_days setting.
	 *
	 * @return int
	 */
	public static function get_retention_period(): int {
		return wc_get_container()->get( Settings::class )->get_retention_period();
	}

	/**
	 * Determine the current value of the level_threshold setting.
	 *
	 * @return string
	 */
	public static function get_level_threshold(): string {
		return wc_get_container()->get( Settings::class )->get_level_threshold();
	}

	/**
	 * Generate a public ID for a log file based on its properties.
	 *
	 * The file ID is the basename of the file without the hash part. It allows us to identify a file without revealing
	 * its full name in the filesystem, so that it's difficult to access the file directly with an HTTP request.
	 *
	 * @param string   $source   The source of the log entries contained in the file.
	 * @param int|null $rotation Optional. The 0-based incremental rotation marker, if the file has been rotated.
	 *                           Should only be a single digit.
	 * @param int      $created  Optional. The date the file was created, as a Unix timestamp.
	 *
	 * @return string
	 */
	public static function generate_log_file_id( string $source, ?int $rotation = null, int $created = 0 ): string {
		return File::generate_file_id( $source, $rotation, $created );
	}

	/**
	 * Generate a hash to use as the suffix on a log filename.
	 *
	 * @param string $file_id A file ID (file basename without the hash).
	 *
	 * @return string
	 */
	public static function generate_log_file_hash( string $file_id ): string {
		return File::generate_hash( $file_id );
	}

	/**
	 * Get the directory for storing log files.
	 *
	 * @param bool $create_dir Optional. True to attempt to create the log directory if it doesn't exist. Default true.
	 *
	 * @return string The full directory path, with trailing slash.
	 */
	public static function get_log_directory( bool $create_dir = true ): string {
		return Settings::get_log_directory( $create_dir );
	}

	/**
	 * Calculate the size, in bytes, of the log directory.
	 *
	 * @return int
	 */
	public static function get_log_directory_size(): int {
		return wc_get_container()->get( FileController::class )->get_log_directory_size();
	}
}

SILENT KILLER Tool