HEX
Server: Apache
System: Linux webd001.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: mciraet (192513)
PHP: 8.2.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/mciraet/www/wp-content/plugins/polylang-pro/src/modules/import-export/export/export-file.php
<?php
/**
 * @package Polylang-Pro
 */

/**
 * Abstract class to use to export data as a file.
 *
 * @since 3.1
 * @since 3.6 Extends `PLL_Export_Data` instead of implementing `PLL_Export_File_Interface`.
 */
abstract class PLL_Export_File extends PLL_Export_Data {
	/**
	 * Returns the name of the file to export.
	 *
	 * @since 2.7
	 *
	 * @return string
	 */
	public function get_filename(): string {
		$source_language = $this->get_source_language()->get_locale( 'display' );
		$target_language = $this->get_target_language()->get_locale( 'display' );
		$datenow = gmdate( 'Y-m-d_G-i-s' );
		$extension = $this->get_extension();

		return "{$source_language}_{$target_language}_{$datenow}.{$extension}";
	}

	/**
	 * Returns exported data.
	 *
	 * @since 3.6
	 *
	 * @return string
	 */
	abstract public function get(): string;

	/**
	 * Returns the current file extension.
	 *
	 * @since 3.1
	 *
	 * @return string The file extension.
	 */
	abstract protected function get_extension(): string;
}