Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Flate.php
Go to the documentation of this file.
1 <?php
24 #require_once 'Zend/Pdf/Filter/Compression.php';
25 
34 {
43  public static function encode($data, $params = null)
44  {
45  if ($params != null) {
47  }
48 
49  if (extension_loaded('zlib')) {
50  $trackErrors = ini_get( "track_errors");
51  ini_set('track_errors', '1');
52 
53  if (($output = @gzcompress($data)) === false) {
54  ini_set('track_errors', $trackErrors);
55  #require_once 'Zend/Pdf/Exception.php';
56  throw new Zend_Pdf_Exception($php_errormsg);
57  }
58 
59  ini_set('track_errors', $trackErrors);
60  } else {
61  #require_once 'Zend/Pdf/Exception.php';
62  throw new Zend_Pdf_Exception('Not implemented yet. You have to use zlib extension.');
63  }
64 
65  return $output;
66  }
67 
76  public static function decode($data, $params = null)
77  {
78  global $php_errormsg;
79 
80  if (extension_loaded('zlib')) {
81  $trackErrors = ini_get( "track_errors");
82  ini_set('track_errors', '1');
83 
84  if (($output = @gzuncompress($data)) === false) {
85  ini_set('track_errors', $trackErrors);
86  #require_once 'Zend/Pdf/Exception.php';
87  throw new Zend_Pdf_Exception($php_errormsg);
88  }
89 
90  ini_set('track_errors', $trackErrors);
91  } else {
92  #require_once 'Zend/Pdf/Exception.php';
93  throw new Zend_Pdf_Exception('Not implemented yet');
94  }
95 
96  if ($params !== null) {
98  } else {
99  return $output;
100  }
101  }
102 }
ini_set($varName, $newValue)
static decode($data, $params=null)
Definition: Flate.php:76
static _applyEncodeParams($data, $params)
static encode($data, $params=null)
Definition: Flate.php:43
static _applyDecodeParams($data, $params)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18