Optimizer.php 590 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Twig_Extension_Optimizer extends Twig_Extension
  11. {
  12. protected $optimizers;
  13. public function __construct($optimizers = -1)
  14. {
  15. $this->optimizers = $optimizers;
  16. }
  17. public function getNodeVisitors()
  18. {
  19. return array(new Twig_NodeVisitor_Optimizer($this->optimizers));
  20. }
  21. public function getName()
  22. {
  23. return 'optimizer';
  24. }
  25. }