JsCachingProxy::getCacheFileExtension()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/*------------------------------------------------------------------------------
3
4
   Project  : CachingProxy
5
   Filename : src/JsCachingProxy.php
6
   Autor    : (c) Sebastian Krüger <[email protected]>
7
   Date     : 15.09.2013
8
9
   For the full copyright and license information, please view the LICENSE
10
   file that was distributed with this source code.
11
12
   Description: extends the CachingProxy with js
13
14
  ----------------------------------------------------------------------------*/
15
16
namespace secra\CachingProxy;
17
18
class JsCachingProxy extends AbstractCachingProxy
19
{
20
    /**
21
     * Delivers the set of html tags for webpage inclusion
22
     *
23
     * @return string   the html script tags
24
     *
25
     */
26
    public function getIncludeHtml()
27
    {
28
        // Gibt den Einbindungscode für die Dateien zurück
29
        $filelist = $this->getIncludeFileset();
30
31
        $htmlreturn = "";
32
33
        foreach ($filelist as $file) {
34
            $htmlreturn .= "<script type=\"text/javascript\" ";
35
            $htmlreturn .= "src=\"".$file."\"></script>\n";
36
        }
37
38
        return $htmlreturn;
39
    }
40
41
    /**
42
     * Delivers extension for cached files
43
     *
44
     * @return string   file extension
45
     *
46
     */
47
    protected function getCacheFileExtension()
48
    {
49
        // return Extension of css files
50
        return '.js';
51
    }
52
}