sfPluginBaseTask.class.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * Base class for all symfony plugin tasks.
  11. *
  12. * @package symfony
  13. * @subpackage task
  14. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  15. * @version SVN: $Id: sfPluginBaseTask.class.php 6931 2008-01-04 06:31:12Z fabien $
  16. */
  17. abstract class sfPluginBaseTask extends sfBaseTask
  18. {
  19. private
  20. $pluginManager = null;
  21. public function getPluginManager()
  22. {
  23. if (is_null($this->pluginManager))
  24. {
  25. $environment = new sfPearEnvironment($this->dispatcher, array(
  26. 'plugin_dir' => sfConfig::get('sf_plugins_dir'),
  27. 'cache_dir' => sfConfig::get('sf_cache_dir').'/.pear',
  28. 'web_dir' => sfConfig::get('sf_web_dir'),
  29. ));
  30. $this->pluginManager = new sfSymfonyPluginManager($this->dispatcher, $environment);
  31. }
  32. return $this->pluginManager;
  33. }
  34. }