sfLoader.class.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * sfLoader is a class which contains the logic to look for files/classes in symfony.
  11. *
  12. * This class is deprecated. The same methods now exist in sfApplicationConfiguration.
  13. *
  14. * @package symfony
  15. * @subpackage util
  16. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  17. * @version SVN: $Id: sfLoader.class.php 11783 2008-09-25 16:21:27Z fabien $
  18. */
  19. class sfLoader
  20. {
  21. /**
  22. * Gets the helper directories for a given module name.
  23. *
  24. * @param string $moduleName The module name
  25. *
  26. * @return array An array of directories
  27. */
  28. static public function getHelperDirs($moduleName = '')
  29. {
  30. $configuration = sfProjectConfiguration::getActive();
  31. $configuration->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('The sfLoader::getHelperDirs() method is deprecated. Please use the same method from sfApplicationConfiguration.', 'priority' => sfLogger::ERR)));
  32. return $configuration->getHelperDirs($moduleName);
  33. }
  34. /**
  35. * Loads helpers.
  36. *
  37. * @param array $helpers An array of helpers to load
  38. * @param string $moduleName A module name (optional)
  39. *
  40. * @throws sfViewException
  41. */
  42. static public function loadHelpers($helpers, $moduleName = '')
  43. {
  44. $configuration = sfProjectConfiguration::getActive();
  45. $configuration->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array('The sfLoader::loadHelpers() method is deprecated. Please use the same method from sfApplicationConfiguration.', 'priority' => sfLogger::ERR)));
  46. return $configuration->loadHelpers($helpers, $moduleName);
  47. }
  48. }