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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user