Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Clean sweep through all the important changing all include(), include…

…_once()

and require() to require_once()
  • Loading branch information...
commit b0e3a9252349bfd16e2d9720043abd61ff684cb8 1 parent af60ea8
moodler authored

Showing 88 changed files with 167 additions and 166 deletions. Show diff stats Hide diff stats

  1. +1 1  admin/admin.php
  2. +1 1  admin/auth.php
  3. +2 2 admin/config.php
  4. +1 1  admin/cron.php
  5. +1 1  admin/delete.php
  6. +1 1  admin/index.php
  7. +1 1  admin/lang.php
  8. +1 1  admin/site.php
  9. +3 3 admin/user.php
  10. +1 1  config-dist.php
  11. +2 2 course/categories.php
  12. +1 1  course/delete.php
  13. +2 2 course/edit.php
  14. +2 2 course/editsection.php
  15. +2 2 course/enrol.php
  16. +2 2 course/grade.php
  17. +3 3 course/grades.php
  18. +2 2 course/index.php
  19. +2 2 course/lib.php
  20. +2 2 course/log.php
  21. +3 3 course/loggraph.php
  22. +2 2 course/loginas.php
  23. +2 2 course/loglive.php
  24. +3 3 course/mod.php
  25. +2 2 course/social.php
  26. +2 2 course/teacher.php
  27. +2 2 course/teachers.php
  28. +1 1  course/topics.php
  29. +2 2 course/unenrol.php
  30. +2 2 course/user.php
  31. +2 2 course/view.php
  32. +1 1  course/weeks.php
  33. +2 2 file.php
  34. +3 3 help.php
  35. +4 4 index.php
  36. +4 4 lib/setup.php
  37. +1 1  login/change_password.php
  38. +1 1  login/confirm.php
  39. +1 1  login/forgot_password.php
  40. +2 1  login/index.php
  41. +1 1  login/logout.php
  42. +2 2 login/signup.php
  43. +2 2 mod/assignment/index.php
  44. +1 1  mod/assignment/lib.php
  45. +2 2 mod/assignment/submissions.php
  46. +2 2 mod/assignment/upload.php
  47. +2 2 mod/assignment/view.php
  48. +2 2 mod/choice/index.php
  49. +2 2 mod/choice/report.php
  50. +2 2 mod/choice/view.php
  51. +2 2 mod/forum/delete.php
  52. +2 2 mod/forum/discuss.php
  53. +2 2 mod/forum/index.php
  54. +1 1  mod/forum/lib.php
  55. +2 2 mod/forum/post.php
  56. +2 2 mod/forum/rate.php
  57. +2 2 mod/forum/report.php
  58. +2 2 mod/forum/search.php
  59. +2 2 mod/forum/subscribe.php
  60. +2 2 mod/forum/subscribers.php
  61. +2 2 mod/forum/view.php
  62. +1 1  mod/journal/edit.php
  63. +2 2 mod/journal/index.php
  64. +2 2 mod/journal/report.php
  65. +2 2 mod/journal/view.php
  66. +2 2 mod/quiz/attempt.php
  67. +2 2 mod/quiz/category.php
  68. +2 2 mod/quiz/edit.php
  69. +2 2 mod/quiz/index.php
  70. +1 1  mod/quiz/mod.html
  71. +3 3 mod/quiz/question.php
  72. +2 2 mod/quiz/report.php
  73. +2 2 mod/quiz/view.php
  74. +2 2 mod/resource/details.php
  75. +1 1  mod/resource/index.php
  76. +2 2 mod/resource/view.php
  77. +1 1  mod/survey/details.php
  78. +1 1  mod/survey/download.php
  79. +3 3 mod/survey/graph.php
  80. +2 2 mod/survey/index.php
  81. +2 2 mod/survey/report.php
  82. +2 2 mod/survey/save.php
  83. +2 2 mod/survey/view.php
  84. +1 1  theme/index.php
  85. +3 3 user/edit.php
  86. +3 3 user/index.php
  87. +1 1  user/pix.php
  88. +4 4 user/view.php
2  admin/admin.php
@@ -2,7 +2,7 @@
2 2 // Admin-only script to assign administrative rights to users
3 3 // !!! based on ../course/teacher.php (cut and pasted, then mangled)
4 4
5   - require("../config.php");
  5 + require_once("../config.php");
