PHP Classes

File: index5.php

Recommend this page to a friend!
  Classes of Johan Barbier   No Timeout   index5.php   Download  
File: index5.php
Role: Example script
Content type: text/plain
Description: example
Class: No Timeout
Split the execution of long tasks in small steps
Author: By
Last change: Added multiple asynchronous threads handling via stacks
Date: 16 years ago
Size: 1,436 bytes


Class file image Download
$sFile = 'texte.txt';
$iSize = filesize ($sFile);
* basic test reading a file using a pattern step
* pattern step is </test> element in the xml file
* can be used to read any type of file.
<?xml version
="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="fr" lang="fr">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script language="Javascript" type="text/javascript" src="class/class.noTimeOut.js"></script>
        <script type="text/javascript">
        var sString = ' | ';
        oBuffer = new noTimeOut ();
        oBuffer.declareStack ('FILE');
        oBuffer.initialize ('FILE', 'START', 0);
        oBuffer.initialize ('FILE', 'LIMIT', <?php echo $iSize; ?>);
        oBuffer.initialize ('FILE', 'STEP', 10);
        oBuffer.initialize ('FILE', 'SUBSTR', sString.length);
        oBuffer.initialize ('FILE', 'FILE', '../<?php echo $sFile; ?>');
        oBuffer.initialize ('FILE', 'TARGET', 'divContent');
        oBuffer.initialize ('FILE', 'MSG', 'msg');
        oBuffer.initialize ('FILE', 'SCRIPT', 'scripts/fileFetchLine.php');
        oBuffer.initialize ('FILE', 'TYPE', 'FILE_LINE');

        oBuffer.startWork ('FILE');
        <div id="msg">Waiting</div>
        <div id="divContent" style="width: 500px;"></div>