source: Dev/branches/rest-dojo-ui/client/dojox/widget/tests/honey.php @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 626 bytes
Line 
1<?php
2/* honey.php - sample fake delay script to push data
3   - should use ob_flush() to send chunks rather than
4   just take a long time ...
5*/
6
7session_start();
8
9$char = " ";
10$fakeDelay = (empty($_GET['delay'])) ? 1 : $_GET['delay'];
11$dataSize = (empty($_GET['size'])) ? 2*1024 : $_GET['size'];
12if (empty($_SESSION['counter'])) $_SESSION['counter'] = 1;
13$dataSent = 0;
14$blockSize = 1024;
15
16if ($fakeDelay) { sleep($fakeDelay); }
17
18print "view num: ".$_SESSION['counter']++;
19while ($dataSent<=$dataSize) {
20        for ($i=0; $i<$blockSize/4; $i++) {
21                print $char;
22        } print "<br />";
23        $dataSent += $blockSize;
24        sleep(1);
25}
26
27?>
Note: See TracBrowser for help on using the repository browser.