MDL-61574 mod_lti: removed usage of PHP7 reserved word in namespace
authorThom Rawson <thomw@tallthom.com>
Wed, 21 Mar 2018 10:09:46 +0000 (18:09 +0800)
committerThom Rawson <thomw@tallthom.com>
Sun, 1 Apr 2018 03:39:54 +0000 (12:39 +0900)
15 files changed:
mod/lti/service/memberships/classes/local/resources/contextmemberships.php [moved from mod/lti/service/memberships/classes/local/resource/contextmemberships.php with 99% similarity]
mod/lti/service/memberships/classes/local/resources/linkmemberships.php [moved from mod/lti/service/memberships/classes/local/resource/linkmemberships.php with 98% similarity]
mod/lti/service/memberships/classes/local/service/memberships.php
mod/lti/service/memberships/db/renamedclasses.php [new file with mode: 0644]
mod/lti/service/profile/classes/local/resources/profile.php [moved from mod/lti/service/profile/classes/local/resource/profile.php with 98% similarity]
mod/lti/service/profile/classes/local/service/profile.php
mod/lti/service/profile/db/renamedclasses.php [new file with mode: 0644]
mod/lti/service/toolproxy/classes/local/resources/toolproxy.php [moved from mod/lti/service/toolproxy/classes/local/resource/toolproxy.php with 98% similarity]
mod/lti/service/toolproxy/classes/local/service/toolproxy.php
mod/lti/service/toolproxy/db/renamedclasses.php [new file with mode: 0644]
mod/lti/service/toolsettings/classes/local/resources/contextsettings.php [moved from mod/lti/service/toolsettings/classes/local/resource/contextsettings.php with 97% similarity]
mod/lti/service/toolsettings/classes/local/resources/linksettings.php [moved from mod/lti/service/toolsettings/classes/local/resource/linksettings.php with 96% similarity]
mod/lti/service/toolsettings/classes/local/resources/systemsettings.php [moved from mod/lti/service/toolsettings/classes/local/resource/systemsettings.php with 99% similarity]
mod/lti/service/toolsettings/classes/local/service/toolsettings.php
mod/lti/service/toolsettings/db/renamedclasses.php [new file with mode: 0644]

@@ -24,7 +24,7 @@
  */
 
 
  */
 
 
-namespace ltiservice_memberships\local\resource;
+namespace ltiservice_memberships\local\resources;
 
 use \mod_lti\local\ltiservice\service_base;
 use ltiservice_memberships\local\service\memberships;
 
 use \mod_lti\local\ltiservice\service_base;
 use ltiservice_memberships\local\service\memberships;
@@ -24,7 +24,7 @@
  */
 
 
  */
 
 
-namespace ltiservice_memberships\local\resource;
+namespace ltiservice_memberships\local\resources;
 
 use \mod_lti\local\ltiservice\service_base;
 use ltiservice_memberships\local\service\memberships;
 
 use \mod_lti\local\ltiservice\service_base;
 use ltiservice_memberships\local\service\memberships;
index fbbec96..8066d1b 100644 (file)
@@ -67,8 +67,8 @@ class memberships extends \mod_lti\local\ltiservice\service_base {
 
         if (empty($this->resources)) {
             $this->resources = array();
 
         if (empty($this->resources)) {
             $this->resources = array();
-            $this->resources[] = new \ltiservice_memberships\local\resource\contextmemberships($this);
-            $this->resources[] = new \ltiservice_memberships\local\resource\linkmemberships($this);
+            $this->resources[] = new \ltiservice_memberships\local\resources\contextmemberships($this);
+            $this->resources[] = new \ltiservice_memberships\local\resources\linkmemberships($this);
         }
 
         return $this->resources;
         }
 
         return $this->resources;
diff --git a/mod/lti/service/memberships/db/renamedclasses.php b/mod/lti/service/memberships/db/renamedclasses.php
new file mode 100644 (file)
index 0000000..d38e990
--- /dev/null
@@ -0,0 +1,34 @@
+<?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',
+
+);
@@ -24,7 +24,7 @@
  */
 
 
  */
 
 
-namespace ltiservice_profile\local\resource;
+namespace ltiservice_profile\local\resources;
 
 use \mod_lti\local\ltiservice\service_base;
 
 
 use \mod_lti\local\ltiservice\service_base;
 
