From 1be93dffe10a82ba51b72a9af1f91708f488c2af Mon Sep 17 00:00:00 2001 From: Adrian Greeve <abgreeve@gmail.com> Date: Mon, 9 Dec 2019 11:30:26 +0800 Subject: [PATCH] MDL-63048 lib: Remove renamed classes. --- admin/tool/lp/db/renamedclasses.php | 32 --------------- lib/db/renamedclasses.php | 2 + .../service/memberships/db/renamedclasses.php | 34 ---------------- mod/lti/service/profile/db/renamedclasses.php | 33 --------------- .../service/toolproxy/db/renamedclasses.php | 33 --------------- .../toolsettings/db/renamedclasses.php | 35 ---------------- mod/scorm/report/graphs/db/renamedclasses.php | 40 ------------------- .../report/interactions/db/renamedclasses.php | 40 ------------------- .../report/objectives/db/renamedclasses.php | 40 ------------------- 9 files changed, 2 insertions(+), 287 deletions(-) delete mode 100644 admin/tool/lp/db/renamedclasses.php delete mode 100644 mod/lti/service/memberships/db/renamedclasses.php delete mode 100644 mod/lti/service/profile/db/renamedclasses.php delete mode 100644 mod/lti/service/toolproxy/db/renamedclasses.php delete mode 100644 mod/lti/service/toolsettings/db/renamedclasses.php delete mode 100644 mod/scorm/report/graphs/db/renamedclasses.php delete mode 100644 mod/scorm/report/interactions/db/renamedclasses.php delete mode 100644 mod/scorm/report/objectives/db/renamedclasses.php diff --git a/admin/tool/lp/db/renamedclasses.php b/admin/tool/lp/db/renamedclasses.php deleted file mode 100644 index 0530f09e360..00000000000 --- a/admin/tool/lp/db/renamedclasses.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * This file contains renamed classes mappings. - * - * @package tool_lp - * @copyright 2016 Frédéric Massart - FMCorz.net - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -$renamedclasses = array( - 'tool_lp\\external\\cohort_summary_exporter' => 'core_cohort\\external\\cohort_summary_exporter', - 'tool_lp\\external\\course_module_summary_exporter' => 'core_course\\external\\course_module_summary_exporter', - 'tool_lp\\external\\course_summary_exporter' => 'core_course\\external\\course_summary_exporter', - 'tool_lp\\form\\persistent' => 'core\\form\\persistent', -); diff --git a/lib/db/renamedclasses.php b/lib/db/renamedclasses.php index 720e2ae6a67..cc2304f9f9b 100644 --- a/lib/db/renamedclasses.php +++ b/lib/db/renamedclasses.php @@ -36,8 +36,10 @@ defined('MOODLE_INTERNAL') || die(); // The old class name is the key, the new class name is the value. // The array must be called $renamedclasses. $renamedclasses = array( + // Since Moodle 3.6. 'course_in_list' => 'core_course_list_element', 'coursecat' => 'core_course_category', + // Since Moodle 3.7. 'core\\analytics\\target\\course_dropout' => 'core_course\\analytics\\target\\course_dropout', 'core\\analytics\\target\\course_competencies' => 'core_course\\analytics\\target\\course_competencies', 'core\\analytics\\target\\course_completion' => 'core_course\\analytics\\target\\course_completion', diff --git a/mod/lti/service/memberships/db/renamedclasses.php b/mod/lti/service/memberships/db/renamedclasses.php deleted file mode 100644 index d38e9901372..00000000000 --- a/mod/lti/service/memberships/db/renamedclasses.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * Lists renamed classes so that the autoloader can make the old names still work. - * - * @package mod_lti - * @copyright 2018 Thom Rawson - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Array 'old_class_name' => 'new\class_name'. -$renamedclasses = array( - - // Changed for PHP 7.0 which now has the word "resource" as a reserved word. - 'ltiservice_memberships\local\resource\linkmemberships' => 'ltiservice_memberships\local\resources\linkmemberships', - 'ltiservice_memberships\local\resource\contextmemberships' => 'ltiservice_memberships\local\resources\contextmemberships', - -); diff --git a/mod/lti/service/profile/db/renamedclasses.php b/mod/lti/service/profile/db/renamedclasses.php deleted file mode 100644 index 866e70ab03b..00000000000 --- a/mod/lti/service/profile/db/renamedclasses.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * Lists renamed classes so that the autoloader can make the old names still work. - * - * @package mod_lti - * @copyright 2018 Thom Rawson - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Array 'old_class_name' => 'new\class_name'. -$renamedclasses = array( - - // Changed for PHP 7.0 which now has the word "resource" as a reserved word. - 'ltiservice_profile\local\resource\profile' => 'ltiservice_profile\local\resources\profile', -); - diff --git a/mod/lti/service/toolproxy/db/renamedclasses.php b/mod/lti/service/toolproxy/db/renamedclasses.php deleted file mode 100644 index 0fa7548f80f..00000000000 --- a/mod/lti/service/toolproxy/db/renamedclasses.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * Lists renamed classes so that the autoloader can make the old names still work. - * - * @package mod_lti - * @copyright 2018 Thom Rawson - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Array 'old_class_name' => 'new\class_name'. -$renamedclasses = array( - - // Changed for PHP 7.0 which now has the word "resource" as a reserved word. - 'ltiservice_toolproxy\local\resource\toolproxy' => 'ltiservice_toolproxy\local\resources\toolproxy', -); - diff --git a/mod/lti/service/toolsettings/db/renamedclasses.php b/mod/lti/service/toolsettings/db/renamedclasses.php deleted file mode 100644 index 4e8d4dadbb6..00000000000 --- a/mod/lti/service/toolsettings/db/renamedclasses.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * Lists renamed classes so that the autoloader can make the old names still work. - * - * @package mod_lti - * @copyright 2018 Thom Rawson - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Array 'old_class_name' => 'new\class_name'. -$renamedclasses = array( - - // Changed for PHP 7.0 which now has the word "resource" as a reserved word. - 'ltiservice_toolsettings\local\resource\contextsettings' => 'ltiservice_toolsettings\local\resources\contextsettings', - 'ltiservice_toolsettings\local\resource\linksettings' => 'ltiservice_toolsettings\local\resources\linksettings', - 'ltiservice_toolsettings\local\resource\systemsettings' => 'ltiservice_toolsettings\local\resources\systemsettings', -); - diff --git a/mod/scorm/report/graphs/db/renamedclasses.php b/mod/scorm/report/graphs/db/renamedclasses.php deleted file mode 100644 index de84d931f37..00000000000 --- a/mod/scorm/report/graphs/db/renamedclasses.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * This file contains mappings for classes that have been renamed so that they meet the requirements of the autoloader. - * - * Renaming isn't always the recommended approach, but can provide benefit in situations where we've already got a - * close structure, OR where lots of classes get included and not necessarily used, or checked for often. - * - * When renaming a class delete the original class and add an entry to the db/renamedclasses.php directory for that - * component. - * This way we don't need to keep around old classes, instead creating aliases only when required. - * One big advantage to this method is that we provide consistent debugging for renamed classes when they are used. - * - * @package scormreport_graph - * @copyright 2014 onwards Ankit Agarwal - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Like other files in the db directory this file uses an array. -// The old class name is the key, the new class name is the value. -// The array must be called $renamedclasses. -$renamedclasses = array( - 'scorm_graph_report' => 'scormreport_graph\report' -); diff --git a/mod/scorm/report/interactions/db/renamedclasses.php b/mod/scorm/report/interactions/db/renamedclasses.php deleted file mode 100644 index 203be5c2c61..00000000000 --- a/mod/scorm/report/interactions/db/renamedclasses.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * This file contains mappings for classes that have been renamed so that they meet the requirements of the autoloader. - * - * Renaming isn't always the recommended approach, but can provide benefit in situations where we've already got a - * close structure, OR where lots of classes get included and not necessarily used, or checked for often. - * - * When renaming a class delete the original class and add an entry to the db/renamedclasses.php directory for that - * component. - * This way we don't need to keep around old classes, instead creating aliases only when required. - * One big advantage to this method is that we provide consistent debugging for renamed classes when they are used. - * - * @package scormreport_interactions - * @copyright 2014 onwards Ankit Agarwal - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Like other files in the db directory this file uses an array. -// The old class name is the key, the new class name is the value. -// The array must be called $renamedclasses. -$renamedclasses = array( - 'scorm_interactions_report' => 'scormreport_objectives\report' -); diff --git a/mod/scorm/report/objectives/db/renamedclasses.php b/mod/scorm/report/objectives/db/renamedclasses.php deleted file mode 100644 index 054f278204e..00000000000 --- a/mod/scorm/report/objectives/db/renamedclasses.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see <http://www.gnu.org/licenses/>. - -/** - * This file contains mappings for classes that have been renamed so that they meet the requirements of the autoloader. - * - * Renaming isn't always the recommended approach, but can provide benefit in situations where we've already got a - * close structure, OR where lots of classes get included and not necessarily used, or checked for often. - * - * When renaming a class delete the original class and add an entry to the db/renamedclasses.php directory for that - * component. - * This way we don't need to keep around old classes, instead creating aliases only when required. - * One big advantage to this method is that we provide consistent debugging for renamed classes when they are used. - * - * @package scormreport_objectives - * @copyright 2014 onwards Ankit Agarwal - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die(); - -// Like other files in the db directory this file uses an array. -// The old class name is the key, the new class name is the value. -// The array must be called $renamedclasses. -$renamedclasses = array( - 'scorm_objectives_report' => 'scormreport_objectives\report' -);