Source for file LoaderFactory.php

Documentation is available at LoaderFactory.php

  1. <?php
  2.  
  3. /**
  4. * MVCnPHP - LoaderFactory.class.php
  5. *
  6. * This source file is subject to version 2.02 of the PHP license,
  7. * that is bundled with this package in the file LICENSE, and is
  8. * available at through the world-wide-web at
  9. * http://www.php.net/license/2_02.txt.
  10. * If you did not receive a copy of the PHP license and are unable to
  11. * obtain it through the world-wide-web, please send a note to
  12. * license@php.net so we can mail you a copy immediately.
  13. *
  14. * @author Tony Bibbs <tony@geeklog.net>
  15. * @copyright Tony Bibbs 2003-2005
  16. * @package net.geeklog.mvc
  17. * @version $Id: LoaderFactory.class.php,v 1.3 2003/08/28 01:31:22 tony Exp $
  18. *
  19. */
  20.  
  21. /**
  22. * Builds MVC Config Loaders
  23. *
  24. * I doubt much more besides arrays and XML files
  25. * will be used but just in case I used the factory
  26. * pattern in here to enable easily adding new configuration
  27. * data structures
  28. *
  29. * @author Tony Bibbs <tony@geeklog.net>
  30. * @package net.geeklog.mvc
  31. *
  32. */
  33. class MVCnPHP_LoaderFactory {
  34. /**
  35. * Builds requested MVC configuration loaders.
  36. *
  37. * Config loaders each represent one way of parsing
  38. * an MVC configuration data structure into the objects
  39. * needed by the controller.
  40. *
  41. * @author Tony Bibbs <tony@geeklog.net>
  42. * @access public
  43. * @param string $path Path to base MVC directory
  44. * @param int $configType Constant, either MVC_XML or MVC_ARRAY
  45. * @return object MVC config loader
  46. *
  47. */
  48. public function getLoader($configType = MVC_XML)
  49. {
  50. $filename = $configType . '.php';
  51. require_once $filename;
  52. $loaderClassName = 'MVCnPHP_' . $configType;
  53. return new $loaderClassName();
  54. }
  55. }
  56.  
  57. ?>

Documentation generated on Mon, 7 Mar 2005 22:36:22 -0600 by phpDocumentor 1.3.0RC3