static-configuration 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. //temp folder for uploads
  3. $tempfolder = "/home/ccan/upload-temp/";
  4. //location of upload script (for posting uploads)
  5. $uploadscript = "http://ccan.ozlabs.org/uploader.php";
  6. //infofile
  7. $infofile = '/_info';
  8. //ccan admin
  9. $ccanadmin = "rusty@rustcorp.com.au";
  10. //email from
  11. $frommail = "ccan@ozlabs.org";
  12. //tar home dir
  13. $tar_dir = 'tarballs';
  14. //where bzr repo is: attach module name to browse
  15. $repo_base = 'http://ccan.ozlabs.org/repo/?cmd=inventory;path=';
  16. function extract_field($field,$module)
  17. {
  18. return htmlspecialchars(shell_exec('tools/doc_extract '.$field.' '.$module.'/_info'));
  19. }
  20. // Convert double line breaks into paragraphs, and blank spaces into preformat.
  21. function htmlize_field($field,$module)
  22. {
  23. $state="inpara";
  24. $result="<p>";
  25. $raw=extract_field($field,$module);
  26. foreach (explode("\n", $raw) as $line) {
  27. if ($line == "") {
  28. switch ($state) {
  29. case "inpara":
  30. $state="endpara";
  31. $result .= "</p>";
  32. break;
  33. }
  34. } else if ($line[0] == " " || $line[0] == "\t") {
  35. switch ($state) {
  36. case "literal":
  37. break;
  38. case "inpara":
  39. $result .= "</p>";
  40. case "endpara":
  41. $result .= "<pre>";
  42. $state = "literal";
  43. }
  44. } else {
  45. switch ($state) {
  46. case "literal":
  47. $result .= "</pre>";
  48. case "endpara":
  49. $result .= "<p>";
  50. $state = "inpara";
  51. }
  52. }
  53. $result .= $line . "\n";
  54. }
  55. switch ($state) {
  56. case "literal":
  57. $result .= "</pre>";
  58. break;
  59. case "inpara":
  60. $result .= "</p>";
  61. break;
  62. }
  63. return $result;
  64. }
  65. ?>