FunctionCallsFormulaLoader.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Assetic package, an OpenSky project.
  4. *
  5. * (c) 2010-2011 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\Factory\Loader;
  11. /**
  12. * Loads asset formulae from PHP files.
  13. *
  14. * @author Kris Wallsmith <kris.wallsmith@gmail.com>
  15. */
  16. class FunctionCallsFormulaLoader extends BasePhpFormulaLoader
  17. {
  18. protected function registerPrototypes()
  19. {
  20. return array(
  21. 'assetic_javascripts(*)' => array('output' => 'js/*.js'),
  22. 'assetic_stylesheets(*)' => array('output' => 'css/*.css'),
  23. 'assetic_image(*)' => array('output' => 'images/*'),
  24. );
  25. }
  26. protected function registerSetupCode()
  27. {
  28. return <<<'EOF'
  29. function assetic_javascripts()
  30. {
  31. global $_call;
  32. $_call = func_get_args();
  33. }
  34. function assetic_stylesheets()
  35. {
  36. global $_call;
  37. $_call = func_get_args();
  38. }
  39. function assetic_image()
  40. {
  41. global $_call;
  42. $_call = func_get_args();
  43. }
  44. EOF;
  45. }
  46. }