1<?php
2
3/*
4 * This file is part of the Assetic package, an OpenSky project.
5 *
6 * (c) 2010-2014 OpenSky Project Inc
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Assetic\Factory\Loader;
13
14/**
15 * Loads asset formulae from PHP files.
16 *
17 * @author Kris Wallsmith <kris.wallsmith@gmail.com>
18 */
19class FunctionCallsFormulaLoader extends BasePhpFormulaLoader
20{
21    protected function registerPrototypes()
22    {
23        return array(
24            'assetic_javascripts(*)' => array('output' => 'js/*.js'),
25            'assetic_stylesheets(*)' => array('output' => 'css/*.css'),
26            'assetic_image(*)'       => array('output' => 'images/*'),
27        );
28    }
29
30    protected function registerSetupCode()
31    {
32        return <<<'EOF'
33function assetic_javascripts()
34{
35    global $_call;
36    $_call = func_get_args();
37}
38
39function assetic_stylesheets()
40{
41    global $_call;
42    $_call = func_get_args();
43}
44
45function assetic_image()
46{
47    global $_call;
48    $_call = func_get_args();
49}
50
51EOF;
52    }
53}
54