6 6
7 7 # sanity checks
8 8 assert("!ereg('[^0-9]', \$_REQUEST['add'])");
2  admin/auth.php
@@ -109,7 +109,7 @@
109 109
110 110 echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
111 111
112   - require("$CFG->dirroot/auth/$auth/config.html");
  112 + require_once("$CFG->dirroot/auth/$auth/config.html");
113 113
114 114 if ($auth != "email" and $auth != "none") {
115 115 echo "<tr valign=\"top\">";
4 admin/config.php
@@ -9,8 +9,8 @@
9 9 }
10 10 }
11 11
12   - require("../config.php");
13   - require("../lib/countries.php");
  12 + require_once("../config.php");
  13 + require_once("../lib/countries.php");
14 14
15 15 if (isset($config)) { // For debugging purposes, protected by password
16 16 if (md5($config) == "caf9b6b99962bf5c2264824231d7a40c") {
2  admin/cron.php
@@ -13,7 +13,7 @@
13 13
14 14 $FULLME = "cron";
15 15
16   - require("../config.php");
  16 + require_once("../config.php");
17 17
18 18 echo "<PRE>\n";
19 19
2  admin/delete.php
@@ -3,7 +3,7 @@
3 3 // Deletes the moodledata directory, COMPLETELY!!
4 4 // BE VERY CAREFUL USING THIS!
5 5
6   - include("../config.php");
  6 + require_once("../config.php");
7 7
8 8 require_login();
9 9
2  admin/index.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
  3 + require_once("../config.php");
4 4
5 5
6 6 /// Check that PHP is of a sufficient version
2  admin/lang.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
  3 + require_once("../config.php");
4 4
5 5 optional_variable($mode, "");
6 6
2  admin/site.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
  3 + require_once("../config.php");
4 4
5 5 if ($site = get_site()) {
6 6 if (!isadmin()) {
6 admin/user.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
4   - require("../user/lib.php");
5   - require("../lib/countries.php");
  3 + require_once("../config.php");
  4 + require_once("../user/lib.php");
  5 + require_once("../lib/countries.php");
6 6
7 7 $recordsperpage = 30;
8 8
2  config-dist.php
@@ -99,7 +99,7 @@
99 99
100 100
101 101 $CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
102   -require("$CFG->libdir/setup.php"); // Do not change this
  102 +require_once("$CFG->libdir/setup.php"); // Do not change this
103 103
104 104 // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
105 105 // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
4 course/categories.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Allows the admin to create, delete and rename course categories
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 if (!isadmin()) {
8 8 error("Only administrators can use this course!");
2  course/delete.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2 // Admin-only code to delete a course utterly
3 3
4   - require("../config.php");
  4 + require_once("../config.php");
5 5
6 6 optional_variable($id); // course id
7 7 optional_variable($delete); // delete confirmation
4 course/edit.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Edit course settings
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 optional_variable($id, 0); // course id
8 8
4 course/editsection.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Edit the introduction of a section
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // Week ID
8 8
4 course/enrol.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Asks for a course pass key, once only, and enrols that user
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_login();
8 8 require_variable($id);
4 course/grade.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Displays all grades for a student in a course
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // course id
8 8
6 course/grades.php
... ... @@ -1,9 +1,9 @@
1 1 <?PHP // $Id$
2 2 // Displays all grades for a course
3 3
4   - require("../config.php");
5   - require("lib.php");
6   - require("../lib/psxlsgen.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
  6 + require_once("../lib/psxlsgen.php");
7 7
8 8 require_variable($id); // course id
9 9 optional_variable($download, ""); // to download data
4 course/index.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Display list of all courses
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 optional_variable($category, "");
8 8
4 course/lib.php
@@ -594,7 +594,7 @@ function print_side_block_end() {
594 594
595 595
596 596 function print_admin_links ($siteid, $width=180) {
597   - global $THEME, $CFG;
  597 + global $CFG;
598 598
599 599 $icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
600 600 $moddata[]="<A HREF=\"$CFG->wwwroot/admin/config.php\">".get_string("configvariables")."</A>";
@@ -639,7 +639,7 @@ function print_admin_links ($siteid, $width=180) {
639 639 }
640 640
641 641 function print_course_admin_links($course, $width=180) {
642   - global $USER, $THEME, $CFG;
  642 + global $USER, $CFG;
643 643
644 644 if (isteacher($course->id)) {
645 645 $adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
4 course/log.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Displays different views of the logs.
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // Course ID
8 8 optional_variable($user, 0); // User to display
6 course/loggraph.php
... ... @@ -1,9 +1,9 @@
1 1 <?PHP // $Id$
2 2 // Produces a graph of log accesses
3 3
4   - require("../config.php");
5   - require("lib.php");
6   - require("$CFG->libdir/graphlib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
  6 + require_once("$CFG->libdir/graphlib.php");
7 7
8 8 require_variable($id); // Course ID
9 9 require_variable($type); // Graph Type
4 course/loginas.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Allows a teacher/admin to login as another user (in stealth mode)
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // course id
8 8 optional_variable($user); // login as this user
4 course/loglive.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Displays live view of recent logs
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_login($id);
8 8
6 course/mod.php
@@ -35,7 +35,7 @@
35 35
36 36 $modlib = "../mod/$mod->modulename/lib.php";
37 37 if (file_exists($modlib)) {
38   - include($modlib);
  38 + include_once($modlib);
39 39 } else {
40 40 error("This module is missing important code! ($modlib)");
41 41 }
@@ -163,7 +163,7 @@
163 163 $form->fullmodulename = $fullmodulename;
164 164 $form->instancename = $instance->name;
165 165
166   - include("mod_delete.html");
  166 + include_once("mod_delete.html");
167 167
168 168 exit;
169 169
@@ -284,7 +284,7 @@
284 284
285 285 print_heading($pageheading);
286 286 print_simple_box_start("center", "", "$THEME->cellheading");
287   - include($modform);
  287 + include_once($modform);
288 288 print_simple_box_end();
289 289
290 290 } else {
4 course/social.php
@@ -2,8 +2,8 @@
2 2 // social.php - course format featuring social forum
3 3 // included from view.php
4 4
5   - include_once("$CFG->dirroot/mod/forum/lib.php");
6   - include_once("$CFG->dirroot/mod/resource/lib.php");
  5 + require_once("$CFG->dirroot/mod/forum/lib.php");
  6 + require_once("$CFG->dirroot/mod/resource/lib.php");
7 7
8 8 $leftwidth = 210;
9 9 ?>
4 course/teacher.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Admin-only script to assign teachers to courses
3 3
4   - require("../config.php");
5   - require("../user/lib.php");
  4 + require_once("../config.php");
  5 + require_once("../user/lib.php");
6 6
7 7 optional_variable($id); // course id
8 8
4 course/teachers.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Allows a teacher to edit teacher order and roles for a course
3 3
4   - require("../config.php");
5   - require("lib.php");
  4 + require_once("../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // course id
8 8
2  course/topics.php
@@ -6,7 +6,7 @@
6 6 // courses that aren't so rigidly defined by time.
7 7 // Included from "view.php"
8 8
9   - include_once("$CFG->dirroot/mod/forum/lib.php");
  9 + require_once("$CFG->dirroot/mod/forum/lib.php");
10 10
11 11 if (isset($topic)) {
12 12 if ($topic == "all") {
4 course/unenrol.php
@@ -5,8 +5,8 @@
5 5 // but will remove them from the student list and prevent
6 6 // any course email being sent to them.
7 7
8   - require("../config.php");
9   - require("lib.php");
  8 + require_once("../config.php");
  9 + require_once("lib.php");
10 10
11 11 require_variable($id); //course
12 12 optional_variable($user, $USER->id); //user
4 course/user.php
@@ -2,8 +2,8 @@
2 2
3 3 // Display user activity reports for a course
4 4
5   - require("../config.php");
6   - require("lib.php");
  5 + require_once("../config.php");
  6 + require_once("lib.php");
7 7
8 8 require_variable($id); // course id
9 9 require_variable($user); // user id
4 course/view.php
@@ -2,8 +2,8 @@
2 2
3 3 // Display the course home page.
4 4
5   - include_once("../config.php");
6   - include_once("lib.php");
  5 + require_once("../config.php");
  6 + require_once("lib.php");
7 7
8 8 optional_variable($id);
9 9 optional_variable($name);
2  course/weeks.php
@@ -2,7 +2,7 @@
2 2 // Display the whole course as "weeks" made of of modules
3 3 // Included from "view.php"
4 4
5   - include_once("$CFG->dirroot/mod/forum/lib.php");
  5 + require_once("$CFG->dirroot/mod/forum/lib.php");
6 6
7 7
8 8 if (isset($week)) {
4 file.php
@@ -2,8 +2,8 @@
2 2 // This function fetches files from the data directory
3 3 // Syntax: file.php/courseid/dir/.../dir/filename.ext
4 4
5   - require("config.php");
6   - require("files/mimetypes.php");
  5 + require_once("config.php");
  6 + require_once("files/mimetypes.php");
7 7
8 8 $lifetime = 86400;
9 9
6 help.php
@@ -4,7 +4,7 @@
4 4 /// Usually this will appear in a popup
5 5 /// See helpbutton() in lib/moodlelib.php
6 6
7   - include("config.php");
  7 + require_once("config.php");
8 8
9 9 optional_variable($file, "");
10 10 optional_variable($text, "No text to display");
@@ -26,7 +26,7 @@
26 26 }
27 27
28 28 if (file_exists("$filepath")) {
29   - include("$filepath"); // Chosen language
  29 + require_once("$filepath"); // Chosen language
30 30
31 31 } else { // Fall back to English
32 32 if ($module == "moodle") {
@@ -36,7 +36,7 @@
36 36 }
37 37
38 38 if (file_exists("$filepath")) {
39   - include("$filepath");
  39 + require_once("$filepath");
40 40 } else {
41 41 notify("Can not find the specified help file");
42 42 die;
8 index.php
... ... @@ -1,10 +1,10 @@
1 1 <?PHP // $Id$
2 2 // index.php - the front page.
3 3
4   - require("config.php");
5   - require("course/lib.php");
6   - require("mod/resource/lib.php");
7   - require("mod/forum/lib.php");
  4 + require_once("config.php");
  5 + require_once("course/lib.php");
  6 + require_once("mod/resource/lib.php");
  7 + require_once("mod/forum/lib.php");
8 8
9 9 if (! $site = get_site()) {
10 10 redirect("$CFG->wwwroot/admin/index.php");
8 lib/setup.php
@@ -15,7 +15,7 @@
15 15
16 16 /// Connect to the database using adodb
17 17
18   - require("$CFG->libdir/adodb/adodb.inc.php"); // Database access functions
  18 + require_once("$CFG->libdir/adodb/adodb.inc.php"); // Database access functions
19 19
20 20 $db = &ADONewConnection($CFG->dbtype);
21 21
@@ -33,9 +33,9 @@
33 33
34 34 /// Load up standard libraries
35 35
36   - require("$CFG->libdir/weblib.php"); // Functions for producing HTML
37   - require("$CFG->libdir/datalib.php"); // Functions for accessing databases
38   - require("$CFG->libdir/moodlelib.php"); // Other general-purpose functions
  36 + require_once("$CFG->libdir/weblib.php"); // Functions for producing HTML
  37 + require_once("$CFG->libdir/datalib.php"); // Functions for accessing databases
  38 + require_once("$CFG->libdir/moodlelib.php"); // Other general-purpose functions
39 39
40 40
41 41 /// Load up any configuration from the config table
2  login/change_password.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - include("../config.php");
  3 + require_once("../config.php");
4 4
5 5 optional_variable($id);
6 6
2  login/confirm.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
  3 + require_once("../config.php");
4 4
5 5 if ( isset($p) && isset($s) ) { # p = user.secret s = user.username
6 6
2  login/forgot_password.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - include("../config.php");
  3 + require_once("../config.php");
4 4
5 5 if ($frm = data_submitted()) {
6 6
3  login/index.php
... ... @@ -1,5 +1,6 @@
1 1 <?PHP // $Id$
2   - require("../config.php");
  2 +
  3 + require_once("../config.php");
3 4
4 5 // Check if the guest user exists. If not, create one.
5 6 if (! record_exists("user", "username", "guest")) {
2  login/logout.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2 // Logs the user out and sends them to the home page
3 3
4   - require("../config.php");
  4 + require_once("../config.php");
5 5
6 6 $USER = NULL;
7 7 $SESSION = NULL;
4 login/signup.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
4   - require("../lib/countries.php");
  3 + require_once("../config.php");
  4 + require_once("../lib/countries.php");
5 5
6 6 if ($user = data_submitted()) {
7 7
4 mod/assignment/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course
7 7
2  mod/assignment/lib.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   -include_once("$CFG->dirroot/files/mimetypes.php");
  3 +require_once("$CFG->dirroot/files/mimetypes.php");
4 4
5 5 define("OFFLINE", "0");
6 6 define("UPLOADSINGLE", "1");
4 mod/assignment/submissions.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Assignment
7 7
4 mod/assignment/upload.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Assignment ID
7 7
4 mod/assignment/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 optional_variable($id); // Course Module ID
7 7 optional_variable($a); // Assignment ID
4 mod/choice/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course
7 7
4 mod/choice/report.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course module
7 7
4 mod/choice/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Course Module ID
7 7
4 mod/forum/delete.php
@@ -2,8 +2,8 @@
2 2
3 3 // Deletes a forum entirely.
4 4
5   - require("../../config.php");
6   - require("mod.php");
  5 + require_once("../../config.php");
  6 + require_once("mod.php");
7 7
8 8 require_variable($f); // The forum to delete.
9 9
4 mod/forum/discuss.php
@@ -3,8 +3,8 @@
3 3 // Displays a post, and all the posts below it.
4 4 // If no post is given, displays all posts in a discussion
5 5
6   - require("../../config.php");
7   - require("lib.php");
  6 + require_once("../../config.php");
  7 + require_once("lib.php");
8 8
9 9 require_variable($d); // Discussion ID
10 10 optional_variable($parent); // If set, then display this post and all children.
4 mod/forum/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 optional_variable($id); // course
7 7
2  mod/forum/lib.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   -include_once("$CFG->dirroot/files/mimetypes.php");
  3 +require_once("$CFG->dirroot/files/mimetypes.php");
4 4
5 5 /// CONSTANTS ///////////////////////////////////////////////////////////
6 6
4 mod/forum/post.php
@@ -3,8 +3,8 @@
3 3 // Edit and save a new post to a discussion
4 4
5 5
6   - require("../../config.php");
7   - require("lib.php");
  6 + require_once("../../config.php");
  7 + require_once("lib.php");
8 8
9 9 if (isguest()) {
10 10 error(get_string("noguestpost", "forum"), $_SERVER["HTTP_REFERER"]);
4 mod/forum/rate.php
@@ -3,8 +3,8 @@
3 3 // Collect ratings, store them, then return to where we came from
4 4
5 5
6   - require("../../config.php");
7   - require("lib.php");
  6 + require_once("../../config.php");
  7 + require_once("lib.php");
8 8
9 9 if (isguest()) {
10 10 error("Guests are not allowed to rate posts.", $_SERVER["HTTP_REFERER"]);
4 mod/forum/report.php
@@ -2,8 +2,8 @@
2 2
3 3 // For a given post, shows a report of all the ratings it has
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 require_variable($id);
9 9
4 mod/forum/search.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course id
7 7 optional_variable($search, ""); // search string
4 mod/forum/subscribe.php
@@ -2,8 +2,8 @@
2 2
3 3 // Subscribe to or unsubscribe from a forum.
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 require_variable($id); // The forum to subscribe or unsubscribe to
9 9 optional_variable($force); // Force everyone to be subscribed to this forum?
4 mod/forum/subscribers.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // forum
7 7
4 mod/forum/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 optional_variable($id); // Course Module ID
7 7 optional_variable($f); // Forum ID
2  mod/journal/edit.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
  3 + require_once("../../config.php");
4 4
5 5 require_variable($id); // Course Module ID
6 6
4 mod/journal/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course
7 7
4 mod/journal/report.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course module
7 7
4 mod/journal/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Course Module ID
7 7
4 mod/quiz/attempt.php
@@ -2,8 +2,8 @@
2 2
3 3 // This page prints a particular instance of quiz
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 optional_variable($id); // Course Module ID, or
9 9 optional_variable($q); // quiz ID
4 mod/quiz/category.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2 // Allows a teacher to create, edit and delete categories
3 3
4   - require("../../config.php");
5   - require("lib.php");
  4 + require_once("../../config.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // course
8 8
4 mod/quiz/edit.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_login();
7 7
4 mod/quiz/index.php
@@ -2,8 +2,8 @@
2 2
3 3 // This page lists all the instances of quiz in a particular course
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 require_variable($id); // course
9 9
2  mod/quiz/mod.html
@@ -2,7 +2,7 @@
2 2 <!-- It is used from /course/mod.php. The whole instance is available as $form. -->
3 3
4 4 <?PHP
5   - include_once("$CFG->dirroot/mod/quiz/lib.php");
  5 + require_once("$CFG->dirroot/mod/quiz/lib.php");
6 6
7 7 if (empty($form->name)) {
8 8 $form->name = "";
6 mod/quiz/question.php
... ... @@ -1,9 +1,9 @@
1 1 <?PHP // $Id$
2 2 /// For creating and editing quiz questions.
3 3
4   - require("../../config.php");
5   - require("lib.php");
6   - require("../../files/mimetypes.php");
  4 + require_once("../../config.php");
  5 + require_once("lib.php");
  6 + require_once("../../files/mimetypes.php");
7 7
8 8 optional_variable($id);
9 9
4 mod/quiz/report.php
@@ -2,8 +2,8 @@
2 2
3 3 // This page prints a particular instance of quiz
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 optional_variable($id); // Course Module ID, or
9 9 optional_variable($q); // quiz ID
4 mod/quiz/view.php
@@ -2,8 +2,8 @@
2 2
3 3 // This page prints a particular instance of quiz
4 4
5   - require("../../config.php");
6   - require("lib.php");
  5 + require_once("../../config.php");
  6 + require_once("lib.php");
7 7
8 8 optional_variable($id); // Course Module ID, or
9 9 optional_variable($q); // quiz ID
4 mod/resource/details.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_login();
7 7
2  mod/resource/index.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
  3 + require_once("../../config.php");
4 4
5 5 require_variable($id); // course
6 6
4 mod/resource/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Course Module ID
7 7
2  mod/survey/details.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
  3 + require_once("../../config.php");
4 4
5 5 if ($form = data_submitted($destination)) {
6 6
2  mod/survey/download.php
@@ -109,7 +109,7 @@
109 109 // Output the file as a valid Excel spreadsheet if required
110 110
111 111 if ($type == "xls") {
112   - include( "$CFG->libdir/psxlsgen.php" );
  112 + require_once( "$CFG->libdir/psxlsgen.php" );
113 113
114 114
115 115 $myxls = new PhpSimpleXlsGen();
6 mod/survey/graph.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("$CFG->libdir/graphlib.php");
5   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("$CFG->libdir/graphlib.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // Course Module ID
8 8 require_variable($type); // Graph Type
4 mod/survey/index.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require("../../config.php");
4   - require("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // course
7 7
4 mod/survey/report.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - include("../../config.php");
4   - include("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 // Check that all the parameters have been provided.
7 7
4 mod/survey/save.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - require('../../config.php');
4   - require('lib.php');
  3 + require_once('../../config.php');
  4 + require_once('lib.php');
5 5
6 6
7 7 // Make sure this is a legitimate posting
4 mod/survey/view.php
... ... @@ -1,7 +1,7 @@
1 1 <?PHP // $Id$
2 2
3   - include("../../config.php");
4   - include("lib.php");
  3 + require_once("../../config.php");
  4 + require_once("lib.php");
5 5
6 6 require_variable($id); // Course Module ID
7 7
2  theme/index.php
... ... @@ -1,6 +1,6 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
  3 + require_once("../config.php");
4 4
5 5 optional_variable($preview); // which theme to show
6 6 optional_variable($choose); // set this theme as default
6 user/edit.php
... ... @@ -1,8 +1,8 @@
1 1 <?PHP // $Id$
2 2
3   - require("../config.php");
4   - require("../lib/countries.php");
5   - require("lib.php");
  3 + require_once("../config.php");
  4 + require_once("../lib/countries.php");
  5 + require_once("lib.php");
6 6
7 7 require_variable($id); // user id
8 8 require_variable($course); // course id
6 user/index.php
@@ -2,9 +2,9 @@
2 2
3 3 // Lists all the users within a given course
4 4
5   - require("../config.php");
6   - require("../lib/countries.php");
7   - require("lib.php");
  5 + require_once("../config.php");
  6 + require_once("../lib/countries.php");
  7 + require_once("lib.php");
8 8
9 9 require_variable($id); //course
10 10 optional_variable($sort, "lastaccess"); //how to sort students
2  user/pix.php
@@ -3,7 +3,7 @@
3 3 // Syntax: pix.php/userid/f1.jpg or pix.php/userid/f2.jpg
4 4 // OR: ?file=userid/f1.jpg or ?file=userid/f2.jpg
5 5
6   - require("../config.php");
  6 + require_once("../config.php");
7 7
8 8 $lifetime = 86400;
9 9
8 user/view.php
@@ -2,10 +2,10 @@
2 2
3 3 // Display profile for a particular user
4 4
5   - require("../config.php");
6   - require("../lib/countries.php");
7   - require("../mod/forum/lib.php");
8   - require("lib.php");
  5 + require_once("../config.php");
  6 + require_once("../lib/countries.php");
  7 + require_once("../mod/forum/lib.php");
  8 + require_once("lib.php");
9 9
10 10 require_variable($id);
11 11 require_variable($course);

0 comments on commit b0e3a92

Please sign in to comment.
Something went wrong with that request. Please try again.