Source for file HarmoniConfig.class.php

Documentation is available at HarmoniConfig.class.php

  1. <?php
  2.  
  3. require_once(HARMONI . "utilities/DataContainer.abstract.php");
  4. require_once(HARMONI . "errorHandler/Error.class.php");
  5. require_once(HARMONI . "errorHandler/throw.inc.php");
  6.  
  7.  
  8. /**
  9. * The HamoniConfig is a {@link DataContainer} for the {@link Harmoni} object.
  10. *
  11. * @package harmoni.architecture
  12. *
  13. * @copyright Copyright &copy; 2005, Middlebury College
  14. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  15. *
  16. * @version $Id: HarmoniConfig.class.php,v 1.14 2007/09/05 19:55:20 adamfranco Exp $
  17. */
  18.  
  19. class HarmoniConfig extends DataContainer {
  20. /**
  21. * Constructor -- sets up the allowed fields for this kind of {@link DataContainer}
  22. *
  23. * @see DataContainer
  24. * @access public
  25. * @return void
  26. */
  27. function HarmoniConfig()
  28. {
  29. // initialize the data container
  30. $this -> init();
  31. // add the fields we want to allow
  32. $message = "HarmoniConfig - the option 'defaultAction' must be set to a string value!";
  33. $type = "Harmoni";
  34. $this -> add("defaultAction", StringValidatorRule::getRule(), $message, $type);
  35. $this -> add("defaultAction", FieldRequiredValidatorRule::getRule(), $message, $type);
  36. unset( $message, $type);
  37. $message ="HarmoniConfig - the option 'defaultModule' must be set to a string value!";
  38. $type = "Harmoni";
  39. $this -> add("defaultModule", StringValidatorRule::getRule(), $message, $type);
  40. $this -> add("defaultModule", FieldRequiredValidatorRule::getRule(), $message, $type);
  41. $this -> add("programTitle", StringValidatorRule::getRule(), $message, $type);
  42. $this -> add("sessionName", FieldRequiredValidatorRule::getRule());
  43. $this -> set("sessionName","Harmoni");
  44. $this -> add("sessionUseCookies", BooleanValidatorRule::getRule());
  45. $this -> set("sessionUseCookies",true);
  46. $this -> add("sessionUseOnlyCookies", BooleanValidatorRule::getRule());
  47. $this -> set("sessionUseOnlyCookies",true);
  48. $this -> add("sessionCookiePath", FieldRequiredValidatorRule::getRule());
  49. $this -> set("sessionCookiePath","/");
  50. $this -> add("sessionCookieDomain", StringValidatorRule::getRule(), "HarmoniConfig - You must set the 'sessionDomain' to the DNS domain you would like your session cookie sent to! (eg, '.mydomain.com')", "Harmoni");
  51. $this -> set("sessionCookieDomain", ""); // default
  52. }
  53. }
  54.  
  55. ?>

Documentation generated on Wed, 19 Sep 2007 10:23:51 -0400 by phpDocumentor 1.3.0RC3