Permalink
Browse files

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

…_once()

and require() to require_once()
  • Loading branch information...
1 parent af60ea8 commit b0e3a9252349bfd16e2d9720043abd61ff684cb8 moodler committed Jan 5, 2003
Showing with 167 additions and 166 deletions.
  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
View
@@ -2,7 +2,7 @@
// Admin-only script to assign administrative rights to users
// !!! based on ../course/teacher.php (cut and pasted, then mangled)
- require("../config.php");
+ require_once("../config.php");
# sanity checks
assert("!ereg('[^0-9]', \$_REQUEST['add'])");
View
@@ -109,7 +109,7 @@
echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\">";
- require("$CFG->dirroot/auth/$auth/config.html");
+ require_once("$CFG->dirroot/auth/$auth/config.html");
if ($auth != "email" and $auth != "none") {
echo "<tr valign=\"top\">";
View
@@ -9,8 +9,8 @@
}
}
- require("../config.php");
- require("../lib/countries.php");
+ require_once("../config.php");
+ require_once("../lib/countries.php");
if (isset($config)) { // For debugging purposes, protected by password
if (md5($config) == "caf9b6b99962bf5c2264824231d7a40c") {
View
@@ -13,7 +13,7 @@
$FULLME = "cron";
- require("../config.php");
+ require_once("../config.php");
echo "<PRE>\n";
View
@@ -3,7 +3,7 @@
// Deletes the moodledata directory, COMPLETELY!!
// BE VERY CAREFUL USING THIS!
- include("../config.php");
+ require_once("../config.php");
require_login();
View
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
/// Check that PHP is of a sufficient version
View
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
optional_variable($mode, "");
View
@@ -1,6 +1,6 @@
<?PHP // $Id$
- require("../config.php");
+ require_once("../config.php");
if ($site = get_site()) {
if (!isadmin()) {
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
- require("../config.php");
- require("../user/lib.php");
- require("../lib/countries.php");
+ require_once("../config.php");
+ require_once("../user/lib.php");
+ require_once("../lib/countries.php");
$recordsperpage = 30;
View
@@ -99,7 +99,7 @@
$CFG->libdir = "$CFG->dirroot/lib"; // Do not change this
-require("$CFG->libdir/setup.php"); // Do not change this
+require_once("$CFG->libdir/setup.php"); // Do not change this
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows the admin to create, delete and rename course categories
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
if (!isadmin()) {
error("Only administrators can use this course!");
View
@@ -1,7 +1,7 @@
<?PHP // $Id$
// Admin-only code to delete a course utterly
- require("../config.php");
+ require_once("../config.php");
optional_variable($id); // course id
optional_variable($delete); // delete confirmation
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Edit course settings
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($id, 0); // course id
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Edit the introduction of a section
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // Week ID
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Asks for a course pass key, once only, and enrols that user
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_login();
require_variable($id);
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays all grades for a student in a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
View
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Displays all grades for a course
- require("../config.php");
- require("lib.php");
- require("../lib/psxlsgen.php");
+ require_once("../config.php");
+ require_once("lib.php");
+ require_once("../lib/psxlsgen.php");
require_variable($id); // course id
optional_variable($download, ""); // to download data
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Display list of all courses
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($category, "");
View
@@ -594,7 +594,7 @@ function print_side_block_end() {
function print_admin_links ($siteid, $width=180) {
- global $THEME, $CFG;
+ global $CFG;
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/config.php\">".get_string("configvariables")."</A>";
@@ -639,7 +639,7 @@ function print_admin_links ($siteid, $width=180) {
}
function print_course_admin_links($course, $width=180) {
- global $USER, $THEME, $CFG;
+ global $USER, $CFG;
if (isteacher($course->id)) {
$adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays different views of the logs.
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // Course ID
optional_variable($user, 0); // User to display
View
@@ -1,9 +1,9 @@
<?PHP // $Id$
// Produces a graph of log accesses
- require("../config.php");
- require("lib.php");
- require("$CFG->libdir/graphlib.php");
+ require_once("../config.php");
+ require_once("lib.php");
+ require_once("$CFG->libdir/graphlib.php");
require_variable($id); // Course ID
require_variable($type); // Graph Type
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows a teacher/admin to login as another user (in stealth mode)
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
optional_variable($user); // login as this user
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Displays live view of recent logs
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_login($id);
View
@@ -35,7 +35,7 @@
$modlib = "../mod/$mod->modulename/lib.php";
if (file_exists($modlib)) {
- include($modlib);
+ include_once($modlib);
} else {
error("This module is missing important code! ($modlib)");
}
@@ -163,7 +163,7 @@
$form->fullmodulename = $fullmodulename;
$form->instancename = $instance->name;
- include("mod_delete.html");
+ include_once("mod_delete.html");
exit;
@@ -284,7 +284,7 @@
print_heading($pageheading);
print_simple_box_start("center", "", "$THEME->cellheading");
- include($modform);
+ include_once($modform);
print_simple_box_end();
} else {
View
@@ -2,8 +2,8 @@
// social.php - course format featuring social forum
// included from view.php
- include_once("$CFG->dirroot/mod/forum/lib.php");
- include_once("$CFG->dirroot/mod/resource/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/resource/lib.php");
$leftwidth = 210;
?>
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Admin-only script to assign teachers to courses
- require("../config.php");
- require("../user/lib.php");
+ require_once("../config.php");
+ require_once("../user/lib.php");
optional_variable($id); // course id
View
@@ -1,8 +1,8 @@
<?PHP // $Id$
// Allows a teacher to edit teacher order and roles for a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
View
@@ -6,7 +6,7 @@
// courses that aren't so rigidly defined by time.
// Included from "view.php"
- include_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
if (isset($topic)) {
if ($topic == "all") {
View
@@ -5,8 +5,8 @@
// but will remove them from the student list and prevent
// any course email being sent to them.
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); //course
optional_variable($user, $USER->id); //user
View
@@ -2,8 +2,8 @@
// Display user activity reports for a course
- require("../config.php");
- require("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
require_variable($id); // course id
require_variable($user); // user id
View
@@ -2,8 +2,8 @@
// Display the course home page.
- include_once("../config.php");
- include_once("lib.php");
+ require_once("../config.php");
+ require_once("lib.php");
optional_variable($id);
optional_variable($name);
View
@@ -2,7 +2,7 @@
// Display the whole course as "weeks" made of of modules
// Included from "view.php"
- include_once("$CFG->dirroot/mod/forum/lib.php");
+ require_once("$CFG->dirroot/mod/forum/lib.php");
if (isset($week)) {
View
@@ -2,8 +2,8 @@
// This function fetches files from the data directory
// Syntax: file.php/courseid/dir/.../dir/filename.ext
- require("config.php");
- require("files/mimetypes.php");
+ require_once("config.php");
+ require_once("files/mimetypes.php");
$lifetime = 86400;
View
@@ -4,7 +4,7 @@
/// Usually this will appear in a popup
/// See helpbutton() in lib/moodlelib.php
- include("config.php");
+ require_once("config.php");
optional_variable($file, "");
optional_variable($text, "No text to display");
@@ -26,7 +26,7 @@
}
if (file_exists("$filepath")) {
- include("$filepath"); // Chosen language
+ require_once("$filepath"); // Chosen language
} else { // Fall back to English
if ($module == "moodle") {
@@ -36,7 +36,7 @@
}
if (file_exists("$filepath")) {
- include("$filepath");
+ require_once("$filepath");
} else {
notify("Can not find the specified help file");
die;
Oops, something went wrong.

0 comments on commit b0e3a92

Please sign in to comment.