| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 3 | public function saveCacheBust($strApplicationFileContents = '', $strCacheBustFile = '') |
|
| 32 | { |
||
| 33 | // get contents signature |
||
| 34 | 3 | $strNewCacheBust = md5($strApplicationFileContents); |
|
| 35 | |||
| 36 | // get prior cache bust |
||
| 37 | 3 | $strPriorCacheBust = $this->getCacheBust($strCacheBustFile); |
|
| 38 | |||
| 39 | // if unchanged, stop here |
||
| 40 | 3 | if ($strPriorCacheBust == $strNewCacheBust) { |
|
| 41 | return $strPriorCacheBust; |
||
| 42 | } |
||
| 43 | |||
| 44 | // set new cache bust |
||
| 45 | 3 | file_put_contents($strCacheBustFile, $strNewCacheBust); |
|
| 46 | |||
| 47 | // return new cache bust |
||
| 48 | 3 | return $strNewCacheBust; |
|
| 49 | } |
||
| 50 | |||
| 69 |