1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

e_file_inspector_json_phar: Smaller core image

e_file_inspector_json_phar is an extended implementation of
e_file_inspector_json that encapsulates a JSON core image into a
gzip-compressed phar.

This results in space savings of over 60% compared to plain JSON.
This commit is contained in:
Nick Liu
2020-03-23 23:43:52 -05:00
parent b425b4e45d
commit 6f6556178f
9 changed files with 111 additions and 10 deletions

View File

@@ -13,12 +13,20 @@ require_once("CoreImage.php");
class JsonCoreImage extends CoreImage
{
private $checksums = [];
protected $checksums = [];
public function __construct($exportFolder, $tempFolder, $currentVersion, $imageFile)
{
$this->create_image($exportFolder, $tempFolder, $currentVersion);
$this->saveImage($imageFile);
}
/**
* @param $imageFile
*/
protected function saveImage($imageFile)
{
$json_result = json_encode($this->checksums, JSON_PRETTY_PRINT);
$json_string_result = var_export($json_result, true);
$data = $this->generateStub();