Login   Register  
PHP Classes
elePHPant
Icontem

File: v03/sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  Script Progress  >  v03/sample.php  >  Download  
File: v03/sample.php
Role: Example script
Content type: text/plain
Description: Sample using notification and definition list
Class: Script Progress
Flush page output to show progress of server task
Author: By
Last change:
Date: 2012-03-17 06:16
Size: 710 bytes
 

Contents

Class file image Download
<?php

include_once 'class.0.3.php';

$buff = new ScriptProgress(1010000);
$buff->addStylesheet();
$buff->addScript();

$data = array("initialize""configure""prepare process""process""post process""send""log""render""deliver""done""");

$c count($data);
foreach(
$data as $index => $message) {
  
$rt rand(100000999999);
  if(
$index==0) {
    
$buff->set("<ul>");
  } else {
      
$buff->set("<li></li>");
  }
  
$buff->next();
  if(
$index $c 1){
    
usleep($rt); // simulate real runtime 0.1 upt to 1 sec
    
$buff->notify($messagenumber_format($rt 10000003'.'''));
  }
 }

# end operation
$buff->set("</ul>");
$buff->next();

$buff->end();