From f75881f26346f4e2d851a4815a4a7cbe154b1fde Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 13 Dec 2023 09:48:51 +0000 Subject: [PATCH] MDL-80409 dataformat: final removal of deprecated download method. --- lib/dataformatlib.php | 45 ------------------------------------------ lib/deprecatedlib.php | 10 +++++++--- lib/tests/coverage.php | 1 - lib/upgrade.txt | 2 ++ 4 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 lib/dataformatlib.php diff --git a/lib/dataformatlib.php b/lib/dataformatlib.php deleted file mode 100644 index 0fe4b360736..00000000000 --- a/lib/dataformatlib.php +++ /dev/null @@ -1,45 +0,0 @@ -. - -/** - * dataformatlib.php - Contains core dataformat related functions. - * - * @package core - * @subpackage dataformat - * @copyright 2016 Brendan Heywood (brendan@catalyst-au.net) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -/** - * Sends a formated data file to the browser - * - * @package core - * @subpackage dataformat - * - * @param string $filename The base filename without an extension - * @param string $dataformat A dataformat name - * @param array $columns An ordered map of column keys and labels - * @param Iterator $iterator An iterator over the records, usually a RecordSet - * @param callable $callback An option function applied to each record before writing - * @throws coding_exception - * - * @deprecated since Moodle 3.9 - MDL-68500 please use \core\dataformat::download_data - */ -function download_as_dataformat($filename, $dataformat, $columns, $iterator, $callback = null) { - debugging('download_as_dataformat() is deprecated, please use \core\dataformat::download_data() instead', DEBUG_DEVELOPER); - - \core\dataformat::download_data($filename, $dataformat, $columns, $iterator, $callback); -} diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index c0d687ba78f..ec83b422d37 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -2080,11 +2080,9 @@ function get_records_csv() { /** * @deprecated since Moodle 3.2 - * @see download_as_dataformat (lib/dataformatlib.php) */ function put_records_csv() { - throw new coding_exception('put_records_csv() can not be used anymore. Please use ' . - 'lib/dataformatlib.php download_as_dataformat() instead.'); + throw new coding_exception(__FUNCTION__ . '() has been removed, please use \core\dataformat::download_data() instead'); } /** @@ -2720,6 +2718,12 @@ function plagiarism_get_form_elements_module() { ); } +/** + * @deprecated Since Moodle 3.9 - MDL-68500 please use {@see \core\dataformat::download_data} + */ +function download_as_dataformat() { + throw new coding_exception(__FUNCTION__ . '() has been removed, please use \core\dataformat::download_data() instead'); +} /** * @deprecated since Moodle 3.10 diff --git a/lib/tests/coverage.php b/lib/tests/coverage.php index f63fe8eccbb..dce3ee1026e 100644 --- a/lib/tests/coverage.php +++ b/lib/tests/coverage.php @@ -53,7 +53,6 @@ return new class extends phpunit_coverage_info { 'cronlib.php', 'csslib.php', 'customcheckslib.php', - 'dataformatlib.php', 'datalib.php', 'ddllib.php', 'deprecatedlib.php', diff --git a/lib/upgrade.txt b/lib/upgrade.txt index b3a38517012..9a702871abc 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -14,6 +14,8 @@ information provided here is intended especially for developers. * New return value 'icon' has been added to the 'external_files' webservice structure. This return value represents the relative path to the relevant file type icon based on the file's mime type. * Removed the sesskey passed from manageauths and manageenrols to their respective test_settings.php pages. +* The following previously deprecated methods have been removed and can no longer be used: + - `download_as_dataformat` * In enrollib.php, the method enrol_get_course_users() got an optional 5th parameter $usergroups that defaults to an empty array. Here, user group ids can be provided, to select enrolled users in a course that are also members of these groups.