| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function createManifest(Package $package) |
||
| 14 | { |
||
| 15 | $manifestData = array(); |
||
| 16 | foreach (Package::$packageFiles as $rawFile) { |
||
| 17 | $filePath = sprintf('%s/%s', $package->getPackageDir(), $rawFile); |
||
| 18 | $manifestData[$rawFile] = sha1(file_get_contents($filePath)); |
||
| 19 | } |
||
| 20 | |||
| 21 | $manifestJsonPath = sprintf('%s/manifest.json', $package->getPackageDir()); |
||
| 22 | $manifestJson = json_encode((object) $manifestData); |
||
| 23 | |||
| 24 | file_put_contents($manifestJsonPath, $manifestJson); |
||
| 25 | |||
| 26 | return $manifestJsonPath; |
||
| 27 | } |
||
| 28 | } |
||
| 29 |