Guest User

Untitled

a guest
Jan 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <?php
  2.  
  3. # This is an excerpt from a modified version of the CodeIgniter front controller, index.php
  4.  
  5. /*
  6. |---------------------------------------------------------------
  7. | SYSTEM FOLDER NAME
  8. |---------------------------------------------------------------
  9. |
  10. | This variable must contain the name of your "system" folder.
  11. | Include the path if the folder is not in the same directory
  12. | as this file.
  13. |
  14. | NO TRAILING SLASH!
  15. |
  16. |
  17. | If the $CODEIGNITER_PATH environment variable is set for this
  18. | server, then we will use the version of CodeIgniter it references.
  19. |
  20. | Otherwise, we should make an educated guess about where CodeIgniter
  21. | might be on the server. All CodeIgniter packages are named in the
  22. | format: "CodeIgniter_<version>". Assume that such a package exists
  23. | somewhere on the server within PHP's include_path.
  24. |
  25. | Because CodeIgniter 1.7's class loader attempts to use file_exists( )
  26. | on the BASEPATH (i.e. the $system_folder with a trailing slash),
  27. | our system folder must be an absolute path. We actually have to
  28. | prepend the appropriate include_path folder so that the file_exists( )
  29. | checks on the CodeIgniter library classes do not fail.
  30. |
  31. | It should be noted that at the time of this writing, the
  32. | current stable version of CodeIgniter is 2.0.2.
  33. | Stryker's servers still use an outdated version of
  34. | CodeIgniter that we will be linking against for this app.
  35. |
  36. */
  37. $system_folder = getenv('CODEIGNITER_PATH');
  38. if (!$system_folder) {
  39. $ci_folder = "CodeIgniter_1.7.2/system";
  40. foreach(explode(':', get_include_path()) as $path) {
  41. if (file_exists($path . '/' . $ci_folder)) {
  42. $system_folder = $path . '/' . $ci_folder;
  43. break;
  44. }
  45. }
  46. unset($ci_folder);
  47. }
Add Comment
Please, Sign In to add comment