adminutil.php 614 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Add a directory to the include path
  4. *
  5. * @param dir: The directory to add to the path
  6. * @param at_start: If true, place this directory at the beginning of
  7. * the include path. Otherwise, place it at the end.
  8. */
  9. function includeAdd($dir, $at_start=false)
  10. {
  11. $path = ini_get('include_path');
  12. if (strlen($path)) {
  13. $newpath = $at_start ? "$dir:$path" : "$path:$dir";
  14. } else {
  15. $newpath = $dir;
  16. }
  17. ini_set('include_path', $newpath);
  18. }
  19. /**
  20. * Return the parent directory of this module.
  21. */
  22. function getParent()
  23. {
  24. return dirname(dirname(realpath(__FILE__)));
  25. }
  26. ?>