Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
JsPull.php
Go to the documentation of this file.
1 <?php
23 #require_once 'Zend/Json.php';
24 
28 #require_once 'Zend/ProgressBar/Adapter.php';
29 
41 {
47  protected $_exitAfterSend = true;
48 
55  public function setExitAfterSend($exitAfterSend)
56  {
57  $this->_exitAfterSend = $exitAfterSend;
58  }
59 
71  public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
72  {
73  $arguments = array(
74  'current' => $current,
75  'max' => $max,
76  'percent' => ($percent * 100),
77  'timeTaken' => $timeTaken,
78  'timeRemaining' => $timeRemaining,
79  'text' => $text,
80  'finished' => false
81  );
82 
84 
85  // Output the data
86  $this->_outputData($data);
87  }
88 
94  public function finish()
95  {
96  $data = Zend_Json::encode(array('finished' => true));
97 
98  $this->_outputData($data);
99  }
100 
109  protected function _outputData($data)
110  {
111  echo $data;
112 
113  if ($this->_exitAfterSend) {
114  exit;
115  }
116  }
117 }
if($this->helper('Magento\Tax\Helper\Data') ->displayFullSummary()) foreach( $block->getTotal() ->getFullInfo() as $info)(isset($info['hidden']) && $info['hidden']) $percent
Definition: tax.phtml:33
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43
setExitAfterSend($exitAfterSend)
Definition: JsPull.php:55
exit
Definition: redirect.phtml:12
notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
Definition: JsPull.php:71
$arguments
static encode($valueToEncode, $cycleCheck=false, $options=array())
Definition: Json.php:130