@@ -43,7 +43,7 @@ class profile extends \mod_lti\local\ltiservice\resource_base {
     /**
      * Class constructor.
      *
     /**
      * Class constructor.
      *
-     * @param ltiservice_profile\local\resource\profile $service Service instance
+     * @param ltiservice_profile\local\resources\profile $service Service instance
      */
     public function __construct($service) {
 
      */
     public function __construct($service) {
 
index dcea867..55830e9 100644 (file)
@@ -59,7 +59,7 @@ class profile extends \mod_lti\local\ltiservice\service_base {
 
         if (empty($this->resources)) {
             $this->resources = array();
 
         if (empty($this->resources)) {
             $this->resources = array();
-            $this->resources[] = new \ltiservice_profile\local\resource\profile($this);
+            $this->resources[] = new \ltiservice_profile\local\resources\profile($this);
         }
 
         return $this->resources;
         }
 
         return $this->resources;
diff --git a/mod/lti/service/profile/db/renamedclasses.php b/mod/lti/service/profile/db/renamedclasses.php
new file mode 100644 (file)
index 0000000..866e70a
--- /dev/null
@@ -0,0 +1,33 @@
+<?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',
+);
+
@@ -24,7 +24,7 @@
  */
 
 
  */
 
 
-namespace ltiservice_toolproxy\local\resource;
+namespace ltiservice_toolproxy\local\resources;
 
 defined('MOODLE_INTERNAL') || die();
 
 
 defined('MOODLE_INTERNAL') || die();
 
@@ -47,7 +47,7 @@ class toolproxy extends \mod_lti\local\ltiservice\resource_base {
     /**
      * Class constructor.
      *
     /**
      * Class constructor.
      *
-     * @param ltiservice_toolproxy\local\resource\toolproxy $service Service instance
+     * @param ltiservice_toolproxy\local\resources\toolproxy $service Service instance
      */
     public function __construct($service) {
 
      */
     public function __construct($service) {
 
index 1d42761..ab69e08 100644 (file)
@@ -58,7 +58,7 @@ class toolproxy extends \mod_lti\local\ltiservice\service_base {
 
         if (empty($this->resources)) {
             $this->resources = array();
 
         if (empty($this->resources)) {
             $this->resources = array();
-            $this->resources[] = new \ltiservice_toolproxy\local\resource\toolproxy($this);
+            $this->resources[] = new \ltiservice_toolproxy\local\resources\toolproxy($this);
         }
 
         return $this->resources;
         }
 
         return $this->resources;
diff --git a/mod/lti/service/toolproxy/db/renamedclasses.php b/mod/lti/service/toolproxy/db/renamedclasses.php
new file mode 100644 (file)
index 0000000..0fa7548
--- /dev/null
@@ -0,0 +1,33 @@
+<?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',
+);
+
@@ -24,9 +24,9 @@
  */
 
 
  */
 
 
-namespace ltiservice_toolsettings\local\resource;
+namespace ltiservice_toolsettings\local\resources;
 
 
-use ltiservice_toolsettings\local\resource\systemsettings;
+use ltiservice_toolsettings\local\resources\systemsettings;
 use ltiservice_toolsettings\local\service\toolsettings;
 
 defined('MOODLE_INTERNAL') || die();
 use ltiservice_toolsettings\local\service\toolsettings;
 
 defined('MOODLE_INTERNAL') || die();
@@ -44,7 +44,7 @@ class contextsettings extends \mod_lti\local\ltiservice\resource_base {
     /**
      * Class constructor.
      *
     /**
      * Class constructor.
      *
-     * @param ltiservice_toolsettings\local\resource\contextsettings $service Service instance
+     * @param ltiservice_toolsettings\local\resources\contextsettings $service Service instance
      */
     public function __construct($service) {
 
      */
     public function __construct($service) {
 
  */
 
 
  */
 
 
-namespace ltiservice_toolsettings\local\resource;
+namespace ltiservice_toolsettings\local\resources;
 
 
-use ltiservice_toolsettings\local\resource\systemsettings;
-use ltiservice_toolsettings\local\resource\contextsettings;
+use ltiservice_toolsettings\local\resources\systemsettings;
+use ltiservice_toolsettings\local\resources\contextsettings;
 use ltiservice_toolsettings\local\service\toolsettings;
 
 defined('MOODLE_INTERNAL') || die();
 use ltiservice_toolsettings\local\service\toolsettings;
 
 defined('MOODLE_INTERNAL') || die();
@@ -45,7 +45,7 @@ class linksettings extends \mod_lti\local\ltiservice\resource_base {
     /**
      * Class constructor.
      *
     /**
      * Class constructor.
      *
-     * @param ltiservice_toolsettings\local\resource\linksettings $service Service instance
+     * @param ltiservice_toolsettings\local\resources\linksettings $service Service instance
      */
     public function __construct($service) {
 
      */
     public function __construct($service) {
 
@@ -24,7 +24,7 @@
  */
 
 
  */
 
 
-namespace ltiservice_toolsettings\local\resource;
+namespace ltiservice_toolsettings\local\resources;
 
 use ltiservice_toolsettings\local\service\toolsettings;
 
 
 use ltiservice_toolsettings\local\service\toolsettings;
 
index 5626e21..f7969a9 100644 (file)
@@ -58,9 +58,9 @@ class toolsettings extends \mod_lti\local\ltiservice\service_base {
 
         if (empty($this->resources)) {
             $this->resources = array();
 
         if (empty($this->resources)) {
             $this->resources = array();
-            $this->resources[] = new \ltiservice_toolsettings\local\resource\systemsettings($this);
-            $this->resources[] = new \ltiservice_toolsettings\local\resource\contextsettings($this);
-            $this->resources[] = new \ltiservice_toolsettings\local\resource\linksettings($this);
+            $this->resources[] = new \ltiservice_toolsettings\local\resources\systemsettings($this);
+            $this->resources[] = new \ltiservice_toolsettings\local\resources\contextsettings($this);
+            $this->resources[] = new \ltiservice_toolsettings\local\resources\linksettings($this);
         }
 
         return $this->resources;
         }
 
         return $this->resources;
diff --git a/mod/lti/service/toolsettings/db/renamedclasses.php b/mod/lti/service/toolsettings/db/renamedclasses.php
new file mode 100644 (file)
index 0000000..4e8d4da
--- /dev/null
@@ -0,0 +1,35 @@
+<?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',
+);
+