WC_CSV_Batch_Exporter::get_file() public WC 3.1.0
Get the file contents.
{} Это метод класса: WC_CSV_Batch_Exporter{}
Хуков нет.
Возвращает
Строку.
Использование
$WC_CSV_Batch_Exporter = new WC_CSV_Batch_Exporter(); $WC_CSV_Batch_Exporter->get_file();
Список изменений
С версии 3.1.0 | Введена. |
Код WC_CSV_Batch_Exporter::get_file() WC CSV Batch Exporter::get file WC 5.0.0
public function get_file() {
$file = '';
if ( @file_exists( $this->get_file_path() ) ) { // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
$file = @file_get_contents( $this->get_file_path() ); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPress.WP.AlternativeFunctions.file_system_read_file_get_contents
} else {
@file_put_contents( $this->get_file_path(), '' ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_file_put_contents, Generic.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents
@chmod( $this->get_file_path(), 0664 ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.chmod_chmod, WordPress.WP.AlternativeFunctions.file_system_read_file_put_contents, Generic.PHP.NoSilencedErrors.Discouraged
}
return $file;
}