BaseCompilerFilter.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /*
  3. * This file is part of the Assetic package, an OpenSky project.
  4. *
  5. * (c) 2010-2012 OpenSky Project Inc
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Assetic\Filter\GoogleClosure;
  11. use Assetic\Asset\AssetInterface;
  12. use Assetic\Filter\FilterInterface;
  13. /**
  14. * Base filter for the Google Closure Compiler implementations.
  15. *
  16. * @author Kris Wallsmith <kris.wallsmith@gmail.com>
  17. */
  18. abstract class BaseCompilerFilter implements FilterInterface
  19. {
  20. // compilation levels
  21. const COMPILE_WHITESPACE_ONLY = 'WHITESPACE_ONLY';
  22. const COMPILE_SIMPLE_OPTIMIZATIONS = 'SIMPLE_OPTIMIZATIONS';
  23. const COMPILE_ADVANCED_OPTIMIZATIONS = 'ADVANCED_OPTIMIZATIONS';
  24. // formatting modes
  25. const FORMAT_PRETTY_PRINT = 'pretty_print';
  26. const FORMAT_PRINT_INPUT_DELIMITER = 'print_input_delimiter';
  27. // warning levels
  28. const LEVEL_QUIET = 'QUIET';
  29. const LEVEL_DEFAULT = 'DEFAULT';
  30. const LEVEL_VERBOSE = 'VERBOSE';
  31. protected $compilationLevel;
  32. protected $jsExterns;
  33. protected $externsUrl;
  34. protected $excludeDefaultExterns;
  35. protected $formatting;
  36. protected $useClosureLibrary;
  37. protected $warningLevel;
  38. public function setCompilationLevel($compilationLevel)
  39. {
  40. $this->compilationLevel = $compilationLevel;
  41. }
  42. public function setJsExterns($jsExterns)
  43. {
  44. $this->jsExterns = $jsExterns;
  45. }
  46. public function setExternsUrl($externsUrl)
  47. {
  48. $this->externsUrl = $externsUrl;
  49. }
  50. public function setExcludeDefaultExterns($excludeDefaultExterns)
  51. {
  52. $this->excludeDefaultExterns = $excludeDefaultExterns;
  53. }
  54. public function setFormatting($formatting)
  55. {
  56. $this->formatting = $formatting;
  57. }
  58. public function setUseClosureLibrary($useClosureLibrary)
  59. {
  60. $this->useClosureLibrary = $useClosureLibrary;
  61. }
  62. public function setWarningLevel($warningLevel)
  63. {
  64. $this->warningLevel = $warningLevel;
  65. }
  66. public function filterLoad(AssetInterface $asset)
  67. {
  68. }
  69. }