diff -r 000000000000 -r 4eba9c11703f web/Zend/ProgressBar/Adapter/JsPush.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/Zend/ProgressBar/Adapter/JsPush.php Mon Dec 13 18:29:26 2010 +0100
@@ -0,0 +1,148 @@
+_updateMethodName = $methodName;
+
+ return $this;
+ }
+
+ /**
+ * Set the finish method name
+ *
+ * @param string $methodName
+ * @return Zend_ProgressBar_Adapter_JsPush
+ */
+ public function setFinishMethodName($methodName)
+ {
+ $this->_finishMethodName = $methodName;
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @param float $current Current progress value
+ * @param float $max Max progress value
+ * @param float $percent Current percent value
+ * @param integer $timeTaken Taken time in seconds
+ * @param integer $timeRemaining Remaining time in seconds
+ * @param string $text Status text
+ * @return void
+ */
+ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
+ {
+ $arguments = array(
+ 'current' => $current,
+ 'max' => $max,
+ 'percent' => ($percent * 100),
+ 'timeTaken' => $timeTaken,
+ 'timeRemaining' => $timeRemaining,
+ 'text' => $text
+ );
+
+ $data = '';
+
+ // Output the data
+ $this->_outputData($data);
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @return void
+ */
+ public function finish()
+ {
+ if ($this->_finishMethodName === null) {
+ return;
+ }
+
+ $data = '';
+
+ $this->_outputData($data);
+ }
+
+ /**
+ * Outputs given data the user agent.
+ *
+ * This split-off is required for unit-testing.
+ *
+ * @param string $data
+ * @return void
+ */
+ protected function _outputData($data)
+ {
+ // 1024 padding is required for Safari, while 256 padding is required
+ // for Internet Explorer. The
is required so Safari actually
+ // executes the
+ echo str_pad($data . '
', 1024, ' ', STR_PAD_RIGHT) . "\n";
+
+ flush();
+ ob_flush();
+ }
+}