misc.php 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * The Zoo
  4. * $Id: misc.php,v 1.1 2006-12-03 23:20:08 marand Exp $
  5. */
  6. interface iComparable
  7. {
  8. /**
  9. * Compare the current instance
  10. *
  11. * @param iComparable $other
  12. */
  13. public function cmp(iComparable $other);
  14. }
  15. function get_temp_dir()
  16. {
  17. return 'e:/src/OsinetOffice/tmp';
  18. }
  19. function output_encoder($s)
  20. {
  21. return iconv('UTF-8', 'IBM850', $s);
  22. }
  23. // Activate the OB handler:
  24. ob_start("output_encoder", 2);
  25. /**
  26. * automatically find the glade file for a class file
  27. *
  28. */
  29. function load_glade()
  30. {
  31. return new GladeXML(basename($_SERVER['PHP_SELF'], 'php') . 'glade');
  32. }
  33. /**
  34. * returns the name of the invoking function/method
  35. * if it's a method, it is prefixed by the class name
  36. *
  37. * @return string
  38. */
  39. function func_name()
  40. {
  41. $trace = debug_backtrace();
  42. $func = $trace[1]['function'];
  43. if (isset($trace[1]['class']))
  44. $func = $trace[1]['class'] . '::' . $func;
  45. return $func;
  46